[arch-general] Package grub Encourages Warnings to be Ignored.
Hi, Having spotted warning: /boot/grub/grub.cfg saved as /boot/grub/grub.cfg.pacsave during today's large package upgrade, I went to /boot/grub afterwards expecting work to do. grub.cfg.pacsave didn't exist. `pacman -Ql grub' showed grub doesn't own anything in /boot. Google led me to https://bbs.archlinux.org/viewtopic.php?id=242285 where Salkay had earlier started along the same path. The warning has wasted our time, and the forum's conclusion is `ignore the warning'. Encouraging warnings to be ignored is a bad idea; I don't suppose some here are too happy when a user turns up with a problem and the answer was under their nose but they `ignored the warning'. Can a better solution to this be engineered? -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Saturday, December 8, 2018 9:55 AM, Ralph Corderoy <ralph@inputplus.co.uk> wrote:
Can a better solution to this be engineered?
For the kernel we run mkinitcpio. So there shouldn't be a real reason why we shouldn't run grub-mkconfig >/${main_grub_dir}/grub.cfg for grub. That being said, the path is /boot/grub.cfg for me, so I'm not sure how we'd get the installfile to figure out where to output its output. One key difference is that the output of mkinitcpio are binary files, whereas grub.cfg is a text file, and maybe operators would like to modify that file after it's generated? So one could make a case that the install file should in fact keep its hands off grub.cfg entirely. cheers! mar77i Sent with ProtonMail Secure Email.
On 2018-12-08 13:45, mar77i via arch-general wrote:
For the kernel we run mkinitcpio. So there shouldn't be a real reason why we shouldn't run grub-mkconfig >/${main_grub_dir}/grub.cfg for grub. That being said, the path is /boot/grub.cfg for me, so I'm not sure how we'd get the installfile to figure out where to output its output.
One key difference is that the output of mkinitcpio are binary files, whereas grub.cfg is a text file, and maybe operators would like to modify that file after it's generated? So one could make a case that the install file should in fact keep its hands off grub.cfg entirely.
Right, grub.cfg can quite easily be written by hand. Also, there is (usually?) no necessity to change the grub.cfg after a grub update. I doubt even that the grub-mkconfig output changes (notably).
On 12/8/18 7:45 AM, mar77i via arch-general wrote:
For the kernel we run mkinitcpio. So there shouldn't be a real reason why we shouldn't run grub-mkconfig >/${main_grub_dir}/grub.cfg for grub. That being said, the path is /boot/grub.cfg for me, so I'm not sure how we'd get the installfile to figure out where to output its output.
As you have just pointed out, there is no way to possibly know where a user's grub.cfg is, or even whether they have one rather than using some external boot disk, or using the grub package exclusively to modify the grub.efi on some externally mounted system, or or or or.
One key difference is that the output of mkinitcpio are binary files, whereas grub.cfg is a text file, and maybe operators would like to modify that file after it's generated? So one could make a case that the install file should in fact keep its hands off grub.cfg entirely.
Well, yes. In fact, I consider the mere existence of the grub-mkconfig command to be a harsh sin. :p I would fork the grub package and roll my own if it were to erase my lovingly handwritten grub.cfg with some autogenerated nonsense that all too often doesn't even work. I'd also submit an annoyed bug report... ... It boggles my mind that a distribution that prides itself on: - DIY, - KISS, - understanding how things work, and - the avoidance of crutch-like tools meant to abstract into nonexistence the job of maintaining your system still discourages all these things with respect to the grub bootloader. I am in the gradual process of hopefully fixing all this via rewriting the wiki page for grub. My current progress towards this end can be seen at https://wiki.archlinux.org/index.php/User:Eschwartz/Grub#Configuration -- Eli Schwartz Bug Wrangler and Trusted User
On 09/12/18 6:13 am, Eli Schwartz via arch-general wrote:
Well, yes. In fact, I consider the mere existence of the grub-mkconfig command to be a harsh sin. :p
...
It boggles my mind that a distribution that prides itself on: - DIY, - KISS, - understanding how things work, and - the avoidance of crutch-like tools meant to abstract into nonexistence the job of maintaining your system
still discourages all these things with respect to the grub bootloader.
I am in the gradual process of hopefully fixing all this via rewriting the wiki page for grub. My current progress towards this end can be seen at https://wiki.archlinux.org/index.php/User:Eschwartz/Grub#Configuration
In my opinion DIY (Do it yourself) does not mean hand write everything from scratch. KISS (Keep it simple) implies that if you can use a tool (grub-mkconfig in this case) then use it. Because handwriting the whole grub file is time consuming and as well as error prone. Simple is to use a tool in this case. Hand writing a full conf file is no way simple. Ofcourse, once created, its easy to edit the existing one. Hand writing becomes simple in such cases. Ofcourse grub-mkconfig should not be default and should not be used in post_install/upgrade. Hence in my opinion, in your Wiki page, giving priority to writing a configuration from scratch (section 3.2) over using grub-mkconfig (section 3.3) isnt the right approach. Regards Amish.
On 12/9/18 2:14 AM, Amish via arch-general wrote:
Simple is to use a tool in this case. Hand writing a full conf file is no way simple.
Are you sure about that? Here's your handwritten 'full conf file'... menuentry "Linux" { linux /boot/vmlinuz-linux root=... rw initrd /boot/intel-ucode.img /boot/initramfs-linux.img } Yes, that's all. Please don't spread FUD -- Rob (coderobe) O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
On 09/12/18 6:50 am, Robin Broda via arch-general wrote:
On 12/9/18 2:14 AM, Amish via arch-general wrote:
Simple is to use a tool in this case. Hand writing a full conf file is no way simple. Are you sure about that? Here's your handwritten 'full conf file'...
menuentry "Linux" { linux /boot/vmlinuz-linux root=... rw initrd /boot/intel-ucode.img /boot/initramfs-linux.img }
Yes, that's all. Please don't spread FUD
You picked one line out of context and claiming that its FUD. Thats because you have assumed that people will install only Linux. And that too plain Linux. And that too no grub modules. No fancy stuff. That too no failsafe stuff. Or LTS stuff. etc. etc. Now if you have to hand write grub.cfg considering all of the above, I dont think its as easy as 4 lines above. And I bet if you recommend above 4 lines to a normal user, he is going to make spelling mistake even in above 4 lines that you have given. Or forget starting or ending braces some where or forget new line. And then have a broken system in the end. I am not saying dont write grub.conf on your own. I am saying that recommend tools first because tools are well tested and probes things much better. If above 4 lines sufficed everyone and all cases - then yes its easy. But from user manual point of view you can not recommend hand written grub first. Regards, Amish.
On Sun, 9 Dec 2018 07:56:29 +0530, Amish via arch-general wrote:
Thats because you have assumed that people will install only Linux. And that too plain Linux.
Chainloading e.g. FreeBSD, Windows or whatsoever is even simpler.
And that too no grub modules. No fancy stuff.
That too no failsafe stuff. Or LTS stuff. etc. etc.
You could add all of this, but you only need to do it one time, not after each upgrade of a kernel.
Now if you have to hand write grub.cfg considering all of the above, I dont think its as easy as 4 lines above.
It still is, just a few additional lines are needed.
And I bet if you recommend above 4 lines to a normal user, he is going to make spelling mistake even in above 4 lines that you have given.
If this happens to me, I simply correct the spelling mistake.
Or forget starting or ending braces some where or forget new line.
And then have a broken system in the end.
This doesn't happen often and if it happens, it could be easily fixed with an editor.
I am not saying dont write grub.conf on your own. I am saying that recommend tools first because tools are well tested and probes things much better.
If above 4 lines sufficed everyone and all cases - then yes its easy. But from user manual point of view you can not recommend hand written grub first.
You don't mention all the failures of that os-prober and the other thingies. Some people don't want any fancy stuff at all, but a menu order that fits to their needs, so they would have to edit the configs for all those auto-crap. On my machine I've seen auto-generated menus with entries for installs that don't exist, after waiting several minutes to generate a grub.cfg, that could be edited manually in a few seconds, without this kind of mistakes.
Top posting - because answer is general to all the emails to list: 1) My focus was on Eli Schwartz e-mail, where he mentioned about his proposed changes to Grub Wiki. https://lists.archlinux.org/pipermail/arch-general/2018-December/045830.html 2) I even said that grub-mkconfig should NOT be default. But from Wiki point of view should be above manual grub.cfg section. 3) Unfortunately instead of acknowledging that I am giving my opinion, he started accusing me of being more or less anti-Arch person. God knows why he needed to do that. But anyway, I dont mind. 4) Existing Grub wiki already has custom grub.cfg section which I believe is good enough and well written and ordered after grub-mkconfig related section. 5) Eli Schwartz Grub wiki, in its current state, is confusing. I would rather read official Grub manual if I had to read all that detail about what each keyword means. Its no way close to custom grub.cfg section that already exists with nice example entries. 6) Every software has bugs - just because grub-mkconfig has some bug reports it does not mean its not suitable tool for this purpose. @Eli - Do not get offended please. Just my honest opinion about your proposed changes. Regards, Amish On 09/12/18 8:23 am, Ralf Mardorf via arch-general wrote:
On Sun, 9 Dec 2018 07:56:29 +0530, Amish via arch-general wrote:
Thats because you have assumed that people will install only Linux. And that too plain Linux. Chainloading e.g. FreeBSD, Windows or whatsoever is even simpler.
And that too no grub modules. No fancy stuff.
That too no failsafe stuff. Or LTS stuff. etc. etc. You could add all of this, but you only need to do it one time, not after each upgrade of a kernel.
Now if you have to hand write grub.cfg considering all of the above, I dont think its as easy as 4 lines above. It still is, just a few additional lines are needed.
And I bet if you recommend above 4 lines to a normal user, he is going to make spelling mistake even in above 4 lines that you have given. If this happens to me, I simply correct the spelling mistake.
Or forget starting or ending braces some where or forget new line.
And then have a broken system in the end. This doesn't happen often and if it happens, it could be easily fixed with an editor.
I am not saying dont write grub.conf on your own. I am saying that recommend tools first because tools are well tested and probes things much better.
If above 4 lines sufficed everyone and all cases - then yes its easy. But from user manual point of view you can not recommend hand written grub first. You don't mention all the failures of that os-prober and the other thingies.
Some people don't want any fancy stuff at all, but a menu order that fits to their needs, so they would have to edit the configs for all those auto-crap. On my machine I've seen auto-generated menus with entries for installs that don't exist, after waiting several minutes to generate a grub.cfg, that could be edited manually in a few seconds, without this kind of mistakes.
On Sun, 9 Dec 2018 07:56:29 +0530, Amish via arch-general wrote:
But from user manual point of view you can not recommend hand written grub first.
I don't have a grub.cfg at hand, but you could add boot options for just one kernel of one install in a similar way to grub.cfg as you could do for syslinux.cfg. [rocketmouse@archlinux ~]$ grep LABEL=s3.archlinux /boot/syslinux/syslinux.cfg | head -3 APPEND root=LABEL=s3.archlinux ro threadirqs APPEND root=LABEL=s3.archlinux ro threadirqs nopti APPEND root=LABEL=s3.archlinux ro If you don't edit grub.cfg manually, you need to configure the auto-thingy configs to add three entries instead of doing it by editing grub.cfg directly. This makes it more complicated and harder to find even a simple spelling mistake.
On Sun, 9 Dec 2018 06:44:52 +0530, Amish via arch-general wrote:
KISS (Keep it simple) implies that if you can use a tool (grub-mkconfig in this case) then use it.
No, it does not. The Arch Linux kernel names don't change. They are always something like e.g. vmlinuz-linux, never something like e.g. vmlinuz-4.4.0-140-whatsoever. When I used GRUB 2, I always edited grub.cfg directly by myself. However, I migrated to syslinux. Btw. on my multi-boot machine are Ubuntu flavours installed. Even if I remove the boot-loader from an Ubuntu flavour install, it likely gets reinstalled after a release upgrade. I workaround the useless call of the grub auto-thingy by dpkg-divert, since the bootloader is only needed by one install. [root@archlinux moonstudio]# systemd-nspawn -q dpkg-divert --list | grep "local diversion of" local diversion of /usr/sbin/grub-mkconfig to /usr/sbin/grub-mkconfig.real local diversion of /usr/sbin/update-grub to /usr/sbin/update-grub.real The generated grub.cfg contains all kinds of needless crap. It takes way to long to generate grub.cfg after each upgrade of each installed distro, simply editing grub.cfg or adding two links (e.g. vmlinuz-lowlatency -> vmlinuz-4.4.0-140-lowlatency) is less time consuming. By default the grub auto-thingy fails and editing the configs for this auto-thingy is rocket science, not KISS.
On 12/8/18 8:14 PM, Amish via arch-general wrote:
In my opinion DIY (Do it yourself) does not mean hand write everything from scratch.
KISS (Keep it simple) implies that if you can use a tool (grub-mkconfig in this case) then use it. Because handwriting the whole grub file is time consuming and as well as error prone. Simple is to use a tool in this case. Hand writing a full conf file is no way simple. Ofcourse, once created, its easy to edit the existing one. Hand writing becomes simple in such cases.
Writing your own grub.cfg is so simple my 3 year old brother can make one if someone first teaches him how to use a text editor. Using grub-mkconfig is time-consuming and error-prone, relies on external tools which aren't installed by default for OS detection, and has numerous embarrassing bugs: failure to boot with german locales?? https://bugs.archlinux.org/task/52763 heisenbug with path locations: https://bugs.archlinux.org/task/40029 totally borked with intel-ucode: https://bugs.archlinux.org/task/44288 somewhat borked with intel-ucode: https://bugs.archlinux.org/task/60999 https://bugs.archlinux.org/task/52910 generated menuentries are in the wrong order and default to LTS: https://bugs.archlinux.org/task/28081 generated config may try to boot the installation ISO: https://bugs.archlinux.org/task/51698 ... Did you *actually* read my wiki page, with its three-line grub.cfg? Supporting multiple kernels is nearly as easy, and the primary distinguishing factor between grub and systemd-boot, which people obsess over because of how "simple" the handwritten config file is as opposed to grub, is that instead of systemd-boot storing each one in a different file, grub uses one file, and stores each one inside of a pair of brackets after the word "menuentry".
Hence in my opinion, in your Wiki page, giving priority to writing a configuration from scratch (section 3.2) over using grub-mkconfig (section 3.3) isnt the right approach.
I hereby give you all my meh. You are the very example of the entire Arch Linux distribution being completely ignorant about how grub works due to the LIES of the grub developers who use scary language to make people think it's too hard for mere mortals to use. -- Eli Schwartz Bug Wrangler and Trusted User
Hi Eli,
I am in the gradual process of hopefully fixing all this via rewriting the wiki page for grub. My current progress towards this end can be seen at https://wiki.archlinux.org/index.php/User:Eschwartz/Grub#Configuration
Interesting. My grub.cfg is from grub-mkconfig(8) and I'd much prefer one with all unnecessary guff removed so its actual labour can be clearly seen. -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy
On 12/8/18 3:55 AM, Ralph Corderoy wrote:
Hi,
Having spotted
warning: /boot/grub/grub.cfg saved as /boot/grub/grub.cfg.pacsave
during today's large package upgrade, I went to /boot/grub afterwards expecting work to do. grub.cfg.pacsave didn't exist. `pacman -Ql grub' showed grub doesn't own anything in /boot. Google led me to https://bbs.archlinux.org/viewtopic.php?id=242285 where Salkay had earlier started along the same path.
The warning has wasted our time, and the forum's conclusion is `ignore the warning'. Encouraging warnings to be ignored is a bad idea; I don't suppose some here are too happy when a user turns up with a problem and the answer was under their nose but they `ignored the warning'.
Can a better solution to this be engineered?
This is a one-time event where a package has removed a backup file from the package. It happened because the file should *never* have been packaged by pacman to begin with, and we fixed that bug by removing it from the package -- however, there is no way for a package to declare this, so it is hardly possible to stop pacman from providing that message. See https://bugs.archlinux.org/task/57949 for more details. Nevertheless, the package maintainer determined to have the post_update script restore the file for users in order to prevent an easily avoidable situation where users would need to fix their *boot* configuration after a routine update. Nowhere in that thread you point to has anyone stated to "ignore pacsave warnings, they don't matter". Someone did point to the install script in order to help clear up what happened in a seemingly impossible situation, but that is not anywhere near the same thing. ... So just for the record, it is wise of you to ask what happened, because this update was indeed confusing and violates user expectations, albeit for a good cause. (I'm less happy that you instantly decided we have instituted a distro-wide policy to ignore warnings.) Could we have handled this better? Yes -- if I were the person who performed that update, I would have added a message echoed in the post_upgrade: "Performing one-time restore of user-generated grub.cfg due to removing it from the packaged files -- feel free to ignore the pacsave warning this once." Is it the end of the world that this was not done? Hardly -- I assume people either did their due diligence, and discovered the thread you pointed to, or did their due diligence and discovered the install script contents (maybe by looking up the PKGBUILD history for the grub package), or, sadly, simply aren't the type of person to look at pacman's output. Either way, there is not much to be done about it after the fact. Much like there's not much to be done about packaging the grub.cfg in the first place, 6 years after the fact, except to fix what we can and resolve to do better next time. -- Eli Schwartz Bug Wrangler and Trusted User
On 09/12/18 5:31 am, Eli Schwartz via arch-general wrote:
Could we have handled this better? Yes -- if I were the person who performed that update, I would have added a message echoed in the post_upgrade:
"Performing one-time restore of user-generated grub.cfg due to removing it from the packaged files -- feel free to ignore the pacsave warning this once."
This is exactly what I noticed in CentOS. (for some other package) Once "yum / rpm" saved some file as ".rpmsave". It echoed that: "Restoring file /path/to/xyz.conf.rpmsave to /path/to/xyz.conf" This way user does not get confused where that rpmsave file (or pacsave for us) vanished. Regards Amish.
Hi Eli,
Having spotted
warning: /boot/grub/grub.cfg saved as /boot/grub/grub.cfg.pacsave
during today's large package upgrade, I went to /boot/grub afterwards expecting work to do. grub.cfg.pacsave didn't exist. `pacman -Ql grub' showed grub doesn't own anything in /boot. Google led me to https://bbs.archlinux.org/viewtopic.php?id=242285 where Salkay had earlier started along the same path.
The warning has wasted our time, and the forum's conclusion is `ignore the warning'. Encouraging warnings to be ignored is a bad idea; I don't suppose some here are too happy when a user turns up with a problem and the answer was under their nose but they `ignored the warning'.
Can a better solution to this be engineered?
This is a one-time event where a package has removed a backup file from the package. ... See https://bugs.archlinux.org/task/57949 for more details.
Thanks, I've added to the forum's thread for anyone else that Google leads thither.
Nowhere in that thread you point to has anyone stated to "ignore pacsave warnings, they don't matter".
The conclusion from the forum was that the warning was to be expected, and that no action was required because of it. That conclusion to ignore this warning when *upgrading grub* was correct. The thread didn't suggest, to someone with my limited packaging knowledge, that the warning was a one-off so I thought that I, and others, would get it on future grub-package upgrades. A single warning that should be ignored is encouraging other warnings to be ignored too. I can conclude that without claiming it was the explicit advice from the forum's thread.
So just for the record, it is wise of you to ask what happened, because this update was indeed confusing and violates user expectations, albeit for a good cause.
It's much better to have an awkward fix than on-going wrongness, I agree.
(I'm less happy that you instantly decided we have instituted a distro-wide policy to ignore warnings.)
But I did not. Nowhere did I suggest it was a distro-wide policy. Even the subject spells out `Package grub'. I pointed out something I thought could be improved in package grub, but you took it as a criticism of a joint `we' decision by a group of Arch volunteers.
I would have added a message echoed in the post_upgrade:
"Performing one-time restore of user-generated grub.cfg due to removing it from the packaged files -- feel free to ignore the pacsave warning this once."
That would have been ideal.
Is it the end of the world that this was not done?
Nowhere did I suggest it was. If, as I wrongly thought, it were a recurring warning on all future grub-package upgrades then it would be something to consider improving. But the end of the world, no. Thanks for the explanation. -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy
participants (7)
-
Amish
-
Einhard Leichtfuß
-
Eli Schwartz
-
mar77i@protonmail.ch
-
Ralf Mardorf
-
Ralph Corderoy
-
Robin Broda