From 199eea97bad60365dcfd5bac7ea55fc39b2f773a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 8 Jun 2011 22:39:33 -0400 Subject: 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 --- init | 9 ++------- 1 file 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 -- cgit v1.2.3-24-g4f1b