Try it in a directory
You don't need a spare disk to try Core Linux. corefs can build a root
filesystem in any directory, and core-chroot lets you step into it.
You need a Linux machine with root access, wget, tar and xz, plus Docker
to run the package repository. The commands below start in a checkout of the
Core Linux sources, with install-scripts/ and pkgrepo/ side by side.
1. Build the tools
cd install-scripts
make # no m4 on the host? docker compose run --rm make
This writes bin/corefs, bin/core-chroot, bin/genfstab and bin/mkinitfs.
Each is a single bash script, assembled from m4 sources so it needs nothing
installed beside it.
2. Serve the package repository
In a second terminal:
cd pkgrepo
make serve # http://localhost:8000/core
That's the address corefs uses by default, so there's nothing to configure.
3. Build the root filesystem
Back in install-scripts:
sudo bin/corefs install base ./rootfs
Run corefs as root. Otherwise the files in ./rootfs belong to you instead of
root, and the system won't work properly when you enter it.
No Docker? Install straight from the repository files
corefs reads file:// URLs too, so you can skip make serve:
sudo bin/corefs install base ./rootfs --mirror "file://$PWD/../pkgrepo/repo/core"
4. Look around
sudo bin/core-chroot ./rootfs
core-chroot mounts /proc, /sys, /dev and a few tmpfs inside the root
filesystem, binds in your /etc/resolv.conf so DNS works, and starts a shell:
(chroot) myhost:/# cat /etc/os-release
NAME="Core Linux"
ID=corelinux
VERSION_ID=0.1
PRETTY_NAME="Core Linux 0.1"
(chroot) myhost:/# cat /var/lib/corefs/busybox/version
1.37.0-r30
Every installed package has a record in /var/lib/corefs: its version and the
list of files it unpacked. See Filesystem layout.
Type exit to leave. core-chroot unmounts everything it mounted on the way out.
5. Clean up
sudo rm -rf ./rootfs
Stop the repository server with Ctrl+C in its terminal.