Bug#644825: LVM support on GNU/kFreeBSD
Package: libparted0debian1
Version: 2.3-8
Severity: wishlist
Tags: d-i patch
Hi,
This patch adds support for detecting LVM volumes on GNU/kFreeBSD.
It is needed to support LVM in the GNU/kFreeBSD version of D-I.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 8.1-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libparted0debian1 depends on:
ii libblkid1 2.19.1-5
ii libc0.1 2.13-21
ii libuuid1 2.19.1-5
ii multiarch-support 2.13-21
libparted0debian1 recommends no packages.
Versions of packages libparted0debian1 suggests:
ii libparted0-dev <none>
ii libparted0-i18n <none>
ii parted 2.3-8
-- no debconf information
Index: parted-2.3/libparted/arch/freebsd.c
===================================================================
--- parted-2.3.orig/libparted/arch/freebsd.c 2011-10-04 07:04:59.000000000 +0200
+++ parted-2.3/libparted/arch/freebsd.c 2011-10-04 07:08:39.589736010 +0200
@@ -1140,6 +1140,31 @@
return 1;
}
+static int
+_probe_lvm_volumes ()
+{
+ DIR* lvm_dir;
+ struct dirent* lvm_dent;
+ char buf[PATH_MAX];
+ struct stat st;
+
+ lvm_dir = opendir ("/dev/linux_lvm");
+ if (!lvm_dir)
+ return 0;
+
+ while ((lvm_dent = readdir (lvm_dir))) {
+ if (strcmp (lvm_dent->d_name, ".") == 0 || strcmp (lvm_dent->d_name, "..") == 0)
+ continue;
+ snprintf (buf, sizeof (buf), "/dev/linux_lvm/%s", lvm_dent->d_name);
+ if (stat (buf, &st) != 0)
+ continue;
+ _ped_device_probe (buf);
+ }
+ closedir (lvm_dir);
+
+ return 1;
+}
+
static void
freebsd_probe_all ()
{
@@ -1148,6 +1173,8 @@
_probe_kern_disks ();
_probe_zfs_volumes ();
+
+ _probe_lvm_volumes ();
}
static char*
Index: parted-2.3/libparted/arch/freebsd.c
===================================================================
--- parted-2.3.orig/libparted/arch/freebsd.c 2011-10-04 07:04:59.000000000 +0200
+++ parted-2.3/libparted/arch/freebsd.c 2011-10-04 07:08:39.589736010 +0200
@@ -1140,6 +1140,31 @@
return 1;
}
+static int
+_probe_lvm_volumes ()
+{
+ DIR* lvm_dir;
+ struct dirent* lvm_dent;
+ char buf[PATH_MAX];
+ struct stat st;
+
+ lvm_dir = opendir ("/dev/linux_lvm");
+ if (!lvm_dir)
+ return 0;
+
+ while ((lvm_dent = readdir (lvm_dir))) {
+ if (strcmp (lvm_dent->d_name, ".") == 0 || strcmp (lvm_dent->d_name, "..") == 0)
+ continue;
+ snprintf (buf, sizeof (buf), "/dev/linux_lvm/%s", lvm_dent->d_name);
+ if (stat (buf, &st) != 0)
+ continue;
+ _ped_device_probe (buf);
+ }
+ closedir (lvm_dir);
+
+ return 1;
+}
+
static void
freebsd_probe_all ()
{
@@ -1148,6 +1173,8 @@
_probe_kern_disks ();
_probe_zfs_volumes ();
+
+ _probe_lvm_volumes ();
}
static char*
Reply to: