From 2db7f3be9fa2ed7a6ae1168276ba35a0485266e0 Mon Sep 17 00:00:00 2001 From: Alessandro Elias Date: Wed, 17 Feb 2016 16:26:18 +0000 Subject: Added script as fallback to dnbd3-rootfs. Signed-off-by: Alessandro Elias --- .../hd-boot/hooks/prepare-kern_cmdline-fallback.sh | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 builder/hd-boot/hooks/prepare-kern_cmdline-fallback.sh 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 -- cgit v1.2.3-55-g7522