summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-06-21 18:25:19 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-06-21 18:35:54 +0200
commitfbe54fe257e9bcaf13458b404211797b6786e868 (patch)
treee20e6dc1a86e34234f7a4a207f6e04a3bd424592
parente1af7f91d98880295a319a9721dfce0bc6a1f141 (diff)
downloaddrakx-fbe54fe257e9bcaf13458b404211797b6786e868.tar
drakx-fbe54fe257e9bcaf13458b404211797b6786e868.tar.gz
drakx-fbe54fe257e9bcaf13458b404211797b6786e868.tar.bz2
drakx-fbe54fe257e9bcaf13458b404211797b6786e868.tar.xz
drakx-fbe54fe257e9bcaf13458b404211797b6786e868.zip
grub2: simplify using user.cfg (mga#15930)
-rw-r--r--perl-install/bootloader.pm17
1 files changed, 3 insertions, 14 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index f32d6292c..9a5085aa3 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -339,14 +339,7 @@ sub read_grub2() {
}
# Get password prior to run update-grub2:
- my $pw_f = get_grub2_users();
- if (-e $pw_f) {
- foreach (cat_($pw_f)) {
- if (/password_pbkdf2 root (.*)/) {
- $bootloader{password} = $1;
- }
- }
- }
+ $bootloader{password} = { getVarsFromSh(get_grub2_users()) }->{GRUB2_PASSWORD};
$bootloader{method} = cat_($f) =~ /set theme=.*maggy/ ? 'grub2-graphic' : 'grub2';
\%bootloader;
@@ -1856,11 +1849,7 @@ sub write_grub2 {
if (!is_grub2_already_crypted($bootloader->{password})) {
$bootloader->{password} = crypt_grub2_password($bootloader->{password});
}
-
- output_with_perm($pw_f, 0755, qq(cat <<EOF
-set superusers="root"
-password_pbkdf2 root $bootloader->{password}
-EOF));
+ output_with_perm($pw_f, 0600, "GRUB2_PASSWORD=$bootloader->{password}");
} else {
rm_rf($pw_f);
}
@@ -1898,7 +1887,7 @@ EOF));
}
sub get_grub2_users() {
- "$::prefix/etc/grub.d/01_drakx_users";
+ "$::prefix/boot/grub2/user.cfg";
}
sub get_grub2_install_sh() {