You are not logged in.
Pages: 1
Hello, before the recent changes to mkinitcpio I was able to easily build a custom initramfs image during pacman kernel update by just adding a custom hook into the /usr/share/libalpm/hooks/ path. It kept using a custom /etc/mkinitcpio-custom.conf with a radeon module included into the image. After last update things seem to get more complicated and I can't figure out what kind of hook should be used to make pacman build a custom image. Modifing /usr/share/mkinitcpio/hook.preset doesnt work:
# mkinitcpio preset file for the '%PKGBASE%' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-%PKGBASE%"
PRESETS=('default' 'fallback' 'radeon')
#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-%PKGBASE%.img"
#default_options=""
radeon_config="/etc/mkinitcpio-custom.conf"
radeon_image="/boot/radeon-%PKGBASE%-custom.img"
fallback_image="/boot/initramfs-%PKGBASE%-fallback.img"
fallback_options="-S autodetect"
I'm kinda newbie in scripting and still learn. Could anybody point me how to resolve this issue? Thanks.
Last edited by Al.Piotrowicz (2020-02-26 17:20:52)
Offline
The hook you are using no longer works and as you have not posted it should I assume you have abandoned it?
You modified /usr/share/mkinitcpio/hook.preset (which will be overwritten by the next update to mkinitcpio)
then how did you trigger 90-mkinitcpio-install.hook to install / update that as /etc/mkinitcpio.d/${pkgbase}.preset ?
Offline
Not quite sure what you mean, but my /etc/mkinitcpio.d/ path has the required presets:
-rw-r--r-- 1 root root 380 2019-03-30 linux-initramfs-radeon.preset
-rw-r--r-- 1 root root 391 11-11 22:23 linux-lts.preset
-rw-r--r-- 1 root root 375 11-11 22:23 linux.preset
Yes I abandoned it and I know it will be overwritten by the next update, but it doesn't work as intended so I don't care about it. It was just a copy of the regular 90-linux.hook with modified mkinitcpio.conf and /boot/%custom%.img, nothing fancy was there at all. During pacman kernel update 90-mkinitcpio-install.hook worked well for both kernels (mainline and lts), but it didn't build my custom (radeon within) image.
Offline
The system has two kernels linux and linux-lts and you want each kernel to have three initrds default, fallback and radeon.
For the above if you add your changes back to linux-lts.preset and linux.preset then update one of the kernel packages are the changes preserved?
Offline
The system has two kernels linux and linux-lts and you want each kernel to have three initrds default, fallback and radeon.
No, I want only one (radeon-built-in) initrd built from the mainline. That's all.
For the above if you add your changes back to linux-lts.preset and linux.preset then update one of the kernel packages are the changes preserved?
Yes, it will preserve but that's not my purpose. I just want to "force" mkinitcpio to build one additional initrd from the mainline linux containing a radeon module.
Offline
If you do not need the initrd generated by the custom preset to be updated on package update could you not keep linux-initramfs-radeon.preset ?
Otherwise I believe you will need a custom hook for the custom preset.
Offline
Yes, its pointless having it in the /etc/mkinitcpio.d/ path. It's not being parsed by the 90-mkinitcpio-install.hook. Could you narrow me how to create the custom preset to be updated on package update? I'd appreciate it.
Last edited by Al.Piotrowicz (2019-11-13 22:57:32)
Offline
I can try and write a hook just need some more information first:
The current /usr/share/libalpm/hooks/90-mkinitcpio-install.hook using /usr/share/libalpm/scripts/mkinitcpio-install will call mkinitcpio -P when the update is called because of usr/lib/initcpio/*
Is that behavior what you want?
If so the custom hook just needs to cover the update of usr/lib/modules/$pkgbase/vmlinuz where $pkgbase would be the kernel name you want the preset to trigger on.
By mainline do you mean the linux-mainline from AUR which tracks Linus's tree linux or the linux package from from core that tracks stable or something else?
For the custom case it would be simpler to not use a template then copy it into /etc/mkinitcpio.d/ just have the hook call mkinitcpio for that hook on match.
Does the above describe your needs?
Offline
Yes, that's correct @loqs. I used a "mainline" for mistake, cause I messed with it in the past. I meant the stable linux-core package in this topic. Sorry for the confusion.
Offline
I wonder, why don't you just add your additional configuration to linux.preset? This file is not modified automatically if it exists.
Last edited by progandy (2019-11-14 00:12:36)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
I need to have both @progandy (with and without the radeon module) due to some testing I perform with my buggy mobo bios issue posted here
Offline
Yes? Doesn't this work as linux.preset?
# mkinitcpio preset file for the 'linux' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
PRESETS=('default' 'fallback' 'radeon')
#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""
#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
radeon_config="/etc/mkinitcpio-custom.conf"
radeon_image="/boot/radeon-linux-custom.img"
Last edited by progandy (2019-11-14 07:31:17)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Yes, work as intended, thank you.
Offline
Please mark as [SOLVED] by editing the title in your first post.
Offline
Pages: 1