exec cli strings as commands on init

This commit is contained in:
Ciro Santilli
2018-02-09 23:26:58 +00:00
parent fc168d6eb5
commit 0a1a600d49
3 changed files with 14 additions and 3 deletions

View File

@@ -132,7 +132,15 @@ When debugging a module, it becomes tedious to wait for build and re-type:
every time.
Instead, you can add your test commands to:
Instead, you can either run them from a minimal init:
./run -e 'init=/eval.sh - lkmc_eval="insmod /hello.ko;/poweroff.out"' -n
or run them at the end of the BusyBox init, which does things like setting up networking:
./run -e '- lkmc_eval="insmod /hello.ko;wget -S google.com;poweroff.out;"'
or add them to a new `init.d` entry:
cp rootfs_overlay/etc/init.d/S98 rootfs_overlay/etc/init.d/S99
vim S99

View File

@@ -1,6 +1,7 @@
#!/bin/sh
# For temparary test commands, first copy this file to to
# S99 which is already gitignored.
echo 'S98'
# insmod /hello.ko
if [ -n "$lkmc_eval" ]; then
eval "$lkmc_eval"
fi
exit 0

2
rootfs_overlay/eval.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
eval "$lkmc_eval"