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 | 26fc80090bda55609b6eb29d82023018b2873743 (patch) | |
tree | 05a4e750bf5cd9a022528fad667892433f28db92 /perl-install/partition_table | |
parent | 2bd074d0ad9963ae54a94d3945ff99334ecf93ed (diff) | |
download | drakx-backup-do-not-use-26fc80090bda55609b6eb29d82023018b2873743.tar drakx-backup-do-not-use-26fc80090bda55609b6eb29d82023018b2873743.tar.gz drakx-backup-do-not-use-26fc80090bda55609b6eb29d82023018b2873743.tar.bz2 drakx-backup-do-not-use-26fc80090bda55609b6eb29d82023018b2873743.tar.xz drakx-backup-do-not-use-26fc80090bda55609b6eb29d82023018b2873743.zip |
recognize grub2 magic (from rosa but cleaned)
warning: looks bogus and actually unused by Rosa...
Diffstat (limited to 'perl-install/partition_table')
-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 |