Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | # Simple initramfs image artifact generation for tiny images. |
| 2 | DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \ |
| 3 | the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 4 | first 'init' program more efficiently. core-image-tiny-initramfs doesn't \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | actually generate an image but rather generates boot and rootfs artifacts \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | that can subsequently be picked up by external image generation tools such as wic." |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | VIRTUAL-RUNTIME_dev_manager ?= "busybox-mdev" |
| 9 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 10 | PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | |
| 12 | # Do not pollute the initrd image with rootfs features |
| 13 | IMAGE_FEATURES = "" |
| 14 | |
| 15 | export IMAGE_BASENAME = "core-image-tiny-initramfs" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 16 | IMAGE_NAME_SUFFIX ?= "" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 17 | IMAGE_LINGUAS = "" |
| 18 | |
| 19 | LICENSE = "MIT" |
| 20 | |
| 21 | # don't actually generate an image, just the artifacts needed for one |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | |
| 24 | inherit core-image |
| 25 | |
| 26 | IMAGE_ROOTFS_SIZE = "8192" |
| 27 | IMAGE_ROOTFS_EXTRA_SPACE = "0" |
| 28 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 29 | # Use the same restriction as initramfs-live-install |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 30 | COMPATIBLE_HOST = "(i.86|x86_64|aarch64).*-linux" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 31 | |
| 32 | python 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 | |
| 42 | IMAGE_PREPROCESS_COMMAND += "tinyinitrd;" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 43 | |
| 44 | QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init" |