Jump to content

Switching custom kernels (e.g. 100Hz/250Hz/1000Hz)


Recommended Posts

I searched the forum, but did not find anything...:

 

I am creating my own Kernel configurations with Armbian, for example I want to observe the effect of 100Hz/250Hz/1000Hz on the timer on osnoise etc.

 

Currently ./ compile.sh can result in two outputs:

- Either a SD-Card-Image with one Kernel configuration

- or some Kernel-files in "Output" I dont yet understand in their structure or what to do to activate them on an already created running System making it bootable

 

I saw that Armbian-Config offers to switch Kernels, but this loooks more like a long list of standard-kernels from somewhere...how can I use this or a different technique like uboot to set my SD-card up like:

 

Three custom Kernels stored e.g. for the three frequencies switchable for the next boot.

 

 

Link to comment
Share on other sites

Armbian is designed to have one kernel installed at a time only. When using armbian-config for switching it checks apt repo for available packages for the board and gives the user the choice to install one of them.

 

However it is possible to use the Armbian Build Framework to create a set of custom packages that can simply be installed via dpkg. Within creating those you have the option to adjust the kernel config.

 

So in your situation you go through that building process three times to create three package sets with the different frequencies enabled.

Install one set, reboot and test, install the next set, reboot and test again and so on.

Link to comment
Share on other sites

11 часов назад, multiblitz сказал:

Three custom Kernels stored e.g. for the three frequencies switchable for the next boot.

This is an easily solved problem. Which device model (chip) do you want to use to test different kernel ?

 

2 часа назад, Werner сказал:

Armbian is designed to have one kernel installed at a time only.

Not anymore. When using extlinux.conf or efi\grub, you can install and use an unlimited number of cores (limited only by free space for placement). The choice of which kernel (or even a completely different system) can be made in two ways, either on the screen via the keyboard (if u-boot has support for this), or via the UART console (this works on any model).

 

 

Link to comment
Share on other sites

I have a coupleof different boards I would like to try this, but lets start with Rockchip 3328h (NanoPiNeo3).

 

I read through the  thread linked...but its a bit beyond my current understanding...can you give me a command-line type of tutorial what to do ? That would be very cool. On x86/grub is was a breath...but uboot is new to me.

Link to comment
Share on other sites

It are basically two posts that matter. This to collect the necessary information for the implementation, and this to make the preparations on the basis of the collected information and to compile an extlinux.conf. Of course, you have to adjust the deviations from your system accordingly.

1 hour ago, multiblitz said:

can you give me a command-line type of tutorial what to do ?

The commands for the command-line are already given there.

Link to comment
Share on other sites

THX for your support !

 

My starting point is a sdcard with Armbian on it lets say 250HZ Kernel.

 

Now, the first question is how to get the second Kernel with 100 HZ Timer onto it....Using ARmbian ./compile.sh again and chose the first option "Build Kernel package and uboot" ? And than copy this to the card ? Or Download from Kernel.org and compile like with a x86 ? Not sure if on an Arm devices the normal Kernel can be created or if the add ons/drivers are missing than...I generated once a Kernel for ARM from Kernel.org...generation was no isse, but than did not know how to teach "uboot" that its there now (like with the x86 and update-grub).

 

So, the current infos are:

root@nanopineo3:~# cat /proc/cmdline
ls -hal /boot
lsblk -o +PARTUUID
root=UUID=673c38cb-a7b1-4743-8c7c-8831fa10ce2b rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000  consoleblank=0 loglevel=1 ubootpart=59d35469-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u consoleblank=0 quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-3 nohz_full=1-3 rcu_nocbs=1-3 no_balance_cores=1-3  cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
total 58M
drwxr-xr-x  3 root root 4.0K Oct 13 11:17 .
drwxr-xr-x 20 root root 4.0K Oct 10 22:47 ..
-rw-r--r--  1 root root  382 Oct 13 11:17 armbianEnv.txt
-rw-r--r--  1 root root    0 Oct 12 21:33 armbianEnv.txt.out
-rw-r--r--  1 root root 1.5K Oct  9 22:18 armbian_first_run.txt.template
-rw-r--r--  1 root root  38K Oct  9 22:18 boot.bmp
-rw-r--r--  1 root root 3.1K Oct  9 22:15 boot.cmd
-rw-rw-r--  1 root root 3.2K Oct  9 22:20 boot.scr
-rw-r--r--  1 root root 235K Oct  9 22:07 config-5.19.14-rockchip64
lrwxrwxrwx  1 root root   22 Oct  9 22:17 dtb -> dtb-5.19.14-rockchip64
drwxr-xr-x  6 root root 4.0K Oct  9 22:17 dtb-5.19.14-rockchip64
lrwxrwxrwx  1 root root   26 Oct  9 22:17 Image -> vmlinuz-5.19.14-rockchip64
-rw-r--r--  1 root root  12M Oct  9 22:25 initrd.img-5.19.14-rockchip64
-rw-r--r--  1 root root    0 Oct  9 22:17 .next
-rw-r--r--  1 root root 6.1M Oct  9 22:07 System.map-5.19.14-rockchip64
lrwxrwxrwx  1 root root   26 Oct  9 22:25 uInitrd -> uInitrd-5.19.14-rockchip64
-rw-r--r--  1 root root  12M Oct  9 22:25 uInitrd-5.19.14-rockchip64
-rw-r--r--  1 root root  30M Oct  9 22:07 vmlinuz-5.19.14-rockchip64
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT PARTUUID
mmcblk0     179:0    0   7.5G  0 disk
└─mmcblk0p1 179:1    0   7.3G  0 part /          59d35469-01
zram0       252:0    0 990.4M  0 disk [SWAP]
zram1       252:1    0    50M  0 disk /var/log

 

When you say in the second link:

"First step: prepare kernel package (copy files around)" ...which Kernel package do you mean in my example ? The original one with 250 HZ or the new one with 100 HZ ?

Link to comment
Share on other sites

6 hours ago, multiblitz said:

Now, the first question is how to get the second Kernel with 100 HZ Timer onto it

The main problem with kernel.deb packages is that not all noteworthy kernel artifacts are included, but are generated by the installation routine. E.g. the initramfs or depmod results. If the system installation routine also removes other installed kernels from the system, this is not helpful.

I therefore prefer the method of extracting the installed kernel artifacts from a full image. To do this, I loop-mount the image and then copy the components over to /usr/lib/modules/${kernelversion}.

 

6 hours ago, multiblitz said:

which Kernel package do you mean in my example ?

This procedure applies to all kernels that you want to install. With my method, a kernel installation consists of instantiating the /usr/lib/modules/${kernelversion} directory branch.

 

6 hours ago, multiblitz said:

but than did not know how to teach "uboot" that its there now

To be able to make distro-boot aware of a new kernel, dublicate a boot stanza in extlinux.conf and adjust the ${kernelversion} part. The same concept as with grub.

 

6 hours ago, multiblitz said:

So, the current infos are:

With this information, a boot stanza should look something like this:

Spoiler
label 5.19.14-rockchip64
        fdtdir /usr/lib/modules/5.19.14-rockchip64/dtb/
        kernel /usr/lib/modules/5.19.14-rockchip64/Image
        initrd /usr/lib/modules/5.19.14-rockchip64/initrd.img-5.19.14-rockchip64
        append root=PARTUUID=59d35469-01 rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000 consoleblank=0 loglevel=1 ubootpart=59d35469-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u consoleblank=0 quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-3 nohz_full=1-3 rcu_nocbs=1-3 no_balance_cores=1-3  cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

 

 

Link to comment
Share on other sites

Thx...working on it...when I look onto the conf file, there is a default entry which has some more entries than the labels like...

 

label default

        fdtdir /usr/lib/modules/linux/dtb/

        kernel /usr/lib/modules/linux/vmlinuz

        append loglevel=4 root=PARTUUID=8b029f90-01 cma=896M coherent_pool=2M selinux=0 audit=0 c>

 

cma..cohorent_pool etc ?

 

And I dont have a /usr/lib/modules/linux/dtb/:

root@nanopineo3:/usr/lib/modules# ls

5.19.14-rockchip64  Linux_5.19.16_100HZ

 

..so I guess...i simply copy your stanza im as default, correct ?
 

So we have 

 

label default

fdtdir /usr/lib/modules/5.19.14-rockchip64/dtb/

kernel /usr/lib/modules/5.19.14-rockchip64/Image

initrd /usr/lib/modules/5.19.14-rockchip64/initrd.img-5.19.14-rockchip64

append root=PARTUUID=59d35469-01 rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000 consoleblank=0 loglevel=1 ubootpart=59d35469-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u consoleblank=0 quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-3 nohz_full=1-3 rcu_nocbs=1-3 no_balance_cores=1-3 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

 

label Linux_5.19.16_100HZ

fdtdir /usr/lib/modules/Linux_5.19.16_100HZ/dtb/

kernel /usr/lib/modules/Linux_5.19.16_100HZ/Image

initrd /usr/lib/modules/Linux_5.19.16_100HZ/initrd.img-5.19.14-rockchip64

append root=PARTUUID=59d35469-01 rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000 consoleblank=0 loglevel=1 ubootpart=59d35469-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u consoleblank=0 quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-3 nohz_full=1-3 rcu_nocbs=1-3 no_balance_cores=1-3 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

 

?
 

As I will always use only SSH with the NPiNeo3, the default is important for switching...

 

I changed the name of the new copied content of the 100HZ Kernel as you see...i hope that this will not create problems ?
 

I found when I create my own custom kernels and want to give it a local name extension in general settings...the creation of the image fails...so i have the issue that all my Kernel-Images have the same name which is a bit confusing to know who is who...if there is a way how to give a custom configure kernel its own name without messing up sd card image creatiin, please let me know...

 

Link to comment
Share on other sites

2 hours ago, multiblitz said:

when I look onto the conf file, there is a default entry which has some more entries


This is a boot stanza that is set up for use with my kernel builds. They are generic mainline builds, i.e. they are suitable for all devices with aarch architecture for which sufficient mainline support is available. It is called "default" because a symbolic link (linux) pointing to ${kernelversion} controls which kernel is currently in use, and therefore no explicit name can be specified. Label naming has no functional consequences.

 

2 hours ago, multiblitz said:

And I dont have a /usr/lib/modules/linux/dtb/:

If you had followed the instructions of the second important post (First step: prepare kernel package (copy files around)), you would have everything. This is necessary because the same file names cannot be hosted multiple times in /boot and would overwrite each other.

 

2 hours ago, multiblitz said:

As I will always use only SSH with the NPiNeo3, the default is important for switching...

Without uboot console access, you won't have a way to choose which kernel to boot with when booting. You will get always the one of the first bootable stanza.

 

2 hours ago, multiblitz said:

I changed the name of the new copied content of the 100HZ Kernel as you see

This will not work, you cannot change the ${kernelversion} component arbitrarily, because it is compiled into the kernel binary and is used, for example, for the localization of the modules to be loaded.

 

2 hours ago, multiblitz said:

if there is a way how to give a custom configure kernel its own name without messing up sd card image creatiin, please let me know

Sorry, but here is a point reached where Armbian knowledge is required, which I do not have. Here you need to read the Armbian documentation or motivate an Armbian maintainer to help you.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines