tar2fs: chgrp and failsafe kpartx
The current state made vm images belong to root group, no reason to not change those to the primary group of the user building an image. kpartx -d -s could fail in some circumstances, make a safety cleanup call more verbose.
This commit is contained in:
parent
209c610f80
commit
aa7f2d8423
@ -138,7 +138,10 @@ exit_handler() {
|
||||
umount ${BOOTFS:+"$BOOTFS"} "$ROOTFS"{/dev,/proc,/sys,}
|
||||
|
||||
if [ -n "$LOOPDEV" ]; then
|
||||
kpartx -d -s "$LOOPDEV"
|
||||
kpartx -d -s "$LOOPDEV" || {
|
||||
sleep 10
|
||||
kpartx -d -s -v "$LOOPDEV"
|
||||
}
|
||||
losetup --detach "$LOOPDEV"
|
||||
fi
|
||||
rm -r -- "$ROOTFS"
|
||||
@ -272,5 +275,5 @@ image=/boot/vmlinuz
|
||||
fi
|
||||
|
||||
if [ -n "$SUDO_USER" ]; then
|
||||
chown "$SUDO_USER" "$IMG" "$ROOTFS" "$WORKDIR"
|
||||
chown "$SUDO_USER:$(id -g "$SUDO_USER")" "$IMG" "$ROOTFS" "$WORKDIR" ||:
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user