How does EndeavourOS do the reboot check after update?

I run EndeavourOS on this machine and vanilla Arch on another. One thing I like to do is implement features I like on EndeavourOS on my Arch machine. While there is a simple reboot-checker script in the AUR, I’m finding that it always suggests a reboot because I have both the Linux and Linux-LTS kernels installed. Maybe I can fix the script, but whatever EndeavourOS is doing doesn’t seem to have that issue. Also, I’m having a hard time finding out how the script is called as part of an update.

Is there any documentation that explains how it works?

It is implemented in package eos-hooks, in these files:

  • eos-reboot-required.hook
  • eos-reboot-required2
  • eos-reboot-required

eos-reboot-required.hook is a pacman hook that calls eos-reboot-required2 when a listed package will be updated.

eos-reboot-required2 has the logic to check if a reboot is really recommended.

eos-reboot-required displays the actual notification.

8 Likes

Install eos on the other machine as well. Problem solved :rofl:.

10 Likes

Thanks :slight_smile:

Ok, found them…and went through the ArchWiki on how pacman hooks work. What you have is a lot better than that little script I found in the AUR. Looks like eos-reboot-required2 is also checking to see if the update was on the currently running kernel.

Yeah, it makes some checks to see if a reboot would be needed. Running kernel is one of those checks.

3 Likes

Consider this little script I wrote:

1 Like

Nice thing about Linux systems is that you can write up that little script and give it a shot :wink:

Reading up a little on pacman in the ArchWiki, I think I understand why Arch does not already have a “recommend reboot” utility. It seems those devs are quite conservative and suggest rebooting after every “pacman -Syu”. I think that may be a little over-conservative but, I’ll acknowledge I’m not the expert here :wink:

I would just assume anything with mesa or kernel related requires reboot. I only update like weekly ish anyway, so I just reboot just every time.