aboutsummaryrefslogtreecommitdiff
path: root/util-linux/losetup.c
AgeCommit message (Collapse)Author
2017-03-16mount: create loop devices with LO_FLAGS_AUTOCLEAR flagDenys Vlasenko
The "autolooped" mount (mount [-oloop] IMAGE /DIR/DIR) always creates AUTOCLEARed loopdevs, so that umounting drops them (and this does not require any code in the umount userspace). This happens since circa linux-2.6.25: commit 96c5865559cee0f9cbc5173f3c949f6ce3525581 Date: Wed Feb 6 01:36:27 2008 -0800 Subject: Allow auto-destruction of loop devices IOW: in this case, umount does not have to use -d to drop the loopdev. The explicit loop mount (mount /dev/loopN /DIR/DIR) does not do this. In this case, umount without -d should not drop loopdev. Unfortunately, bbox umount currently always implies -d, this probably needs fixing. function old new delta set_loop 537 597 +60 singlemount 1101 1138 +37 losetup_main 419 432 +13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 110/0) Total: 110 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23Convert all util-linux/* applets to "new style" applet definitionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-27losetup: assorted fixes. Closes 6314Denys Vlasenko
"losetup -d" was not complaining that LOOPDEV is missing. "losetup -a" was listing only up to /dev/loop9. "losetup -f" looped forever if llop0 was taken, and never tried anything after /dev/loop9. "-o" with other options (say, -r) had no effect. function old new delta losetup_main 376 419 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-12losetup: fix util-linux compatibilityMandeep Singh Baines
Added -a support. Also made sure -f works as follows: losetup [-r] [-o offset] {-f|loopdev} file Removed support for 'losetup -r' with no arguments. Signed-off-by: Mandeep Singh Baines <msb@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-12losetup: implement -r option. Closes 4033.Denys Vlasenko
function old new delta packed_usage 28595 28633 +38 losetup_main 285 290 +5 singlemount 906 908 +2 set_loop 674 672 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11move remaining help text from include/usage.src.hPere Orga
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16*: make GNU licensing statement forms more regularDenys Vlasenko
This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-04losetup: use LOOP_foo definesLauri Kasanen
Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-07modprobe: add support for -l and -s. Remove some unsupported optionsPascal Bellard
Fixed some goofs in help text function old new delta modprobe_main 494 653 +159 packed_usage 27129 27145 +16 insmod_main 98 95 -3 Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-19losetup: support /dev/loop10 and higher. closes bug 1627Denys Vlasenko
function old new delta query_loop 91 95 +4 losetup_main 288 285 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2008-07-21- commentary typo fixBernhard Reutner-Fischer
2008-03-23patch: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> (-80 bytes)Denis Vlasenko
*: removal of #include <getopt.h>
2007-12-22perror_nomsg: don't print extra colonDenis Vlasenko
losetup: print name of loop device in error messages
2007-10-11add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-01printf("%s\n") -> puts()Denis Vlasenko
2007-09-26losetup: support -f (Loic Grenie <loic.grenie@gmail.com>)Denis Vlasenko
function old new delta losetup_main 238 278 +40 packed_usage 23021 23027 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 46/0) Total: 46 bytes
2007-08-18don't pass argc in getopt32, it's superfluousDenis Vlasenko
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes text data bss dec hex filename 773469 1058 11092 785619 bfcd3 busybox_old 772644 1058 11092 784794 bf99a busybox_unstripped
2007-05-26usage.c: remove reference to busybox.hDenis Vlasenko
*: s/include "busybox.h"/include "libbb.h"
2007-04-19loop device code: readability improvementDenis Vlasenko
2007-02-03suppress warnings about easch <applet>_main() havingDenis Vlasenko
no preceding prototype
2006-10-08attempt to regularize atoi mess.Denis Vlasenko
2006-10-03getopt_ulflags -> getopt32.Denis Vlasenko
It is impossible to formulate sane ABI based on size of ulong because it can be 32-bit or 64-bit. Basically it means that you cannot portably use more that 32 option chars in one call anyway... Make it explicit.
2006-09-29losetup: use /dev/loopN or /dev/loop/N according to CONFIG_FEATURE_DEVFS=n/yDenis Vlasenko
2006-09-27losetup: with no arguments lists all /dev/loopN. Corrected help text.Denis Vlasenko
(patch by Vladimir Dronnikov <dronnikov@gmail.ru>)
2006-09-22losetup: getopt_ulflags'ification + small fix for perror_nomsgDenis Vlasenko
2006-07-02Standardize on the vi editing directives being on the first line."Robert P. J. Day"
2006-01-25just whitespaceTim Riker
2006-01-13- revert last change for now..Bernhard Reutner-Fischer
2006-01-13this applet needlessly big! TODO: bb_getopt_ulflags()Bernhard Reutner-Fischer
- use atol for the offset, which is always in bytes. Small step in eventually dropping bb_xparse_number().
2005-12-21When you went "losetup -d /dev/loop0 /dev/loop1" the error message was strange.Rob Landley
2005-11-29Fix losetup so that it A) actually works again, B) has much better errorRob Landley
messages, C) can show the current association (if any) when called with only one argument. Update the documentation a lot too. Remind me to add a test suite for this thing. I think I've figured out how to handle root-only testsuites...
2005-08-10Major rewrite of mount, umount, losetup. Untangled lots of code, shrunkRob Landley
things down a bit, fixed a number of funky corner cases, added support for several new features (things like mount --move, mount --bind, lazy unounts, automatic detection of loop mounts, and so on). Probably broke several other things, but it's fixable. (Bang on it, tell me what doesn't work for you...) Note: you no longer need to say "-o loop". It does that for you when necessary. Still need to add "user mount" support, which involves making mount suid. Not too hard to do under the new infrastructure, just haven't done it yet... The previous code had the following notes, that belong in the version control comments: - * 3/21/1999 Charles P. Wright <cpwright@cpwright.com> - * searches through fstab when -a is passed - * will try mounting stuff with all fses when passed -t auto - * - * 1999-04-17 Dave Cinege...Rewrote -t auto. Fixed ro mtab. - * - * 1999-10-07 Erik Andersen <andersen@codepoet.org>. - * Rewrite of a lot of code. Removed mtab usage (I plan on - * putting it back as a compile-time option some time), - * major adjustments to option parsing, and some serious - * dieting all around. - * - * 1999-11-06 mtab support is back - andersee - * - * 2000-01-12 Ben Collins <bcollins@debian.org>, Borrowed utils-linux's - * mount to add loop support. - * - * 2000-04-30 Dave Cinege <dcinege@psychosis.com> - * Rewrote fstab while loop and lower mount section. Can now do - * single mounts from fstab. Can override fstab options for single - * mount. Common mount_one call for single mounts and 'all'. Fixed - * mtab updating and stale entries. Removed 'remount' default. - *
2003-07-30Lars Ekman writes:Eric Andersen
When using "losetup" the device is always setup as Read-Only. (I have only tested with the -o flag, but looking at the code the problem seems general) The problem is the "opt" variable in "losetup.c" that is reused in the "set_loop()" call. Clear it before the call and everything is OK; opt = 0; /* <-------- added line */ if (delete) return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE; else return set_loop (argv[optind], argv[optind + 1], offset, &opt) ? EXIT_FAILURE : EXIT_SUCCESS; } Best Regards, Lars Ekman
2003-03-19Major coreutils update.Manuel Novoa III
2002-03-20* include/applets.h (CONFIG_LOSETUP): New.Matt Kraai
* include/usage.h (losetup_trivial_usage, losetup_full_usage): New. * util-linux/Makefile: Add losetup.o. * util-linux/config.in: Add losetup prompt. * util-linux/losetup.c: New.