GithubHelp home page GithubHelp logo

Loading device tree overlays about gokrazy HOT 9 CLOSED

stv0g avatar stv0g commented on June 12, 2024
Loading device tree overlays

from gokrazy.

Comments (9)

stapelberg avatar stapelberg commented on June 12, 2024 1

My question: Is it possible to use the device tree overlays from the Raspberry Pi Foundations kernel with the gokrazy kernel? Has this been attempted already?

I think I vaguely remember someone using a device tree overlay at some point.

For testing, you could copy the files of the boot partition, re-create said partition (mkfs.vfat), copy back your files with any modifications you need.

For making gokrazy pick up dtbs, you need to change (at least) what gokrazy includes in the boot partition: https://github.com/gokrazy/tools/blob/23cde3b0d858497a63c21e93ad30859bf197995f/internal/packer/write.go#L151

Or are there better approaches for customizing the device tree used by gokrazy?

No, this use-case isn’t well served right now. But I’m willing to accept changes to make it better :)

from gokrazy.

Doridian avatar Doridian commented on June 12, 2024 1

I'll see if I can get the first bit done to pull in the blobs (I also just now only realized you merged my previous PR, thanks for merging it).
The second one I started looking at somewhat when initially investigating that PR's change and I'll see if I can get some time to actually look at it later this week.

If someone else wants to poke in, they are more than welcome of course :)

from gokrazy.

dme avatar dme commented on June 12, 2024 1

After updating all of the relevant pieces, then updating config.json with:

    "BootloaderExtraLines": [
	"dtoverlay=w1-gpio"
    ]

I rebuilt (ensuring to use the default kernel package, not my own) to get:

/perm/home # ls /sys/bus/w1/devices
28-4adf871e64ff  28-89ca871e64ff  28-a48c071e64ff  w1_bus_master1
/perm/home # 

Which I believe means that this all works 👍

from gokrazy.

Doridian avatar Doridian commented on June 12, 2024

Poking in here because I need the ability to load DT overlays and wanting to contribute an enhancement to add as much.

@stapelberg What would your idea be of where these go? Firmware or kernel?
Firmware makes semantically more sense to be but kernel already has the .dtb file, which the .dtbo would overlay over, and keeping them in separate repos doesn't make that much sense to me.

from gokrazy.

stapelberg avatar stapelberg commented on June 12, 2024

The devicetree is part of the kernel, so device tree overlays should go into the kernel repository, I think.

from gokrazy.

Doridian avatar Doridian commented on June 12, 2024

@stapelberg Opened a PR for this gokrazy/tools#63 let me know what you think. This (just) adds the ability for the kernel package to contain overlay/*.dtbo and those to be included.

from gokrazy.

stapelberg avatar stapelberg commented on June 12, 2024

As part of looking at https://github.com/gokrazy/kernel/pull/475/files, I came across the device tree overlay issue again.

I think what needs to be done is:

  • Change the gokrazy/firmware auto-update setup to also pull in the boot/overlays directory from the raspberrypi/firmware repository: gokrazy/firmware#309
    • Change gokrazy/tools/internal/packer/write.go to include "overlays/*.dtbo" in firmwareGlobs: gokrazy/tools#67
  • Make the config.txt on the boot partition configurable through gokrazy’s instance config.json, most likely just with a config_addendum mechanism where the user-supplied config is appended to what’s already in gokrazy/kernel/config.txt

Not all overlays will necessarily work depending on how specific they are to the Raspberry Pi OS kernel. But chances are that some just work.

Let me know if anyone is interested in contributing support for this.

from gokrazy.

stapelberg avatar stapelberg commented on June 12, 2024

OK, we have the overlays directory included in the gokrazy/firmware repository now, and the packer includes them in the boot partition.

What’s left is introducing the config_addendum mechanism in gokrazy/internal/config, using it in gokrazy/tools and documenting it in gokrazy/gokrazy/website.

from gokrazy.

stapelberg avatar stapelberg commented on June 12, 2024

I had a few minutes of downtime, so I introduced the BootloaderExtraLines JSON array in config.json and made the packer write those lines to config.txt.

Still left to do: documentation

If anyone wants to give this a shot and report back, success/failure reports are welcome!

from gokrazy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.