You are not logged in.

#1 2012-02-21 15:46:25

Rorschach
Member
From: Ankh-Morpork
Registered: 2008-11-07
Posts: 143

How can I execute a command after kernel-upgrade/mkinitcpio

Because of the archlinux specific kernelnaming-policy there's a problem when using grub2. The created menu looks nasty because grub-mkconfig can't find the proper kernel-version. (Bugreport: https://bugs.archlinux.org/task/25453)

Even if this is fixed we need to recreate the grubconfig always when a new kernel-version is installed.

What I want now is executing grub-mkconfig after each kernel-installation/mkinitcpio, without repackaging the kernel. Is such a hook possible?

Last edited by fsckd (2012-02-21 17:36:20)

Offline

#2 2012-02-21 17:39:31

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: How can I execute a command after kernel-upgrade/mkinitcpio

mod note: I fixed the url to the bug report for you by moving the ')' outside of the tags.

One possible workaround, disable the linux detection script (in /etc/grub.d) and make your own script which echoes the Arch entries as you want them to be.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2012-02-21 17:55:00

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How can I execute a command after kernel-upgrade/mkinitcpio

Not possible until pacman gets hook support. Coming Soon™.

Offline

#4 2012-03-18 11:38:17

elmurato
Member
From: Germany
Registered: 2012-03-18
Posts: 4

Re: How can I execute a command after kernel-upgrade/mkinitcpio

Rorschach, I added a solution in the bugreport you posted. It might be ugly but it works wink

Offline

#5 2012-03-18 19:58:59

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,174

Re: How can I execute a command after kernel-upgrade/mkinitcpio

I don't recreate grub.cfg every time the kernel is updated. Why is this supposed to be necessary?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-03-18 21:04:17

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,360

Re: How can I execute a command after kernel-upgrade/mkinitcpio

I haven't looked at this too closely, but you should be able to construct a bash script using inotify-tools to watch your vmlinuz files and run your custom commands when vmlinuz changes.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#7 2012-03-20 07:49:33

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: How can I execute a command after kernel-upgrade/mkinitcpio

Rorschach wrote:

Because of the archlinux specific kernelnaming-policy there's a problem when using grub2. The created menu looks nasty because grub-mkconfig can't find the proper kernel-version. (Bugreport: https://bugs.archlinux.org/task/25453)

Even if this is fixed we need to recreate the grubconfig always when a new kernel-version is installed.

What I want now is executing grub-mkconfig after each kernel-installation/mkinitcpio, without repackaging the kernel. Is such a hook possible?

This is not necessary unless Versioned Kernel Installs are supported by pacman. I have added a new patch to https://www.dropbox.com/sh/jth3mchm3hob … src.tar.gz that solves the issue. No need for pacman or mkinitcpio hooks (for now).

Offline

#8 2012-06-23 17:32:01

wlane7878
Member
Registered: 2012-06-23
Posts: 1

Re: How can I execute a command after kernel-upgrade/mkinitcpio

This article was written for debian/ubuntu but should work for arch Run Command On Kernel Update. Hope it helps.

Last edited by wlane7878 (2012-06-23 17:32:19)

Offline

Board footer

Powered by FluxBB