Rebuild kernel package from src.rpm for Almalinux 10-beta

Hello everyone,

I’m trying to build a kernel package from the src.rpm for Arm’s AlmaLinux 10-beta. I’m new to AlmaLinux and package systems, so I would like to ask where I should get the almalinux-10-aarch64.cfg for the mock command:

  $ mock -r almalinux-10-aarch64 --rebuild kernel-6.11.0-0.rc5.23.el10.src.rpm

This command finishes with the following error:

ERROR: Could not find required config file: /etc/mock/almalinux-10-aarch64.cfg
ERROR:   If you're trying to specify a path, include the .cfg extension, e.g. -r ./target.cfg
ERROR: Non-existing Mock config 'almalinux-10-aarch64'

I guess it won’t be enough just to copy the config for almalinux-9, as it will also be necessary to provide almalinux-10.tpl and so on, like in the example below:

[ok@pc-11278 kernel]$ cat /etc/mock/almalinux-9-aarch64.cfg 
include('templates/almalinux-9.tpl')

config_opts['root'] = 'almalinux-9-aarch64'
config_opts['description'] = 'AlmaLinux 9'
config_opts['target_arch'] = 'aarch64'
config_opts['legal_host_arches'] = ('aarch64',)

How should I build the kernel.src.rpm in this case?

I assume that I can do the following: “rpmbuild -ba ~/rpmbuild/SPECS/kernel.spec” but IIUC use mock is better, isn’t it?

Another question I have is if I want to update a config, which wiil be used for kernel compilation, which defconfig should I use:

ls -la ~/rpmbuild/SOURCES/kernel-aarch64-*.config 
-rw-r--r--. 1 ok ok 249242 Sep 23 02:00 /home/ok/rpmbuild/SOURCES/kernel-aarch64-64k-debug-rhel.config
-rw-r--r--. 1 ok ok 249675 Feb 17 12:12 /home/ok/rpmbuild/SOURCES/kernel-aarch64-64k-rhel.config
-rw-r--r--. 1 ok ok 249103 Sep 23 02:00 /home/ok/rpmbuild/SOURCES/kernel-aarch64-debug-rhel.config
-rw-r--r--. 1 ok ok 249547 Sep 23 02:00 /home/ok/rpmbuild/SOURCES/kernel-aarch64-rhel.config
-rw-r--r--. 1 ok ok 250914 Sep 23 02:00 /home/ok/rpmbuild/SOURCES/kernel-aarch64-rt-debug-rhel.config
-rw-r--r--. 1 ok ok 251358 Sep 23 02:00 /home/ok/rpmbuild/SOURCES/kernel-aarch64-rt-rhel.config

Thanks in advance.

You can find all the config files in the Alma kernel repo. rpms/kernel: The Linux kernel - kernel - AlmaLinux OS Foundation Git Server

The configs in the Alma kernel repo are related only to the kernel itself, aren’t they?

There are no mock configs that would be placed in /etc/mock, correct?

[ok@pc-11278 aarch64]$ ls -la /etc/mock/alma*
-rw-r--r--. 1 root root 251 Jan 16 01:00 /etc/mock/alma+epel-8-aarch64.cfg
-rw-r--r--. 1 root root 251 Jan 16 01:00 /etc/mock/alma+epel-8-ppc64le.cfg
-rw-r--r--. 1 root root 248 Jan 16 01:00 /etc/mock/alma+epel-8-x86_64.cfg
-rw-r--r--. 1 root root 172 Jan 16 01:00 /etc/mock/alma+epel-9-aarch64.cfg
-rw-r--r--. 1 root root 172 Jan 16 01:00 /etc/mock/alma+epel-9-ppc64le.cfg
-rw-r--r--. 1 root root 170 Jan 16 01:00 /etc/mock/alma+epel-9-s390x.cfg
-rw-r--r--. 1 root root 171 Jan 16 01:00 /etc/mock/alma+epel-9-x86_64.cfg
-rw-r--r--. 1 root root 212 Jan 16 01:00 /etc/mock/almalinux-8-aarch64.cfg
-rw-r--r--. 1 root root 212 Jan 16 01:00 /etc/mock/almalinux-8-ppc64le.cfg
-rw-r--r--. 1 root root 209 Jan 16 01:00 /etc/mock/almalinux-8-x86_64.cfg
-rw-r--r--. 1 root root 212 Jan 16 01:00 /etc/mock/almalinux-9-aarch64.cfg
-rw-r--r--. 1 root root 212 Jan 16 01:00 /etc/mock/almalinux-9-ppc64le.cfg
-rw-r--r--. 1 root root 206 Jan 16 01:00 /etc/mock/almalinux-9-s390x.cfg
-rw-r--r--. 1 root root 209 Jan 16 01:00 /etc/mock/almalinux-9-x86_64.cfg

If my understanding is correct, I need to use mock to build the src.rpm with the command:

mock -r almalinux-10-aarch64 --rebuild fullpackagename.src.rpm

and I need to obtain the almalinux-10-aarch64 config from somewhere