Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 282626 - sys-fs/cryptsetup don't require specifying loop device for loop file based mappings
Summary: sys-fs/cryptsetup don't require specifying loop device for loop file based ma...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-24 23:38 UTC by Zeev Tarantov
Modified: 2015-04-12 22:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
the patch (cryptsetup.patch,2.61 KB, patch)
2009-08-24 23:38 UTC, Zeev Tarantov
Details | Diff
fixed names of files in patch (cryptsetup.patch,2.65 KB, patch)
2009-08-25 00:10 UTC, Zeev Tarantov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zeev Tarantov 2009-08-24 23:38:04 UTC
Currently if I want to map an encrypted filesystem that resides in a file rather than a partition, I have to specify which /dev/loopX device the mapping should use. Suppose I have 10 such files, but only use them one at a time. I'd still need to have 10 loop devices (default is 8). There is no reason to statically allocate those, because losetup can automatically use the next available one.

I submit a patch to dm-crypt-start.sh which, when "source" is unspecified but "loop_file" is specified, maps the file to the next available loop device (-f option to losetup), gets the device's name, and proceeds as if that device was specified as "source".

I submit a patch to dm-crypt-stop.sh which, instead of grepping all the sources, checking which ones are loop devices, and unmapping them, looks for loop_files, finds out which are currently mapped to loop devices (-j option to losetup), and unmaps those devices.

Also the example conf file is changed to add a comment about this feature.

The patched files are static files in the portage tree.

This change is backwards compatible with configurations that do specify "source" and more user friendly. In cases of many mappings some of which are not always used, the difference is substantial.

Reproducible: Always




Please apply.
Comment 1 Zeev Tarantov 2009-08-24 23:38:31 UTC
Created attachment 202208 [details, diff]
the patch
Comment 2 Zeev Tarantov 2009-08-25 00:10:51 UTC
Created attachment 202211 [details, diff]
fixed names of files in patch

The patch itself was right, but I named the files wrong. Oops.
Comment 3 SpanKY gentoo-dev 2015-04-12 22:04:26 UTC
should be all set now in the tree; thanks for the report!

Commit message: Allow loopbacks to be allocated dynamically from a free one
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd?r1=1.7&r2=1.8
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc?r1=1.8&r2=1.9