mirror of
https://git.yoctoproject.org/poky
synced 2026-02-08 18:02:12 +01:00
Currently VIRTUAL-RUNTIME_dev_manager is defined by some init managers with "??=" and in packagegroup-core-boot with "?=". This means that this variable is different in this package group and in all other the recipes. This was discovered when trying to use new feature INIT_MANAGER when migrating to scarthgap and using systemd distro. After deleting all VIRTUAL_RUNTIME providers defined in init-manager-systemd udev was installed additionally via packagegroup-core-boot. Having a distro settings overriden in single recipe is wrong and needs to be corrected. Therefore let's define the setting in all init managers and remove it from packagegroup-core-boot. core-image-tiny-initramfs has a dilemma - use busybox-mdev even if distro does not enable it in busybox recipe to keep the image tiny, or rather not install it even if distro enables it in busybox. This patch chooses the first option. (From OE-Core rev: 89e2652ac83f2602d6dd60623a225b88dc67d288) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
48 lines
1.9 KiB
BlitzBasic
48 lines
1.9 KiB
BlitzBasic
# Simple initramfs image artifact generation for tiny images.
|
|
SUMMARY = "Tiny image capable of booting a device."
|
|
DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
|
|
the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
|
|
first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
|
|
actually generate an image but rather generates boot and rootfs artifacts \
|
|
that can subsequently be picked up by external image generation tools such as wic."
|
|
|
|
# if distro does not override VIRTUAL-RUNTIME_dev_manager and default in different, busybox is compiled without mdev support
|
|
# however this keeps the image small by not installing heavy-weight manager and in initramfs it may not even be necessary
|
|
# override in distro if needed
|
|
VIRTUAL-RUNTIME_dev_manager ?= "busybox-mdev"
|
|
|
|
PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
|
|
|
|
# Do not pollute the initrd image with rootfs features
|
|
IMAGE_FEATURES = ""
|
|
|
|
IMAGE_NAME_SUFFIX ?= ""
|
|
IMAGE_LINGUAS = ""
|
|
|
|
LICENSE = "MIT"
|
|
|
|
# don't actually generate an image, just the artifacts needed for one
|
|
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
|
|
|
|
inherit core-image
|
|
|
|
IMAGE_ROOTFS_SIZE = "8192"
|
|
IMAGE_ROOTFS_EXTRA_SPACE = "0"
|
|
|
|
# Use the same restriction as initramfs-live-install
|
|
COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux"
|
|
|
|
python tinyinitrd () {
|
|
# Modify our init file so the user knows we drop to shell prompt on purpose
|
|
newinit = None
|
|
with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
|
|
newinit = init.read()
|
|
newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
|
|
with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
|
|
init.write(newinit)
|
|
}
|
|
|
|
IMAGE_PREPROCESS_COMMAND += "tinyinitrd"
|
|
|
|
QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"
|