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:
parent
bf472b1799
commit
e374c6bc04
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Uncomment the following line, if udhcpc should not touch /etc/resolv.conf
|
||||
# STATIC_DNS="yes"
|
Loading…
Reference in New Issue