live-iso-gnome/los.sh
Ward from fusion-voyager-3 19f63f33a2
Some checks failed
Release Nest NVIDIA amd64-v3 ISO / build (push) Failing after 9m0s
This is ridiclous but i saw it as a solution 5 times in stack overflow
2024-08-11 00:55:03 +03:00

25 lines
496 B
Bash

los() (
img="$1"
dev="$(sudo losetup --show -f -P "$img")"
echo "$dev"
for part in "$dev"?*; do
if [ "$part" = "${dev}p*" ]; then
part="${dev}"
fi
dst="/mnt/$(basename "$part")"
echo "$dst"
sudo mkdir -p "$dst"
sudo mount "$part" "$dst"
done
)
losd() (
dev="/dev/loop$1"
for part in "$dev"?*; do
if [ "$part" = "${dev}p*" ]; then
part="${dev}"
fi
dst="/mnt/$(basename "$part")"
sudo umount "$dst"
done
sudo losetup -d "$dev"
)