No description
| .gitignore | ||
| config | ||
| kernel.config | ||
| ntmkstdlib.sh | ||
| README.md | ||
| script.sh | ||
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 pointconfig: build configuration (URLs + options)kernel.config: predefined kernel config used by defaultsources/: optional local source archives (offline/local mode)ntmkstdlib.sh: logging/error utility functions used byscript.sh
Prerequisites
Install common build and runtime tools:
bash,make,gcc,tar,cpio,gzip,sed,find,wget- one ISO tool:
xorrisoormkisofsorgenisoimage qemu-system-x86_64(only if you wantrun)
Notes:
USE_LOCAL_SOURCE=trueinconfigmeans the script first looks for archives insources/.- 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 tarballGLIBC_SOURCE_URL: glibc tarballBUSYBOX_SOURCE_URL: BusyBox tarballSYSLINUX_SOURCE_URL: Syslinux tarballUSE_PREDEFINED_KERNEL_CONFIG: iftrue, useskernel.config; otherwise usesx86_64_defconfigUSE_LOCAL_SOURCE: iftrue, use local archives insources/when availableJOB_FACTOR: build jobs multiplier (jobs = CPU cores * JOB_FACTOR)CFLAGS: flags passed to BusyBox buildUSE_GLIBC: iftrue, builds glibc and uses dynamic BusyBox; default behavior is static BusyBox
Current script behavior:
USE_PREDEFINED_BUSYBOX_CONFIG,OVERLAY_TYPE,USE_BOOT_LOGO, andSTATIC_GET_SOURCE_URLare present inconfigbut not consumed byscript.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 (
-nographicin QEMU)
Troubleshooting
- If
./script.sh isofails with missing kernel/initramfs, run./script.sh allfirst. - If ISO creation fails, install one of:
xorriso,mkisofs,genisoimage. - If download fails in local mode, verify archives exist in
sources/or setUSE_LOCAL_SOURCE=false. - If build is slow, increase
JOB_FACTORinconfig.