summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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
commit1fa99dd6372f3da5269640feca4d7bfa156f33f1 (patch)
tree7ad7fc772e73deb38f19bf7bee02a44672f11373
parentf5b918155a028c3f124316a33c5a57558e52cb27 (diff)
downloadliveslak-1fa99dd6372f3da5269640feca4d7bfa156f33f1.tar.gz
liveslak-1fa99dd6372f3da5269640feca4d7bfa156f33f1.tar.xz
isocomp.sh: verify that we can write to the USB partition
-rw-r--r--isocomp.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/isocomp.sh b/isocomp.sh
index a1884df..7a644c3 100644
--- a/isocomp.sh
+++ b/isocomp.sh
@@ -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