Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What is happening with grub on Gentoo
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Sun Oct 20, 2013 6:42 am    Post subject: What is happening with grub on Gentoo Reply with quote

While the docs recommend grub2 and
Quote:
We recommend to start with GRUB2 as soon as it is available. The migration of GRUB to GRUB2 is documented online. The instructions in this section relate to "GRUB Legacy" and will disappear from the book soon after the stabilization of GRUB2.


Grub Legacy is easier to maintain and configure as I have seen now. Why discontinue support?
I am about to go back to grub legacy because grub2 is intransparent as I have seen and you
obviously have to reinstall it each time you start to run a new kernel.

What´s happening with the bootloader discussion in Gentoo? There seems to be a fair bit of
disagreement about which way to go.
:evil:
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2836

PostPosted: Sun Oct 20, 2013 7:34 am    Post subject: Reply with quote

Even tho grub legacy is no longer supported you can still use it.

For me, I do prefer extlinux, which is something between lilo and grub, but support mdraid1 metadata 1.0, is simple and working,
_________________
BitBucket -- better-initramfs
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Sun Oct 20, 2013 12:15 pm    Post subject: Reply with quote

Thank you SlashBeast; will have a look at it.
So you install from within the system by mounting the boot partition into /boot?
Can I configure it to use framebuffer and uvesafb ? Don´t want large fonts.
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 841
Location: Montréal

PostPosted: Sun Oct 20, 2013 12:44 pm    Post subject: Re: What is happening with grub on Gentoo Reply with quote

transsib wrote:

I am about to go back to grub legacy because grub2 is intransparent as I have seen and you
obviously have to reinstall it each time you start to run a new kernel.
:evil:

You do not have to reinstall Grub2 each time you install a new kernel. It's stay installed in the Mbr (or else). You must reinstall Grub 1 and 2 if you emerge a new version of them.

You can use a symbolic link from vmlinuz to your new kernel version and the same for an initramfs to it's new version.

This is what I do, but I am only using the 00_header script and I configure Grub2 by myself in 40_custom in the /etc/grub.d/ directory. All others scripts in this directory are not executable. Like this, I can advoid to recreate /etc/grub/grub.cfg with grub2-mkconfig when I start to use a new kernel version.
_________________
Paul
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Oct 20, 2013 1:22 pm    Post subject: Re: What is happening with grub on Gentoo Reply with quote

transsib wrote:
Grub Legacy is easier to maintain and configure

It is only simpler because it has less possibilities.
Quote:
and you obviously have to reinstall it each time you start to run a new kernel.

No. You can use exactly the same setup as in legacy grub (or with any other bootloader); grub.cfg has essentially the same commands and even more (and allows for scripting which is much more convenient since instead of an exponential number of boot-entries you can just use variables). If you use the smart-ass scripts of grub2 instead, this is your own decision.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2109
Location: Near Toronto

PostPosted: Sun Oct 20, 2013 2:22 pm    Post subject: Reply with quote

Quote:
It is only simpler because it has less possibilities.


I can use libreoffice to edit a simple text file. It has many
more possibilities than nano.

But, you know, I wouldn't want nano replaced by libreoffice.

I don't need what grub2 offers so it's sad that grub will no longer
be supported
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 332
Location: Canada

PostPosted: Sun Oct 20, 2013 2:36 pm    Post subject: Reply with quote

I use grub2 much like I used legacy grub.

See the manual configuration section of http://wiki.gentoo.org/wiki/GRUB2_Quick_Start

I dislike the automatic configuration but fortunately it is not necessary to use it.
Back to top
View user's profile Send private message
TomWij
Developer
Developer


Joined: 04 Jul 2012
Posts: 1551

PostPosted: Sun Oct 20, 2013 2:50 pm    Post subject: Re: What is happening with grub on Gentoo Reply with quote

transsib wrote:
Grub Legacy is easier to maintain and configure as I have seen now.


Easier or easy? I have not experienced Grub 2 to be more difficult.

transsib wrote:
Why discontinue support?


Because the software life cycle has come to an end; when upstream discontinues it, we cannot provide false claims of guaranteed support that cannot be realized. (On a side note, I do not maintain this package)

transsib wrote:
I am about to go back to grub legacy because grub2 is intransparent as I have seen and you
obviously have to reinstall it each time you start to run a new kernel.


Or you just adjust the configuration file in /boot/grub/ and use it the Grub Legacy way. It is as easy as it used to be.

The default is easier for people that don't want to configure it, it might indeed not be the best default for Gentoo users; yet, that doesn't stop it from being used like you have been doing it for years.

Okay, the syntax has perhaps changed a small bit; but other than that, it is mostly still the same.

nlsa8z6zoz7lyih3ap wrote:
I dislike the automatic configuration but fortunately it is not necessary to use it.


Well, I am starting to dislike the manual configuration as I am near 115 lines right now (the side effect of making entries for dev, testing, backup and debug kernels for various branches, ...); there's a heavy amount of repetition in there, so I am planning to look into the automation and/or using its script nature to shorten that. I can see where some of the features become useful; though, on a side note, using a better text editor (select something, then use a key to have it select all occurences) and/or tools like sed and awk still help a great deal to maintain the manual configuration.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Oct 20, 2013 4:15 pm    Post subject: Reply with quote

albright wrote:
Quote:
It is only simpler because it has less possibilities.

I can use libreoffice to edit a simple text file. It has many
more possibilities than nano.

It has hardly more possibilities concerning textfile editing, maybe libreoffice cannot even be used for textfile editing.
A better comparison would be an ancient bourne shell vs. a modern shell like bash or zsh: It has the same possibiities, in case of zsh (like grub2) with a slightly changed syntax to make things more convenient, and you have functions and arrays. Yes, due to this new features there are some more commands and an extended syntax. Do you really think it would a good idea to stay with an ancient bourne shell (with all its known bugs) if you are too lazy to learn these new commands?
Quote:
I don't need what grub2 offers

Probably you would use if you would know some of the possibilities. But if you just refuse to learn, you cannot be helped.
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Sun Oct 20, 2013 4:23 pm    Post subject: Reply with quote

Thank you all a lot for the input. I haven´t changed anything yet.
I am not the kind of Gentoo user that holds on to good old habits.
I embrace progress and usually love to go with it.
As you can see there are almost as many boot variants as Gentoo users
which encourages doubts.
And there are highly experienced people whose opinions I respect very much
that are not so sure whether grub2 makes sense.
I will keep grub2 and see where that takes me and certainly learn how to customize it.
Thanks again
Back to top
View user's profile Send private message
nemectic
Apprentice
Apprentice


Joined: 20 Aug 2004
Posts: 181

PostPosted: Sun Oct 20, 2013 4:29 pm    Post subject: Reply with quote

I think the automatically generated grub.cfg's of grub2 make it appear much more intimidating than it actually is.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Oct 20, 2013 4:34 pm    Post subject: Re: What is happening with grub on Gentoo Reply with quote

TomWij wrote:
Well, I am starting to dislike the manual configuration as I am near 115 lines right now (the side effect of making entries for dev, testing, backup and debug kernels for various branches, ...)

Mine is currently 602 lines: Luxury menus to change resolutions, init-system, various kernel parameters (each manually or from fixed choices like openrc/systemd/direct to bash/zsh), booting various kernels from main system, 32 bit chroot, tiny rescue system, or from an analogous partition of my second harddisk, possibility to run 4 sorts of memchecks (32 bit and 64 bit, linux or bsd style), chainloading test systems, giving VBE info, using various SBM bootloaders (to boot e.g. from a cdrom without changing the bios) etc.
Quote:
so I am planning to look into the automation and/or using its script nature to shorten that

I use the script nature to set variables for resolution, init-system and some kernel parameters and use these variables in the main sections. Without that I would (as was the case with legacy grub) need a menu entry for every combination I might ever want (or I would have to edit a the boot prompt) which are both rather annoying possibilities. If you have various kernels on only one or two partitions you can as well set the kernel name as a variable.
The only drawback of setting variables is that they are not preserved over submenus, e.g. if you want to set the resolution, all possible resolutions must appear in the same menu level as your kernel. If somebody knows how to work around that restriction, I would be happy to know (since I have 2 "main" submenus with kernels, I essentially have to repeat the resoltion/boot/parameter options in both of them, currently; of course it is not so bad in the gruib.cfg since there are functions so that the menus consist essentially of only one command, but at booting I see "long" menus although I would like to "hide" setting of some options in further submenus)
Back to top
View user's profile Send private message
pa4wdh
Apprentice
Apprentice


Joined: 16 Dec 2005
Posts: 247

PostPosted: Sun Oct 20, 2013 4:49 pm    Post subject: Reply with quote

I've recently did a 64bit x86 install, and with that grub2 makes sense since grub-legacy would have been the only program i needed 32bit support for.

In my opinion the best thing about grub2 is it's rescue mode. It really does what it says and rescued me from what otherwise would have been an unbootable system (which is no fun if you can't boot from USB or CD :wink: ).

Quote:

I dislike the automatic configuration but fortunately it is not necessary to use it.

I 100% agree with that. As soon as i found out i could configure manually i started doing that, leading to a much cleaner, easier to read configuration. And after a little getting used to it, it isn't much harder than the grub-legacy format.

However, if you use LVM or software raid to boot from you should use the -9999 built, since the regular 2.00 doesn't handle that very well (at least it didn't in my case :cry: , which was the source of the problems i needed the rescue mode for :wink: )
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Oct 20, 2013 4:54 pm    Post subject: Reply with quote

pa4wdh wrote:
In my opinion the best thing about grub2 is it's rescue mode.

This existed already in legacy grub. However, if you use lvm2 as you say, legacy grub could not help you at all with that, of course - one of several things not available with legacy grub.
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 332
Location: Canada

PostPosted: Sun Oct 20, 2013 5:24 pm    Post subject: Reply with quote

Quote:
Well, I am starting to dislike the manual configuration as I am near 115 lines right now (the side effect of making entries for dev,
testing, backup and debug kernels for various branches, ...); there's a heavy amount of repetition in there, so I am planning to look into
the automation and/or using its script nature to shorten that. I can see where some of the features become useful; though, on a side note,
using a better text editor (select something, then use a key to have it select all occurences) and/or tools like sed and awk still help a
great deal to maintain the manual configuration.



My manual configuration for grub2 follows. It is little different, except for the odd change in syntax, than the one I used with legacy
grub. I never change this configuration when I build a new kernel. I use my own script when I build new kernels, and it builds and copies
the new kernel to /boot and links it to vmlinuz-gentoo.




Code:

### BEG
default=1
menuentry           'Gentoo'  {
root=hd0,5
linux          /vmlinuz-gentoo     iommu=on
initrd         /initramfs7.cpio.gz
}



menuentry           'Gentoo  systemd'  {
root=hd0,5
linux          /vmlinuz-gentoo     iommu=on
initrd         /initsystemd7.cpio.gz
}




menuentry           'Gentoo Alternate Root'  {
root=hd0,6
linux          /vmlinuz-gentoo
initrd          /initsystemd8.cpio.gz
}


menuentry 'Gentoo64 Single User Mode'   {
root=hd0,5
linux        /vmlinuz-gentoo
initrd       /initramfsingle7.cpio.gz
}



menuentry "Memtest86+" {
        linux16 /boot/memtest86plus/memtest.bin
}








If I had just one gentoo partition instead of 2, my grub2 config could be as short as just the following 6 lines:


Code:

### BEG
menuentry           'Gentoo'  {
root=hd0,5
linux          /vmlinuz-gentoo     iommu=on
initrd         /initramfs7.cpio.gz
}




My point is that, if you loved legacy grub, like I did (and still do) you can move to grub2 by making only the most minor syntax changes to your old legacy grab configuration file
and then doing everything else more or less the same way that you used to.

Moreover, grub2, like legacy grub has an interactive mode that can be used, if you suddenly want to boot into a kernel that is not listed in grub.cfg.
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Sun Oct 20, 2013 5:41 pm    Post subject: Reply with quote

See, lots of discontent :wink:

I miss
Code:
insmod gfxpayload=keep
in my grub.cfg
Back to top
View user's profile Send private message
pa4wdh
Apprentice
Apprentice


Joined: 16 Dec 2005
Posts: 247

PostPosted: Sun Oct 20, 2013 7:16 pm    Post subject: Reply with quote

mv wrote:
pa4wdh wrote:
In my opinion the best thing about grub2 is it's rescue mode.

This existed already in legacy grub. However, if you use lvm2 as you say, legacy grub could not help you at all with that, of course - one of several things not available with legacy grub.

Are you actually sure about that ? I've never seen something like that. I have seen an interactive mode, but that's only possible after all components are loaded.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Oct 20, 2013 7:36 pm    Post subject: Reply with quote

pa4wdh wrote:
I have seen an interactive mode, but that's only possible after all components are loaded.

IMHO "interactive" and "rescue" mode are the same; in legacy grub there is not much loading of components. If your stage1.5 (or analogon for grub2) fails e.g. because of harddisk problems or only partially installed grub you are lost in legacy grub as well as in grub2.
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 332
Location: Canada

PostPosted: Sun Oct 20, 2013 8:09 pm    Post subject: Reply with quote

Quote:
I have seen an interactive mode, but that's only possible after all components are loaded.

With grub2.

I can use interactive mode with only the simple grub.cfg which I list above. When greeted with the menu while booting, select a boot choice, press "e" and follow the directions.

As to rescue mode: Sometimes that is helpful too on rarer occasions. It is worthwhile looking it up and keeping written directions by your PC, for those occasions when grub itself seems to be broken.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2289
Location: Canada

PostPosted: Sun Oct 20, 2013 11:01 pm    Post subject: Re: What is happening with grub on Gentoo Reply with quote

mv wrote:

Mine is currently 602 lines: Luxury menus to change resolutions, init-system, various kernel parameters (each manually or from fixed choices like openrc/systemd/direct to bash/zsh), booting various kernels from main system, 32 bit chroot, tiny rescue system, or from an analogous partition of my second harddisk, possibility to run 4 sorts of memchecks (32 bit and 64 bit, linux or bsd style), chainloading test systems, giving VBE info, using various SBM bootloaders (to boot e.g. from a cdrom without changing the bios) etc.
....
I use the script nature to set variables for resolution, init-system and some kernel parameters and use these variables in the main sections. Without that I would (as was the case with legacy grub) need a menu entry for every combination I might ever want (or I would have to edit a the boot prompt) which are both rather annoying possibilities. If you have various kernels on only one or two partitions you can as well set the kernel name as a variable.
The only drawback of setting variables is that they are not preserved over submenus, e.g. if you want to set the resolution, all possible resolutions must appear in the same menu level as your kernel. If somebody knows how to work around that restriction, I would be happy to know (since I have 2 "main" submenus with kernels, I essentially have to repeat the resoltion/boot/parameter options in both of them, currently; of course it is not so bad in the gruib.cfg since there are functions so that the menus consist essentially of only one command, but at booting I see "long" menus although I would like to "hide" setting of some options in further submenus)


Wow, I feel I am missing something in life. Last time I did anything to my grub.conf besides copying the kernel line for new version was like 8 years ago.
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Mon Oct 21, 2013 6:12 am    Post subject: Reply with quote

Hope I will never have to use a rescue mode although I´d really like to know
whether it makes fixing things easier than from the Install CD in chroot.
I also don´t have to edit much for grub2 to properly detect my kernels and my Win 7 OS on /dev/sdb
so nicely done.
Code:
grub2-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found theme: /boot/grub/themes/starfield/theme.txt
Found linux image: /boot/kernel-3.11.4-gentoo
Found linux image: /boot/kernel-3.10.7-gentoo
  No volume groups found
Found Windows 7 (loader) on /dev/sdb1
done

I may have a problem with the system clock after having been on Windows but it is
quite possible that this has nothing to do with grub2; it is a recurring issue anyway.

But what I hate is the oversized font size on the boot console. See grub did it nicely.
Splash of grub2 is fine now but once the decompress and boot of kernel starts the resolution changes from
a comfortable 1280x1024x32 vga=795 to huge dimensions. Grub2 does not keep it.

I´ve editied /etc/grub.d/00_header by adding the gfxpayload line here
Code:
   cat << EOF
  set gfxmode=${GRUB_GFXMODE}
  set gfxpayload=keep
  load_video
  insmod gfxterm


Found here
http://www.intdblog.com/2009/09/grub-2-graphical-boot-tips-to-set.html

I tried to add a line to /etc/default/grub like so
Code:
 The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE="1280x1024x32"

# selbst hinzugefügt
GRUB_GFXPAYLOAD_LINUX=keep


found here
http://forum.ubuntuusers.de/topic/grub2-boot-meldungen-in-1920x1200-aufloesung-/#post-2590169
( many good ideas and tips can be found on ubuntu forums and knowledge base )

To no avail yet - grub2 here reverts me to ye olde huge font size of the early times as soon as the
kernel boots.

Now I´m gonna try it on 40_custom, see whether that makes a difference ´cause it´s got the exec line there.

Which solution is known to work for Gentoo?
Back to top
View user's profile Send private message
TomWij
Developer
Developer


Joined: 04 Jul 2012
Posts: 1551

PostPosted: Mon Oct 21, 2013 7:24 am    Post subject: Reply with quote

You need to change the parameters passed to the kernel for that.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Mon Oct 21, 2013 7:26 am    Post subject: Re: What is happening with grub on Gentoo Reply with quote

dmpogo wrote:
Wow, I feel I am missing something in life. Last time I did anything to my grub.conf besides copying the kernel line for new version was like 8 years ago.

I had such a complex setup already with legacy grub. For instance, my (ancient) laptop has only a chance to work with beamers if I booted with the native beamer resolution; since I know this usually only a few minutes before the talk, it is necessary to have all resolutions at least for the current kernel. Then it is also good to have a fallback kernel. And a way to choose a different init-system or boot directly into the shell if e.g. udev hangs. At my home system I left in a hardly working harddisk as a fallback which is more convient to boot than a rescue cd.
And so on: From time to time necessities for new options turned up in certain rescue situations, and there actually never was a reason to remove these options. So better I spend one time writing/testing a grub.cfg with many possibilities and be reasonable safe for all sort of booting problems I might run into. I already had some occassions where I survived without a rescue cd because of this - and a rescue cd is never available when you urgently need it, e.g. when there is a power loss some hours before a talk.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Mon Oct 21, 2013 7:44 am    Post subject: Reply with quote

transsib wrote:
But what I hate is the oversized font size on the boot console.

Are you talking about boot (i.e. when loading the kernel) or the grub menu?
With the grub menu, I have not much experience, since I have emerged with USE=-fontconfig, since I do not want to install fonts just because of grub. Consequently I removed all graphical elements from the grub menu, since I would not be able to see anything in graphical mode without fonts...
Concerning booting, certain supported resolutions can be directly set in gfxpayload, e.g.
Code:
set gfxpayload='1280x1024x32'

Depending on your kernel setup, you might also need to pass a kernel parameter like video=VGA:1400x1050@75 or vga=0x31A. The latter is supported only with 32 bit kernels if you use linux16.
It depends much on your graphic card and your kernel setup what will work and what is compatible with each other. (E.g. with nouveau drivers, I get a dead lock with the vga= parameter, linux16, and systemd while the same works nicely with openrc or proprietary nvidia drivers).
Back to top
View user's profile Send private message
transsib
l33t
l33t


Joined: 26 Jul 2003
Posts: 641

PostPosted: Mon Oct 21, 2013 5:47 pm    Post subject: Reply with quote

Quote:
You need to change the parameters passed to the kernel for that.

You mean I need to pass those parameters on boot, each time I boot up?
That would be stone-age as grub legacy did this by reading from grub.conf.
Code:
video=uvesafb:1280x1024-24@60,mtrr:3,ywrap,vga=795 splash=silent,fadein,fadeout,theme:natural_gentoo \
fbcon=scrollback:128K quiet CONSOLE=/dev/tty1 \

I have all the necessary options in the kernel to make that work out of the box with nvidia proprietary driver.
Quote:
Are you talking about boot

Yes, grub menu is nice, just as soon as boot starts it looks like old ms-dos times. This is a step backwards.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum