Grub Hook to grub-install and grub-mkconfig?

Thanks for teaching me this.
I thought yay -S grub is the same whether installed or not.

Well, it can happen if I changed again to sytemd-boot, though I believe with this hook and current setup I will remain with Grub (unless they do something else) :rofl:

So far, for me the clueless non techie average Joe, this is what the whole Grub is about for me… confusing!

1 Like

I wonder if I should add
Target = linux
Target = linux-lts
2 Target lines or 1 having both?
Or it can be Target = linux*
Or should it be 2 other hooks?

I read in the forum that the 2 commands should be done if there is a kernel install, this means it applies to kernel update as well?

No, you only need to run grub-mkconfig if you don’t have a kernel as a boot option in your GRUB menu and you want to have it there.

I find it amazing how much effort you put into automatising things you do not understand. A tiny fraction of that effort is all that is needed to actually understand what “the 2 commands” do, so you know exactly when to run them…

2 Likes

I’ll take this as the answer.
I said many times I am not a techie and not a developer. I am just a user who tries to get the best out of his system.

Thanks anyway!

No, because you don’t want to reinstall grub on kernel changes.

If you want hooks for handling kernel changes, you can install grub-hook from the AUR.

To be fair, those are only needed if you regularly install and remove different kernels.

You don’t need to be a techie or a developer to understand what grub-mkconfig does and when you need to run it. It is very simple.

1 Like

Personally, for my own use case, I tend not to automatizing a procedure before I fully grasp what will be happening and why.

As an example, even though there is a convenient systemd service to clean the package cache, I just use the command line: paccache. It gives me a sense of being more “in control” when I see the terminal output.

3 Likes

Thanks a lot @dalto for the focused, clear, and to the point reply as usual.
I thought it was required because -as I mentioned- in many threads I read about it in case of kernel install. (which is not the case for me)

I have only the “default” kernel plus the LTS kernel. I do not play with kernels, install and reinstall…

Again, thank you for this. I am just a user.

Thank you very much for your patience and kind attitude with an average Joe!
Thank you very much.

These shouldn’t be an excuse to not read the documentation and to not learn new stuff. Most people are just users
I am a relatively new Linux user (around an year). The way learn about these things is to read, read and read more.
Give it a try

1 Like

Thanks a lot @peback
For me as a non techie all I know is that these 2 commands are required to be sure (almost) Grub will not do it again. Details on how they do it, no thanks, not for me.

To me they are like checking with the Avometer (or any other way) that the batteries are dead, they need replacement, where is the +ve, where is the -ve, just do it without needing to know what is the difference between Volt and Ampere, what is the difference between a Lithium or Zinc cells! It is just enough for me to see the Avo. doesn’t read so it is dead, and read the +ve and -ve signs.

So, the logic was clear I hope in the other thread in the script I made, based on simple understanding of the issue if there is Grub update you better do command x and command y.
I believe it saved me anyway as I read some had issues because of the update as they had before, or maybe I was just lucky.

@dalto kindly explained why is it better to do a hook, so I just followed and tried here in this thread, which ended up successfully with the help of all of you who posted here.

Thank you all for all the help, support and patience.

1 Like

What about this: Simply uninstall the grub package. (I mean the package, not the already installed boot-loader)

All problems solved. :smiley:
(assuming you can live with not getting (security-)updates for grub.)

In case you want to install another kernel (which should not really happen that often I would assume), simply update grub.cfg manually (it shouldn’t be too hard to copy paste one of those menuentry sections and adapt the initrd and linux references)

2 Likes

Thank you @sradjoker
I promise I will do my best.
I hope you noticed my first post here where I said I read this and that to know how to make a hook.

But I always prefer to ask the experts -even if I think I know perfectly- when it comes to a critical thing like a boot loader or kernel.

I assure you I am not making excuses and assure you as well I am eager to learn as much as I can.

Thanks to you all I have already learned a lot (a lot for me), I never knew there is something called hooks initially! This is just the latest I learned.

These two statements seem pretty contradictory to me…

2 Likes

:thinking:
For me to learn more, can you please explain to me how is uninstalling grub is not uninstalling the bootloader! How is that?!

Well, for me, 2 things I will never ever play with, it gets installed once and that’s it, the boot loader and the kernel.

“grub the package” is used to install “grub the bootloader”. That is what grub-install does.

In theory, once you run grub-install, you could remove “grub the package”.

To be fair, I think that is an extreme solution. :cowboy_hat_face:

2 Likes

Would you believe me if I said when I read your post they seemed really contradictory to me! Me who said the two statements!

Allow me to explain.
I am eager to know and learn how neurosurgeons do their surgeries, what tools, what cases,… maybe how a submarine works, how satellites stay in orbit, where they get energy from, how they “communicate” with NASA.

But knowing how is the communication circuit designed, what components… this is not my field!

This is how I am eager to learn and not eager to learn at the same time.
(Eager to know something about everything, or everything about something, but it would be crazy to try to know everything about everything) Though whenever I try to know everything about something I only know that I know much less than what I thought.

Still sounds contradictory?!
I am enjoying the conversation with you guys cause you are smart. I like it.

For the average Joe I thought that it is just grub, grub is grub!
Thanks a lot @dalto for always teaching me new stuff.

Just curious so I can “yay -Syu grub” and I will still have the bootloader working!
So, what is put in place of “grub” in the command to uninstall the bootloader?

Yeah, I agree. :smile:

Just wanted to trigger some people’s thought process about “what a boot-loader really is”. :wink:
(In the hope that it leads to: Them better understanding what it’s all about with grub-install and stuff)

3 Likes

You actually did and thank you for this. I again learned something new.

Well, I hope I will though my IQ is a bit below Einestein! (his IQ is believed to be 160, in my case I am still struggling to find where I dropped it) :rofl:

also about the fact that

when you install Linux yourself, on your own machine, then you are not a user, you are a System Administrator. If you aren’t willing to know how to administer/maintain your Operating System, then you should assign/pay someone else to do it for you.

:wink:

1 Like

As an exercise you could list all the files that get installed by the package grub: pacman -Ql grub

grub-install is only one among many binaries.

You can have a look at those binaries and use --help or man to see what they do and how they can be used.

There is material for a PHD.

1 Like