Comments (6)
I've been looking around and I can't seem to find any examples of people integrating custom kernel builds into pi-gen, do any exist?
Not that I am aware of, but it's a fairly frequent request, so it's worth thinking about.
pump out a set of uniquely named .deb files that then get pulled into our pi-gen stage
How would these be kept up to date after the customer installs the image?
I can see that the source comes from (I think!) linux stable and rip-distro/linux-packaging
That's right.
I cant find any docs / scripts / forum posts / anything demonstrating how these packages get built...
In the debian/
directory (the packaging), there are two README files which provide more information. Not all the information there is applicable, since it was written for Debian and our fork is a bit different. Other than that, it's just a standard Debian package that you can build like any other, just be sure to use the 'noudeb' profile.
If anyone can point me in the right direction to get this working at my end, I'd be delighted to put together a documented fork of pi-gen showing how to do it for others to find in the future...
Another person was working on something like this recently. You can see how far they've got here: raspberrypi/linux#6063 (comment)
One thing to keep in mind is that our raspi-firmware
package handles the actual installation of the kernel and initramfs into /boot/firmware. You'd need to understand the hooks from that package to make sure your kernel gets picked up as well.
from pi-gen.
That's a perfect leg up to get started, thanks!
How would these be kept up to date after the customer installs the image?
The main thing I'm trying to avoid is doing things outside of the debian packaging model. For example, the documented kernel install method here :
https://www.raspberrypi.com/documentation/computers/linux_kernel.html
details just copying binaries over the top of what the apt package installed. I'm not quite sure of exactly what the interactions are having not tried it, but it looks like an apt upgrade linux-image-XX
with a newer package would trounce all over the images that were manually copied in so this isn't an ideal mechanism.
Ideally I'd like to be able to create a parallel set of custom linux-image packages that one can update from a private PPA that are separate to standard linux-image-xx much in the same way as you have in debian using linux-image-rt- or linux-image-cloud-.
I think the other piece of the puzzle is tracking where the apt-get source packages are put together. So I can see that it's from the rpi linux kernel and the linux-packaging repo ; Id assumed the repos would be tagged with a script somewhere to put together the build but I couldn't find such a thing anywere. Is there even a log of git revisions used per release or do we need to compare source packages coming from apt-get source to the originating repositories manually to do this?
from pi-gen.
Ideally I'd like to be able to create a parallel set of custom linux-image packages that one can update from a private PPA that are separate to standard linux-image-xx much in the same way as you have in debian using linux-image-rt- or linux-image-cloud-.
There's a few ways to make this work - you could use the Replaces directive on your new package, or apt pinning to disallow the regular linux-image* packages.
A PPA is a very Ubuntu concept, but there's little stopping you hosting your own apt repository using Reprepro or aptly. To make use of that, you'd adjust the default sources.list specified in Stage0. Don't forget to enforce your signatures!
Generally, you'd expect a release to have an associated annotated tag - but you might also be able. to retrieve the source from apt itself: https://www.cyberciti.biz/faq/how-to-get-source-code-of-package-using-the-apt-command-on-debian-or-ubuntu/
from pi-gen.
A PPA is a very Ubuntu concept,
It's still just an apt repo underneath and Raspberry Pi OS would happily use them. However, if I recall correctly, to add something to a PPA, you upload the source package and then Launchpad builds it for the appropriate architectures and releases. The main problem is that the build environment (Ubuntu) would not match the target. It 'should' work, but if you'd like to avoid potential headaches, build packages in the environment they are intended to run on.
Id assumed the repos would be tagged with a script somewhere to put together the build but I couldn't find such a thing anywere.
I don't quite understand what you feel is missing. The linux-packaging repo is all that should be needed. The changelog contains the upstream kernel version and the git hash of the raspberrypi/linux commit used to generate rpi.patch.
A debian source package is meant to be self contained, you don't need something outside of the packages listed in build-depends to build it. One sec, I'll provide some examples...
from pi-gen.
A PPA is a very Ubuntu concept, but there's little stopping you hosting your own apt repository using Reprepro or aptly. To make use of that, you'd adjust the default sources.list specified in Stage0. Don't forget to enforce your signatures!
Ignore my reference to PPA's, that's me brain-farting ; using an apt repository would be ideal.
from pi-gen.
I don't quite understand what you feel is missing. The linux-packaging repo is all that should be needed. The changelog contains the upstream kernel version and the git hash of the raspberrypi/linux commit used to generate rpi.patch.
Ah, OK that makes more sense - I'd not realised that was captured in the changelog... I think my brain was fixated on expecting a tag reference somewhere!
So, one only needs the linux-packaging repository? I had a read though both README's and its not clear how the build should be performed. Following README.source I did :
./debian/bin/genorig.py \
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
make -f debian/rules orig
But that just applied the debian patches but not anything rpi related. Looking at what "apt get source" supplies compared to what's committed in linux-packaging, I can see that the debian dir that apt get source gives us also includes a "rules.gen" and a lot of rpi specific scripts that aren't present in linux-packaging repo so things don't quite seem the same (unless there's a step Im not aware of that generates these?) - looking at the script from another user you refrerenced in a comment previously I can see that in their build script https://github.com/febus982/rpi-kernel/blob/7d7c33fb020149449ffcd06e53573d277d70d082/scripts/build_kernel.sh#L56 they refernce this rules.gen... Can you shed any light on how these relate?
I also looked at README.Debian, which confusingly states "We recommend using the 'make deb-pkg' target provided by the upstream kernel source." - which was in fact what I tried doing originally before logging as an issue because it didn't work ; I haven't looked further yet as wasn't sure which direction to spend effort, but I suspect that maybe the package is OK but update-initramfs doesn't do the right thing to allow to work? So now Im not quite sure whether I should focus attention on getting the normal deb-pkg target to work, or the build via linux-packaging...
from pi-gen.
Related Issues (20)
- Cannot build 32-bit images (bullseye, bookworm) using standard build.sh on i686 Debian any more HOT 8
- Customization Using RPi Imager Cause Images to Fail on Boot HOT 7
- Use gpt and btrfs as root filesystem HOT 2
- Problems with `initramfs` not being generated HOT 4
- Removal of config.txt symlinks breaks postinst for fbturbo package HOT 1
- When building an image with zfs-dkms and DEBIAN_FRONTEND=noninteractive and still getting confirmation window HOT 3
- Custom raspberry OS image cannot boot up when boot partition size is 64MB or 128MB HOT 8
- MacOS + Docker: qemu-user-static check from #685 breaking build early HOT 5
- /usr/bin/raspi-config: 847: lxpanelctl: not found HOT 6
- The apt caching proxy we use currently is unreliable - let's replace it with nginx? HOT 1
- stage_list availability during build HOT 2
- ./build-docker.sh error "setarch: failed to set personality to linux32: Invalid argument" HOT 1
- adduser error when setting FIRST_USER_NAME in config HOT 2
- FR: Option to enable Real Time kernel HOT 1
- Change docker to build in the host filesystem directly HOT 2
- If source directory has been bind-mounted, build breaks HOT 4
- debootstrap not empty during stage 0 HOT 18
- Add new one partition to image HOT 1
- Custom dtbo files during firstboot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi-gen.