blob: 16995e6580acaca919c0dd19ca875fbea513bb5e [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001# Simple initramfs image artifact generation for tiny images.
2DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
3the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
Brad Bishopd7bf8c12018-02-25 22:55:05 -05004first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005actually generate an image but rather generates boot and rootfs artifacts \
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006that can subsequently be picked up by external image generation tools such as wic."
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007
8PACKAGE_INSTALL = "initramfs-live-boot packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
9
10# Do not pollute the initrd image with rootfs features
11IMAGE_FEATURES = ""
12
13export IMAGE_BASENAME = "core-image-tiny-initramfs"
14IMAGE_LINGUAS = ""
15
16LICENSE = "MIT"
17
18# don't actually generate an image, just the artifacts needed for one
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020
21inherit core-image
22
23IMAGE_ROOTFS_SIZE = "8192"
24IMAGE_ROOTFS_EXTRA_SPACE = "0"
25
26BAD_RECOMMENDATIONS += "busybox-syslog"
27
28# Use the same restriction as initramfs-live-install
29COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
30
31python tinyinitrd () {
32 # Modify our init file so the user knows we drop to shell prompt on purpose
33 newinit = None
34 with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
35 newinit = init.read()
36 newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
37 with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
38 init.write(newinit)
39}
40
41IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042
43QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"