recent lvm.conf change in ubuntu/lucid breaks FAI setup-storage
Waldemar Brodkorb
fai at waldemar-brodkorb.de
Tue Mar 2 22:16:07 CET 2010
Hi FAI Developers,
recently Ubuntu changed the default lvm.conf file, they now use
following:
-----
# Since version 2.02.54, the tools distinguish between powers of
# 1024 bytes (e.g. KiB, MiB, GiB) and powers of 1000 bytes (e.g.
# KB, MB, GB).
# If you have scripts that depend on the old behaviour, set this to 0
# temporarily until you update them.
si_unit_consistency = 1
-----
This breaks setup-storage. Attached patch fixed it for me.
But I think it will be semantical incorrect if someone uses new
lvm-tools with si_unit_consistency equal 0.
Any idea for a better fix?
thanks in advance
Waldemar
-------------- next part --------------
Index: lib/setup-storage/Parser.pm
===================================================================
--- lib/setup-storage/Parser.pm (revision 5728)
+++ lib/setup-storage/Parser.pm (working copy)
@@ -298,7 +298,7 @@
sub convert_unit
{
my ($val) = @_;
- ($val =~ /^(\d+(\.\d+)?)([kMGTP%]?)(B)?\s*$/) or
+ ($val =~ /^(\d+(\.\d+)?)([kMGTP%]?)i?(B)?\s*$/) or
&FAI::internal_error("convert_unit $val");
$val = $1 * (1 / 1024) * (1 / 1024) if ($3 eq "" && defined ($4) && $4 eq "B");
$val = $1 * (1 / 1024) if ($3 eq "k");
More information about the linux-fai-devel
mailing list