summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-07 11:34:49 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-07 11:34:49 +0000
commita0256593c7c7503728dcf032b7f84b35c2d8c8da (patch)
tree05a4e750bf5cd9a022528fad667892433f28db92
parent1acc01d887d78cdb491dcc6a6e9b3a09422bce60 (diff)
downloaddrakx-a0256593c7c7503728dcf032b7f84b35c2d8c8da.tar
drakx-a0256593c7c7503728dcf032b7f84b35c2d8c8da.tar.gz
drakx-a0256593c7c7503728dcf032b7f84b35c2d8c8da.tar.bz2
drakx-a0256593c7c7503728dcf032b7f84b35c2d8c8da.tar.xz
drakx-a0256593c7c7503728dcf032b7f84b35c2d8c8da.zip
recognize grub2 magic (from rosa but cleaned)
warning: looks bogus and actually unused by Rosa...
-rw-r--r--perl-install/partition_table/raw.pm8
1 files changed, 8 insertions, 0 deletions
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