busybox-udhcpc: add default file to control the modification of /etc/resolv.conf

- using commit aee3a65e2a,
  which fixes the route metrics from holger for all machines

Fixes: SYS#1126
This commit is contained in:
Henning Heinold 2015-05-12 20:41:27 +02:00 committed by Holger Hans Peter Freyther
parent bf472b1799
commit e374c6bc04
3 changed files with 27 additions and 14 deletions

View File

@ -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
}

View File

@ -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,7 +69,7 @@ case "$1" in
metric=$(($metric + 1))
done
fi
if [ "$STATIC_DNS" != "yes" ]; then
# Update resolver configuration file
R=""
[ -n "$domain" ] && R="domain $domain
@ -80,6 +85,7 @@ case "$1" in
else
echo -n "$R" > "$RESOLV_CONF"
fi
fi
;;
esac

View File

@ -0,0 +1,2 @@
# Uncomment the following line, if udhcpc should not touch /etc/resolv.conf
# STATIC_DNS="yes"