summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/init
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-04-28 19:20:16 +0200
committerDirk von Suchodoletz2007-04-28 19:20:16 +0200
commit27323a9c9a2ed48df30efd37f65a55caac1db5d4 (patch)
tree664def21a95e0f049a9f69d801d532a6e0e09353 /initramfs/initrd-stuff/init
parentProper error message if no eth0 appeared ... (diff)
downloadcore-27323a9c9a2ed48df30efd37f65a55caac1db5d4.tar.gz
core-27323a9c9a2ed48df30efd37f65a55caac1db5d4.tar.xz
core-27323a9c9a2ed48df30efd37f65a55caac1db5d4.zip
Code cleanups, simplifications ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@942 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/init')
-rwxr-xr-xinitramfs/initrd-stuff/init38
1 files changed, 16 insertions, 22 deletions
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index f437f133..eaa89173 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -54,7 +54,6 @@ mknod /dev/zero c 1 5
mknod /dev/urandom c 1 9
mknod /dev/kmsg c 1 11
mknod /dev/console c 5 1
-mknod /dev/ctl b 241 255
mknod /dev/bootsplash p
mkdir -p ${devdir}/pts
@@ -235,9 +234,8 @@ done
# or halt of the machine if SLX init does not succeed (e.g. missing kernel
# module for the network adaptor)
if [ ${DEBUGLEVEL} -lt 3 -o ${DEBUGLEVEL} = 8 ] ; then
- [ -x /bin/busybox ] && shtype=a
cat<<EOF > /bin/watchdog
-#!/bin/${shtype}sh
+#!/bin/ash
echo \$$ > /tmp/watchdogpid
[ ! -f /proc/version ] && mount -n -t proc proc /proc
. /etc/functions
@@ -408,7 +406,7 @@ if [ -n "${nbdmod}" ] ; then
fi
echo "Using Copy-on-Write block device for rw access"
mount -n -t tmpfs -o size=${cowsize} ramfs ${rwdir}
- mkdir /dev/cow && cp -a /tmp/ctl /dev/cow
+ mkdir /dev/cow && mknod /dev/cow/ctl b 241 255
usleep 200
ln -s /dev/cowloop0 /dev/cow/0
cowdev -a /dev/nbd0 ${rwdir}/nbd.cow
@@ -620,9 +618,8 @@ echo -e "rootfs / rootfs rw 0 0\ninitramdevs /dev tmpfs rw\
# copy library cache if generated
if [ -z "${noldsc}" ] ; then
if waitfor /tmp/ldcfg 50000 ; then
- test -s /mnt/tmp/ld.so.cache && {
- cp /mnt/tmp/ld.so.cache /mnt/etc/ld.so.cache
- rm /mnt/tmp/ld.so.cache; }
+ test -s /mnt/tmp/ld.so.cache && \
+ mv /mnt/tmp/ld.so.cache /mnt/etc/ld.so.cache
else
error "$init_errldcfg"
fi
@@ -635,45 +632,42 @@ waitfor /tmp/hwcfg 30000 || error "$init_errhw"
>> /mnt/etc/udev/rules.d/04-scanner.rules
# wait for completion of Xorg configuration and finalize it
waitfor /tmp/xready 20000 || error "$init_errxorg" nonfatal
-cp /etc/xorg.conf /mnt/${D_XF86CONFFILE}
+mv /etc/xorg.conf /mnt/${D_XF86CONFFILE}
# wait a while for services setup to complete
waitfor /tmp/svcfg 20000 || error "$init_errsw"
# IP configuration is complete and should not be updated automatically
-killall -9 dhcpcd dhclient pump udhcpc 2>/dev/null
+killall -9 dhcpcd dhclient udhcpc 2>/dev/null
# copy machine configuration file into stage4 filesystem
-cp /etc/machine-setup /mnt/etc
+mv /etc/machine-setup /mnt/etc
-#If uniondirs is not set yet, maybe the unions were given via machine-setup
+# if uniondirs is not set yet, maybe the unions were given via machine-setup
if [ -z "$uniondirs" ]; then
if [ "$union_type" == "AUFS" ]; then
- #Does it contain "://"?
+ # does it contain "://"?
if [ "$aufs" != "${aufs#*://}" ]; then
- uniondirs=$aufs
+ uniondirs="$aufs"
fi
elif [ "$union_type" == "UnionFS" ]; then
- #Does it contain "://"?
+ # does it contain "://"?
if [ "$unionfs" != "${unionfs#*://}" ]; then
- uniondirs=$unionfs
+ uniondirs="$unionfs"
fi
fi
fi
-# If locations are given that should be unioned with the fs root, do it
+# if locations are given that should be unioned with the fs root, do it
if [ -n "$uniondirs" ]; then
- include_in_fsroot_union $union_type $uniondirs
+ include_in_fsroot_union "$union_type" "$uniondirs"
fi
# post init for some distro specific (fixme!! more elegant solution)
postinit
[ -s /initramfs/postinit.local ] && \
- cp /initramfs/postinit.local /bin/postinit.local
+ mv /initramfs/postinit.local /bin/postinit.local
[ -x /bin/postinit.local ] && {
[ $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
[ $DEBUGLEVEL -gt 2 -a $DEBUGLEVEL != 8 ] && /bin/sh
@@ -707,7 +701,7 @@ killall -9 udevd hwautocfg servconfig 2>/mnt/dev/null
[ -f /tmp/watchdogpid ] && kill $(cat /tmp/watchdogpid) 2>/mnt/dev/null
umount -n /proc
# unset old environment variables
-unset debug date initrd ip dnbdroot nbdroot nfsroot rootfs ticks vci vga
+unset client debug date initrd ip dnbdroot nbdroot nfsroot rootfs ticks vci vga
unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \
SLXVERSION UDEVD_EXPECTED_SEQNUM PATH
# new style of pivoting (switch_root or run-init in klibc)