[opensuse] disable overwriting grub.cfg
Hello: My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2. I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself. Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
25.10.2019 20:30, Istvan Gabor пишет:
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Theoretically if you create file in /etc/grub.d that sorts before anything else and exits with error, grub-mkconfig should terminate early enough before it overwrites your grub.cfg. I have never tried it though. There is also an option to set bootloader to none in YaST. But then you will need to manually update it when grub packages are updated. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
25.10.2019 20:30, Istvan Gabor пишет:
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually.
why not change the setup in /etc/grub.d? changing grub.cfg is ok to test but don't stay jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25/10/2019 19.30, Istvan Gabor wrote:
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
You can instead add other entries below those of grub.cfg, by using "/boot/grub2/custom.cfg". Those are not touched. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbNI1gAKCRC1MxgcbY1H 1c10AJ0YNXDhBrR31LyWBnNVfX4aCBqCNgCfXN21MooyBBGeHWWzF7A2WYNXwdY= =PrNE -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi Istvan,
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
what about manipulating /etc/default/grub?
Thanks,
Istvan
Bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/25/2019 12:30 PM, Istvan Gabor wrote:
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Thanks,
Istvan
You can also set the config you want in /etc/default/grub so that when dracut or mkinitrd runs it uses the config you want. That avoids having to disable the normal process. Just set the normal process up to your what you want. See the "Configuration" section of https://wiki.archlinux.org/index.php/GRUB -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
26.10.2019 9:34, David C. Rankin пишет:
On 10/25/2019 12:30 PM, Istvan Gabor wrote:
Hello:
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Thanks,
Istvan
You can also set the config you want in /etc/default/grub
You can not. You can only slightly influence how generated configuration will look like.
so that when dracut or mkinitrd runs it uses the config you want. That avoids having to disable the normal process. Just set the normal process up to your what you want.
See the "Configuration" section of https://wiki.archlinux.org/index.php/GRUB
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 10/26/2019 01:49 AM, Andrei Borzenkov wrote:
You can also set the config you want in /etc/default/grub You can not. You can only slightly influence how generated configuration will look like.
Funny, I always considered being able to set the kernel command line, swap and other needed variables for grub pretty much configuring it. If the concern is about the boilerplate, then no -- that won't help you. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2019/10/25 10:30, Istvan Gabor wrote:
How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Not sure if it is file-system dependent or if it would work, but several file systems support the "immutable flag": sudo chattr +i /boot/grub.cfg to undo it when you want to edit: sudo chattr -i /boot/grub.cfg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, 31 Oct 2019 03:25:21 -0700, L A Walsh wrote:
On 2019/10/25 10:30, Istvan Gabor wrote:
How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Not sure if it is file-system dependent or if it would work, but several file systems support the "immutable flag":
sudo chattr +i /boot/grub.cfg
to undo it when you want to edit:
sudo chattr -i /boot/grub.cfg
Thank you all. In my understanding the concerted work of /etc/default/grub, /etc/grub.d scripts and /boot/grub2/grub.cfg is a grub thing. Running grub update/install after kernel update is an operating system (in my case openSUSE) setup. I do not want to change the default grub behavior (the grub thing part), but I want to set when grub install is run (the openSUSE part). My answer for those who suggested changing any grub related file is that it is a working solution, but is still a hack, because my goal is not changing grub behavior but changing when grub install is run. I guess my option is either to disable boot loader in yast as Andrei suggested, or try that immutable flag. Thank you again, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 31/10/2019 15.38, Istvan Gabor wrote:
On Thu, 31 Oct 2019 03:25:21 -0700, L A Walsh wrote:
On 2019/10/25 10:30, Istvan Gabor wrote:
How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Not sure if it is file-system dependent or if it would work, but several file systems support the "immutable flag":
sudo chattr +i /boot/grub.cfg
to undo it when you want to edit:
sudo chattr -i /boot/grub.cfg
Thank you all.
In my understanding the concerted work of /etc/default/grub, /etc/grub.d scripts and /boot/grub2/grub.cfg is a grub thing. Running grub update/install after kernel update is an operating system (in my case openSUSE) setup. I do not want to change the default grub behavior (the grub thing part), but I want to set when grub install is run (the openSUSE part).
My answer for those who suggested changing any grub related file is that it is a working solution, but is still a hack, because my goal is not changing grub behavior but changing when grub install is run.
I guess my option is either to disable boot loader in yast as Andrei suggested, or try that immutable flag.
But the thing is, everytime the kernel is changed the file *must* absolutely be changed. If you *have* to edit that file, you are doing it wrong. Edit one of the two user files instead, which are yours to edit at will. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbsqZAAKCRC1MxgcbY1H 1R2fAJ9fEGah69xQldqew0Nc+7d/ZOl6OgCgmWLdDckCm1ESMXZJ7u0h0JjFdM4= =mrtQ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Op donderdag 31 oktober 2019 11:25:21 CET schreef L A Walsh:
On 2019/10/25 10:30, Istvan Gabor wrote:
How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
Not sure if it is file-system dependent or if it would work, but several file systems support the "immutable flag":
sudo chattr +i /boot/grub.cfg
to undo it when you want to edit:
sudo chattr -i /boot/grub.cfg Don't do that. It's a guarantee for breakage on the next kernel update.
-- Gertjan Lettink a.k.a. Knurpht openSUSE Board Member openSUSE Forums Team -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Knurpht-openSUSE composed on 2019-10-31 19:47 (UTC+0100):
Don't do that. It's a guarantee for breakage on the next kernel update.
No post in this thread arrived in my account until Knurpht's. :~(
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
I don't bother trying. Instead, I build /boot/grub2/custom.cfg personally (and very infrequently have reason to change it), and copy /etc/grub.d/40_custom to /etc/grub.d/06_custom. The result is grub2-mkconfig's grub.cfg entries always follow my custom entries after POST completes. The autogenerated entries are then useful only when I want to use a prior or test kernel, so it doesn't much matter how or when grub2-mkconfig is run. My custom.cfg stanzas point to the kernel and initrd symlinks generated automatically by kernel installation, so are always pointing to the latest kernel/initrd. e.g.: https://forums.opensuse.org/showthread.php/533087-How-to-have-a-custom-UEFI-... Note those menuentries are much simpler than those grub2-mkconfig creates. https://forums.opensuse.org/showthread.php/537684-How-to-create-a-custom-gru... is conceptually similar to what I do. -- Evolution as taught in public schools is religion, not science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 31/10/2019 20.29, Felix Miata wrote:
Knurpht-openSUSE composed on 2019-10-31 19:47 (UTC+0100):
Don't do that. It's a guarantee for breakage on the next kernel update.
No post in this thread arrived in my account until Knurpht's. :~(
Look at the headers to find out where was the delay.
My question applies to all openSUSE versions that use grub2 and dracut/mkintird. Currently I use Leap 15.1, and 42.2.
I do not like the default grub configuration therefore I adjust /boot/grub2/grub.cfg manually. When I update the kernel or use mkinitrd, grub.cfg is regenerated, and my settings are overwritten. How can I disable regeneration of grub.cfg? I want to take care of grub.cfg myself.
I don't bother trying. Instead, I build /boot/grub2/custom.cfg personally (and very infrequently have reason to change it), and copy /etc/grub.d/40_custom to /etc/grub.d/06_custom.
The result is grub2-mkconfig's grub.cfg entries always follow my custom entries after POST completes.
Nice trick. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbs9EQAKCRC1MxgcbY1H 1cOeAJ9iLR8xvH5iewTCafMq4Oy2dEdx6gCeKmLF3hfLfg/gCWQXXFFt1Co7COY= =mFSx -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (10)
-
Andrei Borzenkov
-
Carlos E. R.
-
David C. Rankin
-
Felix Miata
-
Istvan Gabor
-
James Knott
-
jdd@dodin.org
-
Knurpht-openSUSE
-
L A Walsh
-
mh@mike.franken.de