LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 07-04-2022, 03:03 AM   #1
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Rep: Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312
HOWTO: Linux Kernel customisation/build from source


Hello

I've written a HOWTO guide to enable you to customize the Kernel for your system by building it from source using the Slackware ARM build system and the Slackware 'kernel-source' package.

You can also build from an alternate Kernel source such as the Raspberry Pi's, enabling you to use the RPi Kernel fork if you want to give that a go. See the caveats for that though!

Have fun!
 
Old 07-05-2022, 10:57 AM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
Awesome work Stuart!

Just ran through these stops to build the 5.18.9 rpi kernel.

Code:
Slackware package /root/tgzstash/k/kernel-source-5.18.9-aarch64-1.txz created.

Installing package description file...
  aarch64-kernel_armv8-5.18.9-aarch64-1.txz.build.log: 11.954:1,  0.669 bits/byte, 91.63% saved, 6406561 in, 535917 out.

real    172m29.220s
user    463m36.479s
sys     63m43.917s
 
Old 07-07-2022, 01:16 PM   #3
sunzu
LQ Newbie
 
Registered: Nov 2021
Location: Bavaria, Germany
Distribution: Slackware, PostmarketOS
Posts: 16

Rep: Reputation: Disabled
Thanks Stuart,

no my Pi4 is usable to watch media, so i'm closing my thread about the freezing Pi4, cause it is clearly a upstream problem. No we have a nice workaround with your excellent HOWTO.
thanks again,
sunzu
 
Old 11-15-2022, 08:59 PM   #4
wingfy01
Member
 
Registered: Jul 2009
Location: HZ, China
Distribution: Slackware14 /Debian 6/CentOS5
Posts: 64

Rep: Reputation: 6
Hi drmozes:
Is there a guide for build a custom Slackware Arm image for any other arm board?
I am serarching the documents for building the slackarm image for my rockpi4b+ board...
Thnaks.
 
Old 11-16-2022, 02:52 AM   #5
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Original Poster
Rep: Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312
Quote:
Originally Posted by wingfy01 View Post
Hi drmozes:
Is there a guide for build a custom Slackware Arm image for any other arm board?
I am serarching the documents for building the slackarm image for my rockpi4b+ board...
Thnaks.
First you'd need to add support for that Hardware Model into the OS; making a disc image of it would be the final step.
The documentation to add support is here. It's currently incomplete but covers most of the areas you'd need to check and touch.

Since the RockPi4 is the RK3399 chip, it's probably one of the easier ones to support directly in the OS because you can see how the RockPro64 and Pinebook Pro are integrated. In most cases it's going to be a case of adding a match condition on the RockPi hardware model name in the Kernel module loader scripts and the a/sysvinit-scripts package.
You'd also need to build U-Boot for the RockPi as well. The integration doc says this isn't complete but it is and you can find the build scripts here.

If you can get a U-Boot built for it and flashed into the SPI flash (assuming the RockPi has SPI flash and can boot from it),you could then try booting the rk3399 generic Installer SD card image.
It may boot successfully but won't configure the OS properly because it doesn't know about the RockPi yet.

Brent's working on the HoneyCombe support at the moment and I'll update the documentation as we go along.
There's a reasonable amount of work to support another Hardware Model but the Slackware OS is set up to integrate it relatively easily.

I hope that helps a bit.
 
1 members found this post helpful.
Old 11-16-2022, 08:51 AM   #6
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Original Poster
Rep: Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312
Quote:
Originally Posted by drmozes View Post
First you'd need to add support for that Hardware Model into the OS; making a disc image of it would be the final step.
Just thinking this through: it might be far less work to support the RockPi4 than I thought, since it's an rk3399 SoC.
I can start by simply adding the RockPi Hardware Model identification into the rk3399 loader scripts and so on. Building U-boot for it should be easy enough too.
I won't be able to test any of it since I don't have a RockPi but I can merge it in. Since it's not already support, it won't break anything.

If you happen to have Linux on the RockPi already, can you do do this please?

Code:
[mozes@bourbon ~] $ strings /proc/device-tree/model
Xunlong Orange Pi Plus 2E
We're not doing any Kernel-related upgrades in -current until Linux 6.1 lands (maybe a few weeks from now?) but I can prepare it. I suspect that the existing set of modules configured for the rk3399 will light up the RockPi pretty well and you might get quite far.

This could be a neat project for you if you've got the time.
 
Old 11-16-2022, 11:30 PM   #7
wingfy01
Member
 
Registered: Jul 2009
Location: HZ, China
Distribution: Slackware14 /Debian 6/CentOS5
Posts: 64

Rep: Reputation: 6
Quote:
Originally Posted by drmozes View Post
Just thinking this through: it might be far less work to support the RockPi4 than I thought, since it's an rk3399 SoC.
I can start by simply adding the RockPi Hardware Model identification into the rk3399 loader scripts and so on. Building U-boot for it should be easy enough too.
I won't be able to test any of it since I don't have a RockPi but I can merge it in. Since it's not already support, it won't break anything.

If you happen to have Linux on the RockPi already, can you do do this please?

Code:
[mozes@bourbon ~] $ strings /proc/device-tree/model
Xunlong Orange Pi Plus 2E
We're not doing any Kernel-related upgrades in -current until Linux 6.1 lands (maybe a few weeks from now?) but I can prepare it. I suspect that the existing set of modules configured for the rk3399 will light up the RockPi pretty well and you might get quite far.

This could be a neat project for you if you've got the time.
Thank you for detail reply!
Kernel 6.1 is fine.
And the uboot could be built from here https://github.com/radxa/rockchip-bsp.git.
I dont know where is the slackarm package repo or image repo that i could build the image to flash the board, also the documents for image building steps.
The hardware model in dtb is "rk3333-rock-pi-4b" and dts is here:
https://github.com/radxa/u-boot/blob...rock-pi-4b.dts
 
Old 11-17-2022, 12:23 AM   #8
sndwvs
Senior Member
 
Registered: Aug 2014
Posts: 1,907

Rep: Reputation: Disabled
Quote:
Originally Posted by wingfy01 View Post
Thank you for detail reply!
Kernel 6.1 is fine.
And the uboot could be built from here https://github.com/radxa/rockchip-bsp.git.
I dont know where is the slackarm package repo or image repo that i could build the image to flash the board, also the documents for image building steps.
The hardware model in dtb is "rk3333-rock-pi-4b" and dts is here:
https://github.com/radxa/u-boot/blob...rock-pi-4b.dts
maybe it suits you
 
Old 11-17-2022, 03:57 AM   #9
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Original Poster
Rep: Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312
Quote:
Originally Posted by wingfy01 View Post
Thank you for detail reply!
Kernel 6.1 is fine.
And the uboot could be built from here https://github.com/radxa/rockchip-bsp.git.
I dont know where is the slackarm package repo or image repo that i could build the image to flash the board, also the documents for image building steps.
The hardware model in dtb is "rk3333-rock-pi-4b" and dts is here:
https://github.com/radxa/u-boot/blob...rock-pi-4b.dts
The U-Boot and recovery stuff is here:

https://slackware.uk/slackwarearm/pl.../bootware/src/

The 'recovery' (or 'Initial boot loader flashing image' as it could also be called) image is a small SD card image that runs a U-boot script to erase then flash the SPI version of U-Boot to the SPI flash.
sdcards.build builds the Slackware Installer *and* the recovery images depending on the configuration.

but you need an existing Slackware AArch64 installation to use this stuff.
There's quite a lot in there to digest but it's comprehensively documented, and you can change U-boot version based on a Hardware Model - so you can use the vendor U-boot source repo if need be.

I've added the RockPi 4 Hardware Model to the Kernel module loader scripts as a first start.

Note that Slackware doesn't supply disc images - the proper Installer is used. You can modify the miniroot to build a bootable OS for the device though but there's no tools available to build images like the Slackware Installer that you can 'dd' to storage and boot.
 
Old 11-18-2022, 12:32 AM   #10
wingfy01
Member
 
Registered: Jul 2009
Location: HZ, China
Distribution: Slackware14 /Debian 6/CentOS5
Posts: 64

Rep: Reputation: 6
Quote:
Originally Posted by sndwvs View Post
Yes, it is a nice choice and i will look at it ~~. But i still want to go through the staff. I could submit something to official branch (maintained by drmozes) if possible and this may make my board supported by slackarm officially possible.

Last edited by wingfy01; 11-18-2022 at 12:50 AM.
 
Old 11-18-2022, 12:37 AM   #11
wingfy01
Member
 
Registered: Jul 2009
Location: HZ, China
Distribution: Slackware14 /Debian 6/CentOS5
Posts: 64

Rep: Reputation: 6
Quote:
Originally Posted by drmozes View Post
The U-Boot and recovery stuff is here:

https://slackware.uk/slackwarearm/pl.../bootware/src/

The 'recovery' (or 'Initial boot loader flashing image' as it could also be called) image is a small SD card image that runs a U-boot script to erase then flash the SPI version of U-Boot to the SPI flash.
sdcards.build builds the Slackware Installer *and* the recovery images depending on the configuration.

but you need an existing Slackware AArch64 installation to use this stuff.
There's quite a lot in there to digest but it's comprehensively documented, and you can change U-boot version based on a Hardware Model - so you can use the vendor U-boot source repo if need be.

I've added the RockPi 4 Hardware Model to the Kernel module loader scripts as a first start.

Note that Slackware doesn't supply disc images - the proper Installer is used. You can modify the miniroot to build a bootable OS for the device though but there's no tools available to build images like the Slackware Installer that you can 'dd' to storage and boot.
Thank you for reply. For rockchip, the uboot misc things(idbloader.img, u-boot.dtb, trust image, https://opensource.rock-chips.com/wiki_Boot_option)) that i have built succeessfully, and the next step is building the boot image(extlinux.conf,vmlinuz.img,initram...etc.) with slackarm kernel and the rootfs image from slackarm packages.
I think i also need build a cross compiler chain which is compatiable with slackarm-current in my host pc(slackware 14.2), becasuse i dont have another existing slackware aarch64 installation...

Last edited by wingfy01; 11-18-2022 at 12:52 AM.
 
Old 11-18-2022, 03:01 PM   #12
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by wingfy01 View Post
Thank you for reply. For rockchip, the uboot misc things(idbloader.img, u-boot.dtb, trust image, https://opensource.rock-chips.com/wiki_Boot_option)) that i have built succeessfully, and the next step is building the boot image(extlinux.conf,vmlinuz.img,initram...etc.) with slackarm kernel and the rootfs image from slackarm packages.
I think i also need build a cross compiler chain which is compatiable with slackarm-current in my host pc(slackware 14.2), becasuse i dont have another existing slackware aarch64 installation...
This directory is helpful. All the tools needed to automate a networked cross compiler build are in the x-toolchain/ directory. Also you can get a jump start with a mini root file system extracted to a boot medium.
https://slackware.uk/slackwarearm/sl...earm-devtools/
https://slackware.uk/slackwarearm/sl...ls/minirootfs/

You do not need to build a kernel. Just copy the files here on to your sd card after youve written u-boot to it.
https://slackware.uk/slackwarearm/sl...kernels/armv8/

Finally, this is how we build sd card installers and the recovery image: https://slackware.uk/slackwarearm/pl.../bootware/src/
 
1 members found this post helpful.
Old 11-21-2022, 04:09 AM   #13
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,543

Original Poster
Rep: Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312Reputation: 1312
Have a look at the stuff mralk has suggested, and for the U-Boot stuff look here:

https://slackware.uk/slackwarearm/pl...aarch64/rk3399

Since the RockPi4 has an SPI flash you can probably use and update the existing RK3399 stuff.

U-Boot
Script:
'uboot.build-functions'

This is called from 'uboot.build' (a couple of dirs up in the tree from the rk3399 dir):

The two functions you want are:
hwm_build_spi
hwm_build_sdrecovery

The difference between them is that U-Boot binary and the one created by 'hwm_build_spi' function above is that the one above creates a U-Boot capable of BOOTING from the SPI flash. The second function below creates ont that's capable of BOOTING from the SD card.

I don't know whether you'll be able to use this code directly but it's worth looking at.

SPI flashing

The RK3399 SoC SPI flashing ('recovery') images are created from the script 'sdcards.build-functions' within that 'rk3399' dir at the URL above.

The function responsible is: hwm_sdimage_recovery_build()

This takes both of the U-Boot binaries (boot from SPI capable and boot from SD card capable) and creates the recovery images found here:

Given that the Kernel already supports the RockPi4 and I've added the support to the Kernel module loader, the boot loader might be the the majority of what needs to be done.

There does not seem to be a default config for the RockPi4 in the U-Boot that we have - for example, the RockPro64 has 'configs/rockpro64-rk3399_defconfig' so you probably will need to use the vendor's U-Boot.

Have a look at this stuff and see if you can get the two U-Boot bianries built from the vendor's U-Boot fork. You should be able to use a cross compiler for U-Boot easily - there are a few binary versions available for x86. You *may* be able to use the ARM x-toolchain that I use with distccd on the x86_64 build cluster, but it's not a full toolchain so it may not work (although it does built the ARM Trusted Firmware stuff entirely on x86_64).

Also look at the the ATF build script in case this is required for the RockPi4 (I think it is from what I looked at last week).

Last edited by drmozes; 11-21-2022 at 04:18 AM.
 
Old 11-28-2022, 07:45 AM   #14
wingfy01
Member
 
Registered: Jul 2009
Location: HZ, China
Distribution: Slackware14 /Debian 6/CentOS5
Posts: 64

Rep: Reputation: 6
Thanks drmozes and mralk3. So many details are encough for starting building the slackware image for my board!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 08:21 PM
Slax GUI customisation linuxmandrake Linux - General 0 03-23-2006 05:12 PM
customisation gazman1 Linux - Newbie 1 01-18-2005 02:17 PM
KDE customisation? raid517 Linux - General 3 08-16-2004 07:27 PM
install customisation muhkuhmasta Slackware - Installation 1 07-17-2004 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration