diff options
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 07ee0d606..4bc7ed5cd 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -336,7 +336,10 @@ sub read_grub_menu_lst { foreach my $keyword (grep { $_ ne 'entries' } keys %b) { $b{$keyword} = $b{$keyword} eq '' ? 1 : grub2file($b{$keyword}, $grub2dev, $fstab, \%b); } - $b{encrypted} = is_already_crypted($b{password}); + if ($b{password} =~ /^--md5 (.*)/) { + $b{password} = $1; + $b{encrypted} = 1; + } #- sanitize foreach my $e (@{$b{entries}}) { @@ -1744,10 +1747,13 @@ sub write_grub { push @conf, $format->(grep { defined $bootloader->{$_} } qw(timeout)); push @conf, $format->(grep { $bootloader->{$_} } qw(color serial shade terminal viewport background foreground)); if (my $pw = $bootloader->{password}) { - if ($bootloader->{encrypted} && !is_already_crypted($pw)) { - $bootloader->{password} = crypt_grub_password($pw); + if ($bootloader->{encrypted}) { + $pw = crypt_grub_password($pw) if !is_already_crypted($pw); + $bootloader->{'password --md5'} = $pw; + push @conf, $format->('password --md5'); + } else { + push @conf, $format->('password'); } - push @conf, $format->('password'); } push @conf, map { $_ . ' ' . $file2grub->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(gfxmenu); |