You are not logged in.

#1 2013-01-30 17:34:52

bjschuma
Member
From: Ann Arbor
Registered: 2009-03-10
Posts: 15

Detect grub vs grub2

I'm working on some bash scripts to install and boot into custom Linux kernels across several distros (but mostly Arch and Fedora).  Is there a standard way of checking if a machine is configured with grub legacy instead of grub2?  I was thinking of checking the output of `which grub-mkconfig` but I'm curious if there is a better solution.

Thanks!

Offline

#2 2013-01-30 17:45:06

bslackr
Member
Registered: 2012-01-27
Posts: 131

Re: Detect grub vs grub2

You could check output of grub-install -v.

Offline

#3 2013-01-30 18:36:32

bjschuma
Member
From: Ann Arbor
Registered: 2009-03-10
Posts: 15

Re: Detect grub vs grub2

That looks like it'll work, thank you!

If anybody else needs this, grub-legacy gives:

$ grub-install -v
grub-install (GNU GRUB 0.97)

And grub2 gives:

$ grub-install -v
grub-install (GRUB) 2.00

Offline

Board footer

Powered by FluxBB