Skip to content

Commit

Permalink
images: clean-up up the split between the default factory-image and a…
Browse files Browse the repository at this point in the history
…rduino-includes

Signed-off-by: Michael Scott <[email protected]>
  • Loading branch information
mike-scott authored and MaxPayne86 committed Oct 2, 2024
1 parent 9861e42 commit 793e0ef
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 130 deletions.
55 changes: 11 additions & 44 deletions recipes-samples/images/lmp-devel-arduino-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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; "
57 changes: 56 additions & 1 deletion recipes-samples/images/lmp-factory-image.bb
Original file line number Diff line number Diff line change
@@ -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)} \
"
55 changes: 55 additions & 0 deletions recipes-samples/images/lmp-partner-image-arduino.inc
Original file line number Diff line number Diff line change
@@ -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; "
85 changes: 0 additions & 85 deletions recipes-samples/images/lmp-partner-image.inc

This file was deleted.

1 change: 1 addition & 0 deletions recipes-samples/images/lmp-partner-image.inc

0 comments on commit 793e0ef

Please sign in to comment.