diff options
author | Alessandro Elias | 2016-02-17 17:26:18 +0100 |
---|---|---|
committer | Alessandro Elias | 2016-02-17 17:26:18 +0100 |
commit | 2db7f3be9fa2ed7a6ae1168276ba35a0485266e0 (patch) | |
tree | 3d5e8dec3d2d2f97ee55096062ba054583cf5312 | |
parent | Disabled gen-netfiles.sh, this is done at cmdline hooks, fallback. (diff) | |
download | systemd-init-2db7f3be9fa2ed7a6ae1168276ba35a0485266e0.tar.gz systemd-init-2db7f3be9fa2ed7a6ae1168276ba35a0485266e0.tar.xz systemd-init-2db7f3be9fa2ed7a6ae1168276ba35a0485266e0.zip |
Added script as fallback to dnbd3-rootfs.
Signed-off-by: Alessandro Elias <ae11@c3sl.ufpr.br>
-rwxr-xr-x | builder/hd-boot/hooks/prepare-kern_cmdline-fallback.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/builder/hd-boot/hooks/prepare-kern_cmdline-fallback.sh b/builder/hd-boot/hooks/prepare-kern_cmdline-fallback.sh new file mode 100755 index 00000000..8366bb87 --- /dev/null +++ b/builder/hd-boot/hooks/prepare-kern_cmdline-fallback.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +debug_off() { + set +x +} + +debug_on() { + [ "$RD_DEBUG" = "yes" ] && set -x +} + +debug_on +set -x +if [ -z "$BOOTIF" ]; then + umount /proc/cmdline + + _cmdline=$(cat /proc/cmdline) + _buff=$(expr match "$_cmdline" '.*\(ifname=.*:..:..:..:..:..:..\)' | awk -F'=' '{print $2}') + if [ -n "$_buff" ]; then + echo "${_buff#*:}" > /tmp/net.bootdev + echo "${_buff#*:} ${_buff%%:*}" > /tmp/net.ifaces + fi + unset _cmdline + unset _buff + + SLX_SERVER="$(getargs slxsrv=)" + SLX_SERVER_BASE="$(getargs slxbase=)" + + [ -z "$SLX_SERVER" ] && warn 'No "slxsrv" parameter found in the kernel command line.' + [ -z "$SLX_SERVER_BASE" ] && warn 'No "slxbase" parameter found in the kernel command line.' +fi +debug_off |