LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   compilling kernel (https://www.linuxquestions.org/questions/slackware-arm-108/compilling-kernel-4175644808/)

hedron 12-22-2018 05:17 PM

compilling kernel
 
Is there any difference between the process of compiling/updating the kernel on a SARPI system and a "normal" x86 PC? I'm guessing there isn't, but I don't like guess work.

Penthux 12-22-2018 06:53 PM

Quote:

Originally Posted by hedron (Post 5940472)
Is there any difference between the process of compiling/updating the kernel on a SARPI system and a "normal" x86 PC? I'm guessing there isn't, but I don't like guess work.

The difference is that SARPi is not an operating system. Slackware ARM is an operating system.

The process of compiling a kernel is pretty much the same on all Slackware systems with the only difference being the architecture on which it runs.

syg00 12-23-2018 01:20 AM

Having once (only) done this I hope you are a patient person.
Cross compiling might be a better option.

Penthux 12-23-2018 05:07 AM

Quote:

Originally Posted by syg00 (Post 5940539)
Having once (only) done this I hope you are a patient person.
Cross compiling might be a better option.

I would advise, from personal experience, that the better option is to compile the kernel on the architecture you're intending to use it on.

hedron 12-25-2018 11:55 PM

Ok, so I got the kernel compiled, which was easy. But now I'm realizing that there's no lilo.conf and I dont' know where to put the kernel(bzImage) or how to get the boot process to load it? The SARPI website only talks about rpi-update. I guess I'll use that, if there is other way.

abga 12-26-2018 12:07 AM

You don't need lilo, the Pi GPU will look after the firmware in the VFAT /boot partition, where also your resulting kernel image should reside. Make a backup of the /boot directory before you attempt running your own kernel.
https://elinux.org/RPi_Kernel_Compilation
The Manual Installation section from this doc will also provide you with some details:
https://docs.slackware.com/howtos:ha...rm:raspberrypi

hedron 01-04-2019 01:15 AM

I tried that guide, but when I do, "make ARCH=arm modules_install INSTALL_MOD_PATH=/" I get:
Code:

cp: cannot stat './modules.builtin': No such file or directory
So, I tried make modules.builtin and then I get a huge list of all the modules that were supposed to have compiled, the following being an example of one of them:
Code:

INSTALL sound/usb/snd-usbmidi-lib.ko
cp: cannot stat 'sound/usb/snd-usbmidi-lib.ko': No such file or directory
  DEPMOD  4.20.0-v7

I'm not really sure how to proceed. make modules? But I already did that, as per the guide.

lamerix 01-04-2019 03:39 AM

Few steps before that, it tells you to do
Code:

nohup make zImage dep modules &
I'm guessing
Code:

make modules
didn't finish as expected.
Check the output in the nohup.out file or another way you can go is doing
Code:

make zImage && make dep && make modules
so it steps on failure and u should see what failed.

hedron 01-04-2019 07:25 PM

zImage compiles, but make dep fails.

Code:

make: *** No rule to make target 'dep'.  Stop.
I never had to make dep with x86. The method seems to work otherwise, but it boots with the old kernel. I tried moving the old kernel out of /boot, but then it doesn't boot. The directions there seem to overlook how to get the bootloader to recognize the new kernel. It sounds like that's what make dep is for? When it's only the new one, I get this rainbow cloud screen.

abga 01-04-2019 07:36 PM

@hedron

There is already an existing thread that describes the kernel build procedure for Raspberry Pi, to be found on the second page of the Slackware ARM sub-forum.
https://www.linuxquestions.org/quest...is-4175621155/
Note that you have two firmware entities, the firmware for the Raspberry Pi board, provided by Raspberry and treated separately and the usual kernel firmware collection released by the kernel folks.
Although I was interested myself in building the kernel, participated in that thread, I still haven't followed the kernel building procedure, because the audio engine (emulating the snd_bcm2835 sound card) from the Raspberry Firmware is broken since the middle of 2017 and I got stuck with the Raspberry official kernel&firmware that was released before, specifically, the ones extracted from 2017-04-10-raspbian-jessie-lite.img
https://downloads.raspberrypi.org/raspbian_lite/images/
Just for orientation, if you use the Raspberry official kernel&firmware, you'll have these files (excepting the /boot/overlays/ subfolder) in the /boot folder/partition :
Code:

        bootcode.bin        firmware
        fixup.dat        firmware
        fixup_cd.dat        firmware
        fixup_db.dat        firmware
        fixup_x.dat        firmware
        start.elf        firmware
        start_cd.elf        firmware
        start_db.elf        firmware
        start_x.elf        firmware

        kernel.img        kernel
        kernel7.img        kernel

There's also an official How-To from Raspberry about compiling the kernel, but it doesn't handle the firmware:
https://www.raspberrypi.org/document...el/building.md

Some additional details about the boot procedure, since you were looking after lilo.conf some posts above:
https://www.raspberrypi.org/document...es/bootflow.md
And here you have a nice schematic too:
https://raspberrypi.stackexchange.co...-boot-sequence

hedron 01-23-2019 01:29 PM

>Although you could just compile the vanilla kernel from Kernel.org, it will not have the necessary drivers and modules for the Broadcom SoC on the Raspberry Pi
So, I'm supposed to download the github kernel, compile that, then apply the patches? Because I've just been using the "vanilla" kernel. I've tried all that I can think, looking through the links and so on, but still the boot process stalls at the rainbow cloud.

Code:

COPYING.linux              bcm2835-rpi-zero.dtb
LICENCE.broadcom          bcm2836-rpi-2-b.dtb
README                    bcm2837-rpi-3-b-plus.dtb
README.boot                bcm2837-rpi-3-b.dtb
README.initrd              bcm2837-rpi-cm3-io3.dtb
System Volume Information  bootcode.bin
System.map                cmdline.txt
bcm2708-rpi-0-w.dtb        config.txt
bcm2708-rpi-b-plus.dtb    fixup.dat
bcm2708-rpi-b.dtb          fixup_cd.dat
bcm2708-rpi-cm.dtb        fixup_db.dat
bcm2709-rpi-2-b.dtb        fixup_x.dat
bcm2710-rpi-3-b-plus.dtb  kernel7.img
bcm2710-rpi-3-b.dtb        overlays
bcm2710-rpi-cm3.dtb        start.elf
bcm2835-rpi-a-plus.dtb    start_cd.elf
bcm2835-rpi-a.dtb          start_db.elf
bcm2835-rpi-b-plus.dtb    start_x.elf
bcm2835-rpi-b-rev2.dtb    version-kernel_sarpi3.txt
bcm2835-rpi-b.dtb          version-sarpi3-boot.txt
bcm2835-rpi-cm1-io1.dtb    version-sarpi3-installer.txt
bcm2835-rpi-zero-w.dtb

That's the contents of /boot. Keep in mind that I have tried numerous different ways with initrc.gz, deleting everything, not using the dtb files, and things I don't remember.

hedron 01-24-2019 11:51 AM

Ok, that was the problem. I was using the kernel from kernel.org, instead of github.

SCerovec 02-02-2019 03:29 AM

solved?

maybe a nice roundup post and then [solved]?

FWIW:

the Rpi kernel build process is all but obvious and transparent IMHO, and a nice roundup would help quite a newbie.

:hattip:

abga 02-04-2019 03:14 PM

Quote:

Originally Posted by SCerovec (Post 5956742)
solved?

maybe a nice roundup post and then [solved]?

FWIW:

the Rpi kernel build process is all but obvious and transparent IMHO, and a nice roundup would help quite a newbie.

:hattip:

The instructions from this thread are pretty much complete:
https://www.linuxquestions.org/quest...is-4175621155/
However, I guess I'll soon need to go through this on my own and will maybe write down a concise, step by step guide, as a post. But I'll need to do some Frankenstein work, building the latest kernel source against an older, unbroken, firmware. They broke the audio generation engine in the firmware some 2 years ago and it doesn't look like they are keen to repair it:
https://www.raspberrypi.org/forums/v...83629&start=50
Due to these recent patches I feel like my otherwise rock solid and well performing 4.4.50 kernel needs some urgent upgrade:
https://www.linuxquestions.org/quest...es-4175647337/
The firmware I'm running now is:
Code:

/opt/vc/bin/vcgencmd version
Apr  5 2017 11:49:52
Copyright (c) 2012 Broadcom
version 3ca4cf4a663c5351eaec08b29d50d6e8324981b4 (clean) (release)

And I'll need to clone the firmware used for building the 4.4.50 kernel:
https://github.com/raspberrypi/firmw...d4acb39e8d+174
https://github.com/raspberrypi/firmw...e16c0194a8e54b
I read in the Raspberry forum, that you can use an older firmware, hope it also works.


All times are GMT -5. The time now is 05:44 AM.