Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #180722

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

From Richard Owlett <rowlett@cloud85.net>
Newsgroups linux.debian.user
Subject Re: Booting a CF or SD card from an internal card reader
Date 2017-05-05 15:00 +0200
Message-ID <tDKZX-1Q5-15@gated-at.bofh.it> (permalink)
References <tDCzn-4Hv-3@gated-at.bofh.it> <tDCzn-4Hv-1@gated-at.bofh.it> <tDHIJ-8ec-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 05/05/2017 04:28 AM, Brian wrote:
> 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.
>

Not true.
On my Lenovo T510 laptop I have

root@march-9-Jessie:/home/richard# ls /dev/mm*
/dev/mmcblk0  /dev/mmcblk0p1  /dev/mmcblk0p2  /dev/mmcblk0p5

Although my BIOS will not boot from /dev/mmcblk0, the GRUB resident on 
/dev/sda1 has no trouble finding Debian on /dev/mmcblk0p1.

root@march-9-Jessie:/home/richard# lspci -tv
-+-[0000:ff]-+-00.0  Intel Corporation Core Processor QuickPath 
Architecture Generic Non-core Registers
  |           +-00.1  Intel Corporation Core Processor QuickPath 
Architecture System Address Decoder
  |           +-02.0  Intel Corporation Core Processor QPI Link 0
  |           +-02.1  Intel Corporation 1st Generation Core Processor 
QPI Physical 0
  |           +-02.2  Intel Corporation 1st Generation Core Processor 
Reserved
  |           \-02.3  Intel Corporation 1st Generation Core Processor 
Reserved
  \-[0000:00]-+-00.0  Intel Corporation Core Processor DRAM Controller
              +-02.0  Intel Corporation Core Processor Integrated 
Graphics Controller
              +-16.0  Intel Corporation 5 Series/3400 Series Chipset 
HECI Controller
              +-19.0  Intel Corporation 82577LM Gigabit Network Connection
              +-1a.0  Intel Corporation 5 Series/3400 Series Chipset 
USB2 Enhanced Host Controller
              +-1b.0  Intel Corporation 5 Series/3400 Series Chipset 
High Definition Audio
              +-1c.0-[02]--
              +-1c.1-[03]----00.0  Intel Corporation Centrino Advanced-N 
6200
              +-1c.3-[05-0c]----00.0  Renesas Technology Corp. uPD720202 
USB 3.0 Host Controller
              +-1c.4-[0d]--+-00.0  Ricoh Co Ltd MMC/SD Host Controller
              |            +-00.1  Ricoh Co Ltd R5U2xx (R5U230 / R5U231 
/ R5U241) [Memory Stick Host Controller]
              |            \-00.3  Ricoh Co Ltd R5C832 PCIe IEEE 1394 
Controller
              +-1d.0  Intel Corporation 5 Series/3400 Series Chipset 
USB2 Enhanced Host Controller
              +-1e.0-[0e]--
              +-1f.0  Intel Corporation Mobile 5 Series Chipset LPC 
Interface Controller
              +-1f.2  Intel Corporation 5 Series/3400 Series Chipset 6 
port SATA AHCI Controller
              +-1f.3  Intel Corporation 5 Series/3400 Series Chipset 
SMBus Controller
              \-1f.6  Intel Corporation 5 Series/3400 Series Chipset 
Thermal Subsystem

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Booting a CF or SD card from an internal card reader Leandro Noferini <lnoferin@cybervalley.org> - 2017-05-05 06:00 +0200
  Re: Booting a CF or SD card from an internal card reader Brian <ad44@cityscape.co.uk> - 2017-05-05 11:30 +0200
    Re: Booting a CF or SD card from an internal card reader Stefan Monnier <monnier@iro.umontreal.ca> - 2017-05-05 14:50 +0200
      Re: Booting a CF or SD card from an internal card reader Brian <ad44@cityscape.co.uk> - 2017-05-05 19:40 +0200
        Re: Booting a CF or SD card from an internal card reader Stefan Monnier <monnier@iro.umontreal.ca> - 2017-05-05 20:00 +0200
          Re: Booting a CF or SD card from an internal card reader David Wright <deblis@lionunicorn.co.uk> - 2017-05-05 20:40 +0200
          Re: Booting a CF or SD card from an internal card reader Brian <ad44@cityscape.co.uk> - 2017-05-05 20:40 +0200
    Re: Booting a CF or SD card from an internal card reader Richard Owlett <rowlett@cloud85.net> - 2017-05-05 15:00 +0200
      Re: Booting a CF or SD card from an internal card reader Brian <ad44@cityscape.co.uk> - 2017-05-05 16:10 +0200
      Re: Booting a CF or SD card from an internal card reader David Wright <deblis@lionunicorn.co.uk> - 2017-05-05 17:00 +0200

csiph-web