From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- .../recipes-bsp/images/initramfs-debug-image.bb | 22 ++++++++ .../images/initramfs-kexecboot-image.bb | 28 +++++++++ .../images/initramfs-kexecboot-klibc-image.bb | 12 ++++ .../recipes-bsp/initrdscripts/files/init-debug.sh | 31 ++++++++++ .../initrdscripts/initramfs-debug_1.0.bb | 14 +++++ .../recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm | 43 ++++++++++++++ .../recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb | 66 ++++++++++++++++++++++ .../recipes-bsp/kexecboot/kexecboot_git.bb | 30 ++++++++++ 8 files changed, 246 insertions(+) create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb create mode 100644 external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb (limited to 'external/meta-openembedded/meta-initramfs/recipes-bsp') diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb new file mode 100644 index 00000000..be7350ad --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb @@ -0,0 +1,22 @@ +# Simple initramfs image. Mostly used for live images. +DESCRIPTION = "Small image capable of booting a device. The kernel includes \ +the Minimal RAM-based Initial Root Filesystem (initramfs), which one can use \ +to check the hardware efficiently." + +PACKAGE_INSTALL = "initramfs-debug busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "initramfs-debug-image" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +BAD_RECOMMENDATIONS += "busybox-syslog" diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb new file mode 100644 index 00000000..2573eb48 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb @@ -0,0 +1,28 @@ +SUMMARY = "Initramfs image for kexecboot kernel" +DESCRIPTION = "This image provides kexecboot (linux as bootloader) and helpers." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit image + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +# avoid circular dependencies +EXTRA_IMAGEDEPENDS = "" +KERNELDEPMODDEPEND = "" + +# We really need just kexecboot, kexec and ubiattach +IMAGE_INSTALL = "kexecboot kexec mtd-utils-ubifs" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +IMAGE_LINGUAS = "" + +FEED_DEPLOYDIR_BASE_URI = "" +LDCONFIGDEPEND = "" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +# disable runtime dependency on run-postinsts -> update-rc.d +ROOTFS_BOOTSTRAP_INSTALL = "" + diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb new file mode 100644 index 00000000..3a8d9f74 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb @@ -0,0 +1,12 @@ +require initramfs-kexecboot-image.bb + +SUMMARY = "Initramfs image for kexecboot kernel (klibc-static binaries)" + +# We really need just kexecboot, kexec and ubiattach +# statically compiled against klibc +IMAGE_INSTALL = "kexecboot-klibc kexec-klibc ubiattach-klibc" + +python () { + if d.getVar('TARGET_ARCH') == "nios2": + raise bb.parse.SkipRecipe("'nios2' not supported arch") +} diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh b/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh new file mode 100644 index 00000000..7edbd70c --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +do_mount_fs() { + grep -q "$1" /proc/filesystems || return + test -d "$2" || mkdir -p "$2" + mount -t "$1" "$1" "$2" +} + +do_mknod() { + test -e "$1" || mknod "$1" "$2" "$3" "$4" +} + +mkdir -p /proc +mount -t proc proc /proc + +do_mount_fs sysfs /sys +do_mount_fs debugfs /sys/kernel/debug +do_mount_fs devtmpfs /dev +do_mount_fs devpts /dev/pts +do_mount_fs tmpfs /dev/shm + +mkdir -p /run +mkdir -p /var/run + +do_mknod /dev/console c 5 1 +do_mknod /dev/null c 1 3 +do_mknod /dev/zero c 1 5 + +exec sh /dev/console 2>/dev/console diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb new file mode 100644 index 00000000..667690f8 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "Extremely basic live image init script" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SRC_URI = "file://init-debug.sh" + +S = "${WORKDIR}" + +do_install() { + install -m 0755 ${WORKDIR}/init-debug.sh ${D}/init +} + +inherit allarch + +FILES_${PN} += " /init " diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm new file mode 100644 index 00000000..6e6fd776 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg/icon.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static char * icon_xpm[] = { +"32 32 8 1", +" c None", +". c #D6DBDE", +"+ c #9BA6AE", +"@ c #60727D", +"# c #B8BFC5", +"$ c #A9E8F6", +"% c #12BCE4", +"& c #57D2EC", +" ", +" ", +" ", +" .++@@@@++. ", +" +@@@@@@@@@@@@+ ", +" #@@@@@@@@@@@@@@@@# ", +" +@@@@@@@@@@@@@@@@@@+ ", +" .@@@@@@@@++##+@@@@@@@@@. ", +" @@@@@@@. .@@@@@@@ ", +" +@@@@@+ $$$$ #@@@@@+ ", +" #@@@@@. $%%%%%%%%$ .@@@@@# ", +" @@@@@. &%%%%%%%%%%& .@@@@@ ", +" #@@@@+ %%%%%%%%%%%%%% +@@@@# ", +" @@@@@ &%%%%%%%%%%%%%%& @@@@@ ", +".@@@@. $%%%%%& $%%%%%& .@@@@.", +"+@@@@ %%%%% $%%%%%& @@@@+", +"+@@@+ %%%%$ $%%%%%& $$ +@@@+", +"@@@@+ $%%%% $%%%%%& $%$ +@@@@", +"@@@@# &%%%& &%%%%& $%%& #@@@@", +"@@@@. &%%%& %%%%& $%%%& .@@@@", +"@@@@# $%%%& &%%& &%%%$ #@@@@", +"+@@@+ $%%%% %%%%$ +@@@+", +"+@@@@ %%%%& &%%%% @@@@+", +"#@@@@ &%%%%& &%%%%& @@@@#", +" @@@@+ %%%%%%&$$&%%%%%% +@@@@ ", +" +@@@@. $%%%%%%%%%%%%%%$ .@@@@+ ", +" .@@@@@ $%%%%%%%%%%%%$ @@@@@. ", +" #++++. &%%%%%%%%& .++++# ", +" $&&%%&&$ ", +" ", +" ", +" "}; diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb new file mode 100644 index 00000000..f90e2344 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb @@ -0,0 +1,66 @@ +SUMMARY = "Configuration files for kexecboot" +DESCRIPTION = "Default icon and boot.cfg for kexecboot linux-as-bootloader." +SECTION = "base" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://icon.xpm" + +S = "${WORKDIR}" + +do_install_prepend () { +echo '# /boot/boot.cfg - KEXECBOOT configuration file. +# +# First kernel stanza. +# Show this label in kexecboot menu. +# +LABEL=${KEXECBOOT_LABEL} +# +# Specify full kernel path on target. +KERNEL=/boot/${KERNEL_IMAGETYPE} +# +# Specify which device tree blob to use +# DTB=/boot/my-own-dtb +# +# Append this tags to the kernel cmdline. +APPEND=${CMDLINE} ${CMDLINE_DEBUG} +# +# Overwrite kernel command line instead of appending to it +# CMDLINE=console=/dev/tty0 root=/dev/sdb1 +# +# Specify optional initrd/initramfs. +# INITRD=/boot/initramfs.cpio.gz +# +# Specify full path for a custom icon for the menu-item. +# If not set, use device-icons as default (NAND, SD, CF, ...). +# ICON=/boot/icon.xpm +# +# Priority of item in kexecboot menu. +# Items with highest priority will be shown at top of menu. +# Default: 0 (lowest, ordered by device ordering) +# PRIORITY=10 +# +# +# Second kernel stanza. +# LABEL=${KEXECBOOT_LABEL}-test +# KERNEL=/boot/${KERNEL_IMAGETYPE}-test +# APPEND=${CMDLINE} +#' > ${S}/boot.cfg +} +do_install () { + install -d ${D}/boot + install -m 0644 boot.cfg ${D}/boot/boot.cfg + install -m 0644 icon.xpm ${D}/boot/icon.xpm +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} += "/boot/*" + +CMDLINE ?= "" +CMDLINE_DEBUG ?= "quiet" + +INHIBIT_DEFAULT_DEPS = "1" + +# Note: for qvga the label is currently limited to about 24 chars +KEXECBOOT_LABEL ?= "${@d.getVar('DISTRO') or d.getVar('DISTRO_VERSION')}-${MACHINE}" diff --git a/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb new file mode 100644 index 00000000..6d79e8f8 --- /dev/null +++ b/external/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb @@ -0,0 +1,30 @@ +SUMMARY = "kexecboot linux-as-bootloader" +DESCRIPTION = "kexecboot is a graphical linux-as-bootloader implementation based on kexec." +HOMEPAGE = "http://kexecboot.org" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +PV = "0.6+git${SRCPV}" +S = "${WORKDIR}/git" +SRC_URI = "git://github.com/kexecboot/kexecboot.git" +SRCREV = "4c01d6960aa6a9d03675605062469ab777fa2b01" +inherit autotools + +EXTRA_OECONF = "--enable-textui --enable-delay=2 --enable-evdev-rate=1000,250" + +do_install () { + install -D -m 0755 ${B}/src/kexecboot ${D}${bindir}/kexecboot + install -d ${D}/proc + install -d ${D}/mnt + install -d ${D}/dev + install -d ${D}/sys +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} += " ${bindir}/kexecboot /init /proc /mnt /dev /sys" + +pkg_postinst_${PN} () { + ln -sf ${bindir}/kexecboot $D/init +} + +BBCLASSEXTEND = "klibc" -- cgit 1.2.3-korg