From 36c59e77b45944de52b43cc2c3a16d4e0159c3c2 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jun 2015 12:43:28 +0200 Subject: [PATCH] Fix broken SYSROOT and add it to configure script. Signed-off-by: Joachim Nilsson --- configure | 12 ++++++++++++ finit.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 811448e2..99907a17 100755 --- a/configure +++ b/configure @@ -53,6 +53,9 @@ result() echo "FIFO : $fifo" echo "Config file : $config" echo "rcs.d/ directory : $rcsd" + if [ x"$sysroot" != x"" ]; then + echo "Swap rootfs to : $sysroot" + fi echo "Default username : $defuser" echo "Default hostname : $defhost" echo "Default runlevel : $runlevel" @@ -131,6 +134,8 @@ usage() echo " files, or as built-in if --enable-static is given," echo " defaults to all plugins. Exclude extension!" echo " --with-rcsd=RCSD Finit RCSD directory, default '\$sysconfdir/$confdir'" + echo " --with-sysroot=PATH Some distributions keep a different (writable) rootfs" + echo " that is used at runtime, usually /sysroot or /mnt" 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" @@ -209,6 +214,10 @@ while [ "$*" != "" ]; do rcsd="$arg" ;; + with-sysroot) + sysroot="$arg" + ;; + with-usename) defuser="$arg" ;; @@ -337,6 +346,9 @@ fi echo "#define FINIT_FIFO \"$fifo\"" >> config.h echo "#define FINIT_CONF \"$config\"" >> config.h echo "#define FINIT_RCSD \"$rcsd\"" >> config.h +if [ x"$sysroot" != x"" ]; then + echo "#define SYSROOT \"$sysroot\"" >> config.h +fi echo "#define PLUGIN_PATH \"$plugindir\"" >> config.h if [ x"$random" != x"" ]; then echo "#define RANDOMSEED \"$random\"" >> config.h diff --git a/finit.c b/finit.c index 541f69f2..aa9f6160 100644 --- a/finit.c +++ b/finit.c @@ -139,7 +139,7 @@ int main(int argc, char* argv[]) run("/bin/mount -n -o remount,rw /"); #endif #ifdef SYSROOT - run(SYSROOT, "/", NULL, MS_MOVE, NULL); + mount(SYSROOT, "/", NULL, MS_MOVE, NULL); #endif _d("Root FS up, calling hooks ...");