Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Overlays with custom kernel on Raspberry Pi 2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
bender86
Guru
Guru


Joined: 18 Mar 2005
Posts: 484

PostPosted: Sat Nov 30, 2019 9:02 pm    Post subject: Overlays with custom kernel on Raspberry Pi 2 Reply with quote

Hello,
I am trying to compile a custom kernel from sys-kernel/gentoo-sources on my Raspberry Pi 2.
I followed this guide [1], and I can get a booting kernel.
However, I cannot get dtparam and dtoverlay directives in config.txt to work.
In particular, I have
Code:
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
dtoverlay=w1-gpio,gpiopin=21

but when I boot my custom kernel the leds are still on, and I cannot find temperature sensors from /sys/bus/w1/devices/, even after manually loading the related modules.

If I try to manually call dtparam I get this error:
Code:
# /opt/vc/bin/dtparam act_led_trigger=none
mount: /config/device-tree: mount point does not exist.
* Failed to mount configfs - 2

If instead I use the official compiled kernel [2] everything works as expected.

I also tried with the same exact configuration of the official compiled kernel
Code:
modprobe configs
zcat /proc/config.gz > .config
make oldconfig

and also using the official instructions for compiling the kernel [3], but in these cases I could not get my kernel to boot at all.

I found some comments online about compiling my own device tree, but I do not entirely understand this topic, and I was hoping to simply replace the kernel and leave everything else in place.

Does anyone have an idea for solving this issue?


Anticipating comments about X-Y questions, the actual reason I want to build my own kernel is because I want to emerge net-vpn/wireguard, and that ebuild requires a prepared kernel source and few options which are not enabled in the official compiled kernel. Suggestions to reach my actual goal in other ways are of course welcome.

[1]: https://wiki.gentoo.org/wiki/Raspberry_Pi/Mainline_Kernel
[2]: https://github.com/raspberrypi/firmware
[3]: https://www.raspberrypi.org/documentation/linux/kernel/building.md
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54923
Location: 56N 3W

PostPosted: Sat Nov 30, 2019 9:31 pm    Post subject: Reply with quote

bender86,

Lots of Pi specific kernel code is not in the upstream kernel yet and may never be.
Don't use the mainline kernel.

Learn git. Al least, enough to clone https://github.com/raspberrypi/linux, which is the Pi foundation kernel sources.
Its gentoos vanillia-sources with the ongoing Pi Foundation kernel development.

At the time of writing, you should use the rpi-4.19.y branch as fixes go there first.
That's
Code:
git checkout rpi-4.19.y


There is a
Code:
make <defaulf_config>
for the Pi 2. There are two actually.
Early Pi 2s had an odd expensive Pi2 only Broadcom CPU. Later Pi2s have the same chip as the Pi3 and are 64 bit capable.
This was a cost saving measure.

Your first steps are the git clone, git checkout, make <defaulf_config> and build the PI Foundation kernel for yourself.
Once it works, you can fiddle with it knowing that it if it breaks, it was something you did and not the build process.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bender86
Guru
Guru


Joined: 18 Mar 2005
Posts: 484

PostPosted: Sun Dec 01, 2019 5:37 pm    Post subject: Reply with quote

@NeddySeagoon

Thanks for the answer. Using the Pi foundation kernel sources I was able to get a working kernel, together with working overlays, and working wireguard module :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum