aboutgitcode
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-05-10 18:07:47 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-05-10 18:07:47 +0200
commitdf100318909313694b45ee00983c014b2fd3bbeb (patch)
treeadfdc6aa1d66da4688293dfc89bd73241078a98b
parent2de05069d2d8195d75790bb392e5825c34ed3f36 (diff)
downloadmbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar.gz
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar.bz2
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar.lz
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar.xz
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.tar.zst
mbuto-df100318909313694b45ee00983c014b2fd3bbeb.zip
mbuto: Add /usr/local/sbin to PATH, in pre-init script and on fakeroot call
Otherwise, we'll source executables from /sbin or /usr/sbin first, which is of course not desirable. While at it, remove a mostly duplicated definition of FIXUP for the kselftests profile, so that we just need to fix this in the first FIXUP block. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xmbuto26
1 files changed, 4 insertions, 22 deletions
diff --git a/mbuto b/mbuto
index 20427ad..b4a7cc0 100755
--- a/mbuto
+++ b/mbuto
@@ -51,7 +51,7 @@ THREADS="$(nproc)"
# Fix-up script to run before /init, can be omitted
[ -z "${FIXUP}" ] && FIXUP='#!/bin/sh
-export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
+export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin:
mount -t proc proc /proc
mount -t sysfs sys /sys
@@ -285,26 +285,7 @@ profile_kselftests() {
[ ! -z "${SUBOPT_collection}" ] && __run_args="-c ${SUBOPT_collection}"
[ ! -z "${SUBOPT_test}" ] && __run_args="${__run_args} -t ${SUBOPT_test}"
- FIXUP='#!/bin/sh
-
- export PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
- mount -t proc proc /proc
- mount -t sysfs sys /sys
-
- mount -t devtmpfs dev /dev
-
- mkdir /dev/pts
- mount -t devpts pts /dev/pts
-
- mkdir -p /sys/kernel/debug
- mount -t debugfs debug /sys/kernel/debug
-
- # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968199
- ln -sf /proc/self/fd /dev/fd
- ln -sf /dev/fd/0 /dev/stdin
- ln -sf /dev/fd/1 /dev/stdout
- ln -sf /dev/fd/2 /dev/stderr
+ FIXUP="${FIXUP}"'
set +m
:> /etc/fstab
@@ -1206,7 +1187,8 @@ if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ "$(id -u)" -ne 0 ]; then
if ! FAKEROOT="$(command -v fakeroot)"; then
__fakeroot_missing="y"
else
- PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" "${@}"
+ PATH="${PATH}:/usr/local/sbin:/sbin:/usr/sbin" \
+ "${FAKEROOT}" "${0}" "${@}"
exit ${?}
fi
fi