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 23, 2024
1 parent 3634663 commit 7a56ca0
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -637,32 +637,29 @@ 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/" ; rc=$?
if [ "$rc" != 0 ]; then
rmdir "$mountpoint"
log "mount failed"
eerror "mount failed"
rm -rf "$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"
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=$?
if ls "${tempdir}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then
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 -rf "$tempdir"
if [ "$rc" != 0 ]; then
log "unsquashfs failed"
eerror "unsquashfs failed"
Expand Down

0 comments on commit 7a56ca0

Please sign in to comment.