You are not logged in.

#1 2019-09-09 22:17:37

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Which hook triggers an image rebuild when systemd is updated [solved]

Can someone point me to the pacman hook that triggers mkinitcpio when systemd is updated?  I read through the hook files installed by the systemd package but I can't find an obvious one that is triggering the rebuild of the kernel image.

...
( 9/11) Updating linux-lts initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'default'
  -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts.img
==> Starting build: 4.19.71-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-lts.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'fallback'
  -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-lts-fallback.img -S autodetect
==> Starting build: 4.19.71-1-lts
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: aic94xx
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-lts-fallback.img
==> Image generation successful
...

Last edited by graysky (2019-09-10 10:56:13)

Offline

#2 2019-09-09 22:35:05

loqs
Member
Registered: 2014-03-06
Posts: 19,100

Re: Which hook triggers an image rebuild when systemd is updated [solved]

usr/share/libalpm/hooks/90-linux-lts.hook contains

Target = usr/lib/initcpio/*

the systemd packages contains

usr/lib/initcpio/hooks/
usr/lib/initcpio/hooks/udev
usr/lib/initcpio/install/
usr/lib/initcpio/install/systemd
usr/lib/initcpio/install/udev

Offline

#3 2019-09-10 10:55:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Which hook triggers an image rebuild when systemd is updated [solved]

Thanks loqs.  It would seem that 90-linux-lts.hook is calling the rebuild.  Modifying that hook to remove the 'use/lib/initcpio/*' Target is probably a bad idea.... I am unsure if the systemd package placing files to those locations actually require a rebuild.  I recall the systemd version being advertised briefly on boot, so keeping parity between the package on the filesystem and the splash message wouldn't halt a boot (ie it is just cosmetic).  I do not know enough about the consequences of NOT rebuilding if any other file from systemd's package got updated within those locations.  Plus and perhaps more importantly, other packages might actually require a rebuild... I will just forget about this idea.

Offline

#4 2019-09-10 10:59:22

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Which hook triggers an image rebuild when systemd is updated [solved]

If you do use systemd in your initramfs you should keep it in sync with the package version.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2019-09-10 11:32:20

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,682
Website

Re: Which hook triggers an image rebuild when systemd is updated [solved]

Historically (pre-alpm hooks), the initrd wasn't rebuilt following systemd upgrades, and it rarely (if ever) caused problems -- an image that has successfully mounted the root filesystem and exec'd the init process on the installed system won't stop working just because the aforementioned init has changed since the image was created; but unless you have a good reason to avoid it, updating the initrd with the "latest and greatest" as and when they become available seems like a good idea.

A systemd-based initrd handles things differently, and passes control and state over through `systemctl switch-root`. I'm not sure how the on-disk systemd handles getting control passed from an older version of systemd, but I imagine it has some process to handle it.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB