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 > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 08-03-2008, 04:32 AM
"Derek Kaser"
 
Default kernel order

On Sat, Aug 2, 2008 at 11:25 PM, NoOp <glgxg@sbcglobal.net> wrote:
>
> Is there a parameter in Grub that I can set to tell grub to put the
> -generic kernel's first?

I don't think that there's a parameter that can do that, but you could
do it by giving -generic kernels a greater weight in
/usr/sbin/update-grub. In the file, you should see the following code
in the CompareVersions function (this is taken from Intrepid, where it
starts at line 544):

# we weight different kernel suffixes here
# ac = 50
# pre = -50
# rc = -40
# test = -60
# others are given 99
v1=$(echo $v1 | sed -e 's! k7! 786 !g' -e 's! ac! 50 !g' -e 's! rc!
-40 !g' -e 's! pre! -50 !g' -e 's! test! -60 !g' -e 's![^ ]*[^-0-9 ][^
]*!99!g')
v2=$(echo $v2 | sed -e 's! k7! 786 !g' -e 's! ac! 50 !g' -e 's! rc!
-40 !g' -e 's! pre! -50 !g' -e 's! test! -60 !g' -e 's![^ ]*[^-0-9 ][^
]*!99!g')

If you change that to:

# we weight different kernel suffixes here
# ac = 50
# pre = -50
# rc = -40
# test = -60
# generic = 101
# others are given 99
v1=$(echo $v1 | sed -e 's! k7! 786 !g' -e 's! ac! 50 !g' -e 's! rc!
-40 !g' -e 's! pre! -50 !g' -e 's! test! -60 !g' -e 's! generic! 100
!g' -e 's![^ ]*[^-0-9 ][^ ]*!99!g')
v2=$(echo $v2 | sed -e 's! k7! 786 !g' -e 's! ac! 50 !g' -e 's! rc!
-40 !g' -e 's! pre! -50 !g' -e 's! test! -60 !g' -e 's! generic! 100
!g' -e 's![^ ]*[^-0-9 ][^ ]*!99!g')

It will assign the generic kernel a weight of 100, and the 386 kernel
will keep the default weight of 99. That will make the generic kernel
appear above the 386 kernel.

This will all get erased, however, if grub updates, and you will need
to edit the file again to get the kernels to appear in the desired
order. Grub doesn't update very frequently, though (basically, it only
does when you upgrade to a newer version of Ubuntu), so that probably
won't be an issue.

Derek

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-03-2008, 04:57 AM
"Derek Kaser"
 
Default kernel order

Note: you will need to remove the extra line breaks that Gmail added
to the above code.

It should look like the following:

#[Comments]
v1=$(echo $v1 [snip] *!99!g')
v2=$(echo $v1 [snip] *!99!g')

Derek

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-03-2008, 04:23 PM
NoOp
 
Default kernel order

On 08/02/2008 09:57 PM, Derek Kaser wrote:
> Note: you will need to remove the extra line breaks that Gmail added
> to the above code.
>
> It should look like the following:
>
> #[Comments]
> v1=$(echo $v1 [snip] *!99!g')
> v2=$(echo $v1 [snip] *!99!g')
>
> Derek
>

Brilliant! I'll give that a try today.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-03-2008, 08:42 PM
NoOp
 
Default kernel order

On 08/03/2008 09:23 AM, NoOp wrote:
> On 08/02/2008 09:57 PM, Derek Kaser wrote:
>> Note: you will need to remove the extra line breaks that Gmail added
>> to the above code.
>>
>> It should look like the following:
>>
>> #[Comments]
>> v1=$(echo $v1 [snip] *!99!g')
>> v2=$(echo $v1 [snip] *!99!g')
>>
>> Derek
>>
>
> Brilliant! I'll give that a try today.
>
>

Interesting... I tried it on the laptop and it worked perfectly!

So I copied the modified update-grub over to the desktop (both are hardy
- laptop is a straight hardy install, desktop is a gutsy-to-hardy
upgraded machine), made sure the permissions etc were correct, and did
'sudo update-grub' on the desktop. On the desktop machine the -386's are
still listed above the -generics. So, I'll have to play with it a bit
more on the desktop machine to figure out why.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:56 AM.

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