summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Perttilä <jormangeud@gmail.com>2018-10-26 19:40:02 +0300
committerIru Cai (vimacs) <mytbk920423@gmail.com>2018-11-03 11:05:34 +0800
commitf3daf974bbcf3bd548bdd6e94bbf1289b33200df (patch)
tree16955403999773ece860ff1ef787d5d1d93babcf
parent04275b2d0effdc049b5f0048134813c485c0f8f1 (diff)
downloadliveusb-builder-f3daf974bbcf3bd548bdd6e94bbf1289b33200df.tar.xz
Let udevil define ISOMNT instead of hard-coding.
/etc/udevil/udevil.conf defines "allowed_media_dirs" that may not include /media. This should figure out which loop device got used and where it was mounted.
-rw-r--r--functions.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/functions.sh b/functions.sh
index 158be0b..efb27a4 100644
--- a/functions.sh
+++ b/functions.sh
@@ -44,7 +44,7 @@ process_distro() {
# FIXME
# As a workaround, now we set $ISOFILE before using this function.
# Maybe we have a better solution for this.
- ISOMNT="/media/$ISOFILE"
+ # ISOMNT="/media/$ISOFILE"
}
gen_grubcfg() {
@@ -95,11 +95,19 @@ download_iso() {
}
mount_iso() {
- if findmnt "$ISOMNT" > /dev/null
+ LOOPDEV=$(/sbin/losetup -n -O NAME -j "$ISOPATH/$ISOFILE")
+ if [[ -n "$LOOPDEV" ]]
then
+ ISOMNT="$LOOPDEV"
umount_iso
fi
- udevil mount "$ISOPATH/$ISOFILE" "$ISOMNT"
+
+ udevil mount "$ISOPATH/$ISOFILE"
+ LOOPDEV=$(/sbin/losetup -n -O NAME -j "$ISOPATH/$ISOFILE")
+ if [[ -n "$LOOPDEV" ]]
+ then
+ ISOMNT=$(findmnt -n -o TARGET "$LOOPDEV")
+ fi
}
umount_iso() {