diff options
-rw-r--r-- | move/move.pm | 2 | ||||
-rwxr-xr-x | move/tree/mdk_move_loop | 4 | ||||
-rw-r--r-- | perl-install/devices.pm | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/move/move.pm b/move/move.pm index 25210ae4f..2c26474b4 100644 --- a/move/move.pm +++ b/move/move.pm @@ -197,7 +197,7 @@ sub lomount_clp { log::l("lomount_clp: lomounting $name"); mkdir_p($dir); - my $dev = devices::find_free_loop(); + my $dev = devices::find_free_chloop(); run_program::run('losetup', '-r', '-e', 'gz', $dev, $clp); run_program::run('mount', '-r', $dev, $dir); } diff --git a/move/tree/mdk_move_loop b/move/tree/mdk_move_loop index b98c4a417..76aca6dbe 100755 --- a/move/tree/mdk_move_loop +++ b/move/tree/mdk_move_loop @@ -8,8 +8,8 @@ sub name2file { sub get_file2loop { my %file2loop; foreach (0 .. 9) { - my ($file) = `sudo losetup /dev/loop$_ 2>/dev/null` =~ m!\([^)]*/([^)]*)\)! or last; - $file2loop{$file} = "loop$_"; + my ($file) = `sudo losetup /dev/chloop$_ 2>/dev/null` =~ m!\([^)]*/([^)]*)\)! or last; + $file2loop{$file} = "chloop$_"; } %file2loop; } diff --git a/perl-install/devices.pm b/perl-install/devices.pm index b2b44aec7..106a6db52 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -37,15 +37,19 @@ sub del_loop { my ($dev) = @_; run_program::run("losetup", "-d", $dev); } -sub find_free_loop() { +sub find_free_loop_raw { + my ($o_chloop) = @_; foreach (0..7) { - my $dev = make("loop$_"); + my $dev = make(($o_chloop && 'ch') . "loop$_"); + log::l("trying $dev"); sysopen(my $F, $dev, 2) or next; !ioctl($F, c::LOOP_GET_STATUS(), my $_tmp) && $! == 6 or next; #- 6 == ENXIO return $dev; } die "no free loop found"; } +sub find_free_loop() { find_free_loop_raw() } +sub find_free_chloop() { find_free_loop_raw('chloop') } sub set_loop { my ($file, $o_encrypt_key, $o_encryption) = @_; my $dev = find_free_loop(); @@ -115,6 +119,7 @@ sub entry { "usb/lp" => [ c::S_IFCHR(), 180, 0 ], "input/event" => [ c::S_IFCHR(), 13, 64 ], "loop" => [ c::S_IFBLK(), 7, 0 ], + "chloop" => [ c::S_IFBLK(), 100, 0 ], "md" => [ c::S_IFBLK(), 9, 0 ], "nst" => [ c::S_IFCHR(), 9, 128 ], "scd" => [ c::S_IFBLK(), 11, 0 ], |