# How to build and use it I'm mostly blindly following information from this guide: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel ## Enable kernel source fetching `sudo vim /etc/apt/sources.list` and uncomment these lines: ``` deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted ``` ``` $ sudo apt update $ sudo apt-get build-dep linux-image-$(uname -r) ``` ## Deps for building the kernel ``` $ sudo apt-get install libncurses-dev libssl-dev libelf-dev gawk ``` ## Fetch sources from git and apply this patch ``` $ git clone git://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git $ cd ubuntu-bionic $ patch -p1 < ~/Downloads/ubuntu-up-board.patch ``` Note: you may need to edit the first line of `debian.master/changelog`; it looks like this at the time of writing this gist: ``` linux (4.15.0-40.42+upboard) bionic; urgency=medium ``` The `+upboard` part is important and shows up in your `uname -a` output when the kernel is running and disambiguates your kernel from the official ubuntu packages, however, when I build the kernel it generates an `linux-image-unsigned-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb` package. The official ubuntu packages are signed and the package name is `linux-image` instead, so if you have the same version number (aside from the `+upboard`) as your currently installed kernel, your `linux-image-unsigned` package will conflict with the official `linux-image` package. For that reason, I suggest bumping the actual version number as I have done in this gist. ## Build it This takes a couple of hours on the UP board itself. You may want to run this on a faster system and then copy the packages over to your UP board. Run these steps in your `ubuntu-bionic` git repo: ``` $ fakeroot debian/rules clean $ fakeroot debian/rules binary-headers binary-generic ``` Once done the parent directory of `ubuntu-bionic` will have a few packages: ``` $ ls ../*.deb -1 ../linux-cloud-tools-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ../linux-headers-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ../linux-headers-4.15.0-40_4.15.0-40.42+upboard_all.deb ../linux-image-unsigned-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ../linux-modules-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ../linux-modules-extra-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ../linux-tools-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ``` You only strictly need to install the core kernel and modules: ``` $ cd .. $ sudo dpkg -i linux-image-unsigned-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb \ linux-modules-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb \ linux-modules-extra-4.15.0-40-generic_4.15.0-40.42+upboard_amd64.deb ``` Then reboot and your should be running your new kernel: ``` $ uname -a Linux up2 4.15.0-40-generic #42+upboard SMP Wed Nov 21 23:34:11 PST 2018 x86_64 x86_64 x86_64 GNU/Linux ```