From 5dcd53331cd4b8ef5a8763d0704718e20e194704 Mon Sep 17 00:00:00 2001 From: paavaanan Date: Tue, 12 Feb 2019 01:37:27 -0500 Subject: [PATCH 1/2] removing dhcp changes from initrd --- build_debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 98881b50946d..15d4623c1c4c 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -151,8 +151,8 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mou sudo cp files/initramfs-tools/varlog $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog # Management interface (eth0) dhcp can be optionally turned off (during a migration from another NOS to SONiC) -sudo cp files/initramfs-tools/mgmt-intf-dhcp $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp -sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp +#sudo cp files/initramfs-tools/mgmt-intf-dhcp $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp +#sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd From de549e1d231e7730c34e4d9da42415f3382c7bb3 Mon Sep 17 00:00:00 2001 From: paavaanan Date: Tue, 19 Feb 2019 07:58:35 -0500 Subject: [PATCH 2/2] removing mgmt-intf-dhcp file --- files/initramfs-tools/mgmt-intf-dhcp | 36 ---------------------------- 1 file changed, 36 deletions(-) delete mode 100644 files/initramfs-tools/mgmt-intf-dhcp diff --git a/files/initramfs-tools/mgmt-intf-dhcp b/files/initramfs-tools/mgmt-intf-dhcp deleted file mode 100644 index 52f7ff5f495c..000000000000 --- a/files/initramfs-tools/mgmt-intf-dhcp +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -PREREQS="union-mount" - -prereqs() { echo "$PREREQS"; } - -case $1 in - prereqs) - prereqs - exit 0 - ;; -esac - -# Extract kernel parameters -set -- $(cat /proc/cmdline) -for x in "$@"; do - case "$x" in - mgmt-intf-dhcp=*) - val="${x#mgmt-intf-dhcp=}" - - if [ -z "$val" ]; then - echo "ERROR: mgmt-intf-dhcp value (on/off) not specified !" - exit 0 - fi - - if [ -e "${rootmnt}/etc/network/interfaces" ]; then - if [ "$val" = "off" ]; then - sed -i 's/iface eth0 inet dhcp/iface eth0 inet static/g' ${rootmnt}/etc/network/interfaces - elif [ "$val" = "on" ]; then - sed -i 's/iface eth0 inet static/iface eth0 inet dhcp/g' ${rootmnt}/etc/network/interfaces - fi - fi - - ;; - esac -done