summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
Diffstat (limited to 'remote')
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/setup_stage321
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger7
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/init36
3 files changed, 19 insertions, 25 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
index f0380ece..57ad09e1 100755
--- a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
+++ b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
@@ -45,6 +45,7 @@ FUTURE_ROOT="/mnt"
# Move network stuff
cp /etc/hostname /etc/hosts /etc/resolv.conf "${FUTURE_ROOT}/etc/"
+[ -s "/run/config" ] && cat "/run/config" >> "${FUTURE_ROOT}/opt/openslx/config"
# "Delete" addon hook-script in aufs view
touch "/mnt/opt/openslx/uniontmp/.wh.addon-init"
diff --git a/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger b/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
index ea4d002d..4f9cda68 100755
--- a/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
+++ b/remote/rootfs/rootfs-stage31/data/inc/udhcpc-trigger
@@ -45,7 +45,11 @@ fi
rm -f -- "/etc/resolv.conf"
# DNS/domain?
-[ -n "$dns" ] && echo "..got DNS.."
+if [ -n "$dns" ]; then
+ echo "..got DNS.."
+ echo "# From DHCP in stage 3.1" >> "/run/config"
+ echo "SLX_DNS='$dns'" >> "/run/config"
+fi
for serv in $dns; do
echo "nameserver $serv" >> "/etc/resolv.conf"
done
@@ -76,5 +80,6 @@ if [ -n "$hostname" ]; then
echo "$fqdn" > "/proc/sys/kernel/hostname"
echo "$fqdn" > "/etc/hostname"
echo "$ip $fqdn $hostname" > "/etc/hosts"
+ echo "SLX_HOSTNAME='$hostname'" >> "/run/config"
fi
diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init
index ac058591..250767e3 100755
--- a/remote/rootfs/rootfs-stage31/data/init
+++ b/remote/rootfs/rootfs-stage31/data/init
@@ -41,13 +41,7 @@ setup_gfx () {
#echo "Trying to load module $DRM"
modprobe "$DRM" 2>/dev/null
done
- # start plymouth if activated
- #if [ $DEBUG -lt 1 ]; then
- # echo "Starting plymouth..."
- # # link the theming directory from the config to the current root
- # ln -sf "${FUTURE_ROOT}/usr/share" /usr/share
- # lymouthd --kernel-command-line="splash" --tty=/dev/tty7 && plymouth show-splash
- #fi
+ # start some kind of splash screen if activated
}
setup_gfx &
@@ -57,44 +51,41 @@ mdev -s
# read kernel command line for debugging switch
DEBUG=0
-read KCL < /proc/cmdline
-export KCL
+read KCL < "/proc/cmdline"
for opts in ${KCL}; do
case "${opts}" in
debug=*)
DEBUG=${opts#debug=} ;;
ip=*)
# process IP info
- export IPINFO=${opts#ip=} ;;
+ IPINFO=${opts#ip=} ;;
nfs=*)
- export NFS=${opts#nfs=}
- export NFSPATH=${nfs#*:}
- export NFSSERVER=${nfs%:/*}
+ NFS=${opts#nfs=}
+ NFSPATH=${NFS#*:}
+ NFSSERVER=${NFS%:/*}
;;
BOOTIF=*)
- export MAC="$( echo "$opts" | cut -b 11- | tr '-' ':' | tr '[A-Z]' '[a-z]' )" ;; # make mac lowercase for udev (see setup_network)
+ MAC="$( echo "$opts" | cut -b 11- | tr '-' ':' | tr '[A-Z]' '[a-z]' )" ;; # make mac lowercase for udev (see setup_network)
esac
done
# suppress kernel output if DEBUG is not set
[ $DEBUG -ge 1 ] && echo "0" > /proc/sys/kernel/printk || echo "4 4 1 7" >/proc/sys/kernel/printk
-[ $DEBUG -ge 5 ] && drop_shell "Requested Debug Shell: before network."
+[ $DEBUG -ge 4 ] && drop_shell "Requested Debug Shell: before network."
. "/inc/setup_network" || drop_shell "Error setting up network"
-[ $DEBUG -ge 4 ] && drop_shell "Requested Debug Shell: after network/before configuring."
+[ $DEBUG -ge 3 ] && drop_shell "Requested Debug Shell: after network/before configuring."
. "/inc/activate_sysconfig" || drop_shell "Could not source /bin/activate_sysconfig"
-[ $DEBUG -ge 3 ] && drop_shell "Requested Debug Shell: after network/before configuring."
-
[ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after configuration/before stage32."
. "/inc/setup_stage32" || drop_shell "Problem setting up stage3.2"
# copy files needed for stage3.2 to FUTURE_ROOT
-[ $DEBUG -ge 1 ] && echo "Copying busybox etc. to stage32..."
+echo "Copying busybox etc. to stage32..."
tar -cp "/bin" "/sbin" "/usr/bin" "/usr/sbin" "/etc/functions.inc" | tar -xp -C "${FUTURE_ROOT}/opt/openslx/"
# set the SLX_ROOT_PASS if given in config
@@ -105,17 +96,14 @@ fi
# one last debug shell if activated
[ $DEBUG -ge 1 ] && drop_shell "Requested Debug Shell: before switch_root."
-# tell plymouth about the immediate rootfs switch
-#[ $DEBUG -lt 1 ] && plymouth update-root-fs --new-root-dir=/mnt
-
# unmount filesystems
for mnt in proc sys run ; do
- busybox umount -n "$mnt" 2>/dev/null
+ busybox umount -f -l "/$mnt" 2>/dev/null
done
echo "Switching root...."
# Prepare environment (HOME is needed as a hack for nss_ldap with ssl and no caching)
-unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF
+unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF DEBUG
export HOME=/
export init="/usr/lib/systemd/systemd"
export recovery=