summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-05-22 17:33:54 -0500
committerJohn Klug <john.klug@multitech.com>2019-07-03 17:08:20 -0500
commit07bf681d32bf41c04596319234337dc87cf715ea (patch)
treec31791a5e4e199310425f1d2f3d712a98366e883
parent0a7ea24d01509ff495d9d136f95078b94400b6c0 (diff)
downloadmeta-mlinux-07bf681d32bf41c04596319234337dc87cf715ea.tar.gz
meta-mlinux-07bf681d32bf41c04596319234337dc87cf715ea.tar.bz2
meta-mlinux-07bf681d32bf41c04596319234337dc87cf715ea.zip
Allow ifplugd-disable to install on MTR
-rw-r--r--recipes-core/busybox/ifplugd-disable_1.0.bb30
1 files changed, 27 insertions, 3 deletions
diff --git a/recipes-core/busybox/ifplugd-disable_1.0.bb b/recipes-core/busybox/ifplugd-disable_1.0.bb
index 3d75d2d..927ce54 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}() {
-sed -i 's/^ENABLED="no"/ENABLED="yes"/i' $D${sysconfdir}/default/ifplugd
+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/etc/default/ifplugd
+if [ $ro -eq 1 ] ; then
+ mount -o remount,ro /
+fi
}
+
pkg_postinst_${PN}() {
-sed -i 's/^ENABLED="yes"/ENABLED="no"/i' $D${sysconfdir}/default/ifplugd
+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/etc/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
fi
+if [ $ro -eq 1 ] ; then
+ mount -o remount,ro /
+fi
}