> It looks great to me. Could you please make it against our GIT > repository?
No problem. Here you are.
diff -ruN a/configure.ac b/configure.ac
--- a/configure.ac 2006-12-05 06:37:04.000000000 +0100
+++ b/configure.ac 2006-12-05 06:39:20.000000000 +0100
@@ -486,6 +486,7 @@
libparted/fs/reiserfs/Makefile
libparted/fs/ufs/Makefile
libparted/fs/xfs/Makefile
+libparted/fs/luks/Makefile
parted/Makefile
partprobe/Makefile
doc/Makefile
diff -ruN a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
--- a/libparted/fs/Makefile.am 2006-12-05 06:37:04.000000000 +0100
+++ b/libparted/fs/Makefile.am 2006-12-05 06:33:27.000000000 +0100
@@ -3,7 +3,7 @@
#
# This file may be modified and/or distributed without restriction.
-SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs # bfs
+SUBDIRS = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs luks #
bfs
LIBS = @INTLLIBS@ @LIBS@
@@ -24,6 +24,7 @@
linux_swap/liblinuxswap.la \
xfs/libxfs.la \
jfs/libjfs.la \
+ luks/libluks.la \
reiserfs/libreiserfs.la
# bfs/libbfs.la
diff -ruN a/libparted/fs/luks/Makefile.am b/libparted/fs/luks/Makefile.am
--- a/libparted/fs/luks/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ b/libparted/fs/luks/Makefile.am 2006-12-05 06:34:18.000000000 +0100
@@ -0,0 +1,6 @@
+partedincludedir = -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libluks.la
+libluks_la_SOURCES = luks.c
+
+INCLUDES = $(partedincludedir) @INTLINCS@
diff -ruN a/libparted/fs/luks/luks.c b/libparted/fs/luks/luks.c
--- a/libparted/fs/luks/luks.c 1970-01-01 01:00:00.000000000 +0100
+++ b/libparted/fs/luks/luks.c 2006-12-05 06:34:14.000000000 +0100
@@ -0,0 +1,83 @@
+/*
+ libparted - a library for manipulating disk partitions
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
+#include "config.h"
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(String) dgettext (PACKAGE, String)
+#else
+# define _(String) (String)
+#endif /* ENABLE_NLS */
+
+#include <string.h>
+
+#define LUKS_MAGIC "LUKS"
+#define PHDR_SIZE 592
+
+static PedGeometry*
+luks_probe (PedGeometry* geom)
+{
+ char buf[PHDR_SIZE];
+
+ if (!ped_geometry_read (geom, buf, 0, 1))
+ return NULL;
+
+ if (strncmp (LUKS_MAGIC, buf, strlen(LUKS_MAGIC)) == 0)
+ return ped_geometry_new (geom->dev, geom->start, geom->length);
+ else
+ return NULL;
+}
+
+static PedFileSystemOps luks_ops = {
+ probe: luks_probe,
+ clobber: NULL,
+ open: NULL,
+ create: NULL,
+ close: NULL,
+ check: NULL,
+ copy: NULL,
+ resize: NULL,
+ get_create_constraint: NULL,
+ get_resize_constraint: NULL,
+ get_copy_constraint: NULL
+};
+
+static PedFileSystemType luks_type = {
+ next: NULL,
+ ops: &luks_ops,
+ name: "luks",
+};
+
+void
+ped_file_system_luks_init ()
+{
+ ped_file_system_type_register (&luks_type);
+}
+
+void
+ped_file_system_luks_done ()
+{
+ ped_file_system_type_unregister (&luks_type);
+}
+
+
diff -ruN a/libparted/libparted.c b/libparted/libparted.c
--- a/libparted/libparted.c 2006-12-05 06:37:04.000000000 +0100
+++ b/libparted/libparted.c 2006-12-05 07:11:56.000000000 +0100
@@ -125,6 +125,7 @@
extern void ped_file_system_hfs_init (void);
extern void ped_file_system_fat_init (void);
extern void ped_file_system_ext2_init (void);
+extern void ped_file_system_luks_init (void);
static void
init_file_system_types ()
@@ -139,6 +140,7 @@
ped_file_system_hfs_init ();
ped_file_system_fat_init ();
ped_file_system_ext2_init ();
+ ped_file_system_luks_init ();
}
#endif /* ENABLE_FS */
@@ -214,6 +216,7 @@
extern void ped_file_system_ufs_done (void);
extern void ped_file_system_xfs_done (void);
extern void ped_file_system_amiga_done (void);
+extern void ped_file_system_luks_done (void);
static void
done_file_system_types ()
@@ -228,6 +231,7 @@
ped_file_system_ufs_done ();
ped_file_system_xfs_done ();
ped_file_system_amiga_done ();
+ ped_file_system_luks_done ();
}
#endif /* ENABLE_FS */
signature.asc
Description: OpenPGP digital signature
_______________________________________________ parted-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/parted-devel

