diff options
author | Dirk von Suchodoletz | 2006-12-22 17:27:36 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-12-22 17:27:36 +0100 |
commit | 280108a7fadbe4a95e7d7c446240d8e7638d6390 (patch) | |
tree | a7fdaa354c5c20a11f9dd97f7bdf49a04650f021 /initramfs/initrd-stuff/init | |
parent | Fix for non-busybox watchdog (or should we add (u)sleep to the initramfs (diff) | |
download | core-280108a7fadbe4a95e7d7c446240d8e7638d6390.tar.gz core-280108a7fadbe4a95e7d7c446240d8e7638d6390.tar.xz core-280108a7fadbe4a95e7d7c446240d8e7638d6390.zip |
Small cleanups ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@581 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/init')
-rwxr-xr-x | initramfs/initrd-stuff/init | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 02e2ecad..1e6dddd3 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -2,11 +2,13 @@ # main script for new type of initial ramdisk for OpenSLX linux diskless # clients version 4 # -# Dirk von Suchodoletz <dirk@goe.net>, 17-12-2006 +# this file is distributed under the GPLv2, see ~/openslx/COPYING +# +# Dirk von Suchodoletz <dirk@goe.net>, 22-12-2006 # <mj0@uni-freiburg.de> (xenbr), 27-09-2006 # # (c) 2006 - RZ Universitaet Freiburg -# (c) 2006 - OpenSLX.ORG Project +# (c) 2006 - OpenSLX GmbH # functions common for all distros, messages contains all error and info # output (for some reason the error output is not produced properly - crash) @@ -415,7 +417,6 @@ if [ -n "${UNIONFS}" -o -n "${UNION}" ] ; then UNIONFS=""; } fi - # setup of client root filesystem dependent on the availability of UnionFS if [ -n "${UNIONFS}" ] ; then echo "Using UnionFS for rw access" @@ -510,8 +511,8 @@ done for i in /var/run/utmp /var/log/wtmp /var/log/lastlog /etc/mtab ; do echo -n > /mnt/$i done -chmod a+rwxt /mnt/tmp /mnt/tmp/scratch 2>/dev/null & -chown 65534:0 /mnt/var/lib/nobody & +chown 65534:0 /mnt/var/lib/nobody +# /proc/bus/usb might be deprecated in newer kernels ... echo -e "# /etc/fstab - file generated by $0 (initramfs from $date)\n#\ \tDirk von \ Suchodoletz, dirk@goe.net\n\nrootfs\t\t/\t\trootfs\t\tro\t\t 0 0\n\ @@ -548,7 +549,8 @@ postinit [ -s /initramfs/postinit.local ] && \ cp /initramfs/postinit.local /bin/postinit.local [ -x /bin/postinit.local ] && { - echo "Running postinit.local - if boot stops here, check the script!" + [ $DEBUGLEVEL -gt 0 ] && \ + echo "Running postinit.local - if boot stops here, check the script!" /bin/postinit.local; } # start a debug shell in higher debug levels @@ -567,13 +569,14 @@ test -f /mnt/etc/inittab || error "$init_erritab" d_mkrlscript close boot.ld "" # put /tmp into stage4 mtab sed -n "s,/mnt,,;/\/tmp /p" /proc/mounts >> /mnt/etc/mtab -# preparations to leave initrd - umounting ... +# preparations to leave initramfs - umounting ... umount -n /sys || error "$init_errsys" nonfatal umount -n /proc/bus/usb >/dev/null 2>&1 mount -n --move /dev /mnt/dev -chmod a+rwxt /mnt/dev/shm +chmod a+rwxt /mnt/dev/shm /mnt/tmp /mnt/tmp/scratch 2>/dev/null + killall -9 udevd 2>/dev/null -# kill the watchdog (errhalt) +# kill the watchdog (autopoweroff, if stage3 init never finishes) [ -f /tmp/watchdogpid ] && kill $(cat /tmp/watchdogpid) 2>/dev/null # runtimer [ $DEBUGLEVEL -eq 8 ] && echo "** SLX init ended near $(sysup)" @@ -582,5 +585,5 @@ umount -n /proc unset debug date initrd ip dnbdroot nbdroot nfsroot vci vga unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \ UDEVD_EXPECTED_SEQNUM -# new style of pivoting (exec -c would set an empty environment in bash) +# new style of pivoting (switch_root or run-init in klibc) exec switch_root -c dev/console /mnt /sbin/init || error "$init_runinit" |