9990-misc-helpers.sh: allow fs type override in fromiso feature.
authorMihai Moldovan <ionic@ionic.de>
Mon, 8 Mar 2021 05:30:50 +0000 (06:30 +0100)
committerMihai Moldovan <ionic@ionic.de>
Mon, 8 Mar 2021 05:42:29 +0000 (06:42 +0100)
commit9829d8a93e0e602829c09065ad7e776a9f905e23
tree7ac09275672e3299dc81c0cd74e957c68212e8db
parent9d4ad8c0c81275ddf2f1bbfceb105eef78bc8bb7
9990-misc-helpers.sh: allow fs type override in fromiso feature.

The overriding feature can be turned on/used by prefixing the file
system type to the path, separated from the device node with a colon.

Example (good override): ext4:/dev/vda49/path/to/grml.iso

If the file system specification contains any non-alphanumerical
characters other than '-' or '_', it will be treated as part of the
actual path, since, at least currently, all known file systems match
this rule.

Example (no override): cra$$$yf§:/dev/sr0/another_path/to/grml.iso

In the former example, no file system type override is detected, which
means that the code will eventually search for a device called
'cra$$$yf§:/dev/sr0' (which, granted, doesn't make a lot of sense).

Sometimes it's necessary or at least handy to specify the file system
used for mounting the fromiso backing device directly.

For instance, putting the ISO file on a RAID1-backed device will fail to
mount it through autodetection (which, really, in most cases is a good
thing to not corrupt the array).

This change also mounts the backing device read-only, which should
enable safe usage and mounting even on RAID1 devices. Note, though, that
read-only mounts are not really very much "read-only", since they
actually sometimes still change on-disk file system metadata, like the
last time the device was mounted).

This said, it should be safe enough and users can easily re-sync the
array to ensure consistency later on.
components/9990-misc-helpers.sh