Source package for Patchbox

Hi!

In order to compile some MIDI drivers I need to download the source package for 4.19.71-rt24-v7l+.
This does not work with the expected commands however, see below:

**patch@patchbox:~ $ more /etc/apt/sources.list**
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

**patch@patchbox:~ $ sudo apt-get update**
Hit:1 http://apt.blokas.io rpi InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease 
Hit:3 https://apt.syncthing.net syncthing InRelease                     
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:5 http://raspbian.raspberrypi.org/raspbian buster/main Sources [11.4 MB]
Get:6 http://raspbian.raspberrypi.org/raspbian buster/non-free Sources [139 kB]                                                                               
Get:7 http://raspbian.raspberrypi.org/raspbian buster/contrib Sources [78.5 kB]                                                                               
Get:8 http://raspbian.raspberrypi.org/raspbian buster/rpi Sources [1132 B] 
Fetched 11.6 MB in 11s (1021 kB/s) 
Reading package lists... Done

**patch@patchbox:~ $ sudo apt-get source linux-image-$(uname -r)**
Reading package lists... Done
E: Unable to find a source package for linux-image-4.19.71-rt24-v7l+

Crossing my fingers that someone in this forum has some hint on how I can can download the source package.
:slight_smile:

It’s built from here: https://github.com/BlokasLabs/rpi-linux-rt

The build script for cross-compiling the kernel is here: https://github.com/BlokasLabs/rpi-kernel-rt/blob/master/build.sh

On Raspberry Pi itself, you’ll have to ‘prepare’ the sources first by doing:

cd ~
git clone --depth 1 --branch rpi-4.19.y-rt https://github.com/BlokasLabs/rpi-linux-rt linux
cd linux
make bcm2711_defconfig # For Pi4, so below for other versions
cp /boot/Module7l.symvers Module.symvers # Copy symvers for Pi4, see below for other versions
make modules_prepare

# You may create build & source links too, so 'out of tree' module builds work:
sudo ln -sf /home/patch/linux /lib/modules/$(uname -r)/build
sudo ln -sf /home/patch/linux /lib/modules/$(uname -r)/source

bcm2711_defconfig is for RPi4, use bcm2709_defconfig for RPi2/3 or bcmrpi_defconfig for 1 / zero.
/boot/Module7l.symvers is for RPi4, use /boot/Module7.symvers for RPi2/3 or /boot/Module.symvers for 1 / zero.

See following links & tool source code for more information:

https://github.com/notro/rpi-source/blob/master/rpi-source
https://www.raspberrypi.org/documentation/linux/kernel/building.md

1 Like