From 81e77426e554a61d85e1738af604359171a6062e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 8 Jun 2011 22:37:07 -0400 Subject: init: declare PATH, remove absolute paths We were never very consistent about this anyways. Signed-off-by: Dave Reisner --- init | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'init') diff --git a/init b/init index 332b4de..1cb9337 100644 --- a/init +++ b/init @@ -1,26 +1,28 @@ #!/bin/busybox ash # Install busybox's applets as symlinks -/bin/busybox --install -s +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +busybox --install -s . /init_functions mkdir -p /new_root -/bin/mount -t proc proc /proc -o nosuid,noexec,nodev -/bin/mount -t sysfs sys /sys -o nosuid,noexec,nodev +mount -t proc proc /proc -o nosuid,noexec,nodev +mount -t sysfs sys /sys -o nosuid,noexec,nodev if grep -q devtmpfs /proc/filesystems 2>/dev/null; then - /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid + mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid devtmpfs_mounted=1 else - /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid + mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid devtmpfs_mounted=0 # We don't have devtmpfs, so add the most important standard devices - /bin/mknod /dev/null c 1 3 - /bin/mknod /dev/zero c 1 5 - /bin/mknod /dev/console c 5 1 + mknod /dev/null c 1 3 + mknod /dev/zero c 1 5 + mknod /dev/console c 5 1 # /dev/mem is needed if we want to load uvesafb before triggering uevents - /bin/mknod /dev/mem c 1 1 + mknod /dev/mem c 1 1 fi -/bin/mount -t tmpfs run /run -o nosuid,noexec,nodev,mode=755,size=10M +mount -t tmpfs run /run -o nosuid,noexec,nodev,mode=755,size=10M root="" init="" @@ -35,7 +37,7 @@ parse_cmdline # if available, start udevd at this stage if [ -x /sbin/udevd ]; then msg ":: Starting udevd..." - /sbin/udevd --daemon --resolve-names=never + udevd --daemon --resolve-names=never udevd_running=1 msg "done." else @@ -49,12 +51,12 @@ if [ -n "${disablehooks}" ]; then fi if [ -n "${earlymodules}" ]; then - /sbin/modprobe -qab ${earlymodules//,/ } + modprobe -qab ${earlymodules//,/ } fi . /config -[ -n "$MODULES" ] && /sbin/modprobe -qab $MODULES +[ -n "$MODULES" ] && modprobe -qab $MODULES # If rootdelay is empty or not a non-negative integer, set it to 10 if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then @@ -104,15 +106,15 @@ fi # Stop udevd if is running if [ "${udevd_running}" -eq 1 ]; then - /sbin/udevadm control --exit - /sbin/udevadm info --cleanup-db + udevadm control --exit + udevadm info --cleanup-db fi for d in proc sys dev run; do if [ -d /new_root/${d} ]; then - /bin/mount --move /${d} /new_root/${d} + mount --move /${d} /new_root/${d} else - /bin/umount /${d} + umount /${d} fi done exec env -i TERM=$TERM /sbin/switch_root -c /dev/console /new_root ${init} "$@" -- cgit v1.2.3-24-g4f1b