You are not logged in.
I am using this Wiki page to build multiple kernels. My main idea is to have multiple kernels to choose from in GRUB.
However, the instructions are terse and the Boot Loader part is especially vague.
For example, "If you renamed your kernel in the PKGBUILD pkgbase you may have to rename the initramfs.img in your $build/pkg/kernel/etc before installing with pacman."
But:
find $build -type d -iname "etc"
does not find anything. Nor is initram.fs anywhere in $build.
This may not be a problem if the page is meant exclusively for internal use among the maintainers. But, for me as an alien, the page is confusing.
Last edited by foki (2019-12-15 17:05:31)
Offline
The initramfs is generated by mkinitcpio or dracut respectively and not part of the kernel package.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
You should read the PKGBUILD you are using. If you are using the PKGBUILD from the ABS, you'd see that the mkinitcpio hooks are modified and renamed to refer to $pkgbase. So if you have adjusted pkgbase, then this is all handled for you (mkinitcpio will run from a pacman hook when the new kernel is installed).
Though I agree that that paragraph in the wiki is poorly worded. I'd suggest an edit, but I'm not even sure what the original author is getting at with that line. If you adjusted the pkgbase, and use makepkg and pacman to properly install your built package, then there is nothing more to do. Most of that paragraph/section should probably just be removed.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Note that the boot loader section is older than 2017 so it does not account for the pacman hook at all.
Offline
Perhaps this could be good:
Boot Loader
If you have modified pkgbase in order to have your new kernel installed alongside the default kernel you will need to update your bootloader configuration file and add new entries ('default' and 'fallback') for your custom kernel and the associated initramfs images.
However, I have no first hand experience with this process, so perhaps someone who has done this could check and submit this revision.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You should read the PKGBUILD you are using. If you are using the PKGBUILD from the ABS, you'd see that the mkinitcpio hooks are modified and renamed to refer to $pkgbase. So if you have adjusted pkgbase, then this is all handled for you (mkinitcpio will run from a pacman hook when the new kernel is installed).
Though I agree that that paragraph in the wiki is poorly worded. I'd suggest an edit, but I'm not even sure what the original author is getting at with that line. If you adjusted the pkgbase, and use makepkg and pacman to properly install your built package, then there is nothing more to do. Most of that paragraph/section should probably just be removed.
How will it be handled? I don't get this.
From what I see when I do:
1. Change pkgbase in PKGBUILD
2. makepkg -s
3. pacman -U <the-changed-pkgbase>-headers <the-changed-pkgbase>
Is that the new kernel will replace my current one in GRUB. It looks like it just replaces mine /boot/initramfs-linux-fallback.img, initramfs-linux.img and vmlinuz-linux. It does not touch my /boot/grub/grub.cfg.
So, I am still confused. What should I do to have two versions of the kernel to choose from in GRUB?
Offline
Did you read my suggested revision. You do need to adjust your bootloader, of course. But you don't need to do anything extra to create or move/rename any initramfs.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Perhaps this could be good:
suggested revision wrote:Boot Loader
If you have modified pkgbase in order to have your new kernel installed alongside the default kernel you will need to update your bootloader configuration file and add new entries ('default' and 'fallback') for your custom kernel and the associated initramfs images.
However, I have no first hand experience with this process, so perhaps someone who has done this could check and submit this revision.
If this is your suggested revision then I did read it. But, as I said before, it does not happen in practice.
You should read the PKGBUILD you are using. If you are using the PKGBUILD from the ABS, you'd see that the mkinitcpio hooks are modified and renamed to refer to $pkgbase. So if you have adjusted pkgbase, then this is all handled for you (mkinitcpio will run from a pacman hook when the new kernel is installed).
I did adjust my $pkgbase, but no, it is not "all handled for me". At least not in the way that the new kernel is placed in GRUB menu. What happens in practice is that pacman overwrites my current kernel image and initram. That is not even what the wiki page profess.
Where are "mkinitcpio hooks"? Are you referring to this part of PKGBUILD:
# Used by mkinitcpio to name the kernel
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
How do those hooks are supposed to work? Are they invoked by pacman at the end of the installation process? Where pacman puts the new vmlinux and initramfs? I can't find the wiki page that would explain how that happens. And it does not happen automatically on the installation I am trying to make it work on.
Offline
At least not in the way that the new kernel is placed in GRUB menu.
Like I said, this is not expected. You need to update your boot loader. It seems you did not read my suggested revision: "you will need to update your bootloader configuration".
What happens in practice is that pacman overwrites my current kernel image and initram.
Then you did not change the pkgbase in the PKGBUILD.
Where are "mkinitcpio hooks"?
RTFW. Really, make some effort.
I'll not reply here further.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
foki wrote:At least not in the way that the new kernel is placed in GRUB menu.
Like I said, this is not expected. You need to update your boot loader. It seems you did not read my suggested revision: "you will need to update your bootloader configuration".
foki wrote:What happens in practice is that pacman overwrites my current kernel image and initram.
Then you did not change the pkgbase in the PKGBUILD.
foki wrote:Where are "mkinitcpio hooks"?
RTFW. Really, make some effort.
I'll not reply here further.
Please respect the minimum of civilized human communication.
I did RTFW, and thus I am investing my time here. The wiki is wrong.
Besides solving my own problem, I am also trying to change the referred wiki page in order to make it usable. It is not at the moment. Instead of explaining the process it blurs it.
Offline
Perhaps this could be good:
suggested revision wrote:Boot Loader
If you have modified pkgbase in order to have your new kernel installed alongside the default kernel you will need to update your bootloader configuration file and add new entries ('default' and 'fallback') for your custom kernel and the associated initramfs images.
However, I have no first hand experience with this process, so perhaps someone who has done this could check and submit this revision.
I just checked this. I set `pkgbase=linux-custom` as suggested in the wiki. The resulting linux-custom package contains files only under /usr/lib/modules/5.4.3-arch1-1-custom/ so of course there is no conflict. And the pacman hook (90-mkinitcpio-install.hook) creates /boot/vmlinuz-linux-custom, /boot/initramfs-linux-custom.img and /boot/initramfs-linux-custom-fallback.img (the image name is based on the content of /usr/lib/modules/5.4.3-arch1-1-custom/pkgbase) so they don't conflict either. The only change which is not done automatically is indeed the bootloader configuration.
I've updated the wiki with your suggested revision.
Last edited by lahwaacz (2019-12-14 09:51:31)
Offline
Trilby wrote:Perhaps this could be good:
suggested revision wrote:Boot Loader
If you have modified pkgbase in order to have your new kernel installed alongside the default kernel you will need to update your bootloader configuration file and add new entries ('default' and 'fallback') for your custom kernel and the associated initramfs images.
However, I have no first hand experience with this process, so perhaps someone who has done this could check and submit this revision.
I just checked this. I set `pkgbase=linux-custom` as suggested in the wiki. The resulting linux-custom package contains files only under /usr/lib/modules/5.4.3-arch1-1-custom/ so of course there is no conflict. And the pacman hook (90-mkinitcpio-install.hook) creates /boot/vmlinuz-linux-custom, /boot/initramfs-linux-custom.img and /boot/initramfs-linux-custom-fallback.img (the image name is based on the content of /usr/lib/modules/5.4.3-arch1-1-custom/pkgbase) so they don't conflict either. The only change which is not done automatically is indeed the bootloader configuration.
I've updated the wiki with your suggested revision.
Yes, you're right. My bad. I'm sorry.
Offline
If your happy with this resolution, please mark the thread as [SOLVED] by editing the title in your first post
Offline