blob: 7a71d55b1e8830b6078e4d3d8ef9e13474ea91f5 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001# Simple initramfs image artifact generation for tiny images.
Patrick Williams2a254922023-08-11 09:48:11 -05002SUMMARY = "Tiny image capable of booting a device."
Brad Bishop6e60e8b2018-02-01 10:27:11 -05003DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
4the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006actually generate an image but rather generates boot and rootfs artifacts \
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007that can subsequently be picked up by external image generation tools such as wic."
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08009VIRTUAL-RUNTIME_dev_manager ?= "busybox-mdev"
10
Brad Bishop316dfdd2018-06-25 12:45:53 -040011PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012
13# Do not pollute the initrd image with rootfs features
14IMAGE_FEATURES = ""
15
Andrew Geisslerc9f78652020-09-18 14:11:35 -050016IMAGE_NAME_SUFFIX ?= ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017IMAGE_LINGUAS = ""
18
19LICENSE = "MIT"
20
21# don't actually generate an image, just the artifacts needed for one
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023
24inherit core-image
25
26IMAGE_ROOTFS_SIZE = "8192"
27IMAGE_ROOTFS_EXTRA_SPACE = "0"
28
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029# Use the same restriction as initramfs-live-install
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000030COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031
32python tinyinitrd () {
33 # Modify our init file so the user knows we drop to shell prompt on purpose
34 newinit = None
35 with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
36 newinit = init.read()
37 newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
38 with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
39 init.write(newinit)
40}
41
Andrew Geissler5082cc72023-09-11 08:41:39 -040042IMAGE_PREPROCESS_COMMAND += "tinyinitrd"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050043
44QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"