I am totally frustrated after 3 days trying to build a kernel for Ubuntu 18.04. I needed to build a kernel to enable "RT_GROUP_SCHED" which is required by mininet. The documentation is contradictory. It shouldn't be this difficult to enable something in the kernel like this. Help appreciated. Here is what I tried:
I installed the following, again I think some of these are within build-essential though documentation is not consistent.
sudo apt-get install -y fakeroot kernel-package linux-source uboot-mkimage gcc libc6-dev binutils-dev make bin86 module-init-tools build-essential
I tried downloading the source by unhashing the following line in /etc/apt/sources.list
deb-src http://ug.archive.ubuntu.com/ubuntu/ bionic main restricted
deb-src http://ug.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
sudo apt-get update && sudp apt-get upgrade
I tried both these options to download the source and they downloaded stubs but not the source.
apt-get source linux-image-$(uname -r)
apt-get build-dep linux-image-$(uname -r)
apt-get install linux-source
Finally, I resorted to a direct download.
curl -O http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_4.15.0.orig.tar.gz
tar -xzvf linux_4.15.0.orig.tar.gz
cd linux_4.15
I made the change
make menuconfig
General setup --->
Control Group support --->
CPU Controller --->
[*] Group scheduling for SCHED_RR/FIFO
Do you wish to save your new configuration? <Yes>
I then tried to compile.
make-kpkg clean
fakeroot make-kpkg --initrd --revision=1.0.custom kernel_image
and off it went so I went to bed only to find in the morning it had used by entire harddrive.
LD [M] drivers/scsi/be2iscsi/be2iscsi.ko
ld: final link failed: No space left on device
scripts/Makefile.modpost:129: recipe for target 'drivers/scsi/be2iscsi/be2iscsi.ko' failed
make[2]: *** [drivers/scsi/be2iscsi/be2iscsi.ko] Error 1
Makefile:1214: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/tmp/linux-4.15'
debian/ruleset/targets/common.mk:295: recipe for target 'debian/stamp/build/kernel' failed
make: *** [debian/stamp/build/kernel] Error 2
References
https://help.ubuntu.com/lts/installation-guide/amd64/install.en.pdf https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel What's a simple way to recompile the kernel? "Unknown sequence editconfigs" when trying to build a kernel https://help.ubuntu.com/lts/installation-guide/amd64/ch08s06.html
/usr/share/doc/kernel-package/README