Slackware - ARM This forum is for the discussion of Slackware ARM. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
01-07-2018, 12:15 PM
|
#1
|
Senior Member
Registered: Dec 2002
Distribution: slackware!
Posts: 1,398
|
howto build latest kernel? been dragging my feet on this
Following
https://docs.slackware.com/howtos:ha...m:raspberrypi3
says can use SARPi Project to install 14.2,-current
I did.
Does the following build slackwarearm kernel NOT rpi-update flavored one?
then says:
I recommend to build your own Linux kernel packages because the kernel you are
running does not match with the installed Slackware ARM packages
https://www.raspberrypi.org/document...el/building.md
Next get the sources, which will take some time:
Code:
git clone --depth=1 https://github.com/raspberrypi/linux
RASPBERRY PI 2, PI 3, AND COMPUTE MODULE 3 DEFAULT BUILD CONFIGURATION
Code:
cd linux
KERNEL=kernel7
make bcm2709_defconfig
Build and install the kernel, modules, and Device Tree blobs; this step takes a long time:
Code:
make -j4 zImage modules dtbs
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
Is that all there is to it? THANKS!
|
|
|
01-07-2018, 05:53 PM
|
#2
|
Senior Member
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634
|
I've been considering this for some time now, but due to my personal multimedia needs (DVB & Analogue Sound) I got stuck with the official (Raspbian) 4.4.50 kernel, the last one on which DVB under USB still works and the new firmware with the latest Analogue Sound improvements, that are stressing the GPU too much, is not applied. There are theories that the firmware is "independent" from the kernel and that you can play with them independently, might break some device-tree updated modules, but that never worked for me - no boot if I changed only the firmware files (downgrade).
On your last question, take a look here for some more info:
https://elinux.org/Raspberry_Pi_Kernel_Compilation
And, be aware that you might end up with some issues if you go for the very last kernel version - check on their forums for other peoples successes before picking the kernel source version. Example (I was justme123):
https://www.raspberrypi.org/forums/v...f=107&t=187222
https://github.com/bengtmartensson/lirc_rpi/issues/8
Last edited by abga; 01-07-2018 at 06:01 PM.
Reason: + extra details
|
|
|
01-07-2018, 06:19 PM
|
#3
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by glorsplitz
Does the following build slackwarearm kernel NOT rpi-update flavored one?
|
By using the Raspberry Pi GitHub Linux repository, what you're actually downloading is a modified Linux source which includes support (drivers, configs, etc.) for the RPi devices. There's no such thing as a Slackware ARM kernel (although I can understand what you mean by that). There's just the Linux kernel. The Linux kernel source you're downloading from the Raspberry Pi GitHub repository is what you might describe as the ' rpi-update flavoured one'.
Quote:
Originally Posted by glorsplitz
then says:
I recommend to build your own Linux kernel packages because the kernel you are
running does not match with the installed Slackware ARM packages
|
Who or what says this?
Quote:
Originally Posted by glorsplitz
|
The above documentation can be useful, especially when troubleshooting, but be mindful that everything published on that website is geared up for Raspbian. So, if you're building a kernel on Slackware ARM, these instructions are somewhat lacking in depth and explanation. I guess it's OK for Raspbian users who aren't too bothered about what they're doing, as long as it works in the end.
Quote:
Originally Posted by glorsplitz
Next get the sources, which will take some time:
Code:
git clone --depth=1 https://github.com/raspberrypi/linux
RASPBERRY PI 2, PI 3, AND COMPUTE MODULE 3 DEFAULT BUILD CONFIGURATION
Code:
cd linux
KERNEL=kernel7
make bcm2709_defconfig
Build and install the kernel, modules, and Device Tree blobs; this step takes a long time:
Code:
make -j4 zImage modules dtbs
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
Is that all there is to it? THANKS!
|
In a word, "No". There's more to consider than just that. It's a shame FatDog.eu is still down because I published a forum post on how to compile your own Linux kernel on the RPi devices. However, there's no harm in going through it again. If only for your peace of mind.
Firstly, which RPi are you using to build? I highly recommend not attempting to do this on a RPi2 or RPi3 without a rather large heat-sink attached to the SoC. On the RPi3 I would also recommend a fan to accompany the rather large heat-sink. When you're using all four cores to compile (i.e. gcc 'make -j4' option) the SoC gets very hot, very quickly! Then it'll crash at 88-90° Celsius -by design- as a protection measure to stop any permanent damage being done. So, with that in mind, cooling the SoC is a top priority.
Download the Linux kernel and RPi firmware source using 'git'. I usually work in the /tmp directory.
Code:
~# git clone git://github.com/raspberrypi/linux.git linux
~# git clone git://github.com/raspberrypi/firmware.git firmware
You'll be downloading the 'stable' release or whatever the RPi guys call it. I believe the current release is kernel 4.9.x at this time. You can check which branch you're using with the following command.
Code:
~# cd linux
~# git status
On branch rpi-4.9.y
Your branch is up to date with 'origin/rpi-4.9.y'.
nothing to commit, working tree clean
So, if you want to build another Linux kernel release you can take a look at the available RPi GitHub branches with this command.
If/when you want to switch to another branch (for example: Linux kernel 4.14) use this command.
Code:
~# git checkout -f rpi-4.14.y
Branch 'rpi-4.14.y' set up to track remote branch 'rpi-4.14.y' from 'origin'.
Switched to a new branch 'rpi-4.14.y'
Remember if you do switch kernel branches then you'll have to checkout the firmware branches to match the kernel. Use the RPi firmware 'master' branch for kernel 4.9.x and 'next' branch for kernel 4.14/4.15.
So, you've got all you need to build a kernel. Using the RPi2/3 defconfig here will save a *lot* of time. No need to start configuring your own kernel parameters if you don't want to. Everything is already supported and included for the Raspberry Pi in the Linux kernel source you've downloaded from the RPi repository. First make the kernel .config before building the kernel.
Code:
~# make bcm2709_defconfig
~# make -j4 Image
~# make -j4 dtbs
~# make -j4 modules
~# make modules_install
Now backup * every thing* in your /boot directory before continuing. I recommend putting it on a USB memory stick or another SD card, in case things go pear-shaped. Then you can start copying over the new firmware, overlays, dtbs, kernel, etc.
Code:
~# cd /tmp/firmware
~# cp -av overlays bcm*.dtb bootcode.bin COPYING.linux fixup*.dat LICENCE.broadcom start*.elf /boot/
~# cd /tmp/linux
~# cp -av arch/arm/boot/Image /boot/kernel7.img
~# cp -av System.map /boot/System.map
~# cp -av arch/arm/boot/dts/*.dtb /boot/
~# cp -av arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
That's it. You can 'reboot' and hopefully enjoy your system with a new kernel and firmware.
Last edited by Exaga; 01-08-2018 at 03:50 AM.
Reason: forgot to copy System.map to /boot dir
|
|
3 members found this post helpful.
|
01-07-2018, 06:52 PM
|
#4
|
Senior Member
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634
|
Quote:
Originally Posted by Exaga
Now backup *every thing* in your /boot directory before continuing. I recommend putting it on a USB memory stick or another SD card, in case things go pear-shaped. Then you can start copying over the new firmware, overlays, dtbs, kernel, etc.
|
Backing up /lib/firmware & /lib/modules before the new kernel installation might be also useful if things go wrong with the new compilation.
I was under the apparent false impression that you need the Linaro compiler to get their kernel compiled. Thanks for your HowTo, saved it!
|
|
1 members found this post helpful.
|
01-07-2018, 07:41 PM
|
#5
|
Senior Member
Registered: Dec 2002
Distribution: slackware!
Posts: 1,398
Original Poster
|
Exaga, Thank you, looks like what I've been looking for.
Quote:
Originally Posted by Exaga
Who or what says this?
|
here, just above "5. Tips and tricks". I guess you did, bottom of page says: "Sources Originally written by Exaga"
Quote:
Originally Posted by Exaga
It's a shame FatDog.eu is still down because I published a forum post on how to compile your own Linux kernel on the RPi devices.
|
Maybe if you still have the source, you could provide it as attachment?
On one of my rpi3 I've been using rpi-update, to see how much my mileage would vary, kernel is 4.9.73-v7+, however slackwarearm current kernel is 4.14.12, since all the other updates are for kernel 4.14.12, I'd like to get the kernel proper.
Will be looking to try this out soon, as time permits and report back. Cheers! and thanks for prompt response.
Last edited by glorsplitz; 01-07-2018 at 07:50 PM.
|
|
|
01-07-2018, 08:07 PM
|
#6
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by abga
Backing up /lib/firmware & /lib/modules before the new kernel installation might be also useful if things go wrong with the new compilation.
|
Backing up is always good policy. There's never a bad time to backup. Nothing I'm advising will touch or have anything to do with existing firmware or modules. They will all be supplanted by newer versions but not removed. So, if the worst thing happens, just copy the contents of the /boot partition back onto the SD card from the backup which was made. After that, normal operations resume.
A better option would be to use a seperate SD card with Slackware ARM installed, for testing and to copy the new stuff on to. Then you won't risk breaking your working Slackware ARM system.
Quote:
Originally Posted by abga
I was under the apparent false impression that you need the Linaro compiler to get their kernel compiled. Thanks for your HowTo, saved it!
|
LMFAO! @ Linaro compiler.  I bet you read that on the Raspberry Pi forums or some other equally ' reliable' resource site. Seriously, all you need is some Jaffa cakes, Slackware ARM, gcc, a little 'know-how', and Jaffa cakes.
Don't thank me. Thank MoZes and the rest of the Slackware Team. They are the ones who create all the magic. If it wasn't for them you wouldn't be learning anything from me.
|
|
|
01-07-2018, 08:29 PM
|
#7
|
Senior Member
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634
|
Quote:
Originally Posted by Exaga
Nothing I'm advising will touch or have anything to do with existing firmware or modules.
|
Wouldn't:
Code:
~# make -j4 modules_install
overwrite /lib/modules/kernel-version ? If it's the same kernel version that is being manually compiled?
Last edited by abga; 01-07-2018 at 08:35 PM.
Reason: missed 1 sentence
|
|
|
01-07-2018, 08:34 PM
|
#8
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by glorsplitz
Exaga, Thank you, looks like what I've been looking for.
here, just above "5. Tips and tricks". I guess you did, bottom of page says: "Sources Originally written by Exaga"
Maybe if you still have the source, you could provide it as attachment?
On one of my rpi3 I've been using rpi-update, to see how much my mileage would vary, kernel is 4.9.73-v7+, however slackwarearm current kernel is 4.14.12, since all the other updates are for kernel 4.14.12, I'd like to get the kernel proper.
Will be looking to try this out soon, as time permits and report back. Cheers! and thanks for prompt response.
|
Actually, the whole page was not written by me. I'm only responsible for the top part of that page. The "Manual install method without a Raspbian image" section, and below it, was submitted by yugiohjcj. I'm guessing, the RPi documentation was the only link(s) he could find to building a kernel for the device.
I did do a SARPi test-build using the 4.14.x kernel just before Christmas. It hasn't been tested yet.
The sources just mean who has submitted content to that page. There is no original source, per se.
You're welcome to any of my advice that may be useful to you. I really like to read/hear about Slackware ARM users doing exactly what you're planning to do. There's no better Linux learning curve than Slackware and therefore why waste the opportunity? It would be great if there were lots of Slackware ARM users all running different devices. All chipping in and sharing their work/knowledge and experiences; building kernels and packages, writing Slackdoc pages, posting on these forums, creating blogs, making 'how-to' guides, etc. We'll only get to that point by people doing their own thing and learning by it.
|
|
1 members found this post helpful.
|
01-07-2018, 08:44 PM
|
#9
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by abga
Wouldn't:
Code:
~# make -j4 modules_install
overwrite /lib/modules ?
|
Yes, if you were compiling the same version (e.g. 4.9.73 or 4.14.10) but then there wouldn't be much point in doing that unless you really had to (or wanted to?).
Just as an example: if you have 4.9.70 installed and you are building 4.9.73 then modules_install will not overwrite /lib/modules/4.9.70-v7-arm - it will modules_install to /lib/modules/4.9.73-v7-arm
<edit> Afterthought... there's always this:
https://www.kernel.org/doc/Documenta...ld/modules.txt
Code:
modules_install
Install the external module(s). The default location is
/lib/modules/<kernel_release>/extra/, but a prefix may
be added with INSTALL_MOD_PATH (discussed in section 5).
Last edited by Exaga; 01-07-2018 at 08:57 PM.
Reason: afterthought
|
|
|
01-07-2018, 09:10 PM
|
#10
|
Senior Member
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634
|
Quote:
Originally Posted by Exaga
Yes, if you were compiling the same version (e.g. 4.9.73 or 4.14.10) but then there wouldn't be much point in doing that unless you really had to (or wanted to?).
Just as an example: if you have 4.9.70 installed and you are building 4.9.73 then modules_install will not overwrite /lib/modules/4.9.70-v7-arm - it will modules_install to /lib/modules/4.9.73-v7-arm
<edit> Afterthought... there's always this:
https://www.kernel.org/doc/Documenta...ld/modules.txt
Code:
modules_install
Install the external module(s). The default location is
/lib/modules/<kernel_release>/extra/, but a prefix may
be added with INSTALL_MOD_PATH (discussed in section 5).
|
Thanks for the confirmation, I do indeed need to recompile the same kernel for some drivers patches and maybe check some optimizations - the Raspbian provided kernel 4.4.38 (if my memory serves me well) was performing pretty bad and it was the point I started considering recompiling it on my own and checking the configuration - "optimization recipe".
There's an additional step you might have forgotten in your kernel compilation HowTo from above (many people do), it's about installing the device firmware that comes with the kernel:
Code:
make firmware_install
This is why I hinted the extra step (after the /boot backup) for a backup of both /lib/modules/ & /lib/firmware/
|
|
|
01-07-2018, 09:42 PM
|
#11
|
Member
Registered: Dec 2008
Location: Middlesbrough, UK
Distribution: Slackware
Posts: 264
Rep:
|
Quote:
Originally Posted by abga
There's an additional step you might have forgotten in your kernel compilation HowTo from above (many people do), it's about installing the device firmware that comes with the kernel:
Code:
make firmware_install
This is why I hinted the extra step (after the /boot backup) for a backup of both /lib/modules/ & /lib/firmware/
|
Yes. I've been managing the SARPi Project now for over 5 years and in all that time I've forgotten 'make firmware_install'.
Intentionally.
|
|
1 members found this post helpful.
|
01-08-2018, 10:56 AM
|
#12
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep: 
|
Quote:
Originally Posted by Exaga
Firstly, which RPi are you using to build? I highly recommend not attempting to do this on a RPi2 or RPi3 without a rather large heat-sink attached to the SoC. On the RPi3 I would also recommend a fan to accompany the rather large heat-sink. When you're using all four cores to compile (i.e. gcc 'make -j4' option) the SoC gets very hot, very quickly! Then it'll crash at 88-90° Celsius -by design- as a protection measure to stop any permanent damage being done. So, with that in mind, cooling the SoC is a top priority.
|
With my Raspberry Pi 3 I've had problems with the device locking up compiling heavy stuff. That was solved here without a heatsink and without a fan by downclocking it. Takes longer to compile, but not that much. Adding this to /boot/config.txt was sufficient for me (I added the links as a comment to myself). Not sure though if all three lines are really needed:
Code:
# see forum.fatdog.eu/viewtopic.php?t=139
# or www.raspberrypi.org/forums/viewtopic.php?t=139013&p=923582
force_turbo=0
arm_freq=900
arm_freq_min=600
Quote:
Originally Posted by Exaga
Download the Linux kernel and RPi firmware source using 'git'. I usually work in the /tmp directory.
[...]
That's it. You can 'reboot' and hopefully enjoy your system with a new kernel and firmware.
|
Many thanks, I very much appreciate that you took the time to write it up (and more so that I could download your updated kernel/modules/firmware packages in the past)!  Especially the Raspberry Pi firmware stuff had left me puzzled before.
|
|
|
01-08-2018, 03:01 PM
|
#13
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by titopoquito
With my Raspberry Pi 3 I've had problems with the device locking up compiling heavy stuff. That was solved here without a heatsink and without a fan by downclocking it. Takes longer to compile, but not that much. Adding this to /boot/config.txt was sufficient for me (I added the links as a comment to myself). Not sure though if all three lines are really needed:
Code:
# see forum.fatdog.eu/viewtopic.php?t=139
# or www.raspberrypi.org/forums/viewtopic.php?t=139013&p=923582
force_turbo=0
arm_freq=900
arm_freq_min=600
|
I can believe it, and thanks for sharing your experiences. Underclocking is certainly an option. Not something I would try for myself or advise others to do. Each to their own way, I guess. Whatever works is generally acceptable for most people.
Quote:
Originally Posted by titopoquito
Many thanks, I very much appreciate that you took the time to write it up (and more so that I could download your updated kernel/modules/firmware packages in the past)!  Especially the Raspberry Pi firmware stuff had left me puzzled before.
|
You're most welcome. Always happy to be of some help. 
|
|
|
01-08-2018, 07:17 PM
|
#14
|
Senior Member
Registered: Dec 2002
Distribution: slackware!
Posts: 1,398
Original Poster
|
Quote:
Originally Posted by Exaga
You're welcome to any of my advice that may be useful to you. I really like to read/hear about Slackware ARM users doing exactly what you're planning to do. There's no better Linux learning curve than Slackware and therefore why waste the opportunity? It would be great if there were lots of Slackware ARM users all running different devices. All chipping in and sharing their work/knowledge and experiences; building kernels and packages, writing Slackdoc pages, posting on these forums, creating blogs, making 'how-to' guides, etc. We'll only get to that point by people doing their own thing and learning by it.
|
Exaga, thank you for all the info and support. I agree with all the above. I look forward to getting to this and will definitely post back what happens.
|
|
2 members found this post helpful.
|
01-09-2018, 03:11 PM
|
#15
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,071
|
Quote:
Originally Posted by glorsplitz
Exaga, thank you for all the info and support. I agree with all the above. I look forward to getting to this and will definitely post back what happens.
|
I sincerely hope you are successful and productive in all your endeavours. You may fail 100 times before you get it right once but the knowledge and experience you will gain from it is immeasureable. 
|
|
|
All times are GMT -5. The time now is 03:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|