diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2020-04-21 17:19:31 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-04-21 13:03:35 -0700 |
commit | bf41d89325f1135f928f444ddb91163de91f4313 (patch) | |
tree | d3662a29585f0e7150d3e0ea642d0726b75fbc66 /meta-initramfs/recipes-core | |
parent | ff19c7c5694f79271ae26543562e5563d4250559 (diff) | |
download | meta-openembedded-bf41d89325f1135f928f444ddb91163de91f4313.tar.gz |
meta-initramfs: put images and initrdscripts in recipes-core
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-initramfs/recipes-core')
5 files changed, 105 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-core/images/initramfs-debug-image.bb b/meta-initramfs/recipes-core/images/initramfs-debug-image.bb new file mode 100644 index 0000000000..be7350ade2 --- /dev/null +++ b/meta-initramfs/recipes-core/images/initramfs-debug-image.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | # Simple initramfs image. Mostly used for live images. | ||
2 | DESCRIPTION = "Small image capable of booting a device. The kernel includes \ | ||
3 | the Minimal RAM-based Initial Root Filesystem (initramfs), which one can use \ | ||
4 | to check the hardware efficiently." | ||
5 | |||
6 | PACKAGE_INSTALL = "initramfs-debug busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" | ||
7 | |||
8 | # Do not pollute the initrd image with rootfs features | ||
9 | IMAGE_FEATURES = "" | ||
10 | |||
11 | export IMAGE_BASENAME = "initramfs-debug-image" | ||
12 | IMAGE_LINGUAS = "" | ||
13 | |||
14 | LICENSE = "MIT" | ||
15 | |||
16 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | ||
17 | inherit core-image | ||
18 | |||
19 | IMAGE_ROOTFS_SIZE = "8192" | ||
20 | IMAGE_ROOTFS_EXTRA_SPACE = "0" | ||
21 | |||
22 | BAD_RECOMMENDATIONS += "busybox-syslog" | ||
diff --git a/meta-initramfs/recipes-core/images/initramfs-kexecboot-image.bb b/meta-initramfs/recipes-core/images/initramfs-kexecboot-image.bb new file mode 100644 index 0000000000..9a686f366f --- /dev/null +++ b/meta-initramfs/recipes-core/images/initramfs-kexecboot-image.bb | |||
@@ -0,0 +1,26 @@ | |||
1 | SUMMARY = "Initramfs image for kexecboot kernel" | ||
2 | DESCRIPTION = "This image provides kexecboot (linux as bootloader) and helpers." | ||
3 | |||
4 | inherit image | ||
5 | |||
6 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | ||
7 | |||
8 | # avoid circular dependencies | ||
9 | EXTRA_IMAGEDEPENDS = "" | ||
10 | KERNELDEPMODDEPEND = "" | ||
11 | |||
12 | # We really need just kexecboot, kexec and ubiattach | ||
13 | IMAGE_INSTALL = "kexecboot kexec mtd-utils-ubifs" | ||
14 | |||
15 | # Do not pollute the initrd image with rootfs features | ||
16 | IMAGE_FEATURES = "" | ||
17 | |||
18 | IMAGE_LINGUAS = "" | ||
19 | |||
20 | FEED_DEPLOYDIR_BASE_URI = "" | ||
21 | LDCONFIGDEPEND = "" | ||
22 | IMAGE_ROOTFS_EXTRA_SPACE = "0" | ||
23 | |||
24 | # disable runtime dependency on run-postinsts -> update-rc.d | ||
25 | ROOTFS_BOOTSTRAP_INSTALL = "" | ||
26 | |||
diff --git a/meta-initramfs/recipes-core/images/initramfs-kexecboot-klibc-image.bb b/meta-initramfs/recipes-core/images/initramfs-kexecboot-klibc-image.bb new file mode 100644 index 0000000000..3a8d9f7438 --- /dev/null +++ b/meta-initramfs/recipes-core/images/initramfs-kexecboot-klibc-image.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | require initramfs-kexecboot-image.bb | ||
2 | |||
3 | SUMMARY = "Initramfs image for kexecboot kernel (klibc-static binaries)" | ||
4 | |||
5 | # We really need just kexecboot, kexec and ubiattach | ||
6 | # statically compiled against klibc | ||
7 | IMAGE_INSTALL = "kexecboot-klibc kexec-klibc ubiattach-klibc" | ||
8 | |||
9 | python () { | ||
10 | if d.getVar('TARGET_ARCH') == "nios2": | ||
11 | raise bb.parse.SkipRecipe("'nios2' not supported arch") | ||
12 | } | ||
diff --git a/meta-initramfs/recipes-core/initrdscripts/files/init-debug.sh b/meta-initramfs/recipes-core/initrdscripts/files/init-debug.sh new file mode 100644 index 0000000000..7edbd70cb0 --- /dev/null +++ b/meta-initramfs/recipes-core/initrdscripts/files/init-debug.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
4 | |||
5 | do_mount_fs() { | ||
6 | grep -q "$1" /proc/filesystems || return | ||
7 | test -d "$2" || mkdir -p "$2" | ||
8 | mount -t "$1" "$1" "$2" | ||
9 | } | ||
10 | |||
11 | do_mknod() { | ||
12 | test -e "$1" || mknod "$1" "$2" "$3" "$4" | ||
13 | } | ||
14 | |||
15 | mkdir -p /proc | ||
16 | mount -t proc proc /proc | ||
17 | |||
18 | do_mount_fs sysfs /sys | ||
19 | do_mount_fs debugfs /sys/kernel/debug | ||
20 | do_mount_fs devtmpfs /dev | ||
21 | do_mount_fs devpts /dev/pts | ||
22 | do_mount_fs tmpfs /dev/shm | ||
23 | |||
24 | mkdir -p /run | ||
25 | mkdir -p /var/run | ||
26 | |||
27 | do_mknod /dev/console c 5 1 | ||
28 | do_mknod /dev/null c 1 3 | ||
29 | do_mknod /dev/zero c 1 5 | ||
30 | |||
31 | exec sh </dev/console >/dev/console 2>/dev/console | ||
diff --git a/meta-initramfs/recipes-core/initrdscripts/initramfs-debug_1.0.bb b/meta-initramfs/recipes-core/initrdscripts/initramfs-debug_1.0.bb new file mode 100644 index 0000000000..667690f888 --- /dev/null +++ b/meta-initramfs/recipes-core/initrdscripts/initramfs-debug_1.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Extremely basic live image init script" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | SRC_URI = "file://init-debug.sh" | ||
5 | |||
6 | S = "${WORKDIR}" | ||
7 | |||
8 | do_install() { | ||
9 | install -m 0755 ${WORKDIR}/init-debug.sh ${D}/init | ||
10 | } | ||
11 | |||
12 | inherit allarch | ||
13 | |||
14 | FILES_${PN} += " /init " | ||