From 793e0ef53eee97a280be8253908405b6de793a78 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Tue, 1 Oct 2024 10:42:09 -0700 Subject: [PATCH] images: clean-up up the split between the default factory-image and arduino-includes Signed-off-by: Michael Scott --- .../images/lmp-devel-arduino-image.bb | 55 +++--------- recipes-samples/images/lmp-factory-image.bb | 57 +++++++++++- .../images/lmp-partner-image-arduino.inc | 55 ++++++++++++ recipes-samples/images/lmp-partner-image.inc | 86 +------------------ 4 files changed, 123 insertions(+), 130 deletions(-) create mode 100644 recipes-samples/images/lmp-partner-image-arduino.inc mode change 100644 => 120000 recipes-samples/images/lmp-partner-image.inc diff --git a/recipes-samples/images/lmp-devel-arduino-image.bb b/recipes-samples/images/lmp-devel-arduino-image.bb index 460739f..4087f1b 100644 --- a/recipes-samples/images/lmp-devel-arduino-image.bb +++ b/recipes-samples/images/lmp-devel-arduino-image.bb @@ -11,13 +11,12 @@ require recipes-samples/images/lmp-feature-wifi.inc require recipes-samples/images/lmp-feature-sbin-path-helper.inc require recipes-samples/images/lmp-feature-sysctl-hang-crash-helper.inc -EXTRA_IMAGE_FEATURES = "package-management tools-debug" +# Add any partner layer requirements +include recipes-samples/images/lmp-partner-image.inc -SRC_URI += "\ - file://sudoers-arduino-lmp-base \ -" +EXTRA_IMAGE_FEATURES = "package-management tools-debug" -IMAGE_FEATURES += "ssh-server-dropbear" +SUDOERS_FILE = "sudoers-arduino-lmp-base" CORE_IMAGE_BASE_INSTALL_GPLV3 = "\ packagegroup-core-full-cmdline-utils \ @@ -33,30 +32,10 @@ CORE_IMAGE_BASE_INSTALL += " \ ${@bb.utils.contains('LMP_DISABLE_GPLV3', '1', '', '${CORE_IMAGE_BASE_INSTALL_GPLV3}', d)} \ " -# Arduino additions - -LMP_EXTRA = " \ - lmp-device-tree \ - lmp-auto-hostname \ - u-boot-fio-env \ - tmate \ - libgpiod-tools \ - dtc \ - stress-ng \ -" +# Arduino development changes -ADB = " \ - android-tools \ - android-tools-adbd \ -" - -ARDUINO = " \ - arduino-ootb \ - automount-boot \ - m4-proxy \ - udev-rules-portenta \ - libusbgx-config \ -" +# early start not needed for lmp-base image +LMP_EXTRA:remove = "compose-apps-early-start" VIDEOTOOLS = " \ gstreamer1.0 \ @@ -74,22 +53,10 @@ OPENCV = " \ " CORE_IMAGE_BASE_INSTALL += " \ - libdrm \ - usb-modeswitch \ + automount-boot \ + dtc \ + stress-ng \ + u-boot-fio-env \ u-boot-fw-utils \ - ${LMP_EXTRA} \ - ${ADB} \ - ${ARDUINO} \ ${OPENCV} \ " - -# Packages to be installed in Portenta-X8 machine only -IMAGE_INSTALL:append:portenta-x8 = " openocd" - -fakeroot do_populate_rootfs_add_custom_sudoers () { - # Allow sudo group users to use sudo - bbwarn Changing sudoers for arduino ootb! - install -m 0440 ${WORKDIR}/sudoers-arduino-lmp-base ${IMAGE_ROOTFS}${sysconfdir}/sudoers.d/51-arduino -} - -IMAGE_PREPROCESS_COMMAND += "do_populate_rootfs_add_custom_sudoers; " diff --git a/recipes-samples/images/lmp-factory-image.bb b/recipes-samples/images/lmp-factory-image.bb index 91d047c..2a8046c 100644 --- a/recipes-samples/images/lmp-factory-image.bb +++ b/recipes-samples/images/lmp-factory-image.bb @@ -1 +1,56 @@ -require recipes-samples/images/lmp-partner-image.inc +SUMMARY = "Minimal factory image which includes OTA Lite, Docker, and OpenSSH support" + +require recipes-samples/images/lmp-image-common.inc + +# Factory tooling requires SOTA (OSTree + Aktualizr-lite) +require ${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'recipes-samples/images/lmp-feature-factory.inc', '', d)} + +# Enable wayland related recipes if required by DISTRO +require ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'recipes-samples/images/lmp-feature-wayland.inc', '', d)} + +# Enable IMA support if required by DISTRO +require ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'recipes-samples/images/lmp-feature-ima.inc', '', d)} + +# Enable OP-TEE related recipes if provided by the image +require ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'recipes-samples/images/lmp-feature-optee.inc', '', d)} + +# Enable SE05X related recipes if provided by machine +require ${@bb.utils.contains('MACHINE_FEATURES', 'se05x', 'recipes-samples/images/lmp-feature-se05x.inc', '', d)} + +# Enable TPM2 related recipes if provided by machine +require ${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'recipes-samples/images/lmp-feature-tpm2.inc', '', d)} + +# Enable EFI support if provided by machine +require ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'recipes-samples/images/lmp-feature-efi.inc', '', d)} + +# Enable Xenomai4 related recipes if provided by the image +require ${@bb.utils.contains('MACHINE_FEATURES', 'xeno4', 'recipes-samples/images/lmp-feature-xeno4.inc', '', d)} + +# Enable jailhouse related recipes if provided by the machine +require ${@bb.utils.contains('MACHINE_FEATURES', 'jailhouse', 'recipes-samples/images/lmp-feature-jailhouse.inc', '', d)} + +require recipes-samples/images/lmp-feature-softhsm.inc +require recipes-samples/images/lmp-feature-wireguard.inc +require recipes-samples/images/lmp-feature-docker.inc +require recipes-samples/images/lmp-feature-wifi.inc +require recipes-samples/images/lmp-feature-ota-utils.inc +require recipes-samples/images/lmp-feature-sbin-path-helper.inc + +# Add any partner layer requirements +include recipes-samples/images/lmp-partner-image.inc + +IMAGE_FEATURES += "ssh-server-openssh" + +CORE_IMAGE_BASE_INSTALL_GPLV3 = "\ + packagegroup-core-full-cmdline-utils \ + packagegroup-core-full-cmdline-multiuser \ +" + +CORE_IMAGE_BASE_INSTALL += " \ + kernel-modules \ + networkmanager-nmcli \ + git \ + vim \ + packagegroup-core-full-cmdline-extended \ + ${@bb.utils.contains('LMP_DISABLE_GPLV3', '1', '', '${CORE_IMAGE_BASE_INSTALL_GPLV3}', d)} \ +" diff --git a/recipes-samples/images/lmp-partner-image-arduino.inc b/recipes-samples/images/lmp-partner-image-arduino.inc new file mode 100644 index 0000000..2f42129 --- /dev/null +++ b/recipes-samples/images/lmp-partner-image-arduino.inc @@ -0,0 +1,55 @@ +# Additions for the arduino partner image + +FILESEXTRAPATHS:prepend := "${THISDIR}/configs:" + +IMAGE_FEATURES:remove "ssh-server-openssh" +IMAGE_FEATURES += "ssh-server-dropbear" + +SUDOERS_FILE ?= "sudoers-arduino-lmp" +SRC_URI += "\ + file://${SUDOERS_FILE} \ +" + +LMP_EXTRA = " \ + lmp-device-tree \ + lmp-auto-hostname \ + compose-apps-early-start \ + tmate \ + libgpiod-tools \ +" + +ADB = " \ + android-tools \ + android-tools-adbd \ +" + +ARDUINO = " \ + arduino-ootb \ + m4-proxy \ + udev-rules-portenta \ + libusbgx-config \ +" + +CORE_IMAGE_BASE_INSTALL += " \ + libdrm \ + usb-modeswitch \ + ${LMP_EXTRA} \ + ${ADB} \ + ${ARDUINO} \ +" + +# No default password is configured for the device +EXTRA_USERS_PARAMS += "\ + usermod -p '' ${LMP_USER}; \ +" + +# Packages to be installed in Portenta-X8 machine only +IMAGE_INSTALL:append:portenta-x8 = " openocd" + +fakeroot do_populate_rootfs_add_custom_sudoers () { + # Allow sudo group users to use sudo + bbwarn Changing sudoers for arduino ootb! + install -m 0440 ${WORKDIR}/${SUDOERS_FILE} ${IMAGE_ROOTFS}${sysconfdir}/sudoers.d/51-arduino +} + +IMAGE_PREPROCESS_COMMAND += "do_populate_rootfs_add_custom_sudoers; " diff --git a/recipes-samples/images/lmp-partner-image.inc b/recipes-samples/images/lmp-partner-image.inc deleted file mode 100644 index cfb9849..0000000 --- a/recipes-samples/images/lmp-partner-image.inc +++ /dev/null @@ -1,85 +0,0 @@ -SUMMARY = "Arduino factory image which includes OTA Lite, Docker, and OpenSSH support" - -FILESEXTRAPATHS:prepend := "${THISDIR}/configs:" - -require recipes-samples/images/lmp-image-common.inc - -# Factory tooling requires SOTA (OSTree + Aktualizr-lite) -require ${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'recipes-samples/images/lmp-feature-factory.inc', '', d)} - -# Enable wayland related recipes if required by DISTRO -require ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'recipes-samples/images/lmp-feature-wayland.inc', '', d)} - -# Enable OP-TEE related recipes if provided by the image -require ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'recipes-samples/images/lmp-feature-optee.inc', '', d)} - -require recipes-samples/images/lmp-feature-softhsm.inc -require recipes-samples/images/lmp-feature-wireguard.inc -require recipes-samples/images/lmp-feature-docker.inc -require recipes-samples/images/lmp-feature-wifi.inc -require recipes-samples/images/lmp-feature-ota-utils.inc -require recipes-samples/images/lmp-feature-sbin-path-helper.inc - -IMAGE_FEATURES += "ssh-server-dropbear" - -CORE_IMAGE_BASE_INSTALL_GPLV3 = "\ - packagegroup-core-full-cmdline-utils \ - packagegroup-core-full-cmdline-multiuser \ -" - -CORE_IMAGE_BASE_INSTALL += " \ - kernel-modules \ - networkmanager-nmcli \ - git \ - vim \ - packagegroup-core-full-cmdline-extended \ - ${@bb.utils.contains('LMP_DISABLE_GPLV3', '1', '', '${CORE_IMAGE_BASE_INSTALL_GPLV3}', d)} \ -" - -SRC_URI += "\ - file://sudoers-arduino-lmp \ -" - -LMP_EXTRA = " \ - lmp-device-tree \ - lmp-auto-hostname \ - compose-apps-early-start \ - tmate \ - libgpiod-tools \ -" - -ADB = " \ - android-tools \ - android-tools-adbd \ -" - -ARDUINO = " \ - arduino-ootb \ - m4-proxy \ - udev-rules-portenta \ - libusbgx-config \ -" - -CORE_IMAGE_BASE_INSTALL += " \ - libdrm \ - usb-modeswitch \ - ${LMP_EXTRA} \ - ${ADB} \ - ${ARDUINO} \ -" - -# No default password is configured for the device -EXTRA_USERS_PARAMS += "\ - usermod -p '' ${LMP_USER}; \ -" - -# Packages to be installed in Portenta-X8 machine only -IMAGE_INSTALL:append:portenta-x8 = " openocd" - -fakeroot do_populate_rootfs_add_custom_sudoers () { - # Allow sudo group users to use sudo - bbwarn Changing sudoers for arduino ootb! - install -m 0440 ${WORKDIR}/sudoers-arduino-lmp ${IMAGE_ROOTFS}${sysconfdir}/sudoers.d/51-arduino -} - -IMAGE_PREPROCESS_COMMAND += "do_populate_rootfs_add_custom_sudoers; " diff --git a/recipes-samples/images/lmp-partner-image.inc b/recipes-samples/images/lmp-partner-image.inc new file mode 120000 index 0000000..bd7e47f --- /dev/null +++ b/recipes-samples/images/lmp-partner-image.inc @@ -0,0 +1 @@ +lmp-partner-image-arduino.inc \ No newline at end of file