From 1411cacbce807f2712c4d70b9f1026f585a40fbf Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 23 Jul 2015 15:40:59 +0200 Subject: [PATCH] busybox-udhcpc: add option to skip default route. The IDU requires that udhcpc does neither touch resolv.conf nor install a default route. Add a flag to switch off default route installation, the resolv.conf part is already switch-off-able. --- recipes-core/busybox/busybox_sysmocom.inc | 2 +- recipes-core/busybox/files/simple.script | 3 ++- recipes-core/busybox/files/udhcpc.default | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes-core/busybox/busybox_sysmocom.inc b/recipes-core/busybox/busybox_sysmocom.inc index 9be36e2..621ca48 100644 --- a/recipes-core/busybox/busybox_sysmocom.inc +++ b/recipes-core/busybox/busybox_sysmocom.inc @@ -1,6 +1,6 @@ SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" FILESEXTRAPATHS_prepend := "${SYSMOCOM}/busybox-${SYSMOCOM_ORIG_PV}:${SYSMOCOM}/files:" -PRINC = "28" +PRINC = "29" SRC_URI += "file://udhcpc-ntp.sh \ file://udhcpc-ntp.default \ diff --git a/recipes-core/busybox/files/simple.script b/recipes-core/busybox/files/simple.script index 399951c..af0f01e 100644 --- a/recipes-core/busybox/files/simple.script +++ b/recipes-core/busybox/files/simple.script @@ -1,6 +1,7 @@ #!/bin/sh # udhcpc script edited by Tim Riker +# Added INSTALL_DEFAULT_ROUTE flag, by [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 @@ -46,7 +47,7 @@ case "$1" in /sbin/ifconfig $interface $ip $BROADCAST $NETMASK fi - if [ -n "$router" ] ; then + if [ -n "$router" -a "$INSTALL_DEFAULT_ROUTE" != "no" ] ; then if ! root_is_nfs ; then if [ $have_bin_ip -eq 1 ]; then while ip route del default dev $interface 2>/dev/null ; do diff --git a/recipes-core/busybox/files/udhcpc.default b/recipes-core/busybox/files/udhcpc.default index 4b04b5d..84bbbae 100644 --- a/recipes-core/busybox/files/udhcpc.default +++ b/recipes-core/busybox/files/udhcpc.default @@ -1,2 +1,5 @@ # Uncomment the following line, if udhcpc should not touch /etc/resolv.conf -# STATIC_DNS="yes" +#STATIC_DNS="yes" + +# Uncomment the following line if udhcpc should not install a default route +#INSTALL_DEFAULT_ROUTE="no"