[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Booting a CF or SD card from an internal card reader



On Fri 05 May 2017 at 05:34:13 +0200, Leandro Noferini wrote:

> Brian <ad44@cityscape.co.uk> writes:
> 
> > 1. This HOWTO is a result of the discussion on debian-user beginning at

It should be stressed that the HOWTO is applicable only to devices on
the USB bus.

> Thanks a lot for this document because it hits a problem I found many
> months ago without solution for me. I would like to use my internal card
> reader (Lenovo X240) to boot in tails (https://tails.boum.org)

I rarely dabble in hardware-related things, so a mistake or two could
creep into what follows.

> My reader appears this way:
> 
> ====================================================================
> ~ $ lsusb
> Bus 001 Device 003: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
> ====================================================================

The Lenovo X240 has a Smart Card reader and a 4-in-1 card reader (MMC,
SD, SDHC, SDXC). The Smart Card reader is on the USB bus. I have never
used one but it appears to have something to do with identity cards.
GRUB does not detect it with nativedisk so booting from it is not
possible.

> The sd card with tails on appears this way:
> 
> ====================================================================
> leandro@tricheco:~$ sudo fdisk /dev/mmcblk0
> 
> Welcome to fdisk (util-linux 2.29.2).
> Changes will remain in memory only, until you decide to write them.
> Be careful before using the write command.
> 
> Command (m for help): p
> Disk /dev/mmcblk0: 7,4 GiB, 7969177600 bytes, 15564800 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier: F12D15CF-2FC3-4852-8226-9D4F7E625B29
> 
> Device         Start     End Sectors  Size Type
> /dev/mmcblk0p1  2048 5122047 5120000  2,5G EFI System
> ====================================================================

This is the 4-in-1 card reader; the one you want you are trying to boot
from. As indicted by /dev/mmcblk0p1 it is on the PCI bus. 'lspci' should
display the chip used; one from Ricoh?

GRUB doesn't see anything on this bus (it has no drivers for the device),
so booting from it is not possible.

> Following your document I edited /etc/grub.d/40_custom adding these
> lines:
> 
> ====================================================================
> menuentry 'Tails on CF card' {
> 	insmod part_msdos
>         insmod ext2
>         echo "Running nativedisk command. Please wait."
>         nativedisk
>         search --label --set=root TAILS
>         linux /vmlinuz root=LABEL=TAILS ro
>         initrd /initrd.img
> }
> ====================================================================
> 
> But it is not working.
> 
> If I give the "nativedisk" command in grub command line I get only
> 
> ====================================================================
> (ahci0)
> ====================================================================
> 
> Where am I wrong?

I think you have possibly not appreciated the distinction between a card
reader on a USB bus and one on a PCI bus. The first should be visible to
GRUB and nativedisk (but, as you have seen, isn't always). The second is
never visible to GRUB.

-- 
Brian.


Reply to: