ceos-alpine-installer/lib/base/01_core.sh
John A. Hoeven e1ee30812f Fix first real-hardware install issues from tinkerpad run
- bootstrap: install bash before fetch (ash-only base installs)
- bootstrap/deploy: correct URL (drop /repo prefix, webroot is /srv/repo)
- 01_core: remove bash (bootstrap now handles it)
- ce-base/minimal/basic: BusyBox-compatible df check (drop --output=avail)
- ce-common: add ensure_testing_repo + install_pkg_testing
- 12_access: espeakup + espeakup-openrc from edge/testing
- 05_fonts: nerd-fonts → nerd-fonts-all (meta-package blocks by design)
- 06_utils: tealdeer + bash-completion from edge/testing
- 07_journal: jrnl test checks ~/.local/bin/jrnl (pipx not in PATH during install)
- 11_wiki: arch-aware CE_REPO (${ARCH} replaces hardcoded amd64); Forgejo TODO updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 21:55:21 +02:00

57 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# Created by John A. Hoeven with the ethical assistance of Claude AI
# ---------------------------------------------------------------------------
# 01_core.sh
# ~/projects/ceos/alpine-installer/lib/base/01_core.sh
# Version: v0.0.1 | Status: DEVELOPMENT
# Target: Alpine Linux x86-64 (tinkerpad / ThinkPad T480)
# ---------------------------------------------------------------------------
# Base Tier subscript: enable community repo, install core packages,
# run setup-utmp. Defines install_base_core().
# ---------------------------------------------------------------------------
install_base_core() {
log_info "--- base/01_core: enabling community repo ---"
if grep -q "^[^#].*community" /etc/apk/repositories 2>/dev/null; then
log_info "Community repo already enabled — skipping"
else
doas sed -i '/^#.*community/s/^#//' /etc/apk/repositories \
>> "${LOG_FILE}" 2>&1 \
|| log_warn "Could not uncomment community repo — check /etc/apk/repositories"
run_test "community repo enabled" \
'grep -q "^[^#].*community" /etc/apk/repositories' warn
fi
log_info "--- base/01_core: verifying core packages available ---"
local missing=()
for pkg in bash-completion ca-certificates curl openssh tzdata utmps; do
apk search "${pkg}" 2>/dev/null | grep -q "^${pkg}" \
|| missing+=("${pkg}")
done
if [[ ${#missing[@]} -gt 0 ]]; then
log_warn "Not found in repo search: ${missing[*]} — install may fail"
fi
log_info "--- base/01_core: installing core packages ---"
local -a PKGS=(bash-completion ca-certificates curl openssh tzdata utmps)
for pkg in "${PKGS[@]}"; do
install_pkg "${pkg}"
done
log_info "--- base/01_core: running setup-utmp ---"
if doas setup-utmp >> "${LOG_FILE}" 2>&1; then
log_info "setup-utmp complete"
else
log_warn "setup-utmp returned non-zero — may already be configured"
fi
}
# Standalone entry point
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
SCRIPT_NAME="01_core"
source "${SCRIPT_DIR}/lib/ce-common.sh" || { echo "ERROR: ce-common.sh not found"; exit 1; }
check_not_root
install_base_core
print_summary
fi