summaryrefslogtreecommitdiffstats
path: root/debian/patches/kfreebsd_lvm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/kfreebsd_lvm.patch')
-rw-r--r--debian/patches/kfreebsd_lvm.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/debian/patches/kfreebsd_lvm.patch b/debian/patches/kfreebsd_lvm.patch
new file mode 100644
index 0000000..145d050
--- /dev/null
+++ b/debian/patches/kfreebsd_lvm.patch
@@ -0,0 +1,55 @@
+From 10e3164ce61e959817683edf52c1f1206f82ef0c Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Fri, 28 Mar 2014 17:09:52 +0000
+Subject: Add LVM support on kFreeBSD
+
+Patch-Name: kfreebsd_lvm.patch
+---
+ libparted/arch/freebsd.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/libparted/arch/freebsd.c b/libparted/arch/freebsd.c
+index b78d2bb0..f7061c74 100644
+--- a/libparted/arch/freebsd.c
++++ b/libparted/arch/freebsd.c
+@@ -1178,6 +1178,31 @@ _probe_zfs_volumes ()
+ 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 ()
+ {
+@@ -1186,6 +1211,8 @@ freebsd_probe_all ()
+ _probe_kern_disks ();
+
+ _probe_zfs_volumes ();
++
++ _probe_lvm_volumes ();
+ }
+
+ static char*