From f1c4c48b1759e835720ef4472b05a9eecc9b0e17 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 29 May 2013 17:19:27 +0200 Subject: Write network config from stage31 and stage32's udhcpd to /opt/openslx/config --- remote/rootfs/rootfs-stage31/data/init | 21 +++++++++++++-------- .../data/etc/openslx/udhcpc.openslx.script | 4 ++++ .../data/opt/openslx/bin/activate-sysconfig | 4 +++- 3 files changed, 20 insertions(+), 9 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index e5251025..32903439 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -55,18 +55,13 @@ for opts in ${KCL}; do ip=*) # process IP info export IPINFO=${opts#ip=} ;; - nfs=*) - export NFS=${opts#nfs=} - export NFSPATH=${nfs#*:} - export NFSSERVER=${nfs%:/*} - ;; BOOTIF=*) export MAC="$( echo "$opts" | cut -b 11- | tr '-' ':' )" ;; esac done # suppress kernel output if DEBUG is not set -[ $DEBUG -ge 1 ] && echo "0" >/proc/sys/kernel/printk +[ "$DEBUG" -ge 1 ] && echo "0" >/proc/sys/kernel/printk || echo "4 4 1 7" >/proc/sys/kernel/printk # start plymouth if activated if [ "x$SPLASH" == "x1" -a "x$DEBUG" != "x1" ]; then @@ -78,8 +73,8 @@ fi mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs mount -n -t tmpfs none /dev/shm/uniontmp -echo "Setup networking..." -/bin/setup_network +echo "Setup networking..." # Source script so the variables are still available to us +. "/bin/setup_network" || echo "Error setting up network" # mount rootfs if [ -n "$NFS" ]; then @@ -104,6 +99,16 @@ mount -n --move /dev/shm/uniontmp /mnt/uniontmp # create udev rule for nic we booted from echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'$MAC'", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"' > "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules" +# create ip config +cat >> /mnt/opt/openslx/config <> /opt/openslx/config + echo "SLX_DNS='$dns'" >> /opt/openslx/config + echo "SLX_HOSTNAME='$(hostname)'" >> /opt/openslx/config ;; diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig index e50111ae..fe02d7eb 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/activate-sysconfig @@ -9,11 +9,13 @@ if [ -z "$URL" ]; then exit 1 fi -wget -q -O "/opt/openslx/config" "$URL" +wget -q -O "/opt/openslx/config-remote" "$URL" RET=$? if [ "x$RET" != "x0" ]; then echo "Error - downloading '$URL' via wget failed. Exit Code: $RET" exit 1 fi +echo "# Config fetched from $URL" >> "/opt/openslx/config" +cat "/opt/openslx/config-remote" >> "/opt/openslx/config" exit 0 -- cgit v1.2.3-55-g7522