Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1 | SUMMARY = "Arm SystemReady Linux distros installation" |
| 2 | DESCRIPTION = "Arm SystemReady Linux distro CD/DVD images and installation \ |
| 3 | target disk image" |
| 4 | |
| 5 | IMAGE_CLASSES:remove = "license_image testimage" |
| 6 | |
| 7 | INHIBIT_DEFAULT_DEPS = "1" |
| 8 | COMPATIBLE_HOST = "aarch64-*" |
| 9 | PACKAGE_ARCH = "${TARGET_ARCH}" |
| 10 | |
| 11 | inherit nopackages deploy rootfs-postcommands ${IMAGE_CLASSES} |
| 12 | |
| 13 | do_configure[noexec] = "1" |
| 14 | do_compile[noexec] = "1" |
| 15 | |
| 16 | ISO_IMAGE_NAME = "${PN}-${PV}" |
| 17 | IMAGE_LINK_NAME = "${PN}-${PV}-${MACHINE}" |
| 18 | |
| 19 | ARM_SYSTEMREADY_LINUX_DISTRO_ISO_IMAGE = \ |
| 20 | "${DEPLOY_DIR_IMAGE}/${ISO_IMAGE_NAME}.iso" |
| 21 | # Size of installation disk in MB |
| 22 | ARM_SYSTEMREADY_LINUX_DISTRO_INSTALL_SIZE ?= "4096" |
| 23 | |
| 24 | do_image() { |
| 25 | dd if=/dev/zero of=${WORKDIR}/${IMAGE_LINK_NAME}.wic \ |
| 26 | bs=1M count=${ARM_SYSTEMREADY_LINUX_DISTRO_INSTALL_SIZE} status=none |
| 27 | } |
| 28 | |
| 29 | do_deploy() { |
| 30 | # Deploy the iso and installation target disk image to the deploy folder |
| 31 | install -m 644 ${WORKDIR}/${ISO_IMAGE_NAME}.iso ${DEPLOYDIR} |
| 32 | install -m 644 ${WORKDIR}/${IMAGE_LINK_NAME}.wic ${DEPLOYDIR} |
| 33 | } |
| 34 | |
| 35 | addtask image before do_install |
| 36 | addtask deploy after do_install before do_image_complete |
| 37 | |
| 38 | # Post-process commands may write to IMGDEPLOYDIR |
| 39 | IMGDEPLOYDIR = "${DEPLOY_DIR_IMAGE}" |
| 40 | |
| 41 | python do_image_complete() { |
| 42 | # Run the image post-process commands |
| 43 | from oe.utils import execute_pre_post_process |
| 44 | post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND") |
| 45 | execute_pre_post_process(d, post_process_cmds) |
| 46 | } |
| 47 | do_image_complete[nostamp] = "1" |
| 48 | addtask image_complete after do_deploy before do_build |
| 49 | |
| 50 | do_install[depends] += "arm-systemready-firmware:do_image_complete" |