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-01-2010, 06:30 PM
Stephen Powell
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

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

Or does that file exist in grub version 2 as well? I don't have
grub version 2 installed on any of my machines; so I can't easily
determine this.

--
.'`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 195019121.103027.1278009012663.JavaMail.root@md01. wow.synacor.com">http://lists.debian.org/195019121.103027.1278009012663.JavaMail.root@md01. wow.synacor.com
 
Old 07-01-2010, 06:40 PM
Andrei Popescu
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

On Jo, 01 iul 10, 14:30:12, 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
>
> Or does that file exist in grub version 2 as well? I don't have
> grub version 2 installed on any of my machines; so I can't easily
> determine this.

It doesn't exist in grub2, but there is no guarantee it was removed on
upgrade. If you question relates only to Debian systems why not ask
dpkg?

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
 
Old 07-01-2010, 07:05 PM
Ron Johnson
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

On 07/01/2010 01:30 PM, 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

Or does that file exist in grub version 2 as well? I don't have
grub version 2 installed on any of my machines; so I can't easily
determine this.



Maybe there are magic numbers in the MBR? dd the first few KB of
the device into a data file and look at it with a binary editor.


# dd if=/dev/sda of=first_blocks.dat count=8
# bvi first_blocks.dat

--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4C2CE6F3.2000508@cox.net">http://lists.debian.org/4C2CE6F3.2000508@cox.net
 
Old 07-12-2010, 01:06 PM
Stephen Powell
 
Default What's the easiest way for a shell script to tell if grub version 1 is installed?

On Sat, 03 Jul 2010 07:41:06 -0400 (EDT), Tom H wrote:
> 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)

Thanks, Tom. And thanks also to all who responded. You are all
a wealth of information, and a big help.

--
.'`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1034882814.120496.1278940002127.JavaMail.root@md01 .wow.synacor.com">http://lists.debian.org/1034882814.120496.1278940002127.JavaMail.root@md01 .wow.synacor.com
 

Thread Tools




All times are GMT. The time now is 01:47 PM.

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