0da7f733199f794d9e8ec195cd6542f1672f43c9
[live-boot-grml.git] / debian / patches / 26_support_dns_bootoption.patch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 26_support_dns_bootoption.dpatch by Michael Prokop <mika@grml.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Support dns bootoption. Usage examples: dns=8.8.8.8 / dns=8.8.8.8,1.2.3.4
6
7 @DPATCH@
8 Index: live-boot-grml/components/9990-networking.sh
9 ===================================================================
10 --- live-boot-grml.orig/components/9990-networking.sh   2014-03-08 13:33:11.615385566 +0100
11 +++ live-boot-grml/components/9990-networking.sh        2014-03-08 13:33:11.611386038 +0100
12 @@ -151,7 +151,7 @@
13                                 echo "search ${DNSDOMAIN}" >> /etc/resolv.conf
14                         fi
15  
16 -                       for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1}
17 +                       for i in ${IPV4DNS0} ${IPV4DNS1} ${IPV4DNS1} ${DNSSERVER1} ${DNSSERVER2}
18                         do
19                                 if [ -n "$i" ] && [ "$i" != 0.0.0.0 ]
20                                 then
21 Index: live-boot-grml/components/9990-cmdline-old
22 ===================================================================
23 --- live-boot-grml.orig/components/9990-cmdline-old     2014-03-08 13:33:11.615385566 +0100
24 +++ live-boot-grml/components/9990-cmdline-old  2014-03-08 13:33:11.611386038 +0100
25 @@ -18,6 +18,19 @@
26                                 BOOTIF="${_PARAMETER#BOOTIF=}"
27                                 ;;
28  
29 +                       dns=*)
30 +                               DNSSERVER="${_PARAMETER#*=}"
31 +                               if echo "${DNSSERVER}" | grep -q , ; then
32 +                                       DNSSERVER1="${DNSSERVER%,*}"
33 +                                       DNSSERVER2="${DNSSERVER#*,}"
34 +                                       export DNSSERVER1 DNSSERVER2
35 +                               else
36 +                                       DNSSERVER1="$DNSSERVER"
37 +                                       export DNSSERVER1
38 +                               fi
39 +                               unset DNSSERVER
40 +                               ;;
41 +
42                         bootid=*)
43                                 BOOTID="${_PARAMETER#bootid=}"
44                                 export BOOTID