summaryrefslogtreecommitdiffstats
path: root/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2020-05-11 20:16:05 +0200
committerMing Liu <ming.liu@toradex.com>2020-06-27 10:38:10 +0200
commit75069b6a653a19e298c1b2ea791e80955a26b7b6 (patch)
tree38ed0624f19b61f5ab6205b06f29d3ab88deb765 /recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb
parent4fcf797368139cb42ced99fc3b14bd543b37108d (diff)
downloadmeta-updater-75069b6a653a19e298c1b2ea791e80955a26b7b6.tar.gz
meta: introduce ostree-kernel-initramfs recipe
We package kernel image, devicetrees, initramfs and install them to /usr/lib/modules/${KERNEL_VERSION}, which is the preferred location according to ostree's new implementation, this could simplify the deployment. Reference: https://github.com/ostreedev/ostree/commit/3ab0d5e6644885440bac6abd17b6d2637df5435f To let initramfs-ostree-image be able to be depended by ostree-kernel-initramfs, it must inherit nopackages to avoid a annoying QA warning like the follows: | WARNING: initramfs-ostree-image-0.0.1-r0 do_package: Manifest ...initramfs-ostree-image.packagedata | not found in colibri_imx6 armv7ahf-neon-imx armv7at2hf-neon-imx armv7at2hf-neon armv7ahf-neon armv7at2hf-vfp | armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp armv5hf-vfp allarch | x86_64_x86_64-nativesdk (variant '')? Also we need define OSTREE_KERNEL, OSTREE_DEPLOY_DEVICETREE and OSTREE_DEVICETREE in sota.bbclass so they could be accessed in other recipes as well as in image recipes. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Ming Liu <ming.liu@toradex.com>
Diffstat (limited to 'recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb')
-rw-r--r--recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb52
1 files changed, 52 insertions, 0 deletions
diff --git a/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb
new file mode 100644
index 0000000..fe8a9cc
--- /dev/null
+++ b/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb
@@ -0,0 +1,52 @@
1SUMMARY = "Ostree linux kernel, devicetrees and initramfs packager"
2DESCRIPTION = "Ostree linux kernel, devicetrees and initramfs packager"
3SECTION = "kernel"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
6
7# Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
8inherit module-base kernel-artifact-names
9
10PACKAGES = "ostree-kernel ostree-initramfs ostree-devicetrees"
11
12ALLOW_EMPTY_ostree-initramfs = "1"
13ALLOW_EMPTY_ostree-devicetrees = "1"
14
15FILES_ostree-kernel = "${nonarch_base_libdir}/modules/*/vmlinuz"
16FILES_ostree-initramfs = "${nonarch_base_libdir}/modules/*/initramfs.img"
17FILES_ostree-devicetrees = "${nonarch_base_libdir}/modules/*/dtb/*"
18
19PACKAGE_ARCH = "${MACHINE_ARCH}"
20
21KERNEL_BUILD_ROOT = "${nonarch_base_libdir}/modules/"
22
23# There's nothing to do here, except install the artifacts where we can package them
24do_fetch[noexec] = "1"
25do_unpack[noexec] = "1"
26do_patch[noexec] = "1"
27do_configure[noexec] = "1"
28do_compile[noexec] = "1"
29deltask do_populate_sysroot
30
31do_install() {
32 kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
33 install -d $kerneldir
34
35 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} $kerneldir/vmlinuz
36
37 if [ "${KERNEL_IMAGETYPE}" != "fitImage" ]; then
38 if [ -n "${INITRAMFS_IMAGE}" ]; then
39 cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} $kerneldir/initramfs.img
40 fi
41
42 if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${OSTREE_DEVICETREE}" ]; then
43 mkdir -p $kerneldir/dtb
44 for dts_file in ${KERNEL_DEVICETREE}; do
45 dts_file_basename=$(basename $dts_file)
46 cp ${DEPLOY_DIR_IMAGE}/$dts_file_basename $kerneldir/dtb/$dts_file_basename
47 done
48 fi
49 fi
50}
51do_install[vardepsexclude] = "KERNEL_VERSION"
52do_install[depends] = "virtual/kernel:do_deploy ${@['${INITRAMFS_IMAGE}:do_image_complete', ''][d.getVar('INITRAMFS_IMAGE') == '']}"