On Saturday 12 May 2007 11:09, Robert Millan wrote: > Actually I think we can do much better with our own simple program that > uses libparted. See attachment. That's great! Exactly the sort of thing I was thinking about. > On my amd64 sid, compiled with -Os and stripped it just takes 5224 > bytes. I get 7141 on i386 if compiled as part of partman-base, which has: CFLAGS=-Wall -Os -D_GNU_SOURCE I'm not completely sure how best to package this. Otavio suggested d-i-utils, but that would mean adding a build-depends on libparted and rebuilding d-i-utils on ABI changes in libparted, so not good. The most obvious place is partman-base, but that would mean a dependency from grub-installer on partman-base, which is also not nice. I have an alternative ready (see attached patch) which adds a new udeb "partman-utils" in partman-base. This new udeb contains parted_devices and partmap, and could contain other similar utils. As hw-detect also makes use of parted_devices but currently cannot depend on it, this seems like a good solution to me. (OTOH depending on it may not be desired for arches that are not supported by libparted.) Comments on this packaging issue welcome. Cheers, FJP
Property changes on: .
___________________________________________________________________
Name: svn:ignore
- build-stamp
parted_devices
parted_server
map_devfs
stralign
+ build-stamp
parted_devices
parted_server
map_devfs
partmap
stralign
Property changes on: debian
___________________________________________________________________
Name: svn:ignore
- files
partman-base
partman-base.postrm.debhelper
partman-base.substvars
+ files
partman-base
partman-base.postrm.debhelper
partman-base.substvars
partman-utils
partman-utils.substvars
Index: debian/partman-base.install
===================================================================
--- debian/partman-base.install (revision 0)
+++ debian/partman-base.install (revision 0)
@@ -0,0 +1,5 @@
+visual.d lib/partman
+definitions.sh lib/partman
+partman bin
+parted_server bin
+stralign bin
Index: debian/control
===================================================================
--- debian/control (revision 46782)
+++ debian/control (working copy)
@@ -9,7 +9,14 @@
Package: partman-base
XC-Package-Type: udeb
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, partman-partitioning, partman-target, archdetect, harddrive-detection, di-utils-mapdevfs, di-utils (>= 1.15)
+Depends: ${shlibs:Depends}, ${misc:Depends}, partman-utils, partman-partitioning, partman-target, archdetect, harddrive-detection, di-utils-mapdevfs, di-utils (>= 1.15)
Provides: ${provides}
XB-Installer-Menu-Item: ${menuitemnum}
Description: Partition the storage devices (partman)
+
+Package: partman-utils
+XC-Package-Type: udeb
+Priority: extra
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Utilities related to partitioning
Index: debian/rules
===================================================================
--- debian/rules (revision 46782)
+++ debian/rules (working copy)
@@ -7,7 +7,7 @@
ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
-PACKAGE=partman-base
+export PACKAGE=partman-base
PROVIDES=made-filesystems, mounted-partitions, partitioned-harddrives, created-fstab
@@ -31,6 +31,7 @@
dh_testdir
dh_testroot
dh_clean -k
+ # Install hooks into partman-base udeb
debian/install-rc choose_partition
debian/install-rc storage_device
debian/install-rc active_partition
@@ -41,16 +42,11 @@
debian/install-rc finish.d
debian/install-rc update.d
debian/install-rc valid_visuals.d
- dh_install visual.d lib/partman
- dh_install definitions.sh lib/partman
- dh_install partman bin
- dh_install stralign bin
- dh_install parted_devices bin
- dh_install parted_server bin
binary-arch: build install
dh_testdir
dh_testroot
+ dh_install
dh_installdebconf
cp debian/isinstallable debian/${PACKAGE}/DEBIAN/
dh_strip
Index: debian/partman-utils.dirs
===================================================================
--- debian/partman-utils.dirs (revision 0)
+++ debian/partman-utils.dirs (revision 0)
@@ -0,0 +1 @@
+bin
Index: debian/partman-utils.install
===================================================================
--- debian/partman-utils.install (revision 0)
+++ debian/partman-utils.install (revision 0)
@@ -0,0 +1,2 @@
+parted_devices bin
+partmap bin
Index: debian/install-rc
===================================================================
--- debian/install-rc (revision 46782)
+++ debian/install-rc (working copy)
@@ -2,7 +2,7 @@
set -e
-PACKAGE=$(dh_listpackages)
+# PACKAGE is exported from debian/rules
partman=debian/${PACKAGE}/lib/partman
install -d $partman/$1
@@ -21,4 +21,3 @@
mv $partman/$1/$name $partman/$1/${number}${name}
done
fi
-
Index: debian/partman-base.dirs
===================================================================
--- debian/partman-base.dirs (revision 46782)
+++ debian/partman-base.dirs (working copy)
@@ -1 +1,2 @@
+bin
/lib/partman/auto.d
Index: partmap.c
===================================================================
--- partmap.c (revision 0)
+++ partmap.c (revision 0)
@@ -0,0 +1,24 @@
+#include <parted/parted.h>
+#include <stdio.h>
+
+main (int argc, char **argv)
+{
+ PedDevice *device;
+ PedDisk *disk;
+
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: %s DEVICE\n", argv[0]);
+ exit (1);
+ }
+
+ device = ped_device_get (argv[1]);
+ if (!device)
+ exit (1);
+
+ disk = ped_disk_new (device);
+ if (!disk)
+ exit (1);
+
+ printf ("%s\n", disk->type->name);
+}
Index: Makefile
===================================================================
--- Makefile (revision 46782)
+++ Makefile (working copy)
@@ -1,7 +1,7 @@
CFLAGS=-Wall -Os -D_GNU_SOURCE
LIBS=-lparted -ldl
-all: parted_server parted_devices stralign
+all: parted_server parted_devices partmap stralign
parted_server: parted_server.c
$(CC) $(CFLAGS) $(LIBS) parted_server.c -o parted_server
@@ -9,6 +9,9 @@
parted_devices: parted_devices.c
$(CC) $(CFLAGS) $(LIBS) parted_devices.c -o parted_devices
+partmap: partmap.c
+ $(CC) $(CFLAGS) $(LIBS) partmap.c -o partmap
+
stralign: stralign.c
$(CC) $(CFLAGS) stralign.c -o stralign
Attachment:
pgptyRCZ8nBKG.pgp
Description: PGP signature