]> git.ozlabs.org Git - petitboot/commitdiff
pb-plugin: Move plugin wrappers to a separate dir
authorJeremy Kerr <jk@ozlabs.org>
Thu, 27 Aug 2015 08:33:32 +0000 (16:33 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 27 Aug 2015 08:33:32 +0000 (16:33 +0800)
Use /var/lib/pb-plugins/bin, to prevent overwriting system binaries.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
utils/pb-console
utils/pb-plugin

index 36b9c034e51af0eeaae7b54a03b5ed323798d5dc..5f8ffa6f3ef130ec8ff52d3a69e9daaf094c34c5 100644 (file)
@@ -107,7 +107,7 @@ esac
 # we may have been run from udev - ensure we have a sensible PATH
 if [ -z "$PATH" ]
 then
 # we may have been run from udev - ensure we have a sensible PATH
 if [ -z "$PATH" ]
 then
-       PATH=/usr/bin:/usr/sbin:/bin:/sbin
+       PATH=/var/lib/pb-plugins/bin:/usr/bin:/usr/sbin:/bin:/sbin
 fi
 export PATH
 
 fi
 export PATH
 
index 598530a66e7a7f5581649a2f76088c94e13abbad..1f8a5915960f87fda02fac85ed47fa6616516c34 100755 (executable)
@@ -7,7 +7,7 @@ plugin_file=pb-plugin.cpio.gz
 plugin_meta=pb-plugin.conf
 plugin_meta_dir=etc/preboot-plugins/
 plugin_meta_path=$plugin_meta_dir$plugin_meta
 plugin_meta=pb-plugin.conf
 plugin_meta_dir=etc/preboot-plugins/
 plugin_meta_path=$plugin_meta_dir$plugin_meta
-plugin_wrapper_dir=/usr/bin
+plugin_wrapper_dir=/var/lib/pb-plugins/bin
 
 usage()
 {
 
 usage()
 {
@@ -98,6 +98,8 @@ __create_wrapper()
        binary=$2
        wrapper=$plugin_wrapper_dir/$(basename $binary)
 
        binary=$2
        wrapper=$plugin_wrapper_dir/$(basename $binary)
 
+       mkdir -p $plugin_wrapper_dir
+
        cat <<EOF > $wrapper
 #!/bin/sh
 
        cat <<EOF > $wrapper
 #!/bin/sh