Replace mount by xorriso (#4)

Because that fucking lxd doesn't want to allow to mount an iso...
This commit is contained in:
Maniack Crudelis 2018-03-01 14:31:59 +01:00 committed by Alexandre Aubin
parent e9605c97fe
commit a1cd1958ba

View file

@ -111,28 +111,10 @@ fi
if is_iso "$file"; then
isotmp="$(mktemp -d)"
tmpmnt="$isotmp/tmpmnt"
buildtree="$isotmp/buildtree"
BUILD_DIR=$(pwd)
mkdir "$tmpmnt"
if am_root; then
MOUNT="mount"
UMOUNT="umount"
elif [ -x /usr/bin/sudo ]; then
echo "Attempting to use sudo to gain mount capabilities..."
MOUNT="sudo mount"
UMOUNT="sudo umount"
else
echo "WARNING: Couldn't find sudo and not running as root." >&2
echo "WARNING: Trying to loopback mount the iso anyway..." >&2
MOUNT="mount"
UMOUNT="umount"
fi
$MOUNT "$file" "$tmpmnt" -o loop
cp -a "$tmpmnt" "$buildtree"
$UMOUNT "$tmpmnt"
rmdir "$tmpmnt"
xorriso -osirrox on -indev "$file" -extract / "$buildtree"
chmod -R u+w "$buildtree"