Build the Popcorn Linux Kernel

Building and running Popcorn Linux kernel on real hardware

On your target machine (x86_64 or arm64), download the source code:

git clone --depth=1 -b main --single-branch https://github.com/ssrg-vt/popcorn-kernel.git

Create a build directory to build the kernel.

cd popcorn-kernel
mkdir build
cd build
make -C .. O=$(pwd) defconfig

This will use the default kernel configuration but it often causes issues. You can copy the kernel config on your machine as the template:

cp /boot/config-5.11.0-34-generic .config

You also need to disable some CONFIG_ flags, you can update it with this script:

../update_config.sh

Next, build the kernel with:

make -j8 bindeb-pkg LOCALVERSION=-popcorn

You should be able to see the kernel in the parent folder:

$ ls -lth ..
linux-image-5.2.21-popcorn_5.2.21-popcorn-1_arm64.deb
...

You can install the popcorn linux kernel by:

sudo dpkg -i linux-image-5.2.21-popcorn_5.2.21-popcorn-1_arm64.deb

After reboot the machine, select the correct kernel. You are having the popcorn kernel installed.