Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Kernel compilation with "armmp" flavor

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Lafuente
Posts: 11
Joined: 2020-03-21 09:01

Kernel compilation with "armmp" flavor

#1 Post by Lafuente »

Hello,

I'm pulling my hair out on a kernel compilation issue:

I have a CubieTruck type card (armv7) on which I installed a debian bulleyes without too many problems. However I need to recompile the kernel in order to lighten it. For this I use the traditional Debian way :

Code: Select all

scripts/config --disable DEBUG_INFO
make oldconfig
scripts/config --set-str MODULE_SIG_KEY certs/signing_key.pem
make LSMOD=~/mylsmod localmodconfig
make nconfig
make -j$(nproc) deb-pkg
The kernel compiles correctly and I get the required.deb packages (image and headers). The problem is that when I try to install the kernel at the end of its installation I get an error message:

Code: Select all

Kernel /boot/vmlinuz-5.10.113-armmp-armmp-custom does not match any of the expected flavors (armmp armmp-lpae), therefore not writing it to flash.
I made several attempts to get this "flavor" (many hours) :
  • Through nconfig by naming the kernel with a relevant name
  • by creating a "localversion" file in my kernel tree which contain "-armmp" (without the quote)
Nothing helps, I always have this error message and impossible to get rid of it. If someone can tell me how to create an "armmp" flavour kernel, I'll save a few hairs...

Last precision, it is a Sunxi embedded system that boots through the u-boot loader, and not grub.
Kind regards
Manu

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Kernel compilation with "armmp" flavor

#2 Post by Aki »

Hello,

The armmp is a supported debian kernel flavour [1][6]: for example, in the Debian repository, is available the kernel linux-image-5.10.0-13-armmp

Are you building from original debian kernel sources ?

It could be useful to see the full log of the commands you give to build the custom kernel, starting from the ones to obtain source code.

The method you used is referenced in authoritative Debian sources (for example "The Debian Administrator's handbook", see [4]). It is supported from the standard kernel and, it does not consider the debian flavour by default, IIRC. Therefore, you should be in full control of the name of the kernel (see [7]).

According to the "Kernel Debian Handbook" [2] these [3] are the instruction to build a specific kernel flavour. In your case, you don't want simply rebuild the kernel, but you want to modify an existing flavour (see here [5] for an example).

Hope that helps.

Aki.

[1] https://sources.debian.org/src/linux/5. ... e/defines/
[2] https://www.debian.org/doc/manuals/debi ... -handbook/
[3] https://www.debian.org/doc/manuals/debi ... tml#s4.2.5
[4] https://debian-handbook.info/browse/sta ... ation.html
[5] https://quantum5.ca/2021/08/04/building ... ckporting/
[6] https://wiki.debian.org/DebianKernel/ARMMP
[7] https://debian-handbook.info/browse/sta ... rnel-build
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Kernel compilation with "armmp" flavor

#3 Post by Aki »

@Lafuente:
Have you any feedback ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Lafuente
Posts: 11
Joined: 2020-03-21 09:01

Re: Kernel compilation with "armmp" flavor

#4 Post by Lafuente »

Hello Aki,

No feedback. The problem remain the same :-(

I'm building from the original debian kernel source. i tried to build the kernel on the embedded device (very long) and from an amd64 computer with cross-compilation, but without success..

Actually I use cross-compile only (since results are the same) because it's faster to compile. The command line I use is ::

make ARCH=arm -j$(nproc) CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg

What I can imagine is that the kernel doesn't match the armmp flavor since it end with armhf, witch I guess is not compatible.

The package name is :

Code: Select all

linux-image-5.18.5-armmp-rt10_5.18.5-armmp-rt10-1_armhf.deb
And I think that my problem is due to the make command. Currently I use

Code: Select all

make ARCH=arm -j$(nproc) CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg
I'll try :

Code: Select all

make ARCH=arm -j$(nproc) CROSS_COMPILE=arm-linux-gnueabi- deb-pkg
(without the hf part).

Anyway, thank you for your help.
I'll report any result here.

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Kernel compilation with "armmp" flavor

#5 Post by Aki »

Hi,

What is the Debian kernel source you are trying to build ?

What is its URL ?

The 5.18 is only available in Debian Testing , IIRCC.
The package name is :
linux-image-5.18.5-armmp-rt10_5.18.5-armmp-rt10-1_armhf.deb
I haven’t found it in Debian repositories: can you send me a link to source code to Debian repositories ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Lafuente
Posts: 11
Joined: 2020-03-21 09:01

Re: Kernel compilation with "armmp" flavor

#6 Post by Lafuente »

Yes, I use SID.

Code: Select all

apt install linux-source

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Kernel compilation with "armmp" flavor

#7 Post by Aki »

Hi,

By the way, the error message you sent:

Code: Select all

kernel /boot/vmlinuz-5.10.113-armmp-armmp-custom does not match any of the expected flavors (armmp armmp-lpae), therefore not writing it to flash
is generated by this function (see https://sources.debian.org/src/flash-ke ... l=815#L815)

Code: Select all

[..]
for kflavor in $kflavors ; do
	if check_kflavors "$kvers" "$kflavor" ; then
		kfile_suffix="$kflavor"
		break
	fi
done

if [ -z "$kfile_suffix" ]; then
	echo "Kernel $kfile does not match any of the expected flavors ($kflavors), therefore not writing it to flash." >&2
	exit 0
fi
[..]
The function that makes the check is this (see https://sources.debian.org/src/flash-ke ... hl=815#L88):

Code: Select all

[..]
check_kflavors() {
	local kvers="$1"
	local kflavor="$2"
	if [ "$kflavor" = "any" ]; then
		return 0
	fi
	# count flavor+ as valid
	kvers=${kvers%%+}
	if [ "${kvers}" != "${kvers%%$kflavor}" ]; then
		# kernel version ended with flavor
		return 0
	fi
	return 1
}
[..]
As you can see, it checks that "kernel version ended with flavor".

For example, the kernel name you showed in the first message is "vmlinuz-5.10.113-armmp-armmp-custom". Therefore, it ends with "-custom" and it does not end with a flavour name corresponding to your architecture ("armmp" or "armmp-lpae").

Also in your last message, the name of the kernel package seems not to be correct (linux-image-5.18.5-armmp-rt10_5.18.5-armmp-rt10-1_armhf.deb) because the flavour occurs three times, two times "armmp" (with RT ?), the third "armhf").

Can you send the complete list of commands and the configurations file you use to custom compile the kernel ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Lafuente
Posts: 11
Joined: 2020-03-21 09:01

Re: Kernel compilation with "armmp" flavor

#8 Post by Lafuente »

Thank you for your valuable help.

Commands are :

Code: Select all

tar xavf linux-source-5.18.tar.xz
cd linux-source-5.18
xzcat ../linux-patch-5.18-rt.patch.xz | ARCH=arm patch -p1
cp ../config .config
make ARCH=arm oldconfig
ARCH=arm scripts/config --disable DEBUG_INFO
ARCH=arm scripts/config --set-str MODULE_SIG_KEY certs/signing_key.pem
make ARCH=arm LSMOD=../mylsmod localmodconfig
make ARCH=arm nconfig
make ARCH=arm -j$(nproc) CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg
I'll chech about the kernel name problem and report.

Lafuente
Posts: 11
Joined: 2020-03-21 09:01

Re: Kernel compilation with "armmp" flavor

#9 Post by Lafuente »

Finally, with your help, I manage to build and install the kernel.

It was the kernel name, right.

Thank you.

Aki
Global Moderator
Global Moderator
Posts: 2816
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 68 times
Been thanked: 382 times

Re: Kernel compilation with "armmp" flavor

#10 Post by Aki »

Hi,
I'm glad I helped you to sort it out.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply