diff options
Diffstat (limited to 'meta/recipes-core/images')
8 files changed, 144 insertions, 30 deletions
diff --git a/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/meta/recipes-core/images/build-appliance-image_15.0.0.bb index 595e7ed74d..c673b4ab6c 100644 --- a/meta/recipes-core/images/build-appliance-image_15.0.0.bb +++ b/meta/recipes-core/images/build-appliance-image_15.0.0.bb @@ -1,17 +1,17 @@ SUMMARY = "An image containing the build system itself" DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation." -HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" +HOMEPAGE = "https://docs.yoctoproject.org/overview-manual/yp-intro.html#archived-components" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \ - kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \ + kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcpcd \ tzdata python3-pip perl-misc" IMAGE_FEATURES += "x11-base package-management splash" -QB_MEM = '${@bb.utils.contains("DISTRO_FEATURES", "opengl", "-m 512", "-m 256", d)}' +QB_MEM ?= '${@bb.utils.contains("DISTRO_FEATURES", "opengl", "-m 512", "-m 256", d)}' # Ensure there's enough space to do a core-image-sato build, with rm_work enabled IMAGE_ROOTFS_EXTRA_SPACE = "41943040" @@ -20,12 +20,14 @@ IMAGE_ROOTFS_EXTRA_SPACE = "41943040" APPEND += "rootfstype=ext4 quiet" DEPENDS = "zip-native python3-pip-native" -IMAGE_FSTYPES = "wic.vmdk" +IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx" -inherit core-image module-base setuptools3 +inherit core-image setuptools3 features_check -SRCREV ?= "6b2cdc4b96eab7ad5e8ae8daebe24f2b18b09b1e" -SRC_URI = "git://git.yoctoproject.org/poky \ +REQUIRED_DISTRO_FEATURES += "xattr" + +SRCREV ?= "7cc8bf7af794badd89fb30aa96a878c575630b7f" +SRC_URI = "git://git.yoctoproject.org/poky;branch=master \ file://Yocto_Build_Appliance.vmx \ file://Yocto_Build_Appliance.vmxf \ file://README_VirtualBox_Guest_Additions.txt \ @@ -34,7 +36,7 @@ SRC_URI = "git://git.yoctoproject.org/poky \ RECIPE_NO_UPDATE_REASON = "Recipe is recursive and handled as part of the release process" BA_INCLUDE_SOURCES ??= "0" -IMAGE_CMD_ext4_append () { +IMAGE_CMD:ext4:append () { # We don't need to reserve much space for root, 0.5% is more than enough tune2fs -m 0.5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4 } @@ -42,10 +44,10 @@ IMAGE_CMD_ext4_append () { fakeroot do_populate_poky_src () { # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo # will become invalid in the target. - rm -rf ${WORKDIR}/git/.git - rm -f ${WORKDIR}/git/.gitignore + rm -rf ${UNPACKDIR}/git/.git + rm -f ${UNPACKDIR}/git/.gitignore - cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky + cp -R ${UNPACKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads @@ -56,19 +58,14 @@ fakeroot do_populate_poky_src () { fi # Place the README_VirtualBox_Guest_Additions file in builders home folder. - cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ + cp ${UNPACKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ # Place the README_VirtualBox_Toaster file in builders home folder. - cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ - - # Create a symlink, needed for out-of-tree kernel modules build - if [ ! -e ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build ]; then - rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build - lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build - fi + cp ${UNPACKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc + echo "export TERM=xterm-color" >> ${IMAGE_ROOTFS}/home/builder/.bashrc # Also save (for reference only) the actual SRCREV used to create this image echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc @@ -93,7 +90,7 @@ fakeroot do_populate_poky_src () { # Load tap/tun at startup rm -f ${IMAGE_ROOTFS}/sbin/iptables - lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables + ln -rs ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables echo "tun" >> ${IMAGE_ROOTFS}/etc/modules # Use Clearlooks GTK+ theme @@ -114,7 +111,15 @@ fakeroot do_populate_poky_src () { chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache } -IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " +fakeroot do_tweak_image () { + # add a /lib64 symlink + # this is needed for building rust-native on a 64-bit build appliance + ln -rs ${IMAGE_ROOTFS}/lib ${IMAGE_ROOTFS}/lib64 +} + +IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src do_tweak_image" +# For pip usage above +do_image[network] = "1" addtask rootfs after do_unpack @@ -124,11 +129,18 @@ python () { d.delVarFlag("do_unpack", "noexec") } +# ${S} doesn't exist for us +do_qa_unpack() { + return +} + create_bundle_files () { cd ${WORKDIR} mkdir -p Yocto_Build_Appliance - cp *.vmx* Yocto_Build_Appliance - ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk + cp ${UNPACKDIR}/*.vmx* Yocto_Build_Appliance + ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk + ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vhdx Yocto_Build_Appliance/Yocto_Build_Appliance.vhdx + ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vhd Yocto_Build_Appliance/Yocto_Build_Appliance.vhd zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/Yocto_Build_Appliance.zip } diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb b/meta/recipes-core/images/core-image-initramfs-boot.bb new file mode 100644 index 0000000000..7258944751 --- /dev/null +++ b/meta/recipes-core/images/core-image-initramfs-boot.bb @@ -0,0 +1,22 @@ +SUMMARY = "Basic initramfs to boot a fully-featured rootfs" +DESCRIPTION = "Small initramfs that contains just udev and init, to find the real rootfs." +LICENSE = "MIT" + +INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev" + +PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd" + +# Ensure the initramfs only contains the bare minimum +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" + +# Don't allow the initramfs to contain a kernel, as kernel modules will depend +# on the kernel image. +PACKAGE_EXCLUDE = "kernel-image-*" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +IMAGE_NAME_SUFFIX ?= "" +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +inherit image diff --git a/meta/recipes-core/images/core-image-minimal-initramfs.bb b/meta/recipes-core/images/core-image-minimal-initramfs.bb index 7df8ab1ebd..36e8771c4a 100644 --- a/meta/recipes-core/images/core-image-minimal-initramfs.bb +++ b/meta/recipes-core/images/core-image-minimal-initramfs.bb @@ -1,4 +1,5 @@ # Simple initramfs image. Mostly used for live images. +SUMMARY = "Small image capable of booting a device." DESCRIPTION = "Small image capable of booting a device. The kernel includes \ the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ first 'init' program more efficiently." @@ -16,7 +17,10 @@ PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base- # Do not pollute the initrd image with rootfs features IMAGE_FEATURES = "" -export IMAGE_BASENAME = "${MLPREFIX}core-image-minimal-initramfs" +# Don't allow the initramfs to contain a kernel +PACKAGE_EXCLUDE = "kernel-image-*" + +IMAGE_NAME_SUFFIX ?= "" IMAGE_LINGUAS = "" LICENSE = "MIT" @@ -27,5 +31,5 @@ inherit core-image IMAGE_ROOTFS_SIZE = "8192" IMAGE_ROOTFS_EXTRA_SPACE = "0" -# Use the same restriction as initramfs-live-install -COMPATIBLE_HOST = "(i.86|x86_64).*-linux" +# Use the same restriction as initramfs-module-install +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|loongarch64.*)-(linux.*|freebsd.*)' diff --git a/meta/recipes-core/images/core-image-minimal.bb b/meta/recipes-core/images/core-image-minimal.bb index 4630026aa9..84343adcd8 100644 --- a/meta/recipes-core/images/core-image-minimal.bb +++ b/meta/recipes-core/images/core-image-minimal.bb @@ -9,4 +9,4 @@ LICENSE = "MIT" inherit core-image IMAGE_ROOTFS_SIZE ?= "8192" -IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}" +IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}" diff --git a/meta/recipes-core/images/core-image-ptest-all.bb b/meta/recipes-core/images/core-image-ptest-all.bb new file mode 100644 index 0000000000..d4edb0fd05 --- /dev/null +++ b/meta/recipes-core/images/core-image-ptest-all.bb @@ -0,0 +1,25 @@ +SUMMARY = "Recipe to trigger execution of all ptest images." +HOMEPAGE = "https://www.yoctoproject.org/" + +LICENSE = "MIT" + +inherit features_check nopackages +REQUIRED_DISTRO_FEATURES = "ptest" + +require conf/distro/include/ptest-packagelists.inc + +# Include the full set of ptests +PTESTS = "${PTESTS_FAST} ${PTESTS_SLOW}" + +do_testimage[noexec] = "1" +do_testimage[depends] = "${@' '.join(['core-image-ptest-'+x+':do_testimage' for x in d.getVar('PTESTS').split()])}" + +do_build[depends] = "${@' '.join(['core-image-ptest-'+x+':do_build' for x in d.getVar('PTESTS').split()])}" + +# normally image.bbclass would do this +EXCLUDE_FROM_WORLD = "1" + +python () { + if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d): + bb.build.addtask("do_testimage", "", "", d) +} diff --git a/meta/recipes-core/images/core-image-ptest-fast.bb b/meta/recipes-core/images/core-image-ptest-fast.bb new file mode 100644 index 0000000000..a5364e6cbf --- /dev/null +++ b/meta/recipes-core/images/core-image-ptest-fast.bb @@ -0,0 +1,6 @@ +require core-image-ptest-all.bb + +SUMMARY = "Recipe to trigger execution of all fast ptest images." + +PTESTS = "${PTESTS_FAST}" + diff --git a/meta/recipes-core/images/core-image-ptest.bb b/meta/recipes-core/images/core-image-ptest.bb new file mode 100644 index 0000000000..72081f938d --- /dev/null +++ b/meta/recipes-core/images/core-image-ptest.bb @@ -0,0 +1,44 @@ +inherit features_check +REQUIRED_DISTRO_FEATURES = "ptest" + +require core-image-minimal.bb +require conf/distro/include/ptest-packagelists.inc + +DESCRIPTION += "Also including the ${MCNAME} ptest package." +SUMMARY ?= "${MCNAME} ptest image." +HOMEPAGE = "https://www.yoctoproject.org/" + +PTESTS = "${PTESTS_SLOW} ${PTESTS_FAST}" + +IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh" + +BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS').split()])}" + +# The image can sufficiently large (~1.8GB) that we need to be careful that it fits in a live +# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the +# box) and explicitly add up to 1500MB. +# strace-ptest in particular needs more than 500MB +IMAGE_OVERHEAD_FACTOR = "1.0" +IMAGE_ROOTFS_EXTRA_SPACE = "324288" +IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-mdadm = "1524288" +IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1524288" +IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288" + +# tar-ptest in particular needs more space +IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-tar = "1524288" + +# ptests need more memory than standard to avoid the OOM killer +QB_MEM = "-m 1024" +QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096" +QB_MEM:virtclass-mcextend-python3 = "-m 2048" +QB_MEM:virtclass-mcextend-python3-cryptography = "-m 5100" + +TEST_SUITES = "ping ssh parselogs ptest" + +# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places +PTEST_EXPECT_FAILURE = "1" + +python () { + if not d.getVar("MCNAME"): + raise bb.parse.SkipRecipe("No class extension set") +} diff --git a/meta/recipes-core/images/core-image-tiny-initramfs.bb b/meta/recipes-core/images/core-image-tiny-initramfs.bb index 0eca6d9944..7a71d55b1e 100644 --- a/meta/recipes-core/images/core-image-tiny-initramfs.bb +++ b/meta/recipes-core/images/core-image-tiny-initramfs.bb @@ -1,4 +1,5 @@ # Simple initramfs image artifact generation for tiny images. +SUMMARY = "Tiny image capable of booting a device." DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \ the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ first 'init' program more efficiently. core-image-tiny-initramfs doesn't \ @@ -12,7 +13,7 @@ PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VI # Do not pollute the initrd image with rootfs features IMAGE_FEATURES = "" -export IMAGE_BASENAME = "core-image-tiny-initramfs" +IMAGE_NAME_SUFFIX ?= "" IMAGE_LINGUAS = "" LICENSE = "MIT" @@ -26,7 +27,7 @@ IMAGE_ROOTFS_SIZE = "8192" IMAGE_ROOTFS_EXTRA_SPACE = "0" # Use the same restriction as initramfs-live-install -COMPATIBLE_HOST = "(i.86|x86_64).*-linux" +COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux" python tinyinitrd () { # Modify our init file so the user knows we drop to shell prompt on purpose @@ -38,6 +39,6 @@ python tinyinitrd () { init.write(newinit) } -IMAGE_PREPROCESS_COMMAND += "tinyinitrd;" +IMAGE_PREPROCESS_COMMAND += "tinyinitrd" QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init" |