# Source package for Patchbox

**URL:** <https://community.blokas.io/t/source-package-for-patchbox/1933>\
**Category:** Patchbox OS\
**Created:** [July 15, 2020, 9:25am UTC](https://community.blokas.io/t/source-package-for-patchbox/1933 "2020-07-15T09:25:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Metromon](https://community.blokas.io/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@Metromon](https://community.blokas.io/u/Metromon)\
**Post date:** [July 15, 2020, 9:25am UTC](https://community.blokas.io/t/source-package-for-patchbox/1933/1 "2020-07-15T09:25:06Z")

</div>

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.  
🙂

---

<div class="post-metadata">

**Author:** ![Giedrius](https://community.blokas.io/letter_avatar_proxy/v4/letter/g/6a8cbe/32.png) [@Giedrius](https://community.blokas.io/u/Giedrius)\
**Post date:** [July 15, 2020, 9:39am UTC](https://community.blokas.io/t/source-package-for-patchbox/1933/2 "2020-07-15T09:39:54Z")

</div>

It’s built from here: [https://github.com/BlokasLabs/rpi-linux-rt](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](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:

```auto
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://github.com/notro/rpi-source/blob/master/rpi-source)  
[https://www.raspberrypi.org/documentation/linux/kernel/building.md](https://www.raspberrypi.org/documentation/linux/kernel/building.md)
