diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-12-07 11:34:49 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-12-07 11:34:49 +0000 |
commit | a0256593c7c7503728dcf032b7f84b35c2d8c8da (patch) | |
tree | 05a4e750bf5cd9a022528fad667892433f28db92 /perl-install/partition_table/raw.pm | |
parent | 1acc01d887d78cdb491dcc6a6e9b3a09422bce60 (diff) | |
download | drakx-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...
Diffstat (limited to 'perl-install/partition_table/raw.pm')
-rw-r--r-- | perl-install/partition_table/raw.pm | 8 |
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 |