From bfd6a881ceec794363833d6357cc150f898b6e2f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 26 Feb 2013 06:36:01 +0000 Subject: (read_grub2) add basic support for reading back grub2 config --- perl-install/NEWS | 1 + perl-install/bootloader.pm | 3 +++ 2 files changed, 4 insertions(+) (limited to 'perl-install') diff --git a/perl-install/NEWS b/perl-install/NEWS index d876d8d50..e87ebcf4e 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,4 +1,5 @@ - drakboot: + o add basic support for reading back grub2 config o read & write /boot/grub2/drakboot.conf o prevent installing grub2 somewhere else than MBR - always bypass blkid cache (the cache only includes a subset of the data we need) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 9e8a7d66a..68df8acd3 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -235,6 +235,9 @@ sub read { sub read_grub2 { my %bootloader = getVarsFromSh("$::prefix/boot/grub2/drakboot.conf"); + $bootloader{entries} = [ map { if_(/menuentry\s+['"]([^']+)["']/, { label => $1 }) } cat_("$::prefix/boot/grub2/grub.cfg") ]; + $bootloader{method} = 'grub2'; + \%bootloader; } sub read_grub { -- cgit v1.2.1