Bug 769114

Summary: Yast Grub 2 Boot Loader is missing the Section Field for editing
Product: [openSUSE] openSUSE 12.2 Reporter: Roman Bysh <rb03884>
Component: YaST2Assignee: Michael Chang <mchang>
Status: VERIFIED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: Eduard.Avetisyan, jcheung, rb03884, vmicho
Version: Beta 2   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Roman Bysh 2012-06-27 19:28:17 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0

I initialized the Yast Grub2 Boot Loader and observed that the "Section Field" is missing. Compare it to Grub1 Boot Loader.

This would allow the user to rename the entry shown in the Grub2 Boot Menu.

Reproducible: Always

Steps to Reproduce:
1. Navigate to Yast --> System Tools --> Boot Loader
2. Click on Boot Loader Options
3. The "Section Field" is missing
Actual Results:  
The "Section Field" is missing. The user cannot edit/rename the Grub2 menu entry

Expected Results:  
The "Section Field" is available for the user to edit/rename the Grub2 menu entry
Comment 1 Andreas Jaeger 2012-07-03 17:03:24 UTC
grub2 is not feature compatible to grub, so this might not be possible to do.
Comment 2 Roman Bysh 2012-07-03 19:09:17 UTC
It's unfortunate. I know practically everybody is going to request this feature. We really need a way of renaming the boot entry. Especially for the boot manager. Especially in uefi where the name is displayed on boot manager.

If you can provide an 'edit field' for "Section Field" via Yast Boot Loader, openSUSE will have something other distros do not have.

I posed this question on the Factory mail list and a positive response was provided on the link below:

http://lists.opensuse.org/opensuse-factory/2012-06/msg01068.html
Comment 3 Michael Chang 2012-07-04 06:02:55 UTC
Roman,
I've done with it, and sent pull request to Steffen.
 https://github.com/yast/yast-bootloader/pull/5

I think Andrea is right, we can't offer 100% clone of Grub1's "per" section management feature, because to do that we have to bypass the entire grub2's scripts and sneak into grub.cfg .. that's bad idea and breaks grub2's integrity => no warranty!

We could only focus on the exposed options by grub2, that is what presents in /etc/default/grub. 

But thanks for your idea and following it. :)
Comment 4 Michael Chang 2012-07-04 06:04:49 UTC
(In reply to comment #3)
> Roman,
> I've done with it, and sent pull request to Steffen.
>  https://github.com/yast/yast-bootloader/pull/5

Oh, that is to edit GRUB_DISTRIBUTOR, as we discussed on factory.
Comment 5 Roman Bysh 2012-07-04 20:28:32 UTC
Is your new feature the same as what is done by the kcm-grub module?
Comment 6 Roman Bysh 2012-07-04 20:35:05 UTC
Follow Up

Our problem is when the kernel gets upgraded or downgraded. The entry shown in the Grub2 boot menu always changes. And, the entry appears quite long.
Comment 7 Michael Chang 2012-07-06 06:14:43 UTC
(In reply to comment #5)
> Is your new feature the same as what is done by the kcm-grub module?

In the beginning when survey grub2's feature, I tried kcm-grub and at that time I found they didn't provide the section management feature like we have in yast2-bootloader. So I think the answer is yes for me. But it's a while ago and I didn't check with current kcm-grub.
Comment 8 Michael Chang 2012-07-06 06:54:45 UTC
(In reply to comment #6)
> Follow Up
> 
> Our problem is when the kernel gets upgraded or downgraded. The entry shown in
> the Grub2 boot menu always changes. And, the entry appears quite long.

The config is generated and the entire content depends on your system's status. The title is made of your "distributor" setting and the kernel version it will boot. Kernel version changes, the title changes. Unfortunately this is not the grub2 feature you want.

It's not likely to view from a bug's perspective , but a custom feature's perspective to me. We know we have to shape grub2 more friendly to openSUSE, but not all can be done easily and nevertheless we have to maintain the changes, we have to balance them.

The discussion brings me back to the early stage when I tried to make yast to support grub2, In first version I did try to keep the features in section management and in order to achieve that I did many intrusive changes to grub2 packages. I think the "dead body" may still lay somewhere in my home project (not sure if they were deleted by systems automatically). The final decision is a new version, which not try to do those those hacky changes (like what I described in my wiki page) to grub2, they would be our burden, in terms of maintainability,

For me, I support the decision that time and don't want to reincarnate those ugly changes either.

Thanks.
Comment 9 Roman Bysh 2012-07-06 16:12:26 UTC
Agreed. Sure would be nice to see screenshots of your first version.
I know you're under the gun so there's only so much time to get things done. 

IMHO I think over the next couple of versions we'll see a finely tweaked Yast2 Boot Loader. N'est pas?

Maybe a new openSUSE-specific "config" file can be created that can be linked to Grub2? Pipe dream?
Comment 10 Michal Veselenyi 2012-07-11 18:33:40 UTC
I can confirm.
It gets really annoying as you cannot edit dual/triple boots.
I've installed 12.2b2 on a separate root partition, with common /boot partition (from 11.3) and somewhat I've got about 5-6 entries in grub menu (11.3, 12.2, XP), but cannot edit them in Yast.
Comment 11 Michael Chang 2012-07-12 06:12:50 UTC
In short, it's not YaST but grub2's config (NOT /boot/grub2/grub.cfg, but /etc/default/grub) not offer as the capability to do that.

If anyone could make the config capable to do that and accepted by upstream, who will be my hero, then I'm happy to do that in YaST. Don't ask me to do that because I tried before and gave up. (see comment #8) :(
Comment 12 Roman Bysh 2012-07-13 17:06:04 UTC
May I suggest that the Yast Boot Loader create a separate file. The file can use a name such as "05_yast-bl" and saved to /etc/grub.d/.

So long as it's saved to /etc/grub.d/05_yast-bl, the user will be able to rename the menuentry field.
Comment 13 Roman Bysh 2012-07-13 17:10:23 UTC
Follow Up

It's something to consider for future releases of openSUSE.
Comment 14 Michael Chang 2012-07-16 05:38:51 UTC
(In reply to comment #12)
> May I suggest that the Yast Boot Loader create a separate file. The file can
> use a name such as "05_yast-bl" and saved to /etc/grub.d/.
> 
> So long as it's saved to /etc/grub.d/05_yast-bl, the user will be able to
> rename the menuentry field.

Could you please illustrate your idea more elaborate ?

For example, how we could rename menuentry field via this 05_yast-bl ? Did it require a new config file like in /etc/default/grub_yast-bl that holds per menuentry specific information (And would allow yast to edit) ? How do you deal with the potential clash to the default config & scripts ?

Thanks.
Comment 15 Roman Bysh 2012-07-16 16:42:35 UTC
Correction

The file 05_yast-bl is saved to /etc/grub.d/ not /etc/default/.


I did all of this manually and it works.

The entire block of menuentry entries in grub.cfg are copied to the 05_yast-bl.

I chmod -x 10_linux and os-prober. Since 05_yast-bl has a lower number than 10_linux, it will take precedence and there are no clashes.

Now the user can name the menuentry to their liking. I ran the yast boot loader to update grub.cfg. You can also use grub2-mkconfig -o /boot/grub2/grub.cfg. 

When the user reboots they will see the revised boot menu. As long as there are no kernel updates the user will be satisfied.

A custom script needs to be add so that when a newer version of the kernel is being installed you must chmod +x 10_linux and os-prober so that it can detected. I did this manually just to see if it worked.

The changes should be reflected in grub.cfg. The script copies the changes to
05_yast-bl and the cycle gets repeated.
Comment 16 Roman Bysh 2012-07-16 23:59:03 UTC
Follow Up

The file 05_yast-bl must include the following two lines at the top of the file:

#!/bin/sh
exec tail -n +3 $0
Comment 17 Michael Chang 2012-07-19 06:56:36 UTC
Roman,
Thanks a lot for your effort on investigating this. But I'm sorry I can't do that, at least at this moment, as I think this is inherently a grub2's defect and our attempt to circumvent it would probably leave us alone  .. :(

Yast2 bootloader is not the only tools invented to support grub2, others like kcm-grub or Grub Customizer are there and may work better than yast2 bootloader. If you feel yast2 bootloader not satisfied then it's totally fine for me to pick them and ditch yast2 bootloader. At least, I'm confident in ensuring interoperability with them because we don't take any procedure that may potentially case conflicting.

For ex, if you disable 10_linux and os-prober then other tools may have no idea on how to configuring grub2, as they have no knowledge to 05_yast-bl.
Comment 18 Roman Bysh 2012-07-19 16:19:34 UTC
I'm also seeing this as a defect in grub2. Possibly, an omission.

All of these tools have to dance around the way the scripts have been written. And, it looks like - at least for now - we'll have to do the same until the grub2 code allows more flexibility. Yes?

I like what has been done so far with the 12.2 Yast Boot Loader.
 
Hopefully we can look into this in a future release of openSUSE.
Comment 19 Torsten Duwe 2012-10-11 13:01:11 UTC
*** Bug 775212 has been marked as a duplicate of this bug. ***
Comment 20 Jeffrey Cheung 2013-11-07 07:39:28 UTC
> (In reply to comment #3)
> > Roman,
> > I've done with it, and sent pull request to Steffen.
> >  https://github.com/yast/yast-bootloader/pull/5
> 
> Oh, that is to edit GRUB_DISTRIBUTOR, as we discussed on factory.

I can confirm that when I am at the Boot Loader Settings > Grub2 boot loader > Boot loader option in 12.3, I can edit the "Distributor Name".

Set it closed as fixed