Skip to content

Instantly share code, notes, and snippets.

@fuji246
Last active July 19, 2019 00:33
Show Gist options
  • Save fuji246/0cc8e05fb88927980815f22dd8ed12a8 to your computer and use it in GitHub Desktop.
Save fuji246/0cc8e05fb88927980815f22dd8ed12a8 to your computer and use it in GitHub Desktop.
$ uname -a
Linux pi3 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
$ zgrep "* firmware as of" /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | head -1 |
awk '{ print $5 }'
d4f5315cfac4e
On the build host fetch the equivalent R-PI firmware.
$ mkdir -p /embedded/raspbian/build/
$ cd /embedded/raspbian/build/
$ git clone https://github.com/raspberrypi/firmware
$ cd /embedded/raspbian/build/firmware
$ git checkout d4f5315cfac4e
$ git reset --hard
Determine the kernel hash for this firmware.
$ cat extra/git_hash
1587f775d0a3c437485262ba951afc5e30be69fa
Fetch the kernel source for this hash.
$ cd /embedded/raspbian/build/
$ git clone https://github.com/raspberrypi/linux.git
$ cd /embedded/raspbian/build/linux
$ git checkout 1587f775d0a3c437485262ba951afc5e30be69fa
$ git reset --hard
Config
```
sudo modprobe configs
gunzip -c config.gz > .config
make oldconfig
```
Compile kernel module:
```
make net/sched/sch_netem.ko
sudo mv /lib/modules/$(uname -r)/kernel/sch_netem.ko /lib/modules/$(uname -r)/kernel/sch_netem.ko.bak
sudo mv net/sched/sch_netem.ko /lib/modules/$(uname -r)/kernel/sch_netem.ko
sudo rmmod sch_netem
sudo insmod /lib/modules/$(uname -r)/kernel/sch_netem.ko
dmesg | tail -n 10
```
Check iproute2 version and download iproute2 source:
```
apt show iproute2
wget https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.9.0.tar.gz --no-check-certificate
tar zxvf iproute2-4.9.0.tar.gz
cd iproute2-4.9.0
./configuration
make
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment