[SOLVED]mkinitcpio preset file

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

[SOLVED]mkinitcpio preset file

Postby m3 » Wed Aug 14, 2024 2:11 pm

Hi
I was hoping you may help me with the following.

On rpi4 I am using linux-rpi kernel and have my own configuration to use with mkinitcpio when building the image.
The file is located in /etc/mkinitcpio.conf.d/myconfig.conf
Everything works fine as long as I comment in /etc/mkinitcpio.d/linux-rpi.preset the line ALL_config="/etc/mkinitcpio.conf"

But every time there is linux-rpi update, a new .preset file is installed and the previous one with the settings I use is reverted to .pacsave
I guess this happens because the updated linux-rpi version is mentioned.
So I end up moving the .pacsave file to replace the installed .preset and rebuild once again the image.

So my question,
Is there a way to avoid this from happening or at least point me to some direction?

Tia
Last edited by m3 on Fri Aug 16, 2024 3:57 am, edited 1 time in total.
m3
 
Posts: 5
Joined: Fri Mar 29, 2024 7:19 pm

Re: mkinitcpio preset file

Postby graysky » Wed Aug 14, 2024 7:07 pm

The way we build the kernel currently defines the ALL_kver variable within /etc/mkinitcpio.d/linux-rpi.preset which is unique to each kernel version, 6.6.43-1-rpi, 6.6.44-1-rpi, and so on. This is why your file is replaced by a new one on an update. According to the man page of mkinitcpio.conf, you can place snippets read from /etc/mkinitcpio.conf.d/*.conf which will have a higher precedence and override the main config file. If your goal is to comment out the ALL_config variable, I am wondering if the following will work for you:

echo "ALL_config=" > /etc/mkinitcpio.conf.d/custom.conf
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: mkinitcpio preset file

Postby m3 » Thu Aug 15, 2024 4:48 am

Thank you very much for spending your time on this.

Regrettably none of the two suggested approaches work.

Building the image simply does not read /etc/mkinitcpio.conf.d/custom.conf
It sticks only to the /etc/mkinitcpio.conf.d/linux-rpi.preset file with the instructions set there. Which is why I intervened in this file.
Dead end I guess.

I am not sure if I should ask you to spend more of your valuable time on this, I will give it up I guess.

As a footnote, I am thankful to you and the team for your continuous efforts on providing archlinuxarm.
m3
 
Posts: 5
Joined: Fri Mar 29, 2024 7:19 pm

Re: mkinitcpio preset file

Postby graysky » Thu Aug 15, 2024 8:43 pm

Interesting... it seems that in order for the drop-in to be detected, the ALL_config variable in /etc/mkinitcpio.d/linux-rpi.preset needs to be commented out. You can test it yourself, but I believe this will be the solution you need and I will modify our packages:

1. Comment that line
2. echo "ALL_config=" > /etc/mkinitcpio.conf.d/custom.conf
3. mkinitcpio -p linux-rpi

For me:
==> Building image from preset: /etc/mkinitcpio.d/linux-rpi.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
-> -k 6.6.45-1-rpi -g /boot/initramfs-linux.img
==> Using drop-in configuration file: 'custom.conf'
==> Starting build: '6.6.45-1-rpi'
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: mkinitcpio preset file

Postby m3 » Fri Aug 16, 2024 3:57 am

Hi,

This is what I've being saying from the start. The ALL_config line needs to be commented out. It's the only workaround to force reading the drop-in .conf files.

Good to know that you found this to be of interest. Looking forward to the future modified packages.

Thank you and take care.
m3
 
Posts: 5
Joined: Fri Mar 29, 2024 7:19 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 65 guests