readd grml patches
[live-boot-grml.git] / debian / patches / disabled / 09_fix_resolvconf_pxeboot.dpatch
diff --git a/debian/patches/disabled/09_fix_resolvconf_pxeboot.dpatch b/debian/patches/disabled/09_fix_resolvconf_pxeboot.dpatch
new file mode 100755 (executable)
index 0000000..89bda0d
--- /dev/null
@@ -0,0 +1,35 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_fix_resolvconf_pxeboot.dpatch by Michael Prokop <mika@grml.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix resolvconf handling when booting via PXE
+##
+## When installing grml for PXE boot the system has network after
+## boot but no usable DNS. /etc/resolv.conf is empty except the
+## warning to not edit this file manually but to use the resolvconf
+## tool.
+##
+## The problem is, that the 23networking scripte in the initrd
+## correctly creates the resolv.conf, but it's being overwritten by
+## the resolvconf utility on boot.
+##
+## The fix for now is to remove the symlink so resolvconf breaks
+## early and DNS is working then.
+
+@DPATCH@
+diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking
+index 72aaf12..244eeca 100755
+--- a/grml/23networking
++++ b/grml/23networking
+@@ -110,6 +110,11 @@ EOF
+       then
+               if [ -f /netboot.config ]
+               then
++                      if [ -h /root/etc/resolv.conf ]
++                      then
++                              rm /root/etc/resolv.conf
++                      fi
++
+                       # create a resolv.conf if it is not present or empty
+                       cp /netboot.config /root/var/log/netboot.config