Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284026 - sys-apps/baselayout-1.12.11.1: tries to mount USB filesystems prior to loading modules
Summary: sys-apps/baselayout-1.12.11.1: tries to mount USB filesystems prior to loadin...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-07 20:26 UTC by Mansour Moufid
Modified: 2009-09-08 02:48 UTC (History)
0 users

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


Attachments
A simple workaround. (localmount.patch.2,600 bytes, patch)
2009-09-07 20:29 UTC, Mansour Moufid
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mansour Moufid 2009-09-07 20:26:38 UTC
My goal is to be able to automatically mount a USB drive (which will hold keys to encrypted partitions) at boot via /etc/fstab.

However, the /etc/init.d/localmount script (provided by sys-apps/baselayout-1.12.11.1) handles USB device support -- i.e. modprobe usbcore and mounting usbfs -- *after* mounting any filesystems in /etc/fstab.

Here is an example boot.msg log:

     * Mounting local filesystems ...
    mount: special device /dev/usb/boot_key1 does not exist
     * Some local filesystem failed to mount
      [ !! ]
     * Mounting USB device filesystem (usbfs) ...
      [ ok ]

I've modified the localmount script slightly to get it to go back and mount entries in /etc/fstab that depend on USB support (see attached patch), but I'm sure there's a better way of dealing with such situations.

Here's a sample boot.msg log with the patched localmount:

     * Mounting local filesystems ...
    mount: special device /dev/usb/boot_key1 does not exist
     * Some local filesystem failed to mount
      [ !! ]
     * Mounting USB device filesystem (usbfs) ...
      [ ok ]
     * Mounting local USB-device-backed filesystems ...
      [ ok ]

With the patch, the USB key is indeed mounted properly at boot. The patch is just a workaround, that'll hopefully give developers an idea of what's going on.

Reproducible: Always

Steps to Reproduce:
1. Attempt to have a USB-device-backed partition mount automatically at boot via /etc/fstab.
2.
3.

Actual Results:  
/etc/init.d/localmount fails to mount said entry in /etc/fstab.


Portage 2.1.6.13 (hardened/linux/x86, gcc-3.4.6, glibc-2.9_p20081201-r2, 2.6.28-hardened-r9-custom i686)
=================================================================
System uname: Linux-2.6.28-hardened-r9-custom-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-1.12.11.1
Timestamp of tree: Sat, 05 Sep 2009 22:45:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.ing.umu.se/linux/gentoo/ http://ftp.ds.karen.hj.se/gentoo/ http://ftp.df.lth.se/pub/gentoo/ "
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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.europe.gentoo.org/gentoo-portage"
USE="alsa berkdb branding cli cracklib crypt cups dri hardened iconv isdnlog mudflap ncurses nptl nptlonly pam pcre perl pic pppd python readline reflection session spl ssl sysfs tcpd threads urandom x86 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 imstt intel 	mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage 	siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware 	voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Mansour Moufid 2009-09-07 20:29:29 UTC
Created attachment 203408 [details, diff]
A simple workaround.
Comment 2 SpanKY gentoo-dev 2009-09-08 02:01:52 UTC
the init scripts arent going to figure out what modules your system needs.  either you compile them into your kernel, or load them yourself (i.e. modules.autoload) or use an initramfs (use genkernel).
Comment 3 Mansour Moufid 2009-09-08 02:48:42 UTC
(In reply to comment #2)
> the init scripts arent going to figure out what modules your system needs.
> either you compile them into your kernel, or load them yourself (i.e.
> modules.autoload) or use an initramfs (use genkernel).
> 

I understand. I saw a modprobe in there and assumed that's what it was for. Thanks for the quick reply!