summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile.am3
-rw-r--r--utils/hooks/30-dtb-updates.c2
-rw-r--r--utils/pb-console6
-rwxr-xr-xutils/pb-exec13
-rwxr-xr-xutils/pb-plugin4
5 files changed, 19 insertions, 9 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am
index a523430..8788150 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -18,7 +18,8 @@ dist_pkglibexec_SCRIPTS = utils/pb-console
sbin_PROGRAMS += utils/pb-event utils/pb-config
utils_pb_config_LDADD = $(top_builddir)/lib/libpbcore.la \
- $(top_builddir)/discover/platform.ro
+ $(top_builddir)/discover/platform.ro \
+ $(ELF_LIBS)
utils_hooks_30_dtb_updates_SOURCES = utils/hooks/30-dtb-updates.c
utils_hooks_30_dtb_updates_LDADD = $(top_builddir)/lib/libpbcore.la \
diff --git a/utils/hooks/30-dtb-updates.c b/utils/hooks/30-dtb-updates.c
index b8413fd..2d30c40 100644
--- a/utils/hooks/30-dtb-updates.c
+++ b/utils/hooks/30-dtb-updates.c
@@ -605,7 +605,7 @@ out:
int main(void)
{
struct offb_ctx *ctx;
- int rc;
+ int rc = 0;
ctx = talloc_zero(NULL, struct offb_ctx);
diff --git a/utils/pb-console b/utils/pb-console
index 5ba98cc..012d242 100644
--- a/utils/pb-console
+++ b/utils/pb-console
@@ -119,10 +119,8 @@ esac
# we may have been run from udev - ensure we have a sensible PATH
if [ -z "$PATH" ]
then
- PATH=/usr/bin:/usr/sbin:/bin:/sbin
+ export PATH=/usr/bin:/usr/sbin:/bin:/sbin
fi
-PATH=/var/lib/pb-plugins/bin:$PATH
-export PATH
verbose_opt=
if $pb_config debug | grep -q enabled
@@ -141,5 +139,5 @@ while :
do
$ui $verbose_opt
reset
- $shell
+ $shell -ml
done
diff --git a/utils/pb-exec b/utils/pb-exec
index bfe13f6..d672ec1 100755
--- a/utils/pb-exec
+++ b/utils/pb-exec
@@ -1,7 +1,18 @@
#!/bin/sh
+PREFIX=""
+
+# Check if root required
+if [[ "$(id -u)" != "0" ]]; then
+ read -n 1 -r -p "Running as user $(id -un), run as root? (y/N)" key
+ if [ "$key" == "y" ]; then
+ PREFIX="sudo"
+ fi
+ printf "\n"
+fi
+
# Run a program specified by Petitboot.
-$@
+$PREFIX $@
echo "$0 ran '$@'"
# Wait for the user to exit back to Petitboot.
diff --git a/utils/pb-plugin b/utils/pb-plugin
index a42d051..45bf19d 100755
--- a/utils/pb-plugin
+++ b/utils/pb-plugin
@@ -232,8 +232,8 @@ do_install()
done
pb-event plugin@local \
- name=$PLUGIN_NAME id=$PLUGIN_ID version=$PLUGIN_VERSION \
- vendor=$PLUGIN_VENDOR vendor_id=$PLUGIN_VENDOR_ID \
+ name="$PLUGIN_NAME" id=$PLUGIN_ID version=$PLUGIN_VERSION \
+ vendor="$PLUGIN_VENDOR" vendor_id=$PLUGIN_VENDOR_ID \
date=$PLUGIN_DATE executables="$PLUGIN_EXECUTABLES" \
source_file=$url installed="yes"
OpenPOWER on IntegriCloud