live-build & sudo : mount privilege
Superuser privilege is required for mount.
Is it advisable to add by ${LB_ROOT_COMMAND} in front of each call to mount ?
Regards,
JH Chatenet
diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks
index dc9c18c..143fce5 100755
--- a/scripts/build/chroot_hooks
+++ b/scripts/build/chroot_hooks
@@ -46,8 +46,8 @@ Create_lockfile .lock
# ro prevents modifications and prevents accidentally removing the
# contents of the config directory when removing the chroot.
mkdir -p chroot/root/config
-mount -o bind config chroot/root/config
-mount -o remount,ro,bind config chroot/root/config
+${LB_ROOT_COMMAND} mount -o bind config chroot/root/config
+${LB_ROOT_COMMAND} mount -o remount,ro,bind config chroot/root/config
# Copying hooks
for _HOOK in ${LB_CHROOT_HOOKS}
@@ -110,6 +110,6 @@ then
fi
# Remove bind mount of build config inside chroot.
-umount chroot/root/config
+${LB_ROOT_COMMAND} umount chroot/root/config
rmdir chroot/root/config
diff --git a/scripts/build/chroot_tmpfs b/scripts/build/chroot_tmpfs
index 009f8c9..306582f 100755
--- a/scripts/build/chroot_tmpfs
+++ b/scripts/build/chroot_tmpfs
@@ -47,7 +47,7 @@ case "${1}" in
mv chroot/var/lib/dpkg chroot/var/lib/dpkg.tmp
mkdir chroot/var/lib/dpkg
- mount -t tmpfs tmpfs chroot/var/lib/dpkg
+ ${LB_ROOT_COMMAND} mount -t tmpfs tmpfs chroot/var/lib/dpkg
mv chroot/var/lib/dpkg.tmp/* chroot/var/lib/dpkg
rm -rf chroot/var/lib/dpkg.tmp
@@ -66,7 +66,7 @@ case "${1}" in
mkdir -p chroot/var/lib/dpkg.tmp
mv chroot/var/lib/dpkg/* chroot/var/lib/dpkg.tmp
- umount chroot/var/lib/dpkg
+ ${LB_ROOT_COMMAND} umount chroot/var/lib/dpkg
rm -rf chroot/var/lib/dpkg
mv chroot/var/lib/dpkg.tmp chroot/var/lib/dpkg
Reply to: