Skip to content

Commit

Permalink
grml-live: use xorriso instead of mount -o loop in -e mode
Browse files Browse the repository at this point in the history
mount -o loop is disabled in our new build environment, so avoid that
and use xorriso (actually, osirrox) to extract the squashfs file from
the ISO.
  • Loading branch information
zeha committed Nov 22, 2024
1 parent fac2da0 commit 446c587
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -637,32 +637,32 @@ extract_iso() {
if [ -n "$EXTRACT_ISO_NAME" ]; then
log "Unpacking ISO from ${EXTRACT_ISO_NAME}"
einfo "Unpacking ISO from ${EXTRACT_ISO_NAME}"
local mountpoint=$(mktemp -d)
local tempdir=$(mktemp -d)
local rc=0
mount -o loop "${EXTRACT_ISO_NAME}" "$mountpoint" ; rc=$?
mkdir -p "${tempdir}/live/"
osirrox -indev "${EXTRACT_ISO_NAME}" -extract live "${tempdir}/live/"
if [ "$rc" != 0 ]; then
rmdir "$mountpoint"
log "mount failed"
eerror "mount failed"
rm -r "$tempdir"
log "osirrox failed"
eerror "osirrox failed"
eend 1
bailout 1
fi

if ls "${mountpoint}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then # ISOs >=2011.12
log "Using ${mountpoint}/live/*/*.squashfs for unsquashfs"
if ls "${tempdir}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then # ISOs >=2011.12
log "Using ${tempdir}/live/*/*.squashfs for unsquashfs"
unsquashfs -d "${CHROOT_OUTPUT}" "${mountpoint}"/live/*/*.squashfs ; rc=$?
elif ls "${mountpoint}"/live/*.squashfs 2>/dev/null | grep -q . ; then # ISOs before 2011.12
log "Using ${mountpoint}/live/*.squashfs for unsquashfs"
unsquashfs -d "${CHROOT_OUTPUT}" "${mountpoint}"/live/*.squashfs ; rc=$?
elif ls "${tempdir}"/live/*.squashfs 2>/dev/null | grep -q . ; then # ISOs before 2011.12
log "Using ${tempdir}/live/*.squashfs for unsquashfs"
unsquashfs -d "${CHROOT_OUTPUT}" "${tempdir}"/live/*.squashfs ; rc=$?
else
log "Error: Could not find any *.squashfs files on the ISO"
eerror "Error: Could not find any *.squashfs files on the ISO"
eend 1
bailout 1
fi

umount "$mountpoint"
rmdir "$mountpoint"
rm -r "$tempdir"
if [ "$rc" != 0 ]; then
log "unsquashfs failed"
eerror "unsquashfs failed"
Expand Down

0 comments on commit 446c587

Please sign in to comment.