summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-03 07:05:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-03 07:05:35 +0000
commite842236c2abecc1bdb069a9fa9e96fe89849e36c (patch)
treeec9e89299cfed055765403244e28d0e278181633 /perl-install/devices.pm
parentdf93256cccd635dfbcaffe5d3240956bdd60ecb4 (diff)
downloaddrakx-e842236c2abecc1bdb069a9fa9e96fe89849e36c.tar
drakx-e842236c2abecc1bdb069a9fa9e96fe89849e36c.tar.gz
drakx-e842236c2abecc1bdb069a9fa9e96fe89849e36c.tar.bz2
drakx-e842236c2abecc1bdb069a9fa9e96fe89849e36c.tar.xz
drakx-e842236c2abecc1bdb069a9fa9e96fe89849e36c.zip
drop old unused code
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r--perl-install/devices.pm44
1 files changed, 0 insertions, 44 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 513c1714a..c5ee94c04 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -8,31 +8,6 @@ use run_program;
use log;
use c;
-sub size {
- my ($dev) = @_;
- sysopen(my $F, $dev, 0) or log::l("open $dev: $!"), return 0;
-
- my $valid_offset = sub { sysseek($F, $_[0], 0) && sysread($F, my $_a, 1) };
-
- #- first try getting the size nicely
- if (my $size = c::total_sectors(fileno $F)) {
- return $size * $common::SECTORSIZE;
- }
-
- #- sad it did not work, well searching the size using the dichotomy algorithm!
- my $low = 0;
- my ($high, $mid);
-
- #- first find n where 2^n < size <= 2^n+1
- for ($high = 1; $high > 0 && $valid_offset->($high); $high *= 2) { $low = $high }
-
- while ($low < $high - 1) {
- $mid = int(($low + $high) / 2);
- $valid_offset->($mid) ? $low : $high = $mid;
- }
- $low + 1;
-}
-
sub del_loop {
my ($dev) = @_;
run_program::run("losetup", "-d", $dev);
@@ -242,25 +217,6 @@ sub read_proc_partitions_raw() {
} @all;
}
-sub from_devfs {
- my ($dev) = @_;
- my %from_devfs = reverse %to_devfs;
- if (my $r = $from_devfs{$dev}) {
- return $r;
- } elsif ($dev =~ /(.*?)(\d+)$/) {
- my %from_devfs_prefix = reverse %to_devfs_prefix;
- my $r = $from_devfs_prefix{$1};
- return "$r$2" if $r;
- }
- $dev = "/dev/" . $dev;
- if (-e $dev) {
- my ($major, $minor) = unmakedev((stat($dev))[6]);
- my $r = find { $_->{major} == $major && $_->{minor} == $minor } read_proc_partitions_raw();
- $r and return $r->{dev};
- }
- undef;
-}
-
sub simple_partition_scan {
my ($part) = @_;
$part->{device} =~ /([hs]d[a-z])(\d+)$/;