Ticket #11233 (reopened defect)

Opened 3 years ago

Last modified 21 months ago

XO-1 usb and sd boot does not work in recent builds

Reported by: fanoush Owned by: dsd
Priority: normal Milestone: Future Release
Component: initramfs Version: Development build as of this date
Keywords: Cc: FGrose, sascha_silbe, mavrothal
Action Needed: diagnose Verified: no
Deployments affected: Blocked By:
Blocking:

Description

previous OS versions booted fine without any change when same build files were in internal jffs2 or on SD card or on USB stick. With 11.2.0 it look like this no longer works.

When I boot from USB or SD slot the initrd prints many lines of something similar to 'chdir to /lib/modules failed' and finally something like 'Root device not found, sleeping forever'.

When examining initrd files in /boot I found that there are actually two initial ramdisks, one initrd below 2MB size and one actrd having ~5MB. The 5MB one does have /lib/modules inside while the normal initrd does not.

When replacing initrd by actrd the chdir /lib/modules error message is gone, and I see usb modules inserted and I see mass storage module detecting the usb device but it printed another messages about "scsi_wait_scan module not found" and again root device not found.

I am using SD card with single ext3 partition with fs label "OLPCRoot" in usb card reader or directly in SD slot (just like it works with previous OS versions).

Then I extracted initrd with gzip and cpio, copied /lib/modules from actdrd, repacked and can confirm the original initrd code behaves exactly the same as actrd one.

Then I found file cmdline/20olpc-boot-cmdline.sh inside intrd that checks boot device from ofw and hardcodes root=/dev/sda2 with this code: if [ -z "$root" ]; then

# if no root device was specified, use OFW bootpath to find root

...

/pci/usb@*) root="/dev/sda2" ;; # external USB, assume partitioned

So I changed sda2 to sda1 but it still does not boot with same message - root device not found. Sorry that I don't have exact error messages but the device does not boot so I cannot copy them directly.

Change History

  Changed 3 years ago by fanoush

confirmation that it does not work for other people too http://lists.laptop.org/pipermail/devel/2011-September/033149.html

  Changed 3 years ago by fanoush

  • version changed from not specified to 1.5/1.0 Software Build os874 aka 11.2.0

in reply to: ↑ description   Changed 3 years ago by mavrothal

Replying to fanoush:

I am using SD card with single ext3 partition with fs label "OLPCRoot" in usb card reader or directly in SD slot (just like it works with previous OS versions).

[...]

Then I found file cmdline/20olpc-boot-cmdline.sh inside intrd that checks boot device from ofw and hardcodes root=/dev/sda2 with this code: if [ -z "$root" ]; then # if no root device was specified, use OFW bootpath to find root ... /pci/usb@*) root="/dev/sda2" ;; # external USB, assume partitioned So I changed sda2 to sda1 but it still does not boot with same message - root device not found. Sorry that I don't have exact error messages but the device does not boot so I cannot copy them directly.

This change may work if you are booting from a USB.
If you are booting from a single partition SDcard, try changing root="/dev/disk/mmc/mmc${tmp}p2" to root="/dev/disk/mmc/mmc${tmp}p1"
Though it might be simpler to use a simple /boot/olpc.fth and point it directly to your initrd.img and vmlinuz in the SDcard.

  Changed 3 years ago by Quozl

  • next_action changed from never set to reproduce

Please test with 11.3.0, the latest build is os4, as that is where further development is pointed. We are not planning an 11.2.1.

  Changed 3 years ago by fanoush

  • version changed from 1.5/1.0 Software Build os874 aka 11.2.0 to Development build as of this date

works exactly the same with latest 11.3.0 os5

However I was able to boot into the system by changing two things 1. replacing root=LABEL=OLPCRoot in olpc.fth by root=/dev/sda1 2. replacing initrd by actrd

so it probably boils down to two issues: 1. LABEL=OLPCRoot mechanism somehow does not work 2. default initrd for XO-1 is missing USB modules, or to be more precise - it is missing _all_ kernel modules, whole /lib/modules is missing inside initrd.

My initial goal was to make custom build of 11.2.0 with cs_CZ locale (preferably with versioned_fs disabled) and boot if from usb. I have now succeeded in this goal.

  Changed 3 years ago by Quozl

  • owner set to dsd
  • next_action changed from reproduce to diagnose
  • component changed from not assigned to initramfs
  • milestone changed from Not Triaged to 11.3.0

Excellent, thanks. That brings the problem into current development scope.

  Changed 3 years ago by FGrose

  • cc FGrose added
  • summary changed from XO-1 usb and sd boot does not work in 11.2.0 to XO-1 usb and sd boot does not work in recent builds

follow-up: ↓ 11   Changed 2 years ago by dsd

  • next_action changed from diagnose to add to build
  • milestone changed from 11.3.0 to 12.1.0

This should work in next 12.1.0 build as USB stuff is now included in the kernel (x86-3.1 2098f73d2).

However, the requirements are that the SD card or USB disk must be partitioned in the way that is produced by the sd_card_image module of olpc-os-builder. That is, the first partition includes boot contents, and the second includes the main filesystem. For SD I would suggest just using sd_card_image.

For USB, if working from the tree tarball, the following should work:

  1. extract the entire contents of the tarball onto the 2nd partition
  2. look at the name of the directory in versions/pristine (e.g. "884"). This is the fs version number and will be referred to as FSVERSION below.
  3. On the first partition (PARTITION1), create security and boot-versions toplevel directories
  4. Create directory PARTITION1/boot-versions/FSVERSION
  5. copy PARTITION2/versions/pristine/FSVERSION/boot/* into PARTITION1/boot-versions/FSVERSION
  6. create a symlink at PARTITION1/boot that points at boot-versions/FSVERSION

Contributions to add an appropriate USB output module (or sd_card_image "USB mode") to olpc-os-builder would be accepted if they have a sensible design; this would simplify the above.

This is untested but expected to work - please provide feedback with following 12.1.0 builds.

  Changed 2 years ago by sascha_silbe

  • cc sascha_silbe added

  Changed 2 years ago by dsd

  • status changed from new to closed
  • resolution set to fixed

Another option for USB is to use olpc-os-builder sd_card_image to create an image of appropriate size. Enable sd_card_image's keep_disk_image=1 option so that a disk image is saved. You can then dd this to a USB disk and it should work.

Assuming fixed in 12.1.0 build 2 - please reopen if this is problematic.

in reply to: ↑ 8   Changed 22 months ago by mavrothal

  • cc mavrothal added
  • status changed from closed to reopened
  • resolution deleted

Replying to dsd:

This should work in next 12.1.0 build as USB stuff is now included in the kernel (x86-3.1 2098f73d2).

[snip]

For USB, if working from the tree tarball, the following should work: 1. extract the entire contents of the tarball onto the 2nd partition

[snip]

This is untested but expected to work - please provide feedback with following 12.1.0 builds.

Tried it with os17 on an SDcard with the XO-1 and fails with

tmpfs: No value for mount point option 'strictatime'
mount: mounting tmpfs on/dev/shm failed: Invalid argument
# same for /newrun and /newrun on /run
dracut: FATAL: No or empty root= argument
dracut: Refusing to continue

  Changed 22 months ago by dsd

  • next_action changed from add to build to diagnose
  • milestone changed from 12.1.0 to Future Release

  Changed 21 months ago by mavrothal

Some more info for the future release. Tried it on the XO-1.5 with 12.1.0/os18.
It shows the same "strictatime" error but continues to mount the ext2 and ext4 mmc0p1 and 2 partitions and then fails with

cannot find init!
Please check to make sure you passed a valid root filesystem!

Booting with "olpc.enegrency" I can see that /dev/disk/mmc/mmc0p2 is mounted to /sysroot and sysroot has all the files in both versions/pristine and versions/run

  Changed 21 months ago by sascha_silbe

See also #11872.

Note: See TracTickets for help on using tickets.