diff options
| author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-06-15 05:30:42 +0100 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:48:00 +0100 |
| commit | 41e9edcaf36bf2b7d56eee71bee80703176d111e (patch) | |
| tree | 419414862cddb195cb9e18ca0a04703483651b74 /scripts | |
| parent | b456dd1c73f51b706f7e47ef9296cca7ddd51d19 (diff) | |
| download | live-boot-41e9edcaf36bf2b7d56eee71bee80703176d111e.tar.gz live-boot-41e9edcaf36bf2b7d56eee71bee80703176d111e.zip | |
Check losetup capabilities before specifying to mount as read-only.
This is to retain compatibility with Etch's non-loop-aes-utils' losetup.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live | 7 | ||||
| -rw-r--r-- | scripts/live-helpers | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/scripts/live b/scripts/live index 3f39c97..ee363c3 100755 --- a/scripts/live +++ b/scripts/live @@ -1008,7 +1008,12 @@ setup_unionfs () rofslist="${image} ${rofslist}" elif [ -f "${image}" ] then - backdev=$(get_backing_device "${image}" "-r") + if /sbin/losetup --help 2>&1 | grep -q -- "-r\b" + then + backdev=$(get_backing_device "${image}" "-r") + else + backdev=$(get_backing_device "${image}") + fi fstype=$(get_fstype "${backdev}") if [ "${fstype}" = "unknown" ] diff --git a/scripts/live-helpers b/scripts/live-helpers index 02c3e55..20952f3 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -181,7 +181,10 @@ setup_loop () if [ -n ${readonly} ] then - options="${options} -r" + if /sbin/losetup --help 2>&1 | grep -q -- "-r\b" + then + options="${options} -r" + fi fi if [ 0 -lt "${offset}" ] |
