summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-09 04:39:33 +0200
committerThomas Bächler <thomas@archlinux.org>2011-06-25 12:25:45 +0200
commit199eea97bad60365dcfd5bac7ea55fc39b2f773a (patch)
tree9ac73bb2a00448fbab713e561277767485cd1058 /init
parent81e77426e554a61d85e1738af604359171a6062e (diff)
downloadmkinitcpio-199eea97bad60365dcfd5bac7ea55fc39b2f773a.tar.gz
mkinitcpio-199eea97bad60365dcfd5bac7ea55fc39b2f773a.tar.xz
init: remove unnecessary variable declarations
These don't really serve a purpose and might actually munge a test for an unset var. Declare vars as we need them, substituing with default expansions where possible. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'init')
-rw-r--r--init9
1 files changed, 2 insertions, 7 deletions
diff --git a/init b/init
index 1cb9337..38076bb 100644
--- a/init
+++ b/init
@@ -24,13 +24,8 @@ else
fi
mount -t tmpfs run /run -o nosuid,noexec,nodev,mode=755,size=10M
-root=""
-init=""
echo "/sbin/modprobe" > /proc/sys/kernel/modprobe
-# set default mount handler
-mount_handler="default_mount_handler"
-
# parse the kernel command line
parse_cmdline
@@ -84,9 +79,9 @@ if [ "${break}" = "y" ]; then
fi
# Mount root at /new_root
-${mount_handler} /new_root
+${mount_handler:-default_mount_handler} /new_root
-[ -z "${init}" ] && init="/sbin/init"
+init=${init:-/sbin/init}
if [ "$(stat -c %D /)" = "$(stat -c %D /new_root)" ]; then
# Nothing got mounted on /new_root. This is the end, we don't know what to do anymore
# We fall back into a shell, but the shell has now PID 1