From 26fc80090bda55609b6eb29d82023018b2873743 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 7 Dec 2012 11:34:49 +0000 Subject: recognize grub2 magic (from rosa but cleaned) warning: looks bogus and actually unused by Rosa... --- perl-install/partition_table/raw.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index 0438fda5a..612647e60 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -29,6 +29,14 @@ if_(arch() =~ /ppc/, substr($tmp, 0, 2) eq "\xEBH" or return; index($tmp, $magic, $min) >= 0 && "grub"; }, + sub { my ($F) = @_; + #- similar to grub-legacy, grub2 doesn't seem to have good magic + #- so scanning a range of possible places where grub can have its string + my ($min, $max, $magic) = (0x176, 0x188, "GRUB"); + my $tmp; + sysseek($F, 0, 0) && sysread($F, $tmp, $max + length($magic)) or return; + index($tmp, $magic, $min) >= 0 && "grub2"; + }, [ 'lilo', 0x2, "LILO" ], [ 'lilo', 0x6, "LILO" ], [ 'lilo', 0x6 + 0x40, "LILO" ], #- when relocated in lilo's bsect_update(), variable "space" on paragraph boundary gives 0x40 -- cgit v1.2.1