Please let me emphasize - I am not experienced enough to see all through a PKGBUILD - let alone a kernel PKGBUILD. There is way too many environment variables in play…
So what I do is very much the trial and error approach.
I also use variables to eliminate the human error factor.
I didn’t get that error, the package build and install perfectly.
But I did note something else - and realised it was the pkgbase
variable that should have the -custom appended not the _basever.
I have edited the commands above - 10 times now - adding more comments and
moved the -custom tag from _basever to pkgname.
I am running a build right now - to check.
EDIT:
The resulting package install as expected.
It creates the following files
- /boot/linux618-custom-x86_64.kver
- /etc/mkinitcpio.d/linux618-custom.preset
The resulting init/kernel will have the expected filenames
- /boot/initramfs-6.18-x86_64.img
- /boot/vmlinuz-6.18-x86_64
To make a custom Linux 6.18 fully coexist with a Manjaro 6.18 you will need to do script actions that
- backs up your current manjaro init/kernel
- rename your custom init/kernel to use a custom suffix/prefix
- modify your custom .preset the chosen naming
- move your current manjaro init/kernel back in place
In the PKGBUILD _package() function we have this
# Used by mkinitcpio to name the kernel
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
echo "${_basekernel}-${CARCH}" | install -Dm644 /dev/stdin "$modulesdir/kernelbase"
This is the point I have reached on my speculation on how to achieve naming the final init/kernel image.
Currently it becomes initramfs-6.18-x86_64.img and vmlinuz-6.18-x86_64.
To become totally co-existing - the file names would ideally become
initramfs-6.18-custom-x86_64.img and vmlinuz-6.18-custom-x86_64.
EDIT
And with the latest iteration (v13) this has also been achieved.
Interesting learning experience …