From 06a1a3c83916998526a3b0a64922fc0d58ee4393 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jun 2015 12:01:08 +0200 Subject: [PATCH] Refactor: Move default runlevel to configure script. Signed-off-by: Joachim Nilsson --- configure | 8 ++++++++ finit.h | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 4293626f..a897685e 100755 --- a/configure +++ b/configure @@ -28,6 +28,7 @@ defaults() rcsd=${rcsd:="$sysconfdir/$confdir"} defuser=${defuser:="root"} defhost=${defhost:="noname"} + runlevel=${runlevel:=2} debug=${debug:=0} embedded=${embedded:=0} inetd=${inetd:=1} @@ -55,6 +56,7 @@ fi echo "rcs.d/ directory : $rcsd" echo "Default username : $defuser" echo "Default hostname : $defhost" + echo "Default runlevel : $runlevel" if [ $debug -ne 0 ]; then echo "Debug : ENABLED" @@ -115,6 +117,7 @@ usage() echo " --with-rcsd=RCSD Finit RCSD directory, default '\$sysconfdir/$confdir'" echo " --with-username=USER User for 'startx' .conf option, default: root" echo " --with-hostname=NAME Hostname, if /etc/hostname is missing, default: noname" + echo " --with-runlevel=LEVEL Runlevel to switch to after bootstrap (S), default: 2" echo echo " --enable-embedded Enable embedded defaults, BusBox getty, mdev etc." echo " --enable-debug Enable debug flags, '-O0, -g'" @@ -193,6 +196,10 @@ while [ "$*" != "" ]; do defhost="$arg" ;; + with-runlevel) + runlevel="$arg" + ;; + enable-debug) debug=1 ;; @@ -309,3 +316,4 @@ echo "#define FINIT_RCSD \"$rcsd\"" >> config.h echo "#define PLUGIN_PATH \"$plugindir\"" >> config.h echo "#define DEFUSER \"$defuser\"" >> config.h echo "#define DEFHOST \"$defhost\"" >> config.h +echo "#define RUNLEVEL $runlevel" >> config.h diff --git a/finit.h b/finit.h index 2486a3ee..dd04a4fc 100644 --- a/finit.h +++ b/finit.h @@ -43,14 +43,12 @@ # define GETTY "/sbin/getty -L" # define GETTY_BUSYBOX /* Tell tty.c about the getty argument order */ # define BAUDRATE 115200 -# define RUNLEVEL 2 #else /* Debian/Ubuntu based distributions */ # define CONSOLE "/dev/tty1" # define SETUP_DEVFS "/sbin/udevd --daemon" # define GETTY "/sbin/getty -8" # define GETTY_AGETTY /* Tell tty.c about the getty argument order */ # define BAUDRATE 38400 -# define RUNLEVEL 2 # define RANDOMSEED "/var/lib/urandom/random-seed" # define REMOUNT_ROOTFS_RW # define HAVE_DBUS