Updated debian/ postinst postrm preinst prerm scripts so initrd will be generated
(To facilitate including this kernel using debian's https://salsa.debian.org/live-team/live-build for our https://github.com/fsfw-dresden/usb-live-linux distro I had to build a stub dependency package linux-xanmod-amd64 (live-build wants a $kernelname-$arch package)..)
And to have the initrd be generated I also needed to include a more up-to-date postinst script (modified to not hard-code the xanmod version):
#!/bin/sh -e
version=$(command ls -t /boot/vmlinuz-*|head -n1|sed 's/.*vmlinuz-//') # <= 🔨😅
image_path=/boot/vmlinuz-$version
if [ "$1" != configure ]; then
exit 0
fi
depmod $version
if [ -f /lib/modules/$version/.fresh-install ]; then
change=install
else
change=upgrade
fi
linux-update-symlinks $change $version $image_path # <= ✨ this needed i think
rm -f /lib/modules/$version/.fresh-install
if [ -d /etc/kernel/postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/postinst.d
fi
exit 0
The original file (as well as the other scripts) can be found at https://salsa.debian.org/kernel-team/linux/-/blob/master/debian/templates/image.postinst.in , maybe you can use these updated templates. Would have sent PR but couldn't find xanmod debian/ folders ..
(My approach worked nicely with 5.15.21-xanmod1-0~git20220205.786c4f1 but broke with .22 and .24 for reasons I wasn't able to find out.. just wanted to test the mglru patch anyways so .21 is fine; won't ship xanmod in our production images due to lack of secureboot support)