-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #697 from lumag/honister-initramfs-rootfs-image
Backport initramfs-rootfs-image to the honister branch
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
DESCRIPTION = "Ramdisk image for pivoting into rootfs" | ||
|
||
PACKAGE_INSTALL = " \ | ||
base-passwd \ | ||
initramfs-module-copy-modules \ | ||
initramfs-module-rootfs \ | ||
initramfs-module-udev \ | ||
${VIRTUAL-RUNTIME_base-utils} \ | ||
${MACHINE_ESSENTIAL_EXTRA_RDEPENDS} \ | ||
${ROOTFS_BOOTSTRAP_INSTALL} \ | ||
" | ||
|
||
# Do not pollute the initrd image with rootfs features | ||
IMAGE_FEATURES = "debug-tweaks" | ||
IMAGE_LINGUAS = "" | ||
|
||
LICENSE = "MIT" | ||
|
||
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | ||
inherit core-image | ||
|
||
IMAGE_ROOTFS_SIZE = "8192" | ||
IMAGE_ROOTFS_EXTRA_SPACE = "0" | ||
|
||
# Exclude all kernel images from the rootfs | ||
PACKAGE_EXCLUDE = "kernel-image-*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# Copyright (C) 2022 Linaro Ltd. | ||
# Licensed on MIT | ||
|
||
copy_modules_enabled() { | ||
[ -n "${bootparam_copy_modules}" -a -d /lib/modules/`uname -r` ] | ||
} | ||
|
||
copy_modules_run() { | ||
if [ -n "$ROOTFS_DIR" ]; then | ||
rm -rf $ROOTFS_DIR/lib/modules/`uname -r` | ||
mkdir -p $ROOTFS_DIR/lib/modules | ||
cp -a /lib/modules/`uname -r` $ROOTFS_DIR/lib/modules | ||
else | ||
debug "No rootfs has been set" | ||
fi | ||
} |
15 changes: 15 additions & 0 deletions
15
recipes-support/initrdscripts/initramfs-module-copy-modules_1.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SUMMARY = "initramfs-framework module for copying kernel modules from initramfs to rootfs" | ||
LICENSE = "MIT" | ||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
RDEPENDS:${PN} = "initramfs-framework-base ${VIRTUAL-RUNTIME_base-utils}" | ||
|
||
SRC_URI = "file://copy-modules.sh" | ||
|
||
S = "${WORKDIR}" | ||
|
||
do_install() { | ||
install -d ${D}/init.d | ||
install -m 0755 ${WORKDIR}/copy-modules.sh ${D}/init.d/95-copy_modules | ||
} | ||
|
||
FILES:${PN} = "/init.d/" |