diff options
author | Eric Hameleers <alien@slackware.com> | 2022-08-19 11:59:05 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2022-08-19 11:59:05 +0200 |
commit | 1fa99dd6372f3da5269640feca4d7bfa156f33f1 (patch) | |
tree | 7ad7fc772e73deb38f19bf7bee02a44672f11373 /isocomp.sh | |
parent | f5b918155a028c3f124316a33c5a57558e52cb27 (diff) | |
download | liveslak-1fa99dd6372f3da5269640feca4d7bfa156f33f1.tar.gz liveslak-1fa99dd6372f3da5269640feca4d7bfa156f33f1.tar.xz |
isocomp.sh: verify that we can write to the USB partition
Diffstat (limited to 'isocomp.sh')
-rw-r--r-- | isocomp.sh | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -643,6 +643,20 @@ USBPFREE=$(get_part_mb_free ${USBMNT}) VERSION=$(isoinfo -d -i "${SLISO}" 2>/dev/null |grep Application |cut -d: -f2-) echo "--- The ISO on medium '${USBPART}' is '${VERSION}'" +# Try a write to the partition: +if touch ${USBMNT}/.rwtest 2>/dev/null && rm ${USBMNT}/.rwtest 2>/dev/null +then + echo "--- The medium '${USBPART}' is writable." +else + echo "--- Trying to remount readonly medium '${USBPART}' as writable..." + mount -o remount,rw ${USBMNT} + if [ $? -ne 0 ]; then + echo "*** Failed to remount '${USBPART}' writable, unable to continue!" + cleanup + exit 1 + fi +fi + # Create a mount point for the ISO: ISOMNT=$(mktemp -d -p /var/tmp -t alieniso.XXXXXX) if [ ! -d $ISOMNT ]; then |