FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-02-2010, 09:27 AM
Anand Sivaram
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

On Fri, Jul 2, 2010 at 08:17, Bob Proulx <bob@proulx.com> wrote:

Stephen Powell wrote:

> What's the easiest way for a shell script to tell if grub version 1

> is installed? *It is important to distinguish grub version 1 from

> grub version 2. *For example, can I just do this?

>

> if [ -f /boot/grub/menu.lst ];then

> * *blah

> * *blah

> * *blah

> fi



If you only need to know if the grub2 *package* is installed then a

very quick check is to see if the documentation directory for it is

installed. *Since all packages are required by Debian Policy to have a

documentation directory.



*if [ -d /usr/share/doc/grub-pc ]; then

* *echo The Grub2 package is installed.

*fi



> Or does that file exist in grub version 2 as well?



If the machine was upgraded from version 1 to version 2 then the

menu.lst file will be left behind until manually removed. *Because it

facilitates returning to version 1 if required.



But having the package installed doesn't meant that the machine

actually has grub2 installed in the boot path. *That seems a little

more difficult.



I recently read this blog entry by Colin Watson that talked a little

bit about grub versions and the problems of mixing them. *You might

find it interesting.



*http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2010/06/21#2010-06-21-grub2-boot-problems




Bob


-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1.4.9 (GNU/Linux)



iEYEARECAAYFAkwtUz0ACgkQ0pRcO8E2ULaw1ACeLd2LCMyHpT +j+ltxS1AKfgeK

91YAn0JNcCXv7/XGZZBbKABXphhLrtLu

=bk8d

-----END PGP SIGNATURE-----



grub2.0, the following commands print version.
grub-setup --version
grub-setup (GRUB) 1.98-1
grub-install --version
grub-install (GNU GRUB 1.98-1)

for grub1.0
grub --version should print the version.


There is some version information in the MBR also
file -s /dev/sda
 
Old 07-03-2010, 11:41 AM
Tom H
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

Stephen Powell <zlinuxman@wowway.com> wrote:
>>> What's the easiest way for a shell script to tell if grub version 1
>>> is installed? *It is important to distinguish grub version 1 from
>>> grub version 2. *For example, can I just do this?

Anand Sivaram <aspnair@gmail.com> wrote:
> grub2.0
> grub-setup --version
> grub-setup (GRUB) 1.98-1
> grub-install --version
> grub-install (GNU GRUB 1.98-1)
> grub1.0
> grub --version should print the version.

>From bootinfoscript
http://sourceforge.net/projects/bootinfoscript/
hexdump -v -n 2 -e '/1 "%x"' $drive
eb48 == grub1
eb4c == grub2 (1.96)
eb63 == grub2 (1.97,1.98)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTim1SReLWtzM45A-tJGA4zshQMXjORUh6jzhEjqt@mail.gmail.com">http://lists.debian.org/AANLkTim1SReLWtzM45A-tJGA4zshQMXjORUh6jzhEjqt@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 04:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org