No description
Find a file
2026-03-06 15:50:53 +01:00
.gitignore finished it with chatgpt help 2026-03-06 15:33:58 +01:00
config finished it with chatgpt help 2026-03-06 15:33:58 +01:00
kernel.config Sync with newer repo. 2019-04-06 00:23:14 +02:00
ntmkstdlib.sh first commit 2017-06-15 22:09:30 +02:00
README.md add READMe.md 2026-03-06 15:50:53 +01:00
script.sh finished it with chatgpt help 2026-03-06 15:33:58 +01:00

makecore

makecore is a Bash-based build script that creates a tiny bootable Linux ISO for x86_64.

It automates:

  • Linux kernel download/build
  • Optional glibc build (for dynamic BusyBox)
  • BusyBox build (static by default)
  • Root filesystem + initramfs generation
  • Bootable ISO creation with Syslinux/Isolinux
  • Optional QEMU run

Repository Layout

  • script.sh: main entry point
  • config: build configuration (URLs + options)
  • kernel.config: predefined kernel config used by default
  • sources/: optional local source archives (offline/local mode)
  • ntmkstdlib.sh: logging/error utility functions used by script.sh

Prerequisites

Install common build and runtime tools:

  • bash, make, gcc, tar, cpio, gzip, sed, find, wget
  • one ISO tool: xorriso or mkisofs or genisoimage
  • qemu-system-x86_64 (only if you want run)

Notes:

  • USE_LOCAL_SOURCE=true in config means the script first looks for archives in sources/.
  • If an archive is missing locally, it falls back to downloading it.

Quick Start

From the project root:

chmod +x script.sh
./script.sh all

This builds everything and produces:

  • ISO: ~/work/tmp/out/minidistro.iso
  • Working directory: ~/work/tmp

Run the ISO in QEMU:

./script.sh run

Commands

./script.sh all    # full pipeline: kernel -> (glibc) -> busybox -> initramfs -> ISO
./script.sh iso    # rebuild ISO stage (expects kernel/initramfs already present)
./script.sh run    # boot generated ISO with qemu-system-x86_64
./script.sh clean  # remove ~/work/tmp workspace

Configuration

Edit config to tune source versions and behavior:

  • KERNEL_SOURCE_URL: Linux kernel tarball
  • GLIBC_SOURCE_URL: glibc tarball
  • BUSYBOX_SOURCE_URL: BusyBox tarball
  • SYSLINUX_SOURCE_URL: Syslinux tarball
  • USE_PREDEFINED_KERNEL_CONFIG: if true, uses kernel.config; otherwise uses x86_64_defconfig
  • USE_LOCAL_SOURCE: if true, use local archives in sources/ when available
  • JOB_FACTOR: build jobs multiplier (jobs = CPU cores * JOB_FACTOR)
  • CFLAGS: flags passed to BusyBox build
  • USE_GLIBC: if true, builds glibc and uses dynamic BusyBox; default behavior is static BusyBox

Current script behavior:

  • USE_PREDEFINED_BUSYBOX_CONFIG, OVERLAY_TYPE, USE_BOOT_LOGO, and STATIC_GET_SOURCE_URL are present in config but not consumed by script.sh.

Boot Behavior

The generated initramfs starts /init, mounts proc, sys, and dev, then launches a shell:

  • kernel console is set to ttyS0
  • ISO is intended for serial console usage (-nographic in QEMU)

Troubleshooting

  • If ./script.sh iso fails with missing kernel/initramfs, run ./script.sh all first.
  • If ISO creation fails, install one of: xorriso, mkisofs, genisoimage.
  • If download fails in local mode, verify archives exist in sources/ or set USE_LOCAL_SOURCE=false.
  • If build is slow, increase JOB_FACTOR in config.