From a5aefbd3bf9e6cee58ee467e164375b7abe44e63 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Fri, 19 May 2023 06:07:28 +0900 Subject: A fstab replacement method change to build container guest In https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/28690 review, I got a request for method change request. Existing method use bbappend for base files. New method use ROOTFS_POSTPROCESS_COMMAND. Bug-AGL: SPEC-4803 Change-Id: I8d92473f50cd5c596b43c94049972bb9ad57c438 Signed-off-by: Naoto Yamaguchi --- .../base-files-guest/base-files-guest-fstab/fstab | 3 +++ .../base-files-guest-fstab_1.0.0.bb | 25 ++++++++++++++++++++++ recipes-core/base-files/agl-container-guest/fstab | 3 --- recipes-core/base-files/base-files_%.bbappend | 1 - .../base-files_agl-container-guest-demo.inc | 2 -- .../agl-demo-container-guest-integration.inc | 18 ++++++++++++++++ .../images/agl-ivi-demo-platform-flutter.bb | 1 + .../images/agl-ivi-demo-platform-html5.bb | 2 ++ recipes-platform/images/agl-ivi-demo-platform.bb | 1 + 9 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 recipes-core/base-files-guest/base-files-guest-fstab/fstab create mode 100644 recipes-core/base-files-guest/base-files-guest-fstab_1.0.0.bb delete mode 100644 recipes-core/base-files/agl-container-guest/fstab delete mode 100644 recipes-core/base-files/base-files_%.bbappend delete mode 100644 recipes-core/base-files/base-files_agl-container-guest-demo.inc create mode 100644 recipes-platform/images/agl-demo-container-guest-integration.inc diff --git a/recipes-core/base-files-guest/base-files-guest-fstab/fstab b/recipes-core/base-files-guest/base-files-guest-fstab/fstab new file mode 100644 index 000000000..d6c936be9 --- /dev/null +++ b/recipes-core/base-files-guest/base-files-guest-fstab/fstab @@ -0,0 +1,3 @@ +# Reference fstab for container guest +devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 diff --git a/recipes-core/base-files-guest/base-files-guest-fstab_1.0.0.bb b/recipes-core/base-files-guest/base-files-guest-fstab_1.0.0.bb new file mode 100644 index 000000000..ad3e6e940 --- /dev/null +++ b/recipes-core/base-files-guest/base-files-guest-fstab_1.0.0.bb @@ -0,0 +1,25 @@ +SUMMARY = "Container guest extention for fstab" +DESCRIPTION = "The base-files-guest-fstab package creates the fstab for container guest integration." +SECTION = "base" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = " \ + file://fstab \ +" +S = "${WORKDIR}" + +#INHIBIT_DEFAULT_DEPS = "1" + +do_install () { + install -m 0755 -d ${D}${sysconfdir} + + install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab-guest +} + +PACKAGES = "${PN}" +FILES:${PN} = "${sysconfdir}/fstab-guest" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +CONFFILES:${PN} = "${sysconfdir}/fstab-guest" diff --git a/recipes-core/base-files/agl-container-guest/fstab b/recipes-core/base-files/agl-container-guest/fstab deleted file mode 100644 index 13389d462..000000000 --- a/recipes-core/base-files/agl-container-guest/fstab +++ /dev/null @@ -1,3 +0,0 @@ -# Reference fstab for container guest -devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 -tmpfs /var/volatile tmpfs defaults 0 0 diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend deleted file mode 100644 index aeddb7cce..000000000 --- a/recipes-core/base-files/base-files_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -require ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', 'base-files_agl-container-guest-demo.inc', '', d)} diff --git a/recipes-core/base-files/base-files_agl-container-guest-demo.inc b/recipes-core/base-files/base-files_agl-container-guest-demo.inc deleted file mode 100644 index dfce6ce6b..000000000 --- a/recipes-core/base-files/base-files_agl-container-guest-demo.inc +++ /dev/null @@ -1,2 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/agl-container-guest:" - diff --git a/recipes-platform/images/agl-demo-container-guest-integration.inc b/recipes-platform/images/agl-demo-container-guest-integration.inc new file mode 100644 index 000000000..f835761fd --- /dev/null +++ b/recipes-platform/images/agl-demo-container-guest-integration.inc @@ -0,0 +1,18 @@ +IMAGE_CONTAINER_GUEST_APPEND = " base-files-guest-fstab" +IMAGE_INSTALL:append = " \ + ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', '${IMAGE_CONTAINER_GUEST_APPEND}', '', d)} \ +" + +fixupfstab_for_container_guest_images() { + rm -f ${IMAGE_ROOTFS}/${sysconfdir}/fstab + ln -s fstab-guest ${IMAGE_ROOTFS}/${sysconfdir}/fstab +} + +rmboot_for_container_guest_images() { + rm -rf ${IMAGE_ROOTFS}/boot +} + +ROOTFS_POSTPROCESS_COMMAND += " \ + ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', 'fixupfstab_for_container_guest_images;', '', d)} \ + ${@bb.utils.contains('AGL_FEATURES', 'agl-container-guest-demo', 'rmboot_for_container_guest_images;', '', d)} \ +" diff --git a/recipes-platform/images/agl-ivi-demo-platform-flutter.bb b/recipes-platform/images/agl-ivi-demo-platform-flutter.bb index 336ad3bb6..f385c1e08 100644 --- a/recipes-platform/images/agl-ivi-demo-platform-flutter.bb +++ b/recipes-platform/images/agl-ivi-demo-platform-flutter.bb @@ -3,6 +3,7 @@ require agl-image-ivi.bb DESCRIPTION = "AGL Flutter based Demo Platform image" require agl-demo-features.inc +require agl-demo-container-guest-integration.inc # add packages for demo platform (include demo apps) here IMAGE_INSTALL:append = " \ diff --git a/recipes-platform/images/agl-ivi-demo-platform-html5.bb b/recipes-platform/images/agl-ivi-demo-platform-html5.bb index 805e239a5..dc82ce4e5 100644 --- a/recipes-platform/images/agl-ivi-demo-platform-html5.bb +++ b/recipes-platform/images/agl-ivi-demo-platform-html5.bb @@ -3,6 +3,8 @@ require agl-image-ivi.bb SUMMARY = "DEMO platform of AGL HTML5 profile" DESCRIPTION = "Contains the web runtime and sample web apps" +require agl-demo-container-guest-integration.inc + # add packages for demo platform (include demo apps) here IMAGE_INSTALL:append = " \ packagegroup-agl-demo-platform-html5 \ diff --git a/recipes-platform/images/agl-ivi-demo-platform.bb b/recipes-platform/images/agl-ivi-demo-platform.bb index e82a474e7..f5fcad912 100644 --- a/recipes-platform/images/agl-ivi-demo-platform.bb +++ b/recipes-platform/images/agl-ivi-demo-platform.bb @@ -4,6 +4,7 @@ DESCRIPTION = "AGL Demo Platform image currently contains a simple HMI and \ demos." require agl-demo-features.inc +require agl-demo-container-guest-integration.inc # add packages for demo platform (include demo apps) here IMAGE_INSTALL:append = " \ -- cgit 1.2.3-korg