diff --git a/README.md b/README.md index a84f74c..095f042 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ An independent, source-only Linux distribution built around one idea: you don't install a system, you *craft* one — **ける・けいとうてき** (keru keitō-teki): a system assembled the way you want it. -This repository holds the **operating system itself** — the installer, the ISO -build tooling, the profile system, and the build pipeline. The two things Keru -depends on live in their own repositories: +This repository holds the **operating system itself** — the installer, the +profile system, and the build pipeline. The two things Keru depends on live in +their own repositories: - **[kama](https://github.com/AstralZX/kama)** — the package manager (a shell script) - **[kama-packages](https://github.com/AstralZX/kama-packages)** — the recipe repository @@ -19,6 +19,8 @@ is compiled from original source. Nothing is fixed. Nothing you didn't ask for is forced on you. +Read the full **philosophy** in [docs/PHILOSOPHY.md](docs/PHILOSOPHY.md). + ## The differentiator: everything is swappable Keru's installer is a TUI that walks you through designing your exact machine @@ -28,48 +30,39 @@ Keru's installer is a TUI that walks you through designing your exact machine - **C library** — glibc, musl, uClibc-ng, and more - **filesystem** — ext4, btrfs, xfs, zfs, f2fs, jfs, reiserfs, swap, and more - **kernel** — linux, linux-lts, linux-hardened, linux-cachyos, and more +- **privilege elevation** — doas, sudo, opendoas, su - **kernel parameters, locale, clock, keymap** — all configurable Every init, every libc, every filesystem, everything. The selections are made during install and fixed at first boot. The system that lands on your disk is precisely the one you chose. +## How installation works + +The ISO carries **only the installer** — nothing else. There is no prebuilt +base image on the disk. When you boot it, the installer connects to the +network, and then fetches and builds whatever you selected (init system, +kernel, libc, filesystem tooling, and tools) on the fly. + +A working **network connection is therefore a hard requirement** for +installing Keru. The installer checks connectivity and offers in-installer +network setup (wireless via `nmtui`/`wifi-menu`, or Ethernet/DHCP) before the +build begins. + ## Repository layout ``` installer/ TUI installer — writes make.conf from your choices profile/ make.conf template (the swappables + build flags) scripts/ build pipeline: build-root, mkfs-root, common helpers -docs/ design docs + the recipe format spec - -(ISO build tooling is not in this repo yet — coming later.) +docs/ philosophy + design docs + the recipe format spec ``` -## Building +## Release -The three repos should sit next to each other (or point at each other via -`KAMA_DIR` / `PKGS_DIR` / `PKGDIR`): - -``` -~/dev/ -├── KeruOS/ -├── kama/ -└── kama-packages/ -``` - -Then, from `KeruOS/`: - -```sh -make install # run the TUI installer -# or, headlessly: -sh scripts/build-root.sh # build a rootfs into /tmp/keru/root -``` - -Requires the sibling `kama` and `kama-packages` repos to be present. - -## Status - -Design + scaffolding. Nothing is building end-to-end yet. +Keru OS is currently in development. The first installable release, **0.1**, +will ship as a bootable ISO — no source builds, no manual tooling required. +It will be made available here when it's ready. ## License diff --git a/docs/DESIGN.md b/docs/DESIGN.md deleted file mode 100644 index a924721..0000000 --- a/docs/DESIGN.md +++ /dev/null @@ -1,19 +0,0 @@ -# design/index - -This directory holds the working design for Keru OS. The code is scaffolding -and not yet functional end-to-end. - -## What exists - -- `recipe-format.md` — the Kama recipe format (easy/advanced tiers) -- `README.md` (repo root) — project identity + layout - -## Open design questions - -- **Bootstrapping toolchain**: chicken-and-egg — the first compiler must be - obtained somehow. Options: a documented one-time bootstrap from a binary - seed, or a multi-stage rebuild (host -> minimal -> full). Not yet decided. -- **No dependency resolver**: how upgrades/rebuilds are handled for a system - that's "built once at install." Currently framed as install-time-only. -- **Cache artifacts vs. rebuilds**: whether the build cache stores binaries - for fast re-install or always recompiles. diff --git a/docs/PHILOSOPHY.md b/docs/PHILOSOPHY.md new file mode 100644 index 0000000..392e3ef --- /dev/null +++ b/docs/PHILOSOPHY.md @@ -0,0 +1,83 @@ +# Keru OS — Philosophy + +Keru is a source-only Linux distribution built on one governing principle: + +> **The OS is a choice, not a conclusion.** + +Most distros ship a decision someone else already made for you — a default +init, a default libc, a default filesystem. You inherit it and live with it. +Keru refuses that premise. Every foundational component is a *variable you +resolve at install time*, not a fixed value baked into the distribution. +Every init, every libc, every filesystem, every kernel, every +privilege-elevation tool — all selectable, none forced. + +## Anti-opinionated, not opinionated + +Keru is not opinionated. It is **anti-opinionated**. An opinionated distro +picks a stack and defends it — *"you get s6 and XFS whether you like it or +not."* Keru is the direct rejection of that. It holds **no opinion** about +which init, libc, filesystem, or daemon you should run, because that decision +belongs to you, not to the distribution. + +The distro's only opinion is that you have to form one. After that, it shuts +up and builds exactly what you chose. + +## Only what you asked for + +The install medium carries **nothing but the installer**. There is no prebuilt +base image, no hidden bloat, no background assumptions. You pick your system, +Keru fetches it and compiles it from source, and the disk reflects exactly +that and nothing more. What gets built is defined by what you chose — not by +what maintainers decided you should have. + +## Control without complexity + +This is the deliberate bet, and the thing that separates Keru from a +Gentoo-skin. The package manager, **Kama**, is a shell script. It reads a +`make.conf` and runs recipe commands. No dependency solver. No package +database. No compiled manager machinery. + +> "Sure, the package manager is in shell, and that compromises performance — +> but it's still faster than many package managers people actually use, and +> the real cost of a build is the compiler, not the meta-machinery around it." + +The dependency model is AUR-style ephemeral: build tools are fetched, +compiled, and removed once they've served, so they never accumulate. The +richness lives in the recipes and the profile, not in the machinery. Keru is +the position that package managers became more complex than the packages they +manage, and that the simple version is the right one. + +> "A package manager doesn't need a resolver to be honest. It needs to be +> legible — you can read every decision it makes, because every decision is a +> script or a line in make.conf you can see and change." + +## Squared with reality + +Building every init, every libc, every filesystem from source at install time +requires a working network connection, and the installer is honest about that: +connectivity is a hard gate, and network setup happens inside the installer. +This is what makes "everything is swappable" real rather than aspirational. +The power to choose anything comes from the fact that nothing is prebuilt — +you fetch exactly the parts you picked. + +> "You give up the convenience of a prebuilt system so the system you get is +> exactly the one you designed. Speed-to-install is traded for +> fit-to-request. If you want fast and prebaked, a binary distro is right +> there. If you want your machine, this is the one." + +## Agreement on choice, not agreement on opinion + +The through-line across Keru's lineage is clear: TOML packages, then a +50-line build DSL, then plain shell. And from *opinionated dogma* — "you get +s6 and XFS whether you like it or not" — to *anti-opinionated anything-goes*. +Keru keeps the from-scratch purity while rejecting the fixed dogmas outright. + +> "We don't tell you which init to worship or which filesystem to trust. We +> tell you that you have to choose — and then we build exactly that." + +The philosophy in one line: + +> **A system should be exactly what you chose it to be — selected at install, +> built from source, nothing forced and nothing you didn't ask for.** + +And in two words: **anti-opinionated by design.** diff --git a/installer/install.sh b/installer/install.sh index 199ccb1..368fa9d 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -46,6 +46,63 @@ pick() { # prompt, array-of-labels, defaults -> writes choice to $CHOICE fi } +# ---- network check ------------------------------------------------------- +# The ISO carries only the installer. Everything else (kernels, init systems, +# libcs, filesystems, tools) is fetched and built at install time, so a working +# network connection is a hard prerequisite. +require_network() { + local ok=0 + # try a few reachability probes + for host in mirror.keru.org github.com 1.1.1.1; do + if command -v ping >/dev/null 2>&1 && ping -c1 -W2 "$host" >/dev/null 2>&1; then ok=1; break; fi + # fallback: plain connect test via /dev/tcp + case "$host" in + *.*.*.*) : ;; # ip already covered by ping + esac + done + if [ "$ok" = "0" ]; then + if command -v nc >/dev/null 2>&1; then + nc -z -w5 mirror.keru.org 443 >/dev/null 2>&1 && ok=1 + fi + fi + [ "$ok" = "1" ] +} + +# ---- network configuration ------------------------------------------------ +configure_network() { + msg "network configuration" + if command -v nmtui >/dev/null 2>&1; then + nmtui 2>/dev/null && return 0 + fi + if command -v dialog >/dev/null 2>&1 && command -v wifi-menu >/dev/null 2>&1; then + dialog --stdout --menu "Network" 12 40 3 \ + 1 "Wireless (wifi-menu)" 2 "Ethernet (skip)" 3 "Manual (ip)" 2>/dev/null + fi + read -r -p "Bring up Ethernet (DHCP) now? [Y/n] " eth + case "$eth" in + n|N|no) : ;; + *) command -v dhcpcd >/dev/null 2>&1 && (dhcpcd >/dev/null 2>&1 &) || true ;; + esac +} + +banner "Keru OS — network required" +info "the ISO only carries the installer." +info "the system you choose (init, libc, fs, kernel, tools) is fetched and" +info "built from the network during installation. a connection is required." + +if require_network; then + msg "network: connected" +else + warn "network: not detected" + read -r -p "Configure the network now? [Y/n] " cfg + case "$cfg" in + n|N|no) die "a network connection is required to install Keru" ;; + *) configure_network ;; + esac + require_network || die "still no network connection — cannot install" + msg "network: connected" +fi + # ---- swappable selections ------------------------------------------------ banner "Keru OS — craft your system" @@ -61,7 +118,10 @@ TARGET_FS="$CHOICE" pick "Kernel" linux linux linux-lts linux-hardened linux-cachyos linux-zen KERNEL="$CHOICE" -pick "Network tools" nmtui networkmanager nmtui connman +pick "Privilege elevation (sudo alternative)" doas doas sudo opendoas su +SUDO="$CHOICE" + +pick "Network tools" nmtui nmtui networkmanager connman systemd-networkd NET="$CHOICE" # ---- assemble make.conf ------------------------------------------------ @@ -72,6 +132,7 @@ INIT=$INIT LIBC=$LIBC TARGET_FS=$TARGET_FS KERNEL=$KERNEL +SUDO=$SUDO NET=$NET LICENSE_ACCEPT=(*) EOF diff --git a/profile/make.conf b/profile/make.conf index 9e40af6..43ebb20 100644 --- a/profile/make.conf +++ b/profile/make.conf @@ -24,8 +24,13 @@ TARGET_FS=ext4 # linux (default) | linux-lts | linux-hardened | linux-cachyos | linux-zen KERNEL=linux +# Which privilege-elevation tool gets installed +# doas (default) | sudo | opendoas | su +SUDO=doas + # Base package set pulled into every install -BASE_PACKAGES=(base toolchain kernel nmtui openssh) +# (kernel, init, sudo, and net are selected separately below) +BASE_PACKAGES=(base toolchain openssh) # Locale / clock / keymap applied to the target LOCALE=en_US.UTF-8 diff --git a/scripts/build-root.sh b/scripts/build-root.sh index 04d45d1..5f3dfeb 100755 --- a/scripts/build-root.sh +++ b/scripts/build-root.sh @@ -23,7 +23,7 @@ KAMA="$KAMA_DIR/kama" [ -d "$PKGS_DIR" ] || die "kama-packages repo not found at $PKGS_DIR (set PKGS_DIR)" info "building Keru rootfs into $ROOT" -info "profile: init=$INIT libc=$LIBC fs=$TARGET_FS kernel=$KERNEL" +info "profile: init=$INIT libc=$LIBC fs=$TARGET_FS kernel=$KERNEL sudo=$SUDO" # stage 0 — bootstrap toolchain info "stage 0: bootstrap toolchain (gcc binutils glibc/musl)" @@ -38,9 +38,11 @@ for p in "${BASE_PACKAGES[@]}"; do done # stage 2 — kernel + init + swappables -info "stage 2: kernel + init" +info "stage 2: kernel + init + sudo + net" PKGDIR="$PKGS_DIR" "$KAMA" make "$KERNEL" || die "kernel build failed" PKGDIR="$PKGS_DIR" "$KAMA" make "$INIT" || die "init build failed ($INIT)" +PKGDIR="$PKGS_DIR" "$KAMA" make "$SUDO" || die "sudo tool build failed ($SUDO)" +PKGDIR="$PKGS_DIR" "$KAMA" make "$NET" || die "net tool build failed ($NET)" # stage 3 — fstab/mkinitramfs for the chosen FS info "stage 3: finalize $TARGET_FS root"