[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building (Debian) kernel optimized for RPi Zero (W) and 1



On Tuesday, 25 October 2022 14:34:12 CEST Diederik de Haas wrote:
> > and entirely based on the kernel patches that are added on top of mainline
> > as well as the configuration.

The patch set may be more substantial then I initially thought.
In 2015 I asked plugwash the general procedure to make a raspbian.org style 
kernel and my notes of that are attached.

Through that, I found that an 'update-rpi-patches' script was used (attached) 
and that adds https://github.com/raspberrypi/linux.git as remote.

I don't think I ever succeeded in building such a kernel though, probably also 
because I had ~0 experience with building a kernel at all.
Making a raspbian.org style kernel

https://plugwash.raspbian.org/linux_3.18/
https://sourcearchive.raspbian.org/main/l/linux/

1: take the debdiff
2: filter out debian/patches using filterdiff
3: apply the filtered debdiff to a Debian source package for the correct major version
4: deal with any bits of the patch that failed to apply
5: update the settings in debian/update-rpi-patches
6: make debian/update-rpi-patches executable (since diff/patch don't preserve permissions)
7: run debian/update-rpi-patches
8: try and work out what new config settings are needed from diffing the two major versions in the rpf repo, edit debian/config/armhf/config.rpi (I think that is the name, I may be misremembering) accordingly
9: hack away at the package until it builds successfully
10: build the package
11: test the kernel actually boots, if not hack on things some more until it does

ad 1)
debdiff between the raspbian kernel package and the debian kernel package it's based on.
debdiff linux_3.18.5-1~exp1.dsc linux-3.18_3.18.5-1~exp1+rpi20.dsc > linux-3.18.debdiff
Obtained the linux_3.18.5-1~exp1.dsc file through snapshot.debian.org (http://snapshot.debian.org/archive/debian/20150208T160746Z/pool/main/l/linux/)
Besides the .dsc file you also need the .orig.tar.xz file and the .debian.tar.xz file

ad 2)
filterdiff -p1 -x 'debian/patches/*' linux-3.18.debdiff > linux-3.18.debdiff.filtered

ad 7)
oh another thing, update-rpi-patches will run much faster if you have a clone of the rpi kernel tree in a directory called linuxgit in the parent of the directory where you have the package source extracted

Attachment: update-rpi-patches
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: