@@ -333,6 +333,7 @@ DEFINE_HOST_PROG(WGET, wget, [/usr/bin/wget])
DEFINE_HOST_PROG(IP, ip, [/sbin/ip])
DEFINE_HOST_PROG(UDHCPC, udhcpc, [/sbin/udhcpc])
DEFINE_HOST_PROG(PB_PLUGIN, pb-plugin, [/usr/sbin/pb-plugin])
+DEFINE_HOST_PROG(PB_EXEC, pb-exec, [/usr/sbin/pb-exec])
AC_ARG_WITH(
[tftp],
@@ -29,6 +29,7 @@ const struct pb_system_apps pb_system_apps = {
.ip = HOST_PROG_IP,
.udhcpc = HOST_PROG_UDHCPC,
.pb_plugin = HOST_PROG_PB_PLUGIN,
+ .pb_exec = HOST_PROG_PB_EXEC,
};
#ifndef TFTP_TYPE
@@ -14,6 +14,7 @@ struct pb_system_apps {
const char *ip;
const char *udhcpc;
const char *pb_plugin;
+ const char *pb_exec;
};
extern const struct pb_system_apps pb_system_apps;
@@ -12,7 +12,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-dist_sbin_SCRIPTS += utils/pb-udhcpc utils/pb-plugin utils/pb-sos
+dist_sbin_SCRIPTS += utils/pb-udhcpc utils/pb-plugin utils/pb-sos utils/pb-exec
dist_pkglibexec_SCRIPTS = utils/pb-console
sbin_PROGRAMS += utils/pb-event utils/pb-config
new file mode 100755
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Run a program specified by Petitboot. Assume for now this is a single program
+# with no arguments.
+$1
+
+# Wait for the user to exit back to Petitboot.
+while :; do
+ read -r -p "Press ENTER to return to Petitboot" key
+
+ if [ "$key" == "" ]; then
+ echo "Returning to Petitboot.."
+ exit 0
+ fi
+done
Add a small wrapper script for the Petitboot UI to call interactable programs with. The wrapper calls the program and waits for user input before returning to the Petitboot UI. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> --- configure.ac | 1 + lib/system/system.c | 1 + lib/system/system.h | 1 + utils/Makefile.am | 2 +- utils/pb-exec | 15 +++++++++++++++ 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 utils/pb-exec