diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2022-12-01 17:06:46 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-04-07 17:50:36 -0700 |
| commit | dd9498d832c606fb8ab26c3f2b8e129ed62ba425 (patch) | |
| tree | c3665ca7e7826d8f046b798bfaaf6b6dad227008 /meta-xilinx-core/recipes-bsp/initramdisk | |
| parent | a21bb9a63f89ce486fe64e457b9a88b29db9d764 (diff) | |
| download | meta-xilinx-dd9498d832c606fb8ab26c3f2b8e129ed62ba425.tar.gz | |
initramdisk-xilinx: Add a recipe to package the INITRAMFS_IMAGE
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/initramdisk')
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/initramdisk/initramdisk-xilinx.bb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/initramdisk/initramdisk-xilinx.bb b/meta-xilinx-core/recipes-bsp/initramdisk/initramdisk-xilinx.bb new file mode 100644 index 00000000..af786e7e --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/initramdisk/initramdisk-xilinx.bb | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | INITRAMFS_IMAGE ??= "" | ||
| 2 | |||
| 3 | # Adjust our name to be explicit to what we're going to produce | ||
| 4 | PN = "initramdisk-${INITRAMFS_IMAGE}" | ||
| 5 | |||
| 6 | DESCRIPTION = "Provide the initramdisk available via a package, installed in /boot" | ||
| 7 | |||
| 8 | DEPENDS = "${INITRAMFS_IMAGE}" | ||
| 9 | |||
| 10 | LICENSE = "MIT" | ||
| 11 | |||
| 12 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 13 | |||
| 14 | do_configure[noexec] = "1" | ||
| 15 | do_compile[noexec] = "1" | ||
| 16 | |||
| 17 | do_install[vardepsexclude] += "DEPLOY_DIR_IMAGE" | ||
| 18 | do_install[depends] += "${INITRAMFS_IMAGE}:do_image_complete" | ||
| 19 | do_install[cleandirs] = "${D}" | ||
| 20 | do_install() { | ||
| 21 | if [ -e ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot ]; then | ||
| 22 | install -d ${D}/boot/ | ||
| 23 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot ${D}/boot/. | ||
| 24 | else | ||
| 25 | bbfatal "Unable to find expected initramfs: ${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot" | ||
| 26 | fi | ||
| 27 | } | ||
| 28 | |||
| 29 | PACKAGES = "${PACKAGE_BEFORE_PN} ${PN}" | ||
| 30 | |||
| 31 | RPROVIDES:${PN} = "initramdisk" | ||
| 32 | FILES:${PN} = "/boot/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot" | ||
| 33 | |||
| 34 | python() { | ||
| 35 | if not d.getVar('INITRAMFS_IMAGE'): | ||
| 36 | bb.parse.SkipRecipe("No init ramdisk enabled. This package requires INITRAMFS_IMAGE to be defined.") | ||
| 37 | } | ||
