summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/images
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/images')
-rw-r--r--meta/recipes-core/images/build-appliance-image_15.0.0.bb56
-rw-r--r--meta/recipes-core/images/core-image-initramfs-boot.bb22
-rw-r--r--meta/recipes-core/images/core-image-minimal-initramfs.bb7
-rw-r--r--meta/recipes-core/images/core-image-minimal.bb2
-rw-r--r--meta/recipes-core/images/core-image-ptest-all.bb25
-rw-r--r--meta/recipes-core/images/core-image-ptest-fast.bb6
-rw-r--r--meta/recipes-core/images/core-image-ptest.bb44
-rw-r--r--meta/recipes-core/images/core-image-tiny-initramfs.bb6
8 files changed, 139 insertions, 29 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 705ff63cf7..e406968df2 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,6 +1,6 @@
1SUMMARY = "An image containing the build system itself" 1SUMMARY = "An image containing the build system itself"
2DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation." 2DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation."
3HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance" 3HOMEPAGE = "https://docs.yoctoproject.org/overview-manual/yp-intro.html#archived-components"
4 4
5LICENSE = "MIT" 5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
@@ -11,7 +11,7 @@ IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegro
11 11
12IMAGE_FEATURES += "x11-base package-management splash" 12IMAGE_FEATURES += "x11-base package-management splash"
13 13
14QB_MEM = '${@bb.utils.contains("DISTRO_FEATURES", "opengl", "-m 512", "-m 256", d)}' 14QB_MEM ?= '${@bb.utils.contains("DISTRO_FEATURES", "opengl", "-m 512", "-m 256", d)}'
15 15
16# Ensure there's enough space to do a core-image-sato build, with rm_work enabled 16# Ensure there's enough space to do a core-image-sato build, with rm_work enabled
17IMAGE_ROOTFS_EXTRA_SPACE = "41943040" 17IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
@@ -22,10 +22,12 @@ APPEND += "rootfstype=ext4 quiet"
22DEPENDS = "zip-native python3-pip-native" 22DEPENDS = "zip-native python3-pip-native"
23IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx" 23IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
24 24
25inherit core-image module-base setuptools3 25inherit core-image setuptools3 features_check
26 26
27SRCREV ?= "e56305dd709ae2af2da7a7599984b3ad18c4970f" 27REQUIRED_DISTRO_FEATURES += "xattr"
28SRC_URI = "git://git.yoctoproject.org/poky \ 28
29SRCREV ?= "17723c6e34096a53fb186cc70cfc604bb30da8b9"
30SRC_URI = "git://git.yoctoproject.org/poky;branch=master \
29 file://Yocto_Build_Appliance.vmx \ 31 file://Yocto_Build_Appliance.vmx \
30 file://Yocto_Build_Appliance.vmxf \ 32 file://Yocto_Build_Appliance.vmxf \
31 file://README_VirtualBox_Guest_Additions.txt \ 33 file://README_VirtualBox_Guest_Additions.txt \
@@ -34,7 +36,7 @@ SRC_URI = "git://git.yoctoproject.org/poky \
34RECIPE_NO_UPDATE_REASON = "Recipe is recursive and handled as part of the release process" 36RECIPE_NO_UPDATE_REASON = "Recipe is recursive and handled as part of the release process"
35BA_INCLUDE_SOURCES ??= "0" 37BA_INCLUDE_SOURCES ??= "0"
36 38
37IMAGE_CMD_ext4_append () { 39IMAGE_CMD:ext4:append () {
38 # We don't need to reserve much space for root, 0.5% is more than enough 40 # We don't need to reserve much space for root, 0.5% is more than enough
39 tune2fs -m 0.5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4 41 tune2fs -m 0.5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4
40} 42}
@@ -42,10 +44,10 @@ IMAGE_CMD_ext4_append () {
42fakeroot do_populate_poky_src () { 44fakeroot do_populate_poky_src () {
43 # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo 45 # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo
44 # will become invalid in the target. 46 # will become invalid in the target.
45 rm -rf ${WORKDIR}/git/.git 47 rm -rf ${UNPACKDIR}/git/.git
46 rm -f ${WORKDIR}/git/.gitignore 48 rm -f ${UNPACKDIR}/git/.gitignore
47 49
48 cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky 50 cp -R ${UNPACKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky
49 51
50 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf 52 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf
51 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads 53 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads
@@ -56,19 +58,14 @@ fakeroot do_populate_poky_src () {
56 fi 58 fi
57 59
58 # Place the README_VirtualBox_Guest_Additions file in builders home folder. 60 # Place the README_VirtualBox_Guest_Additions file in builders home folder.
59 cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/ 61 cp ${UNPACKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/
60 62
61 # Place the README_VirtualBox_Toaster file in builders home folder. 63 # Place the README_VirtualBox_Toaster file in builders home folder.
62 cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/ 64 cp ${UNPACKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
63
64 # Create a symlink, needed for out-of-tree kernel modules build
65 if [ ! -e ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build ]; then
66 rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
67 lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
68 fi
69 65
70 echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf 66 echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
71 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc 67 echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
68 echo "export TERM=xterm-color" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
72 69
73 # Also save (for reference only) the actual SRCREV used to create this image 70 # Also save (for reference only) the actual SRCREV used to create this image
74 echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc 71 echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
@@ -93,7 +90,7 @@ fakeroot do_populate_poky_src () {
93 90
94 # Load tap/tun at startup 91 # Load tap/tun at startup
95 rm -f ${IMAGE_ROOTFS}/sbin/iptables 92 rm -f ${IMAGE_ROOTFS}/sbin/iptables
96 lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables 93 ln -rs ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
97 echo "tun" >> ${IMAGE_ROOTFS}/etc/modules 94 echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
98 95
99 # Use Clearlooks GTK+ theme 96 # Use Clearlooks GTK+ theme
@@ -114,7 +111,15 @@ fakeroot do_populate_poky_src () {
114 chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache 111 chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache
115} 112}
116 113
117IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; " 114fakeroot do_tweak_image () {
115 # add a /lib64 symlink
116 # this is needed for building rust-native on a 64-bit build appliance
117 ln -rs ${IMAGE_ROOTFS}/lib ${IMAGE_ROOTFS}/lib64
118}
119
120IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src do_tweak_image"
121# For pip usage above
122do_image[network] = "1"
118 123
119addtask rootfs after do_unpack 124addtask rootfs after do_unpack
120 125
@@ -124,13 +129,18 @@ python () {
124 d.delVarFlag("do_unpack", "noexec") 129 d.delVarFlag("do_unpack", "noexec")
125} 130}
126 131
132# ${S} doesn't exist for us
133do_qa_unpack() {
134 return
135}
136
127create_bundle_files () { 137create_bundle_files () {
128 cd ${WORKDIR} 138 cd ${WORKDIR}
129 mkdir -p Yocto_Build_Appliance 139 mkdir -p Yocto_Build_Appliance
130 cp *.vmx* Yocto_Build_Appliance 140 cp ${UNPACKDIR}/*.vmx* Yocto_Build_Appliance
131 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk 141 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
132 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vhdx Yocto_Build_Appliance/Yocto_Build_Appliance.vhdx 142 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vhdx Yocto_Build_Appliance/Yocto_Build_Appliance.vhdx
133 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vhd Yocto_Build_Appliance/Yocto_Build_Appliance.vhd 143 ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}.wic.vhd Yocto_Build_Appliance/Yocto_Build_Appliance.vhd
134 zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance 144 zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
135 ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/Yocto_Build_Appliance.zip 145 ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/Yocto_Build_Appliance.zip
136} 146}
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 @@
1SUMMARY = "Basic initramfs to boot a fully-featured rootfs"
2DESCRIPTION = "Small initramfs that contains just udev and init, to find the real rootfs."
3LICENSE = "MIT"
4
5INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev"
6
7PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd"
8
9# Ensure the initramfs only contains the bare minimum
10IMAGE_FEATURES = ""
11IMAGE_LINGUAS = ""
12
13# Don't allow the initramfs to contain a kernel, as kernel modules will depend
14# on the kernel image.
15PACKAGE_EXCLUDE = "kernel-image-*"
16
17IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
18IMAGE_NAME_SUFFIX ?= ""
19IMAGE_ROOTFS_SIZE = "8192"
20IMAGE_ROOTFS_EXTRA_SPACE = "0"
21
22inherit image
diff --git a/meta/recipes-core/images/core-image-minimal-initramfs.bb b/meta/recipes-core/images/core-image-minimal-initramfs.bb
index 664fe7310e..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 @@
1# Simple initramfs image. Mostly used for live images. 1# Simple initramfs image. Mostly used for live images.
2SUMMARY = "Small image capable of booting a device."
2DESCRIPTION = "Small image capable of booting a device. The kernel includes \ 3DESCRIPTION = "Small image capable of booting a device. The kernel includes \
3the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ 4the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
4first 'init' program more efficiently." 5first 'init' program more efficiently."
@@ -16,7 +17,9 @@ PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-
16# Do not pollute the initrd image with rootfs features 17# Do not pollute the initrd image with rootfs features
17IMAGE_FEATURES = "" 18IMAGE_FEATURES = ""
18 19
19export IMAGE_BASENAME = "${MLPREFIX}core-image-minimal-initramfs" 20# Don't allow the initramfs to contain a kernel
21PACKAGE_EXCLUDE = "kernel-image-*"
22
20IMAGE_NAME_SUFFIX ?= "" 23IMAGE_NAME_SUFFIX ?= ""
21IMAGE_LINGUAS = "" 24IMAGE_LINGUAS = ""
22 25
@@ -29,4 +32,4 @@ IMAGE_ROOTFS_SIZE = "8192"
29IMAGE_ROOTFS_EXTRA_SPACE = "0" 32IMAGE_ROOTFS_EXTRA_SPACE = "0"
30 33
31# Use the same restriction as initramfs-module-install 34# Use the same restriction as initramfs-module-install
32COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' 35COMPATIBLE_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 19f27f8395..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"
9inherit core-image 9inherit core-image
10 10
11IMAGE_ROOTFS_SIZE ?= "8192" 11IMAGE_ROOTFS_SIZE ?= "8192"
12IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}" 12IMAGE_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 @@
1SUMMARY = "Recipe to trigger execution of all ptest images."
2HOMEPAGE = "https://www.yoctoproject.org/"
3
4LICENSE = "MIT"
5
6inherit features_check nopackages
7REQUIRED_DISTRO_FEATURES = "ptest"
8
9require conf/distro/include/ptest-packagelists.inc
10
11# Include the full set of ptests
12PTESTS = "${PTESTS_FAST} ${PTESTS_SLOW}"
13
14do_testimage[noexec] = "1"
15do_testimage[depends] = "${@' '.join(['core-image-ptest-'+x+':do_testimage' for x in d.getVar('PTESTS').split()])}"
16
17do_build[depends] = "${@' '.join(['core-image-ptest-'+x+':do_build' for x in d.getVar('PTESTS').split()])}"
18
19# normally image.bbclass would do this
20EXCLUDE_FROM_WORLD = "1"
21
22python () {
23 if bb.utils.contains('IMAGE_CLASSES', 'testimage', True, False, d):
24 bb.build.addtask("do_testimage", "", "", d)
25}
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 @@
1require core-image-ptest-all.bb
2
3SUMMARY = "Recipe to trigger execution of all fast ptest images."
4
5PTESTS = "${PTESTS_FAST}"
6
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 @@
1inherit features_check
2REQUIRED_DISTRO_FEATURES = "ptest"
3
4require core-image-minimal.bb
5require conf/distro/include/ptest-packagelists.inc
6
7DESCRIPTION += "Also including the ${MCNAME} ptest package."
8SUMMARY ?= "${MCNAME} ptest image."
9HOMEPAGE = "https://www.yoctoproject.org/"
10
11PTESTS = "${PTESTS_SLOW} ${PTESTS_FAST}"
12
13IMAGE_INSTALL:append = " ${MCNAME}-ptest openssh"
14
15BBCLASSEXTEND = "${@' '.join(['mcextend:'+x for x in d.getVar('PTESTS').split()])}"
16
17# The image can sufficiently large (~1.8GB) that we need to be careful that it fits in a live
18# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
19# box) and explicitly add up to 1500MB.
20# strace-ptest in particular needs more than 500MB
21IMAGE_OVERHEAD_FACTOR = "1.0"
22IMAGE_ROOTFS_EXTRA_SPACE = "324288"
23IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-mdadm = "1524288"
24IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1524288"
25IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288"
26
27# tar-ptest in particular needs more space
28IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-tar = "1524288"
29
30# ptests need more memory than standard to avoid the OOM killer
31QB_MEM = "-m 1024"
32QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096"
33QB_MEM:virtclass-mcextend-python3 = "-m 2048"
34QB_MEM:virtclass-mcextend-python3-cryptography = "-m 5100"
35
36TEST_SUITES = "ping ssh parselogs ptest"
37
38# Sadly at the moment the full set of ptests is not robust enough and sporadically fails in random places
39PTEST_EXPECT_FAILURE = "1"
40
41python () {
42 if not d.getVar("MCNAME"):
43 raise bb.parse.SkipRecipe("No class extension set")
44}
diff --git a/meta/recipes-core/images/core-image-tiny-initramfs.bb b/meta/recipes-core/images/core-image-tiny-initramfs.bb
index 47470849ed..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 @@
1# Simple initramfs image artifact generation for tiny images. 1# Simple initramfs image artifact generation for tiny images.
2SUMMARY = "Tiny image capable of booting a device."
2DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \ 3DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
3the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ 4the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
4first 'init' program more efficiently. core-image-tiny-initramfs doesn't \ 5first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
@@ -12,7 +13,6 @@ PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VI
12# Do not pollute the initrd image with rootfs features 13# Do not pollute the initrd image with rootfs features
13IMAGE_FEATURES = "" 14IMAGE_FEATURES = ""
14 15
15export IMAGE_BASENAME = "core-image-tiny-initramfs"
16IMAGE_NAME_SUFFIX ?= "" 16IMAGE_NAME_SUFFIX ?= ""
17IMAGE_LINGUAS = "" 17IMAGE_LINGUAS = ""
18 18
@@ -27,7 +27,7 @@ IMAGE_ROOTFS_SIZE = "8192"
27IMAGE_ROOTFS_EXTRA_SPACE = "0" 27IMAGE_ROOTFS_EXTRA_SPACE = "0"
28 28
29# Use the same restriction as initramfs-live-install 29# Use the same restriction as initramfs-live-install
30COMPATIBLE_HOST = "(i.86|x86_64|aarch64).*-linux" 30COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux"
31 31
32python tinyinitrd () { 32python tinyinitrd () {
33 # Modify our init file so the user knows we drop to shell prompt on purpose 33 # Modify our init file so the user knows we drop to shell prompt on purpose
@@ -39,6 +39,6 @@ python tinyinitrd () {
39 init.write(newinit) 39 init.write(newinit)
40} 40}
41 41
42IMAGE_PREPROCESS_COMMAND += "tinyinitrd;" 42IMAGE_PREPROCESS_COMMAND += "tinyinitrd"
43 43
44QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init" 44QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"