OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version openwrt-19.07
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by higuita - 16.03.2020

FS#2904 - usb-storage fails to load in pre-init

As per forum post:

https://forum.openwrt.org/t/usb-storage-fail-to-load-in-preinit/54903

Basically, installed openwrt, added external root, all looks correctly configured, but after reboot external root fails to mount.
searching in the logs we can see that usb-storage is only loaded after pre-init, but it is listed in /etc/modprobe-boot.d/ ... checking /rom/etc/modules-boot.d/ it is not there.

Either something is missing in the https://openwrt.org/docs/guide-user/additional-software/extroot_configuration to add the usb-storage to the pre-init, or something is broken that makes pre-init fail to load usb-storage when it should.

The same setup worked fine with a older openwrt version (15.01 IIRC)

Supply the following if possible:
- Device problem occurs on
asus wl-500w

- Software versions of OpenWrt/LEDE release, packages, etc.
OpenWrt 19.07.1, r10911-c155900f66

- Steps to reproduce
Install openwrt
add external root
manually mount to confirm setup
reboot
external root not mounted nor switched to, logs show that usb-storage is only loaded after normal root is mounted
manual mount still works

 


Paul Oranje commented on 16.03.2020 09:52

So /overlay is still on internal storage.

Did you recreate the extroot from the rootfs_data ?
(assuming the external storage is a suitable filesystem on /dev/sda1)

mount /dev/sda1 /mnt
cd /mnt
tar cf - -C /overlay . |tar x

And, assuming the extroot has been added into /etc/config/fstab, did you remove the old marker from the external storage before trying to boot with extroot ?

rm /mnt/etc/.extroot-uuid
higuita commented on 16.03.2020 17:02

yes, done all those steps, i just redone then and same result
notice the dmesg:

[ 41.505538] block: extroot: cannot find device sda1
(...)
[ 42.888687] procd: - init -
(...)
[ 47.273106] usb-storage 1-2:1.0: USB Mass Storage device detected

extroot fail to work due the missing usb_storage, that is being loaded only on the init step, not in the pre-init

Paul Oranje commented on 16.03.2020 21:45

Okay, but if your analysis is correct then extroot would not run anywhere, but it does here (ipq806x, OpenWrt 19.07.2). Or d I miss something.

higuita commented on 17.03.2020 00:20

I agree with you, this is weird.
Either this is simply a documentation bug and i'm missing some step, or something that may be broken on some systems only. I'm using a asus wl-500w, so something related to the image openwrt-19.07.1-brcm47xx-legacy-asus-wl-500w ... maybe "legacy" related?

You are also using a usb-storage device, correct?
what is your output for this:

find  /rom/etc/modules-boot.d/ /rom/etc/modules.d/ /etc/modules-boot.d/ /etc/modules.d/ -name usb\*

for me, only the /etc/modules*.d/ i have the usb-storage, the /rom do not have anything for usb-storage

and how about the /etc/config/fstab? mine is this one:

config global
	option anon_swap '0'
	option anon_mount '0'
	option auto_swap '1'
	option auto_mount '1'
	option delay_root '15'
	option check_fs '0'

config mount
	option target '/mnt/sda1'
	option uuid '04f05f45-f506-4465-9ecc-8d836d0588b6'
	option enabled '0'

config mount 'rwm'
	option device '/dev/mtdblock5'
	option target '/rwm'

config mount 'overlay'
	option uuid '04f05f45-f506-4465-9ecc-8d836d0588b6'
	option target '/overlay'
Paul Oranje commented on 21.03.2020 13:26

Your has two entries for the external filesystem (same UUID). Removing the first one that's disabled may help.

Also some options seem missing. Assuming your extroot has ext4 fs, these are:

  option fstype 'ext4'
  option enabled_fsck '1'

The initially installed modules in /rom are determined by the DEVICE_PACKAGES in the makefile for the device, in case of the wl-500w those are:

  kmod-b43 kmod-usb-uhci kmod-usb2-pci

Assuming ext4 for the extroot fs, extra packages needed would be:

  kmod-usb-storage kmod-usb2 kmod-fs-ext4 block-mount

Using imagebuilder is recommended as it allows to include all needed packages in /rom which saves space in the initial overlay fs (non-extroot) as the fs for /rom (squashfs) is denser than the fs used for the internal overlay (jffs).

Good luck.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing