89bda0d739a810abc8dac3db12ca7de2ce09d4d8
[live-boot-grml.git] / debian / patches / disabled / 09_fix_resolvconf_pxeboot.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 09_fix_resolvconf_pxeboot.dpatch by Michael Prokop <mika@grml.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: fix resolvconf handling when booting via PXE
6 ##
7 ## When installing grml for PXE boot the system has network after
8 ## boot but no usable DNS. /etc/resolv.conf is empty except the
9 ## warning to not edit this file manually but to use the resolvconf
10 ## tool.
11 ##
12 ## The problem is, that the 23networking scripte in the initrd
13 ## correctly creates the resolv.conf, but it's being overwritten by
14 ## the resolvconf utility on boot.
15 ##
16 ## The fix for now is to remove the symlink so resolvconf breaks
17 ## early and DNS is working then.
18
19 @DPATCH@
20 diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking
21 index 72aaf12..244eeca 100755
22 --- a/grml/23networking
23 +++ b/grml/23networking
24 @@ -110,6 +110,11 @@ EOF
25         then
26                 if [ -f /netboot.config ]
27                 then
28 +                       if [ -h /root/etc/resolv.conf ]
29 +                       then
30 +                               rm /root/etc/resolv.conf
31 +                       fi
32 +
33                         # create a resolv.conf if it is not present or empty
34                         cp /netboot.config /root/var/log/netboot.config
35