summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-09 15:23:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-09 15:23:56 +0000
commit975c4c27c0245389fedb1669bab816502f1c36f3 (patch)
treeda1eb9b0c736869fcc57bef4b7df4381ff064885 /perl-install/devices.pm
parent29dbc8c49c643d5d18f64907ca9d5104ad9cf08e (diff)
downloaddrakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar
drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.gz
drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.bz2
drakx-975c4c27c0245389fedb1669bab816502f1c36f3.tar.xz
drakx-975c4c27c0245389fedb1669bab816502f1c36f3.zip
no_comment
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r--perl-install/devices.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 5ebee431e..61d6bd4c7 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -35,6 +35,18 @@ sub size($) {
$low + 1;
}
+sub set_loop {
+ my ($file) = @_;
+
+ foreach (0..9) {
+ local *F;
+ my $dev = devices::make("loop$_");
+ sysopen F, $dev, 0 or next;
+ !ioctl(F, c::LOOP_GET_STATUS(), my $tmp) && $! == 6 or next; #- 6 == ENXIO
+ return c::set_loop(fileno F, $file) && $dev;
+ }
+}
+
sub make($) {
local $_ = my $file = $_[0];
my ($type, $major, $minor);
@@ -79,6 +91,7 @@ sub make($) {
@{ ${{"fd" => [ c::S_IFBLK(), 2, 0 ],
"hidbp-mse-" => [ c::S_IFCHR(), 10, 32 ],
"lp" => [ c::S_IFCHR(), 6, 0 ],
+ "loop" => [ c::S_IFBLK(), 7, 0 ],
"md" => [ c::S_IFBLK(), 9, 0 ],
"nst" => [ c::S_IFCHR(), 9, 128],
"scd" => [ c::S_IFBLK(), 11, 0 ],