From e374c6bc04c7c931346f52651bae5b3ef2235a3e Mon Sep 17 00:00:00 2001 From: Henning Heinold Date: Tue, 12 May 2015 20:41:27 +0200 Subject: [PATCH] busybox-udhcpc: add default file to control the modification of /etc/resolv.conf - using commit aee3a65e2aa748e6cc78a08d9bbb14003fb86f93, which fixes the route metrics from holger for all machines Fixes: SYS#1126 --- recipes-core/busybox/busybox_sysmocom.inc | 7 +++- .../files/{sysmocom-idu => }/simple.script | 32 +++++++++++-------- recipes-core/busybox/files/udhcpc.default | 2 ++ 3 files changed, 27 insertions(+), 14 deletions(-) rename recipes-core/busybox/files/{sysmocom-idu => }/simple.script (83%) create mode 100644 recipes-core/busybox/files/udhcpc.default diff --git a/recipes-core/busybox/busybox_sysmocom.inc b/recipes-core/busybox/busybox_sysmocom.inc index e29f906..76a469e 100644 --- a/recipes-core/busybox/busybox_sysmocom.inc +++ b/recipes-core/busybox/busybox_sysmocom.inc @@ -1,21 +1,25 @@ SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" FILESEXTRAPATHS_prepend := "${SYSMOCOM}/busybox-${SYSMOCOM_ORIG_PV}:${SYSMOCOM}/files:" -PRINC = "26" +PRINC = "27" SRC_URI += "file://busybox-ifplugd.sh \ file://ifplugd.sh \ file://udhcpc-ntp.sh \ file://udhcpc-ntp.default \ + file://udhcpc.default \ " PACKAGES =+ "${PN}-ifplugd ${PN}-udhcpc-ntp" +FILES_${PN}-udhcpc += "${sysconfdir}/default/udhcpc" + FILES_${PN}-ifplugd = "${sysconfdir}/ifplugd.sh ${sysconfdir}/init.d/busybox-ifplugd.sh" FILES_${PN}-udhcpc-ntp = "${sysconfdir}/udhcpc.d/60ntp \ ${sysconfdir}/default/udhcpc-ntp \ " +CONFFILES_${PN}-udhcpc += "${sysconfdir}/default/udhcpc" CONFFILES_${PN}-udhcpc-ntp = "${sysconfdir}/default/udhcpc-ntp" INITSCRIPT_PACKAGES += "${PN}-ifplugd" @@ -30,4 +34,5 @@ do_install_append() { install -m 0755 ${WORKDIR}/udhcpc-ntp.sh ${D}/${sysconfdir}/udhcpc.d/60ntp install -d ${D}/${sysconfdir}/default install -m 0644 ${WORKDIR}/udhcpc-ntp.default ${D}/${sysconfdir}/default/udhcpc-ntp + install -m 0644 ${WORKDIR}/udhcpc.default ${D}/${sysconfdir}/default/udhcpc } diff --git a/recipes-core/busybox/files/sysmocom-idu/simple.script b/recipes-core/busybox/files/simple.script similarity index 83% rename from recipes-core/busybox/files/sysmocom-idu/simple.script rename to recipes-core/busybox/files/simple.script index cb9d3d4..d8c375a 100644 --- a/recipes-core/busybox/files/sysmocom-idu/simple.script +++ b/recipes-core/busybox/files/simple.script @@ -4,7 +4,12 @@ [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + + RESOLV_CONF="/etc/resolv.conf" + +[ -r /etc/default/udhcpc ] && . /etc/default/udhcpc + [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" @@ -64,22 +69,23 @@ case "$1" in metric=$(($metric + 1)) done fi - - # Update resolver configuration file - R="" - [ -n "$domain" ] && R="domain $domain + if [ "$STATIC_DNS" != "yes" ]; then + # Update resolver configuration file + R="" + [ -n "$domain" ] && R="domain $domain " - for i in $dns; do - echo "$0: Adding DNS $i" - R="${R}nameserver $i + for i in $dns; do + echo "$0: Adding DNS $i" + R="${R}nameserver $i " - done + done - if [ -x /sbin/resolvconf ]; then - echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc" - else - echo -n "$R" > "$RESOLV_CONF" - fi + if [ -x /sbin/resolvconf ]; then + echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc" + else + echo -n "$R" > "$RESOLV_CONF" + fi + fi ;; esac diff --git a/recipes-core/busybox/files/udhcpc.default b/recipes-core/busybox/files/udhcpc.default new file mode 100644 index 0000000..4b04b5d --- /dev/null +++ b/recipes-core/busybox/files/udhcpc.default @@ -0,0 +1,2 @@ +# Uncomment the following line, if udhcpc should not touch /etc/resolv.conf +# STATIC_DNS="yes"