removing dhcp- turn- off option from initrd (#2555)
* removing dhcp changes from initrd * removing mgmt-intf-dhcp file
This commit is contained in:
parent
fd3f61167d
commit
b56124bf48
@ -153,8 +153,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 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
|
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)
|
# 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 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 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 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
|
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
|
pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user