mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
initramfs-framework: Add exec module
This new module allow for easy execution of external scripts or applications. It runs anything found in /exec.d directory in order and in case of no scripts to be available, it opens a shell. (From OE-Core rev: 9b98c97338b4c3f985eca572d6a1e21324fa0fbc) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5e82878c5d
commit
72d677b2bd
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (C) 2017 O.S. Systems Software LTDA.
|
||||||
|
# Licensed on MIT
|
||||||
|
|
||||||
|
EXEC_DIR=/exec.d # place to look for modules
|
||||||
|
|
||||||
|
exec_enabled() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
exec_run() {
|
||||||
|
if [ ! -d $EXEC_DIR ]; then
|
||||||
|
msg "No contents to exec in $EXEC_DIR. Starting shell ..."
|
||||||
|
sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load and run modules
|
||||||
|
for m in $EXEC_DIR/*; do
|
||||||
|
# Skip backup files
|
||||||
|
if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug "Starting $m"
|
||||||
|
|
||||||
|
# process module
|
||||||
|
./$m
|
||||||
|
done
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ PR = "r4"
|
|||||||
inherit allarch
|
inherit allarch
|
||||||
|
|
||||||
SRC_URI = "file://init \
|
SRC_URI = "file://init \
|
||||||
|
file://exec \
|
||||||
file://rootfs \
|
file://rootfs \
|
||||||
file://finish \
|
file://finish \
|
||||||
file://mdev \
|
file://mdev \
|
||||||
@@ -26,6 +27,9 @@ do_install() {
|
|||||||
install -m 0755 ${WORKDIR}/rootfs ${D}/init.d/90-rootfs
|
install -m 0755 ${WORKDIR}/rootfs ${D}/init.d/90-rootfs
|
||||||
install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
|
install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
|
||||||
|
|
||||||
|
# exec
|
||||||
|
install -m 0755 ${WORKDIR}/exec ${D}/init.d/89-exec
|
||||||
|
|
||||||
# mdev
|
# mdev
|
||||||
install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
|
install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
|
||||||
|
|
||||||
@@ -45,6 +49,7 @@ do_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PACKAGES = "${PN}-base \
|
PACKAGES = "${PN}-base \
|
||||||
|
initramfs-module-exec \
|
||||||
initramfs-module-mdev \
|
initramfs-module-mdev \
|
||||||
initramfs-module-udev \
|
initramfs-module-udev \
|
||||||
initramfs-module-e2fs \
|
initramfs-module-e2fs \
|
||||||
@@ -62,6 +67,10 @@ FILES_${PN}-base = "/init /init.d/99-finish /dev"
|
|||||||
# and mounts the rootfs. Then 90-rootfs will proceed immediately.
|
# and mounts the rootfs. Then 90-rootfs will proceed immediately.
|
||||||
RRECOMMENDS_${PN}-base += "initramfs-module-rootfs"
|
RRECOMMENDS_${PN}-base += "initramfs-module-rootfs"
|
||||||
|
|
||||||
|
SUMMARY_initramfs-module-exec = "initramfs support for easy execution of applications"
|
||||||
|
RDEPENDS_initramfs-module-exec = "${PN}-base"
|
||||||
|
FILES_initramfs-module-exec = "/init.d/89-exec"
|
||||||
|
|
||||||
SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
|
SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
|
||||||
RDEPENDS_initramfs-module-mdev = "${PN}-base busybox-mdev"
|
RDEPENDS_initramfs-module-mdev = "${PN}-base busybox-mdev"
|
||||||
FILES_initramfs-module-mdev = "/init.d/01-mdev"
|
FILES_initramfs-module-mdev = "/init.d/01-mdev"
|
||||||
|
|||||||
Reference in New Issue
Block a user