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))}" SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/busybox-${SYSMOCOM_ORIG_PV}:${SYSMOCOM}/files:" FILESEXTRAPATHS_prepend := "${SYSMOCOM}/busybox-${SYSMOCOM_ORIG_PV}:${SYSMOCOM}/files:"
PRINC = "26" PRINC = "27"
SRC_URI += "file://busybox-ifplugd.sh \ SRC_URI += "file://busybox-ifplugd.sh \
file://ifplugd.sh \ file://ifplugd.sh \
file://udhcpc-ntp.sh \ file://udhcpc-ntp.sh \
file://udhcpc-ntp.default \ file://udhcpc-ntp.default \
file://udhcpc.default \
" "
PACKAGES =+ "${PN}-ifplugd ${PN}-udhcpc-ntp" 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}-ifplugd = "${sysconfdir}/ifplugd.sh ${sysconfdir}/init.d/busybox-ifplugd.sh"
FILES_${PN}-udhcpc-ntp = "${sysconfdir}/udhcpc.d/60ntp \ FILES_${PN}-udhcpc-ntp = "${sysconfdir}/udhcpc.d/60ntp \
${sysconfdir}/default/udhcpc-ntp \ ${sysconfdir}/default/udhcpc-ntp \
" "
CONFFILES_${PN}-udhcpc += "${sysconfdir}/default/udhcpc"
CONFFILES_${PN}-udhcpc-ntp = "${sysconfdir}/default/udhcpc-ntp" CONFFILES_${PN}-udhcpc-ntp = "${sysconfdir}/default/udhcpc-ntp"
INITSCRIPT_PACKAGES += "${PN}-ifplugd" INITSCRIPT_PACKAGES += "${PN}-ifplugd"
@ -30,4 +34,5 @@ do_install_append() {
install -m 0755 ${WORKDIR}/udhcpc-ntp.sh ${D}/${sysconfdir}/udhcpc.d/60ntp install -m 0755 ${WORKDIR}/udhcpc-ntp.sh ${D}/${sysconfdir}/udhcpc.d/60ntp
install -d ${D}/${sysconfdir}/default install -d ${D}/${sysconfdir}/default
install -m 0644 ${WORKDIR}/udhcpc-ntp.default ${D}/${sysconfdir}/default/udhcpc-ntp 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 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf" RESOLV_CONF="/etc/resolv.conf"
[ -r /etc/default/udhcpc ] && . /etc/default/udhcpc
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$subnet" ] && NETMASK="netmask $subnet"
@ -64,22 +69,23 @@ case "$1" in
metric=$(($metric + 1)) metric=$(($metric + 1))
done done
fi fi
if [ "$STATIC_DNS" != "yes" ]; then
# Update resolver configuration file # Update resolver configuration file
R="" R=""
[ -n "$domain" ] && R="domain $domain [ -n "$domain" ] && R="domain $domain
" "
for i in $dns; do for i in $dns; do
echo "$0: Adding DNS $i" echo "$0: Adding DNS $i"
R="${R}nameserver $i R="${R}nameserver $i
" "
done done
if [ -x /sbin/resolvconf ]; then if [ -x /sbin/resolvconf ]; then
echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc" echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc"
else else
echo -n "$R" > "$RESOLV_CONF" echo -n "$R" > "$RESOLV_CONF"
fi fi
fi
;; ;;
esac esac

View File

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