From 4615900f4103f3311734e192f5605f6a42ced19c Mon Sep 17 00:00:00 2001 From: Alessandro Elias Date: Fri, 19 Feb 2016 18:59:51 +0000 Subject: Parse ip, so add to grub config, slxsrv and slxbase. Signed-off-by: Alessandro Elias --- builder/hd-boot/grub/etc/default/grub | 2 +- builder/hd-boot/hooks/partitioner.sh | 11 ++++++----- builder/hd-boot/module-setup.sh | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/builder/hd-boot/grub/etc/default/grub b/builder/hd-boot/grub/etc/default/grub index 629f571c..309664d9 100644 --- a/builder/hd-boot/grub/etc/default/grub +++ b/builder/hd-boot/grub/etc/default/grub @@ -7,7 +7,7 @@ GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="OpenSLX" GRUB_CMDLINE_LINUX_DEFAULT="" -GRUB_CMDLINE_LINUX="loglevel=3 slxsrv=10.66.0.1 slxbase=slx-local/ rd.shell rd.info log_buf_len=1M" +GRUB_CMDLINE_LINUX="loglevel=3 rd.shell rd.info log_buf_len=1M ip=dhcp" #GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" #GRUB_TERMINAL_INPUT="serial" diff --git a/builder/hd-boot/hooks/partitioner.sh b/builder/hd-boot/hooks/partitioner.sh index 21e12a94..de1763e7 100755 --- a/builder/hd-boot/hooks/partitioner.sh +++ b/builder/hd-boot/hooks/partitioner.sh @@ -198,18 +198,19 @@ create_dos_part() set_iface_to_cmdline() { - local tmp + local tmp max ifname _head _tail - tmp="$(cat /usr/share/grub/default/grub | grep -w 'GRUB_CMDLINE_LINUX=')" + tmp="$(cat /etc/default/grub | grep -w 'GRUB_CMDLINE_LINUX=')" [ -n "$tmp" ] || return 1 - mac=$(cat /tmp/net.ifaces) + mac=$(cat /tmp/net.ifaces | cut -d' ' -f1) + ifname=$(cat /tmp/net.ifaces | cut -d' ' -f2) [ -n "$mac" ] || return 1 _head="${tmp#*=\"}" _head="${_head%\"}" - _tail="ifname=$(cat /tmp/net.bootdev):$mac" - sed -r -i "s#GRUB_CMDLINE_LINUX=[\"].*[\"]#GRUB_CMDLINE_LINUX=\"$_head $_tail\"#" /usr/share/grub/default/grub + _tail="ifname=$ifname:$mac" + sed -r -i "s#GRUB_CMDLINE_LINUX=[\"].*[\"]#GRUB_CMDLINE_LINUX=\"$_head $_tail slxsrv=$slxsrv slxbase=$slxbase\"#" /etc/default/grub } install_boot_loader() diff --git a/builder/hd-boot/module-setup.sh b/builder/hd-boot/module-setup.sh index 136dbe74..04cf3581 100755 --- a/builder/hd-boot/module-setup.sh +++ b/builder/hd-boot/module-setup.sh @@ -33,8 +33,7 @@ install() { #inst_hook pre-udev 40 "$moddir/hooks/gen-netfiles.sh" # Must be 40, because dracut runs as 50 and 60 net-genrules.sh # mount hooks - inst_hook mount 11 "$moddir/move-hd-root_to_sysroot.sh" # Note priority 11, due to dnbd3-rootfs runs 10 mount sysroot. - + inst_hook pre-pivot 10 "$moddir/hooks/move-hd-root_to_sysroot.sh" # Note priority 11, due to dnbd3-rootfs runs 10 mount sysroot. # install buid-in kernel parameters for _i in "$moddir/etc/cmdline.d/"*.conf; do -- cgit v1.2.3-55-g7522