mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 12:32:12 +02: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
29
meta/recipes-core/initrdscripts/initramfs-framework/exec
Normal file
29
meta/recipes-core/initrdscripts/initramfs-framework/exec
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user