-
uncomment the “deb-src” lines in /etc/apt/sources.list.
-
install packages and source
sudo apt update
sudo apt-get build-dep linux linux-image-$(uname -r)
sudo apt-get install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf
sudo apt-get install git
sudo apt-get source linux-image-$(uname -r)
- linux source will in current working directory, for example “linux-4.4.0”, then enter into that directory, and copy config, then compile, it will pop some module options, i guess just choose y should be fine.
cd linux-4.4.0
cp /boot/config-`uname -r` .config
make net/sched/sch_netem.ko
** You probabaly need to change Makefile it the module have version check, use dmesg | tail -n 10
to check the error when loading the module and change the VERSION in Makefile **
- you can try load the module you compile to see if it works, for example, make a change of the module name only,
sudo mv /lib/modules/$(uname -r)/kernel/net/sched/sch_netem.ko /lib/modules/$(uname -r)/kernel/net/sched/sch_netem.ko.bak
sudo mv net/sched/sch_netem.ko /lib/modules/$(uname -r)/kernel/net/sched/sch_netem.ko
sudo rmmod sch_netem
sudo insmod /lib/modules/$(uname -r)/kernel/net/sched/sch_netem.ko
dmesg | tail -n 10
- if that works, go with the netem patch to see if it works