GithubHelp home page GithubHelp logo

on-prem / tinycore-kernel Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 21.0 367 KB

TinyCore Linux kernel and module compile scripts.

Home Page: https://on-premises.com

License: MIT License

Makefile 100.00%
jidoteki infrastructure on-prem tinycore

tinycore-kernel's Introduction

tinycore-kernel

Build a TinyCore Linux kernel, modules, and firmware extensions

Kernels and modules are built automatically by GitHub Actions and can be downloaded from Bintray.

Getting Started

  1. Install build dependencies: tce-load -wi git compiletc coreutils bc
  2. Clone this repository: git clone https://github.com/jidoteki/tinycore-kernel

Building a kernel from scratch

The default kernel is 4.19.152-tinycore64

  1. make kernel
  2. cd /tmp/tinycore-kernel-build
  3. The kernel will be named vmlinuz64

Building default module extensions

Default modules extensions are all, base, filesystems, ipv6, mtd, netfilter, raid-dm, scsi, net-bridging.

The all extension will contain all the modules.

The base extension will contain the base modules which are included of the OS core.gz/corepure64.gz.

  1. make extensions
  2. cd /tmp/tinycore-kernel-build
  3. The module extensions will be named <module>-4.9.66-tinycore64.tcz

Rebuilding the OS (remaster) with new modules

The default OS will be searched for in /opt/tinycore/<tinycore_version>/x86_64/release/distribution_files/.

  1. make os
  2. cd /tmp/tinycore-kernel-build
  3. The compressed OS will be named corepure64.gz and uncompressed OS will be named corepure64

Cleaning up

Many directories and files will be created in the WORKDIR, to cleanup, simply type make clean.

Makefile variables

The following variables can be changed at build time, by specifying them as arguments, ex: make MODULES=ipv6

  • MODULES: List of modules to build
  • KERNEL: Kernel version to build
  • KERNEL_ARCH: Kernel architecture to build, either x86_64 or x86
  • 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

Gotchas

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: ipv6-4.9.66-tinycore64.tcz).

Kernel seems to boot, but can't mount loop or disks

The 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.

The 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.

Notes

Please inspect WORKDIR after building, if you want to package firmwares or additional modules.

Contributing

If you find any bugs or issues, please create an issue.

If you want to improve this, please make a pull-request.

License

MIT License

Copyright (c) 2016-2020 Alexander Williams, Unscramble [email protected]

tinycore-kernel's People

Contributors

aw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tinycore-kernel's Issues

Old hardware, trying to make this for 32 bit

Followed readme and got as far as editing the make file to aim at 32 as directed via the listed variables. Kernel downloaded but the script, make kernel, stopped a few lines in indicating that I do not have a config file for config-4.19.113-tinycore.

Is it just a matter of renaming the config? I look within and it almost looks like there is more 64 pins than the listed variables.... Is it possible to use this to build 32 bit kernels / OS?

I have items in my hardware marked "experimental", namely cs5535 pata. Tiny is about the last micro os that has a functional build system. Would be nice to use.

"Failed to mount devtmpfs at /dev: No such device"

I compiled kernel 4.14.78. I only had to remove "firmware_install" from line 65 of the Makefile.

At boot the following message appears at the top of the screen:
"Failed to mount devtmpfs at /dev: No such device"

Is this caused by

CONFIG_DEVTMPFS is not set

in the .config file?
All config files in the kernels directory have CONFIG_DEVTMPFS is not set.

Should I set CONFIG_DEVTMPFS ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.