#!/usr/bin/env sh # keru-install — the Keru OS TUI installer # # Walks you through crafting your exact system, then writes make.conf and # kicks off the build. Everything is swappable here, at install time, and # locked in when you boot. # # Designed to run from the Keru live ISO. Backed by dialog/whiptail if # present; falls back to plain prompted input. All shell, no magic. set -eu . "$(dirname "$0")/../scripts/common.sh" # ---- defaults (mirror profile/make.conf) -------------------------------- OUT="${MAKE_CONF_OUT:-/tmp/keru/make.conf}" DROP="/tmp/keru" mkdir -p "$DROP" # ---- menu helpers ------------------------------------------------------- pick() { # prompt, array-of-labels, defaults -> writes choice to $CHOICE local prompt="$1"; shift local default="$1"; shift CHOICE="$default" if command -v dialog >/dev/null 2>&1; then local args=() local i=0 for opt in "$@"; do args+=("$i" "$opt") i=$((i+1)) done local sel sel=$(dialog --stdout --no-cancel --menu "$prompt" 15 60 8 \ --default-item "$default" "${args[@]}") || true CHOICE=$(eval "printf '%s' \"\${$((sel+1)):-\$default}\"" 2>/dev/null || printf '%s' "$default") else printf '%s\n' "== $prompt ==" local n=1 for opt in "$@"; do printf ' %s) %s\n' "$n" "$opt" n=$((n+1)) done printf 'Select [%s]: ' "$default" read -r sel [ -n "$sel" ] && CHOICE=$(eval "printf '%s' \"\${$sel}\"") || CHOICE="$default" fi } # ---- swappable selections ------------------------------------------------ banner "Keru OS — craft your system" pick "Init system" runit runit s6 openrc systemd INIT="$CHOICE" pick "C library" glibc glibc musl LIBC="$CHOICE" pick "Filesystem" ext4 ext4 btrfs xfs zfs f2fs TARGET_FS="$CHOICE" pick "Kernel" linux linux linux-lts linux-hardened KERNEL="$CHOICE" pick "Network tools" nmtui networkmanager nmtui connman NET="$CHOICE" # ---- assemble make.conf ------------------------------------------------ msg "writing $OUT" cat > "$OUT" <