Skip to content

Commit

Permalink
network interface state to UP on system boot for kdump
Browse files Browse the repository at this point in the history
  • Loading branch information
bilal-ismail committed Apr 24, 2024
1 parent 5c615a9 commit b5b2358
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/setfacl
sudo cp files/initramfs-tools/arista-net $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/arista-net
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/arista-net

# Hook into initramfs: Initialize network interfaces on boot, useful for kdump kernel image
sudo cp files/initramfs-tools/network-interface-preboot-init $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/network-interface-preboot-init
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/network-interface-preboot-init

# Hook into initramfs: resize root partition after migration from another NOS to SONiC on Dell switches
sudo cp files/initramfs-tools/resize-rootfs $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/resize-rootfs
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/resize-rootfs
Expand Down
13 changes: 13 additions & 0 deletions files/initramfs-tools/network-interface-preboot-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Iterate over all detected network interfaces and configure them to use DHCP
interfaces=$(ip -o link show | awk -F': ' '{print $2}' | grep -E '^e')

# Bring up each Ethernet interface
for interface in $interfaces; do
ip link set dev $interface up
dhclient $interface
done

echo("Maigc for kdump: All interfaces have been intialized and DHCP is enabled. Can be verified by command, \"ip addr\"")
ip addr

0 comments on commit b5b2358

Please sign in to comment.