[Pkg-loop-aes-commits] r1519 - in /trunk/loop-aes-utils/debian: changelog patches/00list patches/losetup_add_option_f.dpatch

xam at users.alioth.debian.org xam at users.alioth.debian.org
Fri Aug 22 09:59:16 UTC 2008


Author: xam
Date: Fri Aug 22 09:59:16 2008
New Revision: 1519

URL: http://svn.debian.org/wsvn/pkg-loop-aes/?sc=1&rev=1519
Log:
patches/losetup_add_option_f.dpatch: Added to support
"find next free loop" in losetup. (closes: #495682)

Added:
    trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch   (with props)
Modified:
    trunk/loop-aes-utils/debian/changelog
    trunk/loop-aes-utils/debian/patches/00list

Modified: trunk/loop-aes-utils/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/changelog?rev=1519&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/changelog (original)
+++ trunk/loop-aes-utils/debian/changelog Fri Aug 22 09:59:16 2008
@@ -1,3 +1,10 @@
+loop-aes-utils (2.13.1-4) UNRELEASED; urgency=low
+
+  * patches/losetup_add_option_f.dpatch: Added to support
+    "find next free loop" in losetup. (closes: #495682)
+
+ -- Max Vozeler <xam at debian.org>  Fri, 22 Aug 2008 11:57:17 +0200
+
 loop-aes-utils (2.13.1-3) unstable; urgency=low
 
   * Depend on mount >= 2.13-1 to ensure that its

Modified: trunk/loop-aes-utils/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/patches/00list?rev=1519&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/patches/00list (original)
+++ trunk/loop-aes-utils/debian/patches/00list Fri Aug 22 09:59:16 2008
@@ -1,1 +1,2 @@
 20loop-AES
+losetup_add_option_f

Added: trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch?rev=1519&op=file
==============================================================================
--- trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch (added)
+++ trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch Fri Aug 22 09:59:16 2008
@@ -1,0 +1,118 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## losetup_add_option_f.patch by Max Vozeler <xam at debian.org>
+##
+## DP: Add support for option -f ("find next free loop") which is
+## DP: supported in util-linux-ng proper. See Bug#495682.
+
+ at DPATCH@
+diff -urNad trunk~/mount/lomount.c trunk/mount/lomount.c
+--- trunk~/mount/lomount.c	2008-08-19 20:19:35.000000000 +0200
++++ trunk/mount/lomount.c	2008-08-19 20:19:53.000000000 +0200
+@@ -163,7 +163,6 @@
+ 
+ #define SIZE(a) (sizeof(a)/sizeof(a[0]))
+ 
+-#if !defined(MAIN)
+ char *
+ find_unused_loop_device (void) {
+ 	/* Just creating a device, say in /tmp, is probably a bad idea -
+@@ -205,6 +204,7 @@
+ 	return 0;
+ }
+ 
++#if !defined(MAIN)
+ int is_loop_active(const char *dev, const char *backdev)
+ {
+ 	int fd;
+@@ -1081,12 +1081,13 @@
+   %s -F [options] loop_device [file]   # setup, read /etc/fstab\n\
+   %s loop_device                       # give info\n\
+   %s -a                                # give info of all loops\n\
++  %s -f                                # show next free loop device\n\
+   %s -d loop_device                    # delete\n\
+   %s -R loop_device                    # resize\n\
+ options:  -e encryption  -o offset  -s sizelimit  -p passwdfd  -T  -S pseed\n\
+           -H phash  -I loinit  -K gpgkey  -G gpghome  -C itercountk  -v  -r\n\
+           -P cleartextkey\n"),
+-		progname, progname, progname, progname, progname, progname);
++		progname, progname, progname, progname, progname, progname, progname);
+ 	exit(1);
+ }
+ 
+@@ -1252,7 +1253,8 @@
+ int
+ main(int argc, char **argv) {
+ 	char *partitionName = NULL;
+-	int delete,c,option_a=0,option_F=0,option_R=0,setup_o=0;
++	char *device = NULL;
++	int delete,find,c,option_a=0,option_F=0,option_R=0,setup_o=0;
+ 	int res = 0;
+ 	int ro = 0;
+ 
+@@ -1260,9 +1262,9 @@
+ 	bindtextdomain(PACKAGE, LOCALEDIR);
+ 	textdomain(PACKAGE);
+ 
+-	delete = 0;
++	delete = find = 0;
+ 	progname = argv[0];
+-	while ((c = getopt(argc,argv,"aC:de:FG:H:I:K:o:p:P:rRs:S:Tv")) != -1) {
++	while ((c = getopt(argc,argv,"aC:de:fFG:H:I:K:o:p:P:rRs:S:Tv")) != -1) {
+ 		switch (c) {
+ 		case 'a':		/* show status of all loops */
+ 			option_a = 1;
+@@ -1278,6 +1280,9 @@
+ 			loopEncryptionType = optarg;
+ 			setup_o = 1;
+ 			break;
++		case 'f':		/* find free loop */
++			find = 1;
++			break;
+ 		case 'F':		/* read loop related options from /etc/fstab */
+ 			option_F = 1;
+ 			setup_o = 1;
+@@ -1336,12 +1341,22 @@
+ 			usage();
+ 		}
+ 	}
+-	if (option_a + delete + option_R + setup_o > 1) usage();
++	if (option_a + delete + option_R + setup_o + find > 1) usage();
+ 	if (option_a) {
+ 		/* show all loops */
+ 		if (argc != optind) usage();
+ 		show_all_loops();
+ 		res = 0;
++	} else if (find) {
++		if (argc != optind)
++			usage();
++		device = find_unused_loop_device();
++		if (device == NULL)
++			return -1;
++		if (verbose)
++			printf("Loop device is %s\n", device);
++		printf("%s\n", device);
++		res = 0;
+ 	} else if (delete) {
+ 		/* delete loop */
+ 		if (argc != optind+1) usage();
+diff -urNad trunk~/mount/losetup.8 trunk/mount/losetup.8
+--- trunk~/mount/losetup.8	2008-08-19 20:19:35.000000000 +0200
++++ trunk/mount/losetup.8	2008-08-19 20:19:35.000000000 +0200
+@@ -21,6 +21,8 @@
+ .br
+ .B losetup -a
+ .br
++.B losetup -f
++.br
+ .B losetup
+ .B \-R
+ .I loop_device
+@@ -64,6 +66,8 @@
+ configuration or corresponding modules have been loaded to kernel.
+ .PD
+ .RE
++.IP "\fB\-f\fP"
++Find and show next unused loop device.
+ .IP "\fB\-F\fP"
+ Reads and uses mount options from /etc/fstab that match specified loop
+ device, including offset= sizelimit= encryption= pseed= phash= loinit=

Propchange: trunk/loop-aes-utils/debian/patches/losetup_add_option_f.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-loop-aes-commits mailing list