summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/devices.pm2
-rw-r--r--perl-install/fs.pm5
2 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 6c408a163..90358555c 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -51,9 +51,11 @@ 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) = @_;
+ eval { modules::load('loop') };
my $dev = find_free_loop();
if ($o_encrypt_key && $o_encryption) {
+ eval { modules::load('cryptoloop', 'aes') };
my $cmd = "losetup -p 0 -e $o_encryption $dev $file";
log::l("calling $cmd");
open(my $F, "|$cmd");
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 98ef8827b..f21e68dae 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -663,10 +663,7 @@ sub format_part {
################################################################################
sub set_loop {
my ($part) = @_;
- if (!$part->{real_device}) {
- eval { modules::load('loop') };
- $part->{real_device} = devices::set_loop(devices::make($part->{device}), $part->{encrypt_key}, $part->{options} =~ /encryption=(\w+)/);
- }
+ $part->{real_device} ||= devices::set_loop(devices::make($part->{device}), $part->{encrypt_key}, $part->{options} =~ /encryption=(\w+)/);
}
sub formatMount_part {