summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-01-31 20:11:02 +0100
committerDirk von Suchodoletz2007-01-31 20:11:02 +0100
commit1ad51ac519e7afc970a5ddf991c9141e140bf7f3 (patch)
tree2b35cf904a5e029ee2da9a355976a47d7c6ab670 /initramfs/initrd-stuff
parentUse the right variable name of the existing path. (diff)
downloadcore-1ad51ac519e7afc970a5ddf991c9141e140bf7f3.tar.gz
core-1ad51ac519e7afc970a5ddf991c9141e140bf7f3.tar.xz
core-1ad51ac519e7afc970a5ddf991c9141e140bf7f3.zip
Fixed slow stage3 in higher debuglevels (sleep -> usleep in
/etc/functions) Heavy rewrite of base scripts init/hwautocfg/servconfig. Moved lots of stuff from hwautocfg to init and servconfig to get a cleaner structure (do not wait for processes of init or servconfig in hwautocfg) Cleanup started, old codefragments will be removed soon ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@661 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff')
-rwxr-xr-xinitramfs/initrd-stuff/bin/hwautocfg53
-rwxr-xr-xinitramfs/initrd-stuff/bin/servconfig33
-rw-r--r--initramfs/initrd-stuff/etc/functions10
-rwxr-xr-xinitramfs/initrd-stuff/init14
4 files changed, 67 insertions, 43 deletions
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg
index ba164cd8..45758c71 100755
--- a/initramfs/initrd-stuff/bin/hwautocfg
+++ b/initramfs/initrd-stuff/bin/hwautocfg
@@ -91,6 +91,13 @@ local DRI='\tGroup\t\t"video"\n
# displayvars may overwrite the above settings
displayvars
+# run localizator and configure X11 keyboard
+localization "${country}"
+if [ -z "${XKEYBOARD}" ] ; then
+ error "$hcfg_keyb" nonfatal
+ XKEYBOARD="de"
+fi
+
# check if hardware definition variables are set and overwrite autodetected
# values
if [ -n "$hw_graphic" ] ; then
@@ -406,14 +413,6 @@ cfgcomplete
. /etc/machine-setup
[ $DEBUGLEVEL -eq 21 ] && echo "** finished waiting for config at $(sysup)"
-# run localizator and configure keyboard and console fonts
-DEFKEYTABLE="de-latin1-nodeadkeys"
-localization $country
-if [ -z "${KEYTABLE}" ] ; then
- error "$hcfg_keyb" nonfatal
- KEYTABLE=${DEFKEYTABLE}
-fi
-
# run X11 / Xorg configurator if no xorg.conf file was provided by
# ConfigTGZ (check for /rootfs/${D_XF86CONFFILE#/mnt})
if [ -f /rootfs${D_XF86CONFFILE#/mnt} ] ; then
@@ -463,27 +462,27 @@ done
# wait for completion of clients root filesystem in /mnt and add
# previously generated files to /mnt/etc ...
-[ $DEBUGLEVEL -eq 21 ] && \
- echo -e "** if you did not run hwautocfg in background and exited the \n\
-debug shell, expect to wait from now on a while ..."
-waitfor /tmp/fscmpl 40000
-[ -f /tmp/fstab ] && cat /tmp/fstab >> /mnt/etc/fstab
-[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \
- >> /mnt/etc/udev/rules.d/04-scanner.rules
+#[ $DEBUGLEVEL -eq 21 ] && \
+# echo -e "** if you did not run hwautocfg in background and exited the \n\
+#debug shell, expect to wait from now on a while ..."
+#waitfor /tmp/fscmpl 40000
+#[ -f /tmp/fstab ] && cat /tmp/fstab >> /mnt/etc/fstab
+#[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \
+# >> /mnt/etc/udev/rules.d/04-scanner.rules
# add entries to initialize keytable and consolefont to boot.ld
# postpone some commands into normal bootup environment
-echo -e "\t# entries added by $0: $date" >> /mnt/etc/${D_INITDIR}/boot.ld
-[ -n "${KEYTABLE}" ] && keytable
-[ -n "${CONSOLE_FONT}" ] && consolefont
+#echo -e "\t# entries added by $0: $date" >> /mnt/etc/${D_INITDIR}/boot.ld
+#[ -n "${KEYTABLE}" ] && keytable
+#[ -n "${CONSOLE_FONT}" ] && consolefont
# finalize X configuration XBinPath contains pointer of to X binary
# in /var/X11R6/bin/X - only needed if var is set
-displayvars
-if [ -n $XBinPath ] ; then
- testmkd /mnt/var/X11R6/bin
- ln -sf $XBinPath /mnt/var/X11R6/bin/X
-fi
+#displayvars
+#if [ -n $XBinPath ] ; then
+# testmkd /mnt/var/X11R6/bin
+# ln -sf $XBinPath /mnt/var/X11R6/bin/X
+#fi
# if any new device appeared up to now
if [ -x /bin/mdev ] ; then
mdev -s &
@@ -492,12 +491,12 @@ if [ -x /bin/mdev ] ; then
fi
# wait for completion of Xorg configuration
-waitfor /tmp/xready 20000
-cp /etc/xorg.conf ${D_XF86CONFFILE}
+#waitfor /tmp/xready 20000
+#cp /etc/xorg.conf ${D_XF86CONFFILE}
# do not finish until tmp is setup properly
-[ -n "$part44" ] && waitfor /tmp/tmpready 20000
-
+#[ -n "$part44" ] && waitfor /tmp/tmpready 20000
+# not needed --> servconfig waits for it!
# script run timer or debug information
[ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \
diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig
index 1cbae875..cbe7b187 100755
--- a/initramfs/initrd-stuff/bin/servconfig
+++ b/initramfs/initrd-stuff/bin/servconfig
@@ -83,6 +83,23 @@ echo "
">/mnt/etc/issue
#############################################################################
+# set localization and add entries to initialize keytable and consolefont to
+# boot.ld
+DEFKEYTABLE="de-latin1-nodeadkeys"
+if [ -z "$country" ] ; then
+ error "$scfg_country" nonfatal
+ country="${D_DEFAULTCOUNTRY}"
+fi
+localization "${country}"
+if [ -z "${KEYTABLE}" ] ; then
+ error "$hcfg_keyb" nonfatal
+ KEYTABLE=${DEFKEYTABLE}
+fi
+echo -e "\t# entries added by $0: $date" >> /mnt/etc/${D_INITDIR}/boot.ld
+[ -n "${KEYTABLE}" ] && keytable
+[ -n "${CONSOLE_FONT}" ] && consolefont
+
+#############################################################################
# vmware stuff first part: two scenarios
# * VM images in /usr/share/vmware - then simply link
# * VM images via additional mount (mount source NFS, NBD, ...)
@@ -118,14 +135,6 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then
fi
#############################################################################
-# set localization
-if [ -z "$country" ] ; then
- error "$scfg_country" nonfatal
- country="${D_DEFAULTCOUNTRY}"
-fi
-localization "${country}"
-
-#############################################################################
# setup passwd and shadow for local system users like root, bin, daemon and
# nobody if no user/admin provided passwd exists ...
# the root password provided by machine-setup is used only if no passwd file
@@ -493,6 +502,14 @@ resmgr revoke nobody\nresmgr logout tty7\nkillall X" \
;;
esac
echo -e "# entry made by $0 $date\n$init" >> /mnt/etc/inittab
+ # wait for completion of Xorg configuration and finalize it
+ waitfor /tmp/xready 20000
+ cp /etc/xorg.conf /mnt/${D_XF86CONFFILE}
+ displayvars
+ if [ -n $XBinPath ] ; then
+ testmkd /mnt/var/X11R6/bin
+ ln -sf $XBinPath /mnt/var/X11R6/bin/X
+ fi
fi
# setup requested display manager
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 8ecb5db1..ec8803a1 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -92,7 +92,7 @@ if [ -n "$2" ] ; then
echo -e "${error_msg}${e_msg}${error_nfe}" >> ${LOGFILE}
[ "$DEBUGLEVEL" -gt 1 -a "$DEBUGLEVEL" != 8 ] && \
echo -e "${error_msg}${e_msg}${error_nfe}"
- [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && sleep 10
+ [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && usleep 10
else
echo -e "${error_msg}${e_msg}${error_shell}"
# load usb modules to have keyboard enabled - they might have to be
@@ -124,10 +124,14 @@ usleep () {
if [ -x /bin/usleep ]; then
/bin/usleep `expr $1 \* 1000`
else
+ local i=0
local starttime=$(sed -e "s, .*,,;s,\.,," /proc/uptime)
while [ $(sed -e "s, .*,,;s,\.,," /proc/uptime) -le \
- $(expr $starttime + $1 - 2) ]
- do :
+ $(expr $starttime + $1 - 2) ] ; do
+ # burn some cycles
+ while [ $i -le 100 ] ; do
+ i=$(expr 1 + $i)
+ done
done
fi
return 0
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index 419ad956..de879d69 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -451,7 +451,7 @@ if [ -n "${UNIONFS}" -o -n "${UNION}" ] ; then
error "$init_loadufs" nonfatal
UNIONFS=""; }
fi
-
+echo "Vor Union"
# setup of client root filesystem dependent on the availability of UnionFS
if [ -n "${UNIONFS}" ] ; then
echo "Using UnionFS for rw access"
@@ -532,6 +532,7 @@ fi
# script for stuff to execute during early bootup
d_mkrlscript init boot.ld "Running configuration postponed from InitRamFS"
echo "fs complete at $(sysup)" >/tmp/fscmpl
+echo "FS complete"
# write debug file information after filesystem setup completed
echo -e "# /etc${D_SYSCONFDIR}/logfile - file created by $0 (initramfs \
@@ -582,10 +583,12 @@ if [ -z "${NOLDSC}" ] ; then
else
error "$init_infldcfg" nonfatal
fi
-# copy machine configuration (from global settings, additions made within
-# here and from dhcp/ldap sources) to client /etc for later checks
-waitfor /tmp/svcfg 20000 || error "$init_errsw"
+# wait a while for hardware setup to complete and copy stuff to stage4
waitfor /tmp/hwcfg 30000 || error "$init_errhw"
+[ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \
+ >> /mnt/etc/udev/rules.d/04-scanner.rules
+# wait a while for services setup to complete
+waitfor /tmp/svcfg 20000 || error "$init_errsw"
# IP configuration is made and should not be updated automatically, udevd
# should be killed if started within init
killall -9 dhcpcd dhclient pump udhcpc 2>/dev/null
@@ -614,8 +617,9 @@ done
test -f /mnt/etc/inittab || error "$init_erritab"
# close runlevel script for stuff to execute during early bootup
d_mkrlscript close boot.ld ""
-# put /tmp into stage4 mtab
+# put /tmp into stage4 mtab and add stuff to stage4 fstab
sed -n "s,/mnt,,;/\/tmp /p" /proc/mounts >> /mnt/etc/mtab
+[ -f /tmp/fstab ] && cat /tmp/fstab >> /mnt/etc/fstab
# preparations to leave initramfs - umounting ...
umount -n /sys || error "$init_errsys" nonfatal
umount -n /proc/bus/usb >/dev/null 2>&1