User:Immolo/OldKernelInstall

This guide is intended for those that need to use an older kernel as that's all the hardware supports. Throughout this guide we will be using a 2.6.39 kernel as it's the oldest recommended by Musl however, older ones can still work with it and feel free to add the needed fixes to this guide.

Setup
Log into the system, create your partitions, mount them, change into that directory and then finally download the Musl stage3 tarball for your system (this guide will be using amd64 as the example.)

Due to these devices having a number of ways the above steps need to be completed this guide will start from unpacking the stage3:

Mount the required filesystems:

/run isn't provided by all old host systems so you can ignore it if it's not there.

Next copy over /etc/resolv.conf so Internet works in the chroot:

Chroot into the system:

Before moving on to the next step this is the time to setup make.conf with the require common flags and use flags and finally run emerge-web-rsync.

Create Local Repository
Now, create a local repo for the kernel headers to match the device's kernel.

Next, create the required kernel headers version:

Change the header sources to what you need and others can be obtained from here.

Create a manifest for the ebuild:

Install Headers
First, remove as it won't be supported by this kernel.

Using --clean isn't recommended normally however, in this case it is required so we can emerge the 2.6.29 headers.

This is the time to add USE="-seccomp" to your make.conf.

Now, create a package.mask so a newer kernel isn't installed:

Ebuild fixes
Some ebuilds need to be edited to work.

sys-apps/shadow
The btrfs flag will case issues here so you will need to remove the --enable-btrfs flag for this to compile.

net-misc/iputils
cannot build due to the ipv6 headers so we need to disable this systemwide so only ipv4 can be used.

sys-libs/libseccomp
Stop from being pulling in the future

Re-emerge the system
Emerge the system again to take advantage of your new flags and rebuild against the correct headers for your system.

The base system is now installed so now continue with original handbook for your system to make it bootable.

Known Packages to Fail under 2.6.39
Can be replaced with