Build a TinyCore Linux kernel, modules, and firmware extensions
Kernels and modules are built automatically by GitHub Actions and can be downloaded from Bintray.
- Install build dependencies:
tce-load -wi git compiletc coreutils bc
- Clone this repository:
git clone https://github.com/jidoteki/tinycore-kernel
Building a kernel from scratch
The default kernel is
- The kernel will be named
Building default module extensions
Default modules extensions are
all, base, filesystems, ipv6, mtd, netfilter, raid-dm, scsi, net-bridging.
all extension will contain all the modules.
base extension will contain the base modules which are included of the OS
- The module extensions will be named
Rebuilding the OS (remaster) with new modules
The default OS will be searched for in
- The compressed OS will be named
corepure64.gzand uncompressed OS will be named
Many directories and files will be created in the
WORKDIR, to cleanup, simply type
The following variables can be changed at build time, by specifying them as arguments, ex:
MODULES: List of modules to build
KERNEL: Kernel version to build
KERNEL_ARCH: Kernel architecture to build, either
KERNEL_SOURCE: URL of the kernel source package (
.tar.xz or .txz)
KERNEL_SHA256: SHA256 hash of the kernel source package
OSDIR: Local system directory containing the TinyCore OS (
core.gz or corepure64.gz)
WORKDIR: Temporary work path to build all the files
TinyCore Linux kernel compiling comes with a few gotchas. The list below will hopefully help others who may run into these problems when manually compiling.
Kernel panic on boot
This occurs when you recompile the kernel (ex:
vmlinuz64) without recompiling the modules and/or module extensions. The
base modules in the OS (ex:
corepure64.gz) must be replaced, as well as any module extensions (ex:
Kernel seems to boot, but can't mount loop or disks
modules.dep file should point to
.ko.gz kernel modules, but Linux compiles them as
.ko by default. The
Makefile in this repo gzips all modules, and then performs a
sed on the newly built
modules.dep to ensure it also contains
.ko.gz entries. This
modules.dep will be rebuilt on boot anyways, but it still needs to be correct initially.
kernel.tclocal symlink is also needed for kernel module extensions to be loaded. See the TinyCore Custom Kernel wiki page for more info.
Newly compiled modules are not being loaded
If you edit the kernel config using
make menuconfig or other, and add new modules, you will need to create a new extension containing those modules. It is recommended to do that as opposed to adding them directly in the OS. Adding them to the OS can lead to problems in the future if you accidentally "forget" to include them when you update TinyCore.
Weird things are happening
The default TinyCore Linux kernel is compiled with a set of cosmetic/boot Linux kernel patches, and one patch for AGP. We excluded them in our newer kernel builds (ex:
3.16.38-tinycore64), but you're better off patching your kernel with those patches if you experience strange system behaviour.
WORKDIR after building, if you want to package firmwares or additional modules.
If you find any bugs or issues, please create an issue.
If you want to improve this, please make a pull-request.
Copyright (c) 2016-2020 Alexander Williams, Unscramble firstname.lastname@example.org