From 8f08a3b489206a2137600941eb45198cf15cecc9 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 28 Nov 2018 16:23:11 +0100 Subject: sota.conf: use usrmerge OSTree needs UsrMove to be implemented, meaning that everything should be in /usr. OpenEmbedded has a distro feature usrmerge which implements exactly that, and makes sure that no package install anything in /bin, /sbin or /lib. Make use of it. Signed-off-by: Stefan Agner --- conf/distro/sota.conf.inc | 2 +- lib/oeqa/selftest/cases/updater.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc index ea1ca95..8de9597 100644 --- a/conf/distro/sota.conf.inc +++ b/conf/distro/sota.conf.inc @@ -4,7 +4,7 @@ # # require conf/distro/sota.conf.inc -DISTRO_FEATURES_append = " sota" +DISTRO_FEATURES_append = " sota usrmerge" DISTRO_FEATURES_NATIVE_append = " sota" INHERIT += " sota" # Prelinking increases the size of downloads and causes build errors diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 7e55d07..92bf6fc 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py @@ -36,6 +36,10 @@ class GeneralTests(OESelftestTestCase): result = get_bb_var('DISTRO_FEATURES').find('sota') self.assertNotEqual(result, -1, 'Feature "sota" not set at DISTRO_FEATURES') + def test_feature_usrmerge(self): + result = get_bb_var('DISTRO_FEATURES').find('usrmerge') + self.assertNotEqual(result, -1, 'Feature "sota" not set at DISTRO_FEATURES') + def test_feature_systemd(self): result = get_bb_var('DISTRO_FEATURES').find('systemd') self.assertNotEqual(result, -1, 'Feature "systemd" not set at DISTRO_FEATURES') -- cgit v1.2.3-54-g00ecf From 9d6cf7300d6d7cc6f9447f5882bc3186b6c7e255 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 16 Nov 2018 09:27:44 +0100 Subject: image_types_ostree: make usrmerge mandatory Make usrmerge a mandatory DISTRO feature when using the ostree class. This will allow to remove the "manual" usrmerge implementation. Signed-off-by: Stefan Agner --- classes/image_types_ostree.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ff807a4..878587c 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -1,4 +1,5 @@ # OSTree deployment +inherit distro_features_check OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" @@ -14,6 +15,7 @@ IMAGE_CMD_TAR = "tar --xattrs --xattrs-include=*" CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}; ${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.tar -C ${OTA_IMAGE_ROOTFS} . || [ $? -eq 1 ]" CONVERSIONTYPES_append = " tar" +REQUIRED_DISTRO_FEATURES = "usrmerge" OTA_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" do_image_ostree[dirs] = "${OSTREE_ROOTFS}" do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" -- cgit v1.2.3-54-g00ecf From 2b5d6110db3960a5f37b8ab0836226d7753c74e0 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 16 Nov 2018 14:56:47 +0100 Subject: image_types_ostree: drop manual usrmove implementation OpenEmbedded's usrmerge implementation checks that nothing is installing in /bin, /sbin or /lib. Hence those directories are empty by default. There is no need for the manual usrmove anymore. Signed-off-by: Stefan Agner --- classes/image_types_ostree.bbclass | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 878587c..4095de0 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -41,16 +41,6 @@ IMAGE_CMD_ostree () { mkdir -p usr/rootdirs mv etc usr/ - # Implement UsrMove - dirs="bin sbin lib" - - for dir in ${dirs} ; do - if [ -d ${dir} ] && [ ! -L ${dir} ] ; then - mv ${dir} usr/rootdirs/ - rm -rf ${dir} - ln -sf usr/rootdirs/${dir} ${dir} - fi - done if [ -n "${SYSTEMD_USED}" ]; then mkdir -p usr/etc/tmpfiles.d -- cgit v1.2.3-54-g00ecf