Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 240251 - [OpenRC] usbfs mounted too late for firmware download via udev (fxload)
Summary: [OpenRC] usbfs mounted too late for firmware download via udev (fxload)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-06 11:49 UTC by Joerg Faschingbauer
Modified: 2009-10-11 09:22 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Faschingbauer 2008-10-06 11:49:18 UTC
When using a udev rule to download firmware to a USB device during bootup, I see that usbfs is not mounted at this early point in time. Rather, usbfs is mounted later in the boot process in the localmount init script.

Addition: we use fxload to download firmware to a Cypress controller. This requires a node from the usbfs filesystem.

Reproducible: Always
Comment 1 Joerg Faschingbauer 2008-10-06 11:52:21 UTC
Portage 2.1.4.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.21.7-cfs-v22 i686)
=================================================================
System uname: 2.6.21.7-cfs-v22 i686 unknown
Timestamp of tree: Tue, 30 Sep 2008 01:45:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LDFLAGS="-Wl,-O1"
LINGUAS="en de"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa berkdb bluetooth bzip2 cli cracklib crypt cups dbus dga directfb dri fortran gdbm gpm hal iconv isdnlog jpeg libnotify midi mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcmcia pcre perl png pppd python readline reflection session spl ssl svg sysfs tcpd theora tiff truetype unicode vorbis x86 xinerama xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2008-10-06 19:28:56 UTC
Interesting. :)
Comment 3 Roy Marples 2008-10-07 12:40:56 UTC
Is fxload in /usr/sbin or /sbin?
Where is the firmware?
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-10-07 12:48:32 UTC
fxload installs the bianry to /sbin.

There's an example firmware at /usr/share/usb/a3load.hex, but I don't know what firmware the original submitter is using, but I suspect their complaint is that the procfs init.d needs to start before that custom udev rule runs.
Comment 5 Roy Marples 2008-10-07 13:08:08 UTC
Sucky :)

What is really needed here is the ability to run sysinit as another runlevel with dependencies.

I'm pretty certain this is doable in the near future.
Comment 6 Matthias Schwarzott gentoo-dev 2008-10-07 13:14:59 UTC
Well, despite that fxload is still used, I consider it old and not upstream
maintained. The last release is from year 2002 and does not even compile on Kernel 2.6 without patching. But still all major distributions have it.
All new applications of this Chip get firmware loaded by kernel-modules using firmware_class.

Dreaming: Maybe someone should write a kernel-module to do this?
A hack to get firmware loaded until bug is solved: Do run udevadm trigger for these devices after mounting.
Comment 7 Roy Marples 2008-10-07 13:17:15 UTC
It might be an idea to udevtrigger after local mount for the cases where things need stuff in /usr or /var like say the infamous e10k module. I'm sure udev could supply such a script :)
Comment 8 Joerg Faschingbauer 2008-10-07 15:51:07 UTC
(In reply to comment #6)
> Well, despite that fxload is still used, I consider it old and not upstream
> maintained. The last release is from year 2002 and does not even compile on
> Kernel 2.6 without patching. But still all major distributions have it.
> All new applications of this Chip get firmware loaded by kernel-modules using
> firmware_class.

Can you please point me to one of these applications, to see how this is done?

I don't like fxload either, but it doesn't require me to maintain a kernel module. If I chose to talk USB in userspace only (libusb), I'd definitely want a userspace tool for firmware download.
Comment 9 Joerg Faschingbauer 2008-10-07 15:58:21 UTC
(In reply to comment #7)
> It might be an idea to udevtrigger after local mount for the cases where things
> need stuff in /usr or /var like say the infamous e10k module. I'm sure udev
> could supply such a script :)

Why not move the usbfs mounting code out of localmount, and further up the rc chain? /lib/rcscripts/addons/udev-start.sh, for example. Or even /sbin/rc - proc is mounted there as well. After all, the usbfs mounting code is pretty failsafe and conditional, so it wouldn't hurt.
Comment 10 Roy Marples 2008-10-08 22:35:11 UTC
(In reply to comment #9)
> Why not move the usbfs mounting code out of localmount, and further up the rc
> chain? /lib/rcscripts/addons/udev-start.sh, for example. Or even /sbin/rc -
> proc is mounted there as well. After all, the usbfs mounting code is pretty
> failsafe and conditional, so it wouldn't hurt.

init.sh mounts /dev, /proc and /sys which is the minimal needed to get things rolling. The idea is to shrink init.sh, not bloat it futher.

The ideal minimal init.sh just mounts /proc as nearly everything needs it in the Linux world and then handles mounting /lib/rc/init.d as tmpfs or similar. At this point, we should be able to run enough to run init scripts AND generate the dependency tree if we need to.
Comment 11 Roy Marples 2008-10-10 09:27:21 UTC
Once #240984 is resolved, you can get udev to depend on procfs which solves this nicely :)
Comment 12 Steven Davies 2009-01-24 10:47:25 UTC
Bug 240984 is marked as fixed, can this one be closed?