rpms/e2fsprogs/devel e2fsprogs-1.39-LUKS-blkid.patch, NONE, 1.1 e2fsprogs.spec, 1.70, 1.71

Eric Sandeen (sandeen) fedora-extras-commits at redhat.com
Wed Jun 20 17:31:54 UTC 2007


Author: sandeen

Update of /cvs/pkgs/rpms/e2fsprogs/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9959

Modified Files:
	e2fsprogs.spec 
Added Files:
	e2fsprogs-1.39-LUKS-blkid.patch 
Log Message:
* Wed Jun 20 2007 Eric Sandeen <esandeen at redhat.com> 1.39-12
- add LUKS support to libblkid


e2fsprogs-1.39-LUKS-blkid.patch:

--- NEW FILE e2fsprogs-1.39-LUKS-blkid.patch ---
Theodore Tso schrieb:
> > On Mon, Jun 11, 2007 at 01:51:24PM +0200, Karsten Hopp wrote:
>> >> +static int probe_luks(struct blkid_probe *probe,
>> >> +		       struct blkid_magic *id __BLKID_ATTR((unused)), 
>> >> +		       unsigned char *buf)
>> >> +{
>> >> +	unsigned char *p_buf = buf;
>> >> +	unsigned char uuid[40];
>> >> +	/* 168 is the offset to the 40 character uuid: 
>> >> +	 * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
>> >> +	p_buf += 168;
>> >> +	strncpy(uuid, p_buf, 40);
> > 
> > Why bother with p_buf?  It would actually be shorter and sweeter to
> > do:
> > 
> > 	strncpy(uuid, buf+168, 40);
> > 
> > And remove the lines dealing with p_buf above.
> > 
>> >> +  { "crypt_LUKS",0,	 0,  6,	"LUKS\xba\xbe",		probe_luks },
> > 
> > Any particular reason to use "crypt_LUKS" instead of just "LUKS"?  In
> > your documentation you generally just refer to it as LUKS.
> > 
> > 					- Ted

I've used 'luks' in my first patch, but changed it to 'crypt_LUKS' when
Karel Zak pointed out that libvolume_id from udev already uses 'crypt_LUKS'
for this.
My first patch also did some other (unnecessary) stuff with p_buf and I just
didn't bother to remove it.
I'll attach a new patch without p_buf.

    Karsten

--
  Karsten Hopp        | Mail: karsten at redhat.de
  Red Hat Deutschland | Tel: +49-711-96437-0
  Hauptstaetterstr.58 | Fax: +49-711-613590
  D-70178 Stuttgart   | http://www.redhat.de



e2fsprogs-1.39-luks.patch
Problem:        libblkid doesn't detect/report UUIDs of cryptsetup-luks partitio
ns
Solution:       Add probe for luks UUID
Signed-off-by:  Karsten Hopp <karsten at redhat.com>

--- e2fsprogs-1.39/lib/blkid/ChangeLog.luksuuid	2007-06-11 13:40:14.000000000 +0200
+++ e2fsprogs-1.39/lib/blkid/ChangeLog	2007-06-11 13:40:14.000000000 +0200
@@ -0,0 +1,4 @@
+2007-05-22  Karsten Hopp  <karsten at redhat.com> 
+
+	* probe.c (probe_luks): Add support for cryptsetup-luks partitions
+
--- e2fsprogs-1.39/lib/blkid/probe.c.luksuuid	2007-06-11 13:40:14.000000000 +0200
+++ e2fsprogs-1.39/lib/blkid/probe.c	2007-06-13 12:50:27.000000000 +0200
@@ -468,6 +468,18 @@ static int probe_jfs(struct blkid_probe 
 	return 0;
 }
 
+static int probe_luks(struct blkid_probe *probe,
+		       struct blkid_magic *id __BLKID_ATTR((unused)), 
+		       unsigned char *buf)
+{
+	unsigned char uuid[40];
+	/* 168 is the offset to the 40 character uuid: 
+	 * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
+	strncpy(uuid, buf+168, 40);
+	blkid_set_tag(probe->dev, "UUID", uuid, sizeof(uuid));
+	return 0;
+}
+
 static int probe_romfs(struct blkid_probe *probe,
 		       struct blkid_magic *id __BLKID_ATTR((unused)), 
 		       unsigned char *buf)
@@ -775,6 +787,7 @@ static struct blkid_magic type_array[] =
   { "ocfs2",	 2,	 0,  6,	"OCFSV2",		probe_ocfs2 },
   { "ocfs2",	 4,	 0,  6,	"OCFSV2",		probe_ocfs2 },
   { "ocfs2",	 8,	 0,  6,	"OCFSV2",		probe_ocfs2 },
+  { "crypt_LUKS",0,	 0,  6,	"LUKS\xba\xbe",		probe_luks },
   {   NULL,	 0,	 0,  0, NULL,			NULL }
 };
 



Index: e2fsprogs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/e2fsprogs/devel/e2fsprogs.spec,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- e2fsprogs.spec	23 Feb 2007 11:41:09 -0000	1.70
+++ e2fsprogs.spec	20 Jun 2007 17:31:19 -0000	1.71
@@ -4,7 +4,7 @@
 Summary: Utilities for managing the second and third extended (ext2/ext3) filesystems
 Name: e2fsprogs
 Version: 1.39
-Release: 11
+Release: 12
 License: GPL
 Group: System Environment/Base
 Source:  ftp://download.sourceforge.net/pub/sourceforge/e2fsprogs/e2fsprogs-%{version}.tar.gz
@@ -31,6 +31,7 @@
 Patch60: e2fsprogs-1.39-e2p_percent_div.patch
 Patch61: e2fsprogs-1.39-uuid.patch
 Patch62: e2fsprogs-1.39-mkinstalldirs.patch
+Patch63: e2fsprogs-1.39-LUKS-blkid.patch
 Url: http://e2fsprogs.sourceforge.net/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: e2fsprogs-libs = %{version}-%{release}, device-mapper
@@ -113,6 +114,7 @@
 %patch60 -p1 -b .e2p_percent_div
 %patch61 -p1 -b .uuid
 %patch62 -p1 -b .mkinstalldirs
+%patch63 -p1 -b .LUKS
 
 %build
 aclocal
@@ -264,6 +266,9 @@
 %{_mandir}/man3/uuid_unparse.3*
 
 %changelog
+* Wed Jun 20 2007 Eric Sandeen <esandeen at redhat.com> 1.39-12
+- add LUKS support to libblkid
+
 * Fri Feb 23 2007 Karsten Hopp <karsten at redhat.com> 1.39-11
 - fix post/preun requirements
 - use smp flags




More information about the fedora-extras-commits mailing list