[rear-users] ReaR entry in grub

Gratien D'haese gratien.dhaese at it3.be
Tue May 7 13:43:24 CEST 2013


The line:
> [[ $(type -p grub-probe) || $(type -p grub2-probe) ]]
was added to distinguish between grub and grub2 (apparently not bullet
proof).

SLES 10 Sp4:
strings $(which grub) | sed -rn
's/^[^0-9\.]*([0-9]+\.[-0-9a-z\.]+).*$/\1/p'
2.3
2.2
2.1
2.3.4
2.4
2.0
0.97
0.97
1.5
1.1
0.97

fedora18: grub2 does not exist, nor grub (by default)
[root at fedora18 gdha]# strings $(which grub2-install) | sed -rn
's/^[^0-9\.]*([0-9]+\.[-0-9a-z\.]+).*$/\1/p'
2.00
32.efi
64.efi
64.efi

[root at fedora18 gdha]# rpm -qa | grep grub
grub2-tools-2.00-15.fc18.x86_64
grub2-2.00-15.fc18.x86_64
grub2-efi-2.00-15.fc18.x86_64


On Tue, 7 May 2013 11:23:14 +0200, Jeroen Hoekx <jeroen.hoekx at hamok.be>
wrote:
> Hello,
> 
> I noticed that automatically adding a Relax-and-Recover entry in my
> grub configuration is no longer working for me on RHEL 5 and RHEL 6.
> 
> This was
> [[ $(type -p grub-probe) || $(type -p grub2-probe) ]]
> 
> Which already fails because I don't have grub-probe. Gratien, do you
> know why this line is necessary because we should skip out of the
> script in the next line? The commit message says 'Improved the grub
> (legacy) message to avoid confusion with grub2 style'...
> 
> On RHEL 5 there is another problem. We are using 'strings' on the
> binary to detect the version and then use the first line. On RHEL 6
> that works fine because the first line is 0.97. In RHEL 5 it is 2.4...
> 
> What I see in common between the two is that the last match for a
> version number is correct.
> 
> Could someone post the output in a few other distributions that still
> have legacy grub of:
> $ strings $(which grub) | sed -rn
> 's/^[^0-9\.]*([0-9]+\.[-0-9a-z\.]+).*$/\1/p'
> 
> If the last line is the correct version number there, I'll update the
> code to use that. Otherwise we'll have to find another solution.
> 
> Thanks,
> 
> Jeroen
> _______________________________________________
> rear-users mailing list
> rear-users at lists.relax-and-recover.org
> http://pikachu.3ti.be/mailman/listinfo/rear-users

-- 
Gratien D'haese
IT3 Consultants bvba 
Vennestraat 15, B-2560 Nijlen



More information about the rear-users mailing list