On Thu, Dec 22, 2011 at 04:54:54PM +0100, Marcin Szewczyk, Wodny wrote:
> A proposed (tested to some extent) patch attached.
 
Inspired by this doc:
http://ftp.osuosl.org/pub/linux/utils/util-linux/libblkid-docs/libblkid-Partitions-probing.html#blkid-partition-get-size
and output of /proc/partitions I propose another version of the patch.

-- 
Marcin Szewczyk                       http://wodny.org
mailto:marcin.szewc...@wodny.borg  <- remove b / usuĊ„ b
xmpp:wo...@ubuntu.pl                  xmpp:wo...@jabster.pl
>From 69dde81e0f5ba0c68ad21afeb5d3de8861f807ed Mon Sep 17 00:00:00 2001
From: Marcin Szewczyk <marcin.szewc...@wodny.org>
Date: Thu, 22 Dec 2011 23:05:54 +0100
Subject: [PATCH] BLKPG_ADD_PARTITION: extended part's size = 1KiB

---
 src/helpers/job-create-partition.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/helpers/job-create-partition.c b/src/helpers/job-create-partition.c
index 80277b8..861f3a3 100644
--- a/src/helpers/job-create-partition.c
+++ b/src/helpers/job-create-partition.c
@@ -145,7 +145,15 @@ main (int argc,
           memset (&p, '\0', sizeof(struct blkpg_partition));
           p.pno = out_num;
           p.start = out_start;
-          p.length = out_size;
+          if (*endp == '\0' && (n == 0x05 || n == 0x0f || n == 0x85))
+            {
+              /* TODO: Voodoo inspired value */
+              p.length = 1024;
+            }
+          else
+            {
+              p.length = out_size;
+            }
           a.op = BLKPG_ADD_PARTITION;
           a.datalen = sizeof(p);
           a.data = &p;
-- 
1.7.7.3

Reply via email to