From 78a5c9093302e736f1cc870d4a9b5951f54f7ad7 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Fri, 20 Mar 2009 11:39:26 +0000 Subject: Restructured disk/tmp setup to avoid unionfs/aufs hassles of covered mount points (r2743 didn't fix that). git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2747 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/stage3-stuff/bin/hwautocfg | 30 +++++++++++++++++++----------- initramfs/stage3-stuff/init | 29 +++++++++++++++++------------ 2 files changed, 36 insertions(+), 23 deletions(-) (limited to 'initramfs') diff --git a/initramfs/stage3-stuff/bin/hwautocfg b/initramfs/stage3-stuff/bin/hwautocfg index fddba8df..aee401f1 100755 --- a/initramfs/stage3-stuff/bin/hwautocfg +++ b/initramfs/stage3-stuff/bin/hwautocfg @@ -89,6 +89,18 @@ modprobe ${MODPRV} snd-mixer-oss [ $DEBUGLEVEL -eq 21 ] && echo "** finished most of module loading at $(sysup)" +# scanner setup (fixme: to be checked) +hwinfo --scanner >/etc/hwinfo.scanner +[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \ + >>/mnt/etc/udev/rules.d/04-scanner.rules + +# if any new device appeared up to now +mdev -s +return 0 +} +############################################################################# +# harddisk partition setup part +disk () { # get idea of availabe harddisk partitions, put swap partitions into # (/mnt)/etc/fstab and format and mount partitions of type 44 (unknown) [ $DEBUGLEVEL -eq 21 ] && echo "** starting hdd stuff at $(sysup)" @@ -129,14 +141,6 @@ else echo "no harddisk found ( $(sysup) )" >/tmp/tmpready fi [ $DEBUGLEVEL -eq 21 ] && echo "** finished hdd stuff at $(sysup)" -# scanner setup (fixme: to be checked) -hwinfo --scanner >/etc/hwinfo.scanner -[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \ - >>/mnt/etc/udev/rules.d/04-scanner.rules - -# if any new device appeared up to now -mdev -s -return 0 } ############################################################################# @@ -180,13 +184,17 @@ case $1 in base) base ;; - # main part of hardware setup including Xorg + # main part of hardware setup of pci stuff main) hwmain # main script run timer or debug information [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ - echo "** HW setup finished at $(sysup)" - echo "hwsetup finished at $(sysup)" >/tmp/hwcfg + echo "** HW main setup finished at $(sysup)" + echo "hwsetup main part finished at $(sysup)" >/tmp/hwcfg + ;; + # disk setup part (detecting, formatting, mounting) + disk) + disk ;; # remove unneeded kernel modules finish) diff --git a/initramfs/stage3-stuff/init b/initramfs/stage3-stuff/init index 75c02e9b..561d11bd 100755 --- a/initramfs/stage3-stuff/init +++ b/initramfs/stage3-stuff/init @@ -663,6 +663,19 @@ runinithook '35-have-network-root' # get the complete collection of kernel modules available mount -n --bind /mnt/lib/modules /lib/modules || error "$init_moddir" +# start hardware configuration as background process if not a special +# debuglevel (21) is used for the option of manual hwautocfg start +if [ ${DEBUGLEVEL} = 21 ] ; then + echo "You can run 'hwautocfg main &' manually now ..." + /bin/ash +else + [ $DEBUGLEVEL -eq 20 ] && echo "** started hwautocfg in background at \ +$(sysup)" + hwautocfg main & +fi + +runinithook '40-started-hw-config' + # unionfs/aufs modules visible by now if installed, try to use aufs for rw # access if available union_type="" @@ -680,18 +693,6 @@ else unset aufs unionfs fi -# start hardware configuration as background process if not a special -# debuglevel (21) is used for the option of manual hwautocfg start -if [ ${DEBUGLEVEL} = 21 ] ; then - echo "You can run 'hwautocfg main &' manually now ..." - /bin/ash -else - [ $DEBUGLEVEL -eq 20 ] && echo "** started hwautocfg in background at \ -$(sysup)" - hwautocfg main & -fi - -runinithook '40-started-hw-config' # runtimer [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 20 ] && \ @@ -712,10 +713,14 @@ if [ -n "${union_type}" ] ; then mkdir -p /mnt/uniontmp mount -n --move ${rwdir}/uniontmp /mnt/uniontmp chmod 0755 /mnt/uniontmp /mnt + # running hardware disk/tmp setup now + hwautocfg disk & # run ldconfig if switched on via kernel command line (token ldsc) or # triggered by unionized root filesystem ldcfg elif [ -z "${cowloop}" ] ; then + # fire up hardware disk/tmp setup first + hwautocfg disk & echo "Using bind mounts to ramdisk for rw access" mount -n -t tmpfs -o size=${tmpfssize} ramfs ${rwdir} for path in ${D_BINDMPTS} ; do -- cgit v1.2.3-55-g7522