summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-06 11:21:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-06 11:21:09 +0000
commitde4f752c310da49cfe15cc9cc90886354511b5cc (patch)
treed705e015afe68d2f4e341a895e9129765f9f7d0d /perl-install/common.pm
parenteb80eb7030821b34ee0da643724e7cfff4194b47 (diff)
downloaddrakx-de4f752c310da49cfe15cc9cc90886354511b5cc.tar
drakx-de4f752c310da49cfe15cc9cc90886354511b5cc.tar.gz
drakx-de4f752c310da49cfe15cc9cc90886354511b5cc.tar.bz2
drakx-de4f752c310da49cfe15cc9cc90886354511b5cc.tar.xz
drakx-de4f752c310da49cfe15cc9cc90886354511b5cc.zip
- fix range max value >2TB when creating a partition (useful for LVs >2TB)
nb: >> 11 and << 11 doesn't work on floats which we use to handle >2TB partitions. perl floats are precise enough up until 512TB
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 10d762272..5ad572b5b 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -10,7 +10,7 @@ use run_program;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime formatXiB makedev mandrake_release mandrake_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev);
+our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB makedev mandrake_release mandrake_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev);
# perl_checker: RE-EXPORT-ALL
push @EXPORT, @MDK::Common::EXPORT;
@@ -111,6 +111,13 @@ sub nonblock {
fcntl($F, c::F_SETFL(), fcntl($F, c::F_GETFL(), 0) | c::O_NONBLOCK()) or die "can not fcntl F_SETFL: $!";
}
+#- return a size in sector
+#- ie MB(1) is 2048 sectors, which is 1MB
+sub MB {
+ my ($nb_MB) = @_;
+ $nb_MB * 2048;
+}
+
sub removeXiBSuffix {
local $_ = shift;