Skip to content

The build

The recipe

Seven scripts, run in order. No glibc build: the initramfs reuses the host’s glibc libraries.

./fetch.sh                # upstream sources into downloads/
bash wsl-prereqs.sh       # host toolchain + QEMU + fakeroot (root once)
bash build-busybox.sh     # suid (11 applets) + nosuid (221) into dist/
bash build-kernel.sh      # TC 6.6.8 kernel into dist/bzImage-6.6.8-tc
bash assemble-core.sh     # Core-scripts + busybox + host glibc + users into dist/core.gz
bash boot-qemu.sh         # boot in QEMU, serial log to file
bash embed-initramfs.sh   # optional: kernel with embedded initramfs

BUILD defaults to /root/tc-build and overrides with an argument. boot-qemu.sh honors INITRD= and APPEND= overrides.

The seven bugs

Every one surfaced at boot. Every fix went back through QEMU before it counted.

  1. Dead init. The kernel panicked with no working init. The lib64/ld-linux symlink dangled, and busybox is dynamically linked, so every exec failed. Fix: point the link at ../lib/x86_64-linux-gnu/.
  2. Missing mount. /init and rcS found no mount and no /proc. Upstream keeps mount in the 11-applet suid binary, and assembly had installed only the nosuid tree. Fix: install busybox.suid and retarget its 11 applet links at it.
  3. Hung boot. The boot hung after the udev stage. tc-config waits forever on /dev/zram0 and /dev/rtc0, which nothing creates. Fix: boot with nozswap nortc, documented TinyCore escape hatches.
  4. No serial console. Init respawned around a missing /dev/ttyS0. The static /dev had no serial nodes. Fix: mknod ttyS0-3, with 666 perms on the console, null, and tty nodes.
  5. Unknown users. A password prompt and chown: unknown user/group tc:staff. Upstream ships no passwd, group, or shadow files. Fix: create root with no password and a locked-down tc (uid 1001:50), with /home/tc from skel/.
  6. Missing helpers. rotdash and autoscan not found. tc-misc never compiled, and its CFLAGS target i486, which modern gcc rejects. Fix: build the 3 non-X tools with overridden CFLAGS into /usr/local/bin.
  7. Missing blkid. rebuildfstab needs blkid, disabled in the upstream nosuid config. Fix: enable CONFIG_BLKID plus FEATURE_BLKID_TYPE in build-busybox.sh.