Skip to content

Commit

Permalink
Check losetup capabilities before specifying to mount as read-only.
Browse files Browse the repository at this point in the history
This is to retain compatibility with Etch's non-loop-aes-utils' losetup.

Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
  • Loading branch information
lamby committed Jun 15, 2008
1 parent 71a83d7 commit 824751b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/live
Expand Up @@ -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" ]
Expand Down
5 changes: 4 additions & 1 deletion scripts/live-helpers
Expand Up @@ -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}" ]
Expand Down

0 comments on commit 824751b

Please sign in to comment.