Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/hooks/archiso_pxe_common
diff options
context:
space:
mode:
authorfdupoux <fdupoux@users.sourceforge.net>2020-11-18 21:12:00 +0000
committerfdupoux <fdupoux@users.sourceforge.net>2020-11-18 21:16:27 +0000
commitf671115b7544b4822d860c862a6e9fc4ad2654b6 (patch)
tree73bbeea14ae0db15f7c47fac8d00627446286c34 /hooks/archiso_pxe_common
parent45107657f9a5711983a57fb4b641f8aedfd9d409 (diff)
Reset network interfaces at the end of the PXE boot to allow DHCP to run
Diffstat (limited to 'hooks/archiso_pxe_common')
-rw-r--r--hooks/archiso_pxe_common9
1 files changed, 5 insertions, 4 deletions
diff --git a/hooks/archiso_pxe_common b/hooks/archiso_pxe_common
index f02ef12..2e567ec 100644
--- a/hooks/archiso_pxe_common
+++ b/hooks/archiso_pxe_common
@@ -67,10 +67,11 @@ run_latehook () {
# shellcheck disable=SC2154
# defined via initcpio's parse_cmdline()
if [ "${copytoram}" = "y" ]; then
- if [ -n "${bootif_dev}" ]; then
- ip addr flush dev "${bootif_dev}"
- ip link set "${bootif_dev}" down
- fi
+ for curif in /sys/class/net/*; do
+ netdev=${curif#/sys/class/net/}
+ ip addr flush dev "${netdev}"
+ ip link set "${netdev}" down
+ done
elif [ "${copy_resolvconf}" != "n" ] && [ -f /etc/resolv.conf ]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
fi