diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2020-02-19 15:40:44 +0200 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-05-21 10:40:11 +0300 |
commit | 19ca401463153a7694a320f543852412d74cbd8f (patch) | |
tree | e3720d485786f1f2fc78c909fc2ad2f97829ab8d /recipes-core/busybox | |
parent | ed016261befcdc421ae1ac5d28d21066b56f42f2 (diff) | |
parent | 92cbb8fb30c624d3be98d6408d6ff7f03264a2c9 (diff) | |
download | meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.tar.gz meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.tar.bz2 meta-mlinux-19ca401463153a7694a320f543852412d74cbd8f.zip |
mpower-dev-thud: merge meta-mlinux:master (92cbb8fb Feb 11 2020) to meta-mlinux:multiarch5-thud (ed01626 Feb 3 2020)
Diffstat (limited to 'recipes-core/busybox')
-rw-r--r-- | recipes-core/busybox/busybox_%.bbappend | 3 | ||||
-rwxr-xr-x | recipes-core/busybox/files/ifplugd.init | 2 | ||||
-rw-r--r-- | recipes-core/busybox/files/ifplugd.patch | 20 | ||||
-rw-r--r-- | recipes-core/busybox/ifplugd-disable_1.0.bb | 28 |
4 files changed, 49 insertions, 4 deletions
diff --git a/recipes-core/busybox/busybox_%.bbappend b/recipes-core/busybox/busybox_%.bbappend index ca0d56b..142f08c 100644 --- a/recipes-core/busybox/busybox_%.bbappend +++ b/recipes-core/busybox/busybox_%.bbappend @@ -1,4 +1,4 @@ -PR .= ".mlinux3" +PR .= ".mlinux4" PACKAGES =+ "busybox-ifplugd" FILESEXTRAPATHS_prepend := ":${THISDIR}/files:" RDEPENDS_${PN} += "bash" @@ -17,6 +17,7 @@ SRC_URI += "file://udhcpd.conf.example \ file://ifplugd.init \ file://eth0.conf \ file://eth1.conf.example \ + file://ifplugd.patch \ " do_install_append () { diff --git a/recipes-core/busybox/files/ifplugd.init b/recipes-core/busybox/files/ifplugd.init index 87f2408..418b088 100755 --- a/recipes-core/busybox/files/ifplugd.init +++ b/recipes-core/busybox/files/ifplugd.init @@ -9,7 +9,7 @@ startdaemon(){ # Start the application echo -n "Starting ifplugd: " - CONFS=($(find /etc/ifplugd -name '*.conf')) + CONFS=($(find -L /etc/ifplugd -name '*.conf')) ((i=0)) logger -p daemon.info "Found ${#CONFS[@]} Configurations" while ((i < ${#CONFS[@]})) ; do diff --git a/recipes-core/busybox/files/ifplugd.patch b/recipes-core/busybox/files/ifplugd.patch new file mode 100644 index 0000000..839a8a2 --- /dev/null +++ b/recipes-core/busybox/files/ifplugd.patch @@ -0,0 +1,20 @@ +# +# This patch is found here: +# http://lists.busybox.net/pipermail/busybox/2018-March/086328.html +# Basically ifplugd will not stay up if the driver is loading. +# This is particularly apparent with gadget. +diff -arNu a/networking/ifplugd.c b/networking/ifplugd.c +--- a/networking/ifplugd.c 2019-05-28 18:11:43.836982315 -0500 ++++ b/networking/ifplugd.c 2019-05-28 18:13:13.088979672 -0500 +@@ -358,8 +358,10 @@ + ifrequest.ifr_flags |= IFF_UP; + /* Let user know we mess up with interface */ + bb_error_msg("upping interface"); +- if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) ++ if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) { ++ if (errno != ENODEV && errno != EADDRNOTAVAIL) + xfunc_die(); ++ } + } + + #if 0 /* why do we mess with IP addr? It's not our business */ diff --git a/recipes-core/busybox/ifplugd-disable_1.0.bb b/recipes-core/busybox/ifplugd-disable_1.0.bb index 3d75d2d..3037e23 100644 --- a/recipes-core/busybox/ifplugd-disable_1.0.bb +++ b/recipes-core/busybox/ifplugd-disable_1.0.bb @@ -5,17 +5,41 @@ PACKAGE_ARCH = "all" RDEPENDS_ifplugd-disable = "busybox-ifplugd" ALLOW_EMPTY_ifplugd-disable = "1" -PR = "r1" +PR = "r2" +# Mount root rw to disable/enable ifplugd. +# Mount root ro when we are done. +# This makes the Yocto Police happy. pkg_prerm_${PN}() { +ro=0 +if [ -z "$D" ] ; then + if egrep -q '[[:space:]]/[[:space:]].*[[:space:]]ro,' /proc/mounts ; then + ro=1 + mount -o remount,rw / + fi +fi sed -i 's/^ENABLED="no"/ENABLED="yes"/i' $D${sysconfdir}/default/ifplugd +if [ $ro -eq 1 ] ; then + mount -o remount,ro / +fi } + pkg_postinst_${PN}() { +ro=0 +if [ -z "$D" ] ; then + if egrep -q '[[:space:]]/[[:space:]].*[[:space:]]ro,' /proc/mounts ; then + ro=1 + mount -o remount,rw / + fi +fi sed -i 's/^ENABLED="yes"/ENABLED="no"/i' $D${sysconfdir}/default/ifplugd if [ -f $D/var/config/default/ifplugd ]; then sed -i 's/^ENABLED="yes"/ENABLED="no"/i' $D/var/config/default/ifplugd else - cp $D/etc/default/ifplugd $D/var/config/default/ifplugd + cp $D${sysconfdir}/default/ifplugd $D/var/config/default/ifplugd +fi +if [ $ro -eq 1 ] ; then + mount -o remount,ro / fi } |