1

I am writing to you to ask you about the following: I am working on a custom embedded Linux distro for a Zynq700 based board. One of the features to be added is support for USB in host mode, which I have achieved.

This way, with rootfs I have a combination of udev rules & fstab entries that allow a given USB stick to be automounted with a certain conditions. However, if we change the filesystem to initramfs, the flash drive not only does not automount, it is not recognised.

I looked at the output of dmesg, lsusb & lsmod to make sure of this & confirmed that no driver function is called. In addition, I also notice that the USB stick is not receiving any power (the HW is correct because with the same hdf and roofs I have it functional).

Is there some peculiarity of initramfs compared to rootfs that I'm missing that has this effect?

Thanks in advance

afinfante
  • 61
  • 1
  • 7
  • Typically an `initramfs` is just a smaller filesystem for the same kernel - used to prepare the system for mounting the real filesystem. However, often the initramfs does not load kernel modules - if this is the case, you will need to make sure your chipset's USB host driver and the generic USB storage driver are both built-in (not dynamically loaded) kernel modules. – justinsg Oct 15 '21 at 07:21
  • Hi Justin, first of all thank you very much for your reply. As I feared, this seems to be the way forward. However, I tried to load the USB driver adding `KERNEL_MODULE_AUTOLOAD += "usb-storage"` to my `build/conf/local.conf`. Is this approach wrong? If so, would it be appropriate to use the `menuconfig` kernel task to configure it? (using [Devices Drivers -> USB suport] section) – afinfante Oct 15 '21 at 14:50
  • Hello again, using menuconfig the USB stuff is now kernel drivers and not kernel modules as before. To be sure I have used `cat /lib/modules//modules.builtin` and I get at its output that `uas usb_storage usbcore scsi_mod usb_common` is present. Any ideas? – afinfante Oct 19 '21 at 15:09
  • Seems like you have all the kernel modules you need as built-in. Have any USB buses been registered? You can check `ls /sys/bus/usb/devices/usb*` - should have `usb0` and possibly more. – justinsg Oct 19 '21 at 22:44
  • Hi Justin, I have explored your recommendation. Nothing is displayed under `/sys/bus/usb/devices/`. I'm worried about this topic :( – afinfante Oct 20 '21 at 07:13
  • 1
    Solved. The cause: the ps7init files of the hw platform linked to the FSBL – afinfante Oct 20 '21 at 14:59

0 Answers0