#9457 BLOC 1.5-F11: XO-1.5 OS30 boot scripts aren't quite right

Zarro Boogs per Child bugtracker at laptop.org
Wed Nov 11 23:23:46 EST 2009


#9457: XO-1.5 OS30 boot scripts aren't quite right
---------------------------------+------------------------------------------
           Reporter:  wad        |       Owner:  dsd          
               Type:  defect     |      Status:  new          
           Priority:  blocker    |   Milestone:  1.5-F11      
          Component:  initramfs  |     Version:  not specified
         Resolution:             |    Keywords:               
        Next_action:  design     |    Verified:  0            
Deployment_affected:             |   Blockedby:  9558         
           Blocking:             |  
---------------------------------+------------------------------------------

Comment(by dsaxena):

 Looked into this a bit more as I was highly doubting that all the new udev
 persistent naming stuff would not provide this feature and it I believe we
 already have everything we need to mount by slot path.

 I booted OS39 from the internal SD slot and then placed it in the external
 slot via a uSD -> SD adapter:

 {{{
 SD CARD on Exernal Slot:

 [root at localhost /dev]# cd /dev/disk/by-path/
 [root at localhost by-path]# ls -l
 total 0
 lrwxrwxrwx 1 root root 13 Nov 12 02:55 pci-mmc1:aaaa -> ../../mmcblk0
 lrwxrwxrwx 1 root root 15 Nov 12 02:55 pci-mmc1:aaaa-part1 ->
 ../../mmcblk0p1
 lrwxrwxrwx 1 root root 15 Nov 12 02:55 pci-mmc1:aaaa-part2 ->
 ../../mmcblk0p2
 [root at localhost by-path]# ls -l /dev/root lrwxrwxrwx 1 root root 9 Nov 12
 02:55

 SD CARD on Internal Slot:

 [root at localhost dev]# cd /dev/disk/by-path/
 [root at localhost by-path]# ls -l
 total 0
 lrwxrwxrwx 1 root root 13 Nov 12 02:59 pci-mmc0:aaaa -> ../../mmcblk0
 lrwxrwxrwx 1 root root 15 Nov 12 02:59 pci-mmc0:aaaa-part1 ->
 ../../mmcblk0p1
 lrwxrwxrwx 1 root root 15 Nov 12 02:59 pci-mmc0:aaaa-part2 ->
 ../../mmcblk0p2
 [root at localhost by-path]# ls -l /dev/root
 lrwxrwxrwx 1 root root 9 Nov 12 02:59 /dev/root -> mmcblk0p2
 }}}

 As the above shows, we boot from mmcblk0p2 both times, but the kernel
 knows what device path points to that device. In the external case it is
 pci-mmc1, in the internal case it is pci-mmc0.
 The 4-digit ID afterwards is the card's Relative Card Address which OFW
 can retrieve. But really, if we just have the

 So basically we can do {{{root=PATH=pci-mmc<slot>:<rca>-part2}}} (or
 something along those lines...documentation on this stuff is rather
 lacking) and with udev running in initramfs, we should be able to mount
 the proper device.

 The other option is to grab the UUID from the EXT filesystem header and do
 "root=UUID=<uuid>". I like this option b/c the EXT filesystem can be on SD
 or USB and the root device option remains the same.

 {{{
 [root at localhost by-uuid]# ls -l
 total 0
 lrwxrwxrwx 1 root root 15 Nov 12 03:09 76d6ed54-7900-4cfe-
 bfb4-3f4dc9d1c512 -> ../../mmcblk0p
 1
 lrwxrwxrwx 1 root root 15 Nov 12 03:09 fbbdc9ce-05c3-4faa-
 9f85-77e8fb46e6b4 -> ../../mmcblk0p
 2
 lrwxrwxrwx 1 root root 10 Nov 12 03:39 ff931d55-ded8-4eee-
 86d4-d7acb8d44560 -> ../../sda1
 }}}
 (where sda1 is my usb disk for this example)

 Finally, we can generate a udev-equivalent device ID and do
 {{{root=ID=<ID>}}} but I think generating the ID is far less trivial then
 reading the UUID or determine the slot.

 {{{
 [root at localhost dev]# cd /dev/disk/by-id/
 [root at localhost by-id]# ls -l
 total 0
 lrwxrwxrwx 1 root root 13 Nov 12 03:09 mmc-SU04G_0x00ccfcf8 ->
 ../../mmcblk0
 lrwxrwxrwx 1 root root 15 Nov 12 03:09 mmc-SU04G_0x00ccfcf8-part1 ->
 ../../mmcblk0p1
 lrwxrwxrwx 1 root root 15 Nov 12 03:09 mmc-SU04G_0x00ccfcf8-part2 ->
 ../../mmcblk0p2
 lrwxrwxrwx 1 root root  9 Nov 12 03:39 usb-
 Verbatim_STORE_N_GO_07931D700146-0:0 -> ../../sda
 lrwxrwxrwx 1 root root 10 Nov 12 03:39 usb-
 Verbatim_STORE_N_GO_07931D700146-0:0-part1 -> ../.
 ./sda1
 }}}

 In summary: kernel + udev already have infrastructure to map a MMC slot to
 the appropriate OS block device.

-- 
Ticket URL: <http://dev.laptop.org/ticket/9457#comment:20>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list