summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-09 04:37:07 +0200
committerThomas Bächler <thomas@archlinux.org>2011-06-25 12:25:45 +0200
commit81e77426e554a61d85e1738af604359171a6062e (patch)
tree93cc1d2444fe29f466706ceda19d801978c99fd4 /init
parent6dba57232914a1952dedea70a1dad38142ba7258 (diff)
downloadmkinitcpio-81e77426e554a61d85e1738af604359171a6062e.tar.gz
mkinitcpio-81e77426e554a61d85e1738af604359171a6062e.tar.xz
init: declare PATH, remove absolute paths
We were never very consistent about this anyways. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'init')
-rw-r--r--init36
1 files changed, 19 insertions, 17 deletions
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} "$@"