[OE-core] [PATCH] libparted: make sure not to treat percentages as exact
Zhu Yanjun
yanjun.zhu at windriver.com
Wed Mar 12 09:46:29 UTC 2014
---
...ke-sure-not-to-treat-percentages-as-exact.patch | 22 ++++++++++++++++++++
meta/recipes-extended/parted/parted_3.1.bb | 3 ++-
2 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-extended/parted/parted-3.1/parted-libparted-make-sure-not-to-treat-percentages-as-exact.patch
diff --git a/meta/recipes-extended/parted/parted-3.1/parted-libparted-make-sure-not-to-treat-percentages-as-exact.patch b/meta/recipes-extended/parted/parted-3.1/parted-libparted-make-sure-not-to-treat-percentages-as-exact.patch
new file mode 100644
index 0000000..1cf8309
--- /dev/null
+++ b/meta/recipes-extended/parted/parted-3.1/parted-libparted-make-sure-not-to-treat-percentages-as-exact.patch
@@ -0,0 +1,22 @@
+libparted: make sure not to treat percentages as exact
+
+If 1% of the drive size worked out ot be an even power of
+two, it would trigger the exact placement. Add an exception
+for the percent units.
+---
+ libparted/unit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libparted/unit.c b/libparted/unit.c
+index e545985..ff479f1 100644
+--- a/libparted/unit.c
++++ b/libparted/unit.c
+@@ -548,7 +548,7 @@ ped_unit_parse_custom (const char* str, const PedDevice* dev, PedUnit unit,
+ do not use 4MiB as the range. Rather, presume that they
+ are specifying precisely the starting or ending number,
+ and treat "4MiB" just as we would treat "4194304B". */
+- if (is_power_of_2 (unit_size))
++ if (is_power_of_2 (unit_size) && unit != PED_UNIT_PERCENT)
+ radius = 0;
+
+ *sector = num * unit_size / dev->sector_size;
diff --git a/meta/recipes-extended/parted/parted_3.1.bb b/meta/recipes-extended/parted/parted_3.1.bb
index 8344ea8..d791275 100644
--- a/meta/recipes-extended/parted/parted_3.1.bb
+++ b/meta/recipes-extended/parted/parted_3.1.bb
@@ -4,7 +4,7 @@ LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
SECTION = "console/tools"
DEPENDS = "ncurses readline util-linux"
-PR = "r1"
+PR = "r2"
SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
file://no_check.patch \
@@ -15,6 +15,7 @@ SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
file://fix-deprecated-readline.patch \
file://run-ptest \
file://Makefile \
+ file://parted-libparted-make-sure-not-to-treat-percentages-as-exact.patch \
"
SRC_URI[md5sum] = "5d89d64d94bcfefa9ce8f59f4b81bdcb"
--
1.7.9.5
More information about the Openembedded-core
mailing list