Package Details: grub-hook 2.1-1

Git Clone URL: https://aur.archlinux.org/grub-hook.git (read-only, click to copy)
Package Base: grub-hook
Description: Pacman hook to update GRUB after a kernel update
Upstream URL: https://wiki.archlinux.org/index.php/Pacman#Hooks
Licenses: GPL
Submitter: runnytu
Maintainer: runnytu
Last Packager: runnytu
Votes: 25
Popularity: 0.22
First Submitted: 2013-08-25 22:38
Last Updated: 2020-03-04 19:41

Latest Comments

1 2 Next › Last »

chrisjbillington commented on 2020-03-04 19:47

@runnytu thanks!

runnytu commented on 2020-03-04 19:42

@chrisjbillington, Done with the same version to avoid other users to update.

chrisjbillington commented on 2020-02-23 19:33

Thanks @runnytu, however I'm getting an error when the post_upgrade function runs:

$ sudo pacman -U grub-hook-2.1-1-any.pkg.tar.zst 
loading packages...
warning: grub-hook-2.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) grub-hook-2.1-1

Total Installed Size:  0.00 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Running pre-transaction hooks...
(1/1) pacaudit-pre.hook
:: Processing package changes...
(1/1) reinstalling grub-hook                       [######################] 100%
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

I don't think the functions are supposed to give a nonzero exit code, which they do by running /usr/bin/false as their last command.

In any case since it's been several years, I think it would be ok to drop the .install file rather than fix it.

runnytu commented on 2020-02-23 13:40

@chrisjbillington, It's for people with older versions, I adjust it for only show the text if they have the old files with the same version to avoid users to upgrade again.

chrisjbillington commented on 2020-02-22 17:54

Thanks @runnytu! One more suggestion: The .install script is printing messages during removal: Please remove 'grub' to the HOOKs array in /etc/mkinitcpio.conf.. This seems no longer relevant to existing installs. Should the .install script be removed?

runnytu commented on 2020-02-22 13:10

@chrisjbillington, Done, it's functional again.

chrisjbillington commented on 2020-02-19 19:04

As of the kernel packaging changes a few months ago, this hook is no longer functional. This is because the packages no longer install kernels directly to /boot - instead this is done by mkinitcpio in a postinstall hook. This hook should look for the same files that trigger the mkinitcpio hook instead. The following should do it (also the call to a shell is unnecessary - just call /usr/bin/grub-mkconfig by its full name):

[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/modules/*/vmlinuz

[Action]
Description = Updating grub configuration ...
When = PostTransaction
Exec = /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg

Also, since this hook is installed by a package and is not intended to be user-editable, it should go in /usr/share/libalpm/hooks/ where other packages put their hooks, instead of in /etc/pacman.d/hooks/.

runnytu commented on 2016-11-20 12:53

@QuartzDragon, it seems to haven't installed the bash package (base), in terminal execute /bin/sh, if fails, install or reinstall the bash package, if not please execute sudo /bin/sh -c 'grub-mkconfig -o /boot/grub/grub.cfg', and attach the output errors.

QuartzDragon commented on 2016-11-20 04:27

After kernel upgrades, grub-hook fails with:

(3/3) Updating GRUB Config
call to execv failed (No such file or directory)
error: command failed to execute correctly

Not sure what the issue is?

runical commented on 2016-08-16 23:27

All right, the first one is a good reason. I hadn't thought of that. As for the second, I swear it worked, but you are correct. On further testing, my solution didn't work. Sorry about that :S

And glad I could help make the hook a bit more elegant :)