You are not logged in.

#1 2019-12-13 16:52:16

foki
Member
Registered: 2012-03-22
Posts: 31

[SOLVED] Arch Build System Wiki Page May Need Edits

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

#2 2019-12-13 18:17:19

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

The initramfs is generated by mkinitcpio or dracut respectively and not part of the kernel package.

Offline

#3 2019-12-13 18:56:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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

#4 2019-12-13 19:13:37

lahwaacz
Wiki Admin
From: Czech Republic
Registered: 2012-05-29
Posts: 748

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

Note that the boot loader section is older than 2017 so it does not account for the pacman hook at all.

Offline

#5 2019-12-13 19:39:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2019-12-13 21:55:40

foki
Member
Registered: 2012-03-22
Posts: 31

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

Trilby wrote:

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

#7 2019-12-13 23:15:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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

#8 2019-12-13 23:31:17

foki
Member
Registered: 2012-03-22
Posts: 31

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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.

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

#9 2019-12-14 00:39:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2019-12-14 00:57:56

foki
Member
Registered: 2012-03-22
Posts: 31

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

Trilby wrote:
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

#11 2019-12-14 09:47:56

lahwaacz
Wiki Admin
From: Czech Republic
Registered: 2012-05-29
Posts: 748

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

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.

Last edited by lahwaacz (2019-12-14 09:51:31)

Offline

#12 2019-12-15 04:38:18

foki
Member
Registered: 2012-03-22
Posts: 31

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

lahwaacz wrote:
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

#13 2019-12-15 14:10:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] Arch Build System Wiki Page May Need Edits

If your happy with this resolution, please mark the thread as [SOLVED] by editing the title in your first post

Online

Board footer

Powered by FluxBB