Linux Kernel Development — Episode 2: Building and Booting a Custom Kernel
The next step was to build and boot a custom Linux kernel for ARM using kw, following the tutorial on Building and booting a custom Linux kernel for ARM using kw.
What initially looked like a straightforward process quickly turned into a complete mess.
While trying to install kw, I noticed that several dependencies were missing. That alone was already strange, but things got worse when attempting to install them: my Ubuntu system was not able to find even basic libraries. From there, we started forcing installations, trying to manually install missing packages.
At some point, running sudo apt update started throwing version conflict errors. At the same time, the system was downloading a large number of packages, which already felt suspicious.
Then something even stranger happened: the internet connection suddenly disappeared. The network icon turned red, even though the system had literally just been downloading packages moments before.
I decided to reboot the machine.
After rebooting, the system simply stopped booting.
At this point, I called the professor Paulo Meirelles, and we tried multiple times to bring the system back. We managed to boot into safe mode, but even trying older kernel versions did not fix the issue. The system would not start properly — we could only access the UEFI interface.
With no clear solution, we went to Super Nelson.
He took the machine and started investigating the issue directly from the UEFI terminal. It was not disk corruption, and no essential files had been deleted. Eventually, the conclusion was that the system had entered a broken state due to conflicting package versions.
The root of the problem was that the system was missing packages responsible for controlling version compatibility. By forcing installations, we ended up mixing incompatible package versions, breaking the system.
The fix was painful but effective:
- Using the package history, we removed recently installed packages
- Gradually rolled back the system to a stable state
- Rebuilt the
/etc/apt/sources.list.d/configuration from scratch - Carefully reinstalled dependencies, respecting version constraints
After more than four hours, the system was finally stable again.
A clean sudo apt update and sudo apt upgrade ran without any warnings or errors.
Only then it was possible to proceed with the tutorial and successfully build and boot the custom kernel.