diff --git a/ce-base.sh b/ce-base.sh index dc25fc4..ce698e2 100644 --- a/ce-base.sh +++ b/ce-base.sh @@ -35,7 +35,7 @@ phase_preflight() { run_test "bash >= 4" '[[ "${BASH_VERSINFO[0]}" -ge 4 ]]' fail run_test "arch detected" '[[ -n "${ARCH}" ]]' fail run_test "apk available" 'command -v apk >/dev/null 2>&1' fail - run_test "disk >= 500MB" '[[ $(df -k / | awk "NR==2{print \$4}") -ge 512000 ]]' warn + run_test "disk >= 500MB" '[[ $(df -kP / | awk "NR==2{print \$4}") -ge 512000 ]]' warn run_test "internet reachable" \ 'curl --silent --max-time 10 --output /dev/null https://dl-cdn.alpinelinux.org' warn log_info "Arch: ${ARCH}" diff --git a/ce-basic.sh b/ce-basic.sh index bf23b48..b3b8888 100644 --- a/ce-basic.sh +++ b/ce-basic.sh @@ -40,7 +40,7 @@ phase_preflight() { run_test "community repo enabled" 'grep -q "^[^#].*community" /etc/apk/repositories' fail run_test "internet reachable" \ 'curl --silent --max-time 10 --output /dev/null https://dl-cdn.alpinelinux.org' warn - run_test "disk >= 2GB" '[[ $(df -k / | awk "NR==2{print \$4}") -ge 2097152 ]]' warn + run_test "disk >= 2GB" '[[ $(df -kP / | awk "NR==2{print \$4}") -ge 2097152 ]]' warn log_info "Arch: ${ARCH}" log_info "Pre-flight complete" } diff --git a/ce-minimal.sh b/ce-minimal.sh index 0f8c5c6..95e7640 100644 --- a/ce-minimal.sh +++ b/ce-minimal.sh @@ -40,7 +40,7 @@ phase_preflight() { run_test "community repo enabled" 'grep -q "^[^#].*community" /etc/apk/repositories' fail run_test "internet reachable" \ 'curl --silent --max-time 10 --output /dev/null https://dl-cdn.alpinelinux.org' warn - run_test "disk >= 1GB" '[[ $(df -k / | awk "NR==2{print \$4}") -ge 1048576 ]]' warn + run_test "disk >= 1GB" '[[ $(df -kP / | awk "NR==2{print \$4}") -ge 1048576 ]]' warn log_info "Arch: ${ARCH}" log_info "Pre-flight complete" } diff --git a/lib/basic/05_fonts.sh b/lib/basic/05_fonts.sh index c5173dc..51474f0 100644 --- a/lib/basic/05_fonts.sh +++ b/lib/basic/05_fonts.sh @@ -18,16 +18,8 @@ install_basic_fonts() { install_pkg "figlet" run_test "figlet present" 'command -v figlet >/dev/null 2>&1' warn - # nerd-fonts-all — edge/community; 'nerd-fonts' meta-package blocks install by design - ensure_edge_repo - - log_info "Installing nerd-fonts-all from @edge/community..." - if install_pkg_edge "nerd-fonts-all"; then - log_info "nerd-fonts-all installed" - else - log_warn "nerd-fonts-all@edge not available — skipping gracefully" - MANUAL_PKGS+=("nerd-fonts: edge install failed — check pkgs.alpinelinux.org/packages?name=nerd-fonts-all&branch=edge") - fi + # nerd-fonts-all — v3.23 stable community; no tag needed + install_pkg "nerd-fonts-all" } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then diff --git a/lib/ce-common.sh b/lib/ce-common.sh index c3f662d..62ca774 100644 --- a/lib/ce-common.sh +++ b/lib/ce-common.sh @@ -14,6 +14,12 @@ [[ -n "${CE_COMMON_LOADED:-}" ]] && return 0 CE_COMMON_LOADED=1 +# ohiod_address — address the Organic Humanoid I/O Device by unit ID +ohiod_address() { + local unit_id="${SUDO_USER:-${USER}}" + echo "Organic Humanoid I/O Device unit ID ${unit_id}" +} + # Architecture detection ARCH="$(uname -m)" diff --git a/lib/minimal/11_wiki.sh b/lib/minimal/11_wiki.sh index 76ff8e2..356f1f4 100644 --- a/lib/minimal/11_wiki.sh +++ b/lib/minimal/11_wiki.sh @@ -13,9 +13,7 @@ # Defines install_minimal_wiki(). # --------------------------------------------------------------------------- -install_minimal_wiki() { - log_info "--- minimal/11_wiki: glow (CE repo) ---" - +install_minimal_wiki_ce_repo() { local CE_REPO_HOST="https://cervelloelettrico.it/bin" local CE_REPO="${CE_REPO_HOST}/${ARCH}/alpine" local INSTALL_DIR="${HOME}/.local/bin" @@ -24,7 +22,6 @@ install_minimal_wiki() { mkdir -p "${INSTALL_DIR}" - # Abort cleanly if CE repo unreachable if ! curl --silent --max-time 10 --output /dev/null "${CE_REPO}/glow"; then log_warn "CE repo unreachable (${CE_REPO}) — skipping glow" FAILED_PKGS+=("glow (CE repo unreachable)") @@ -34,9 +31,9 @@ install_minimal_wiki() { log_info "Downloading glow, sha256, and sig from CE repo..." local ok=1 - curl --silent --max-time 30 -o "${TEMP_DIR}/glow" "${CE_REPO}/glow" || ok=0 + curl --silent --max-time 30 -o "${TEMP_DIR}/glow" "${CE_REPO}/glow" || ok=0 curl --silent --max-time 10 -o "${TEMP_DIR}/glow.sha256" "${CE_REPO}/glow.sha256" || ok=0 - curl --silent --max-time 10 -o "${TEMP_DIR}/glow.sig" "${CE_REPO}/glow.sig" || ok=0 + curl --silent --max-time 10 -o "${TEMP_DIR}/glow.sig" "${CE_REPO}/glow.sig" || ok=0 if [[ "${ok}" -eq 0 ]]; then log_warn "glow download incomplete — skipping install" @@ -45,7 +42,6 @@ install_minimal_wiki() { return 0 fi - # SHA256 verification local expected actual expected="$(awk '{print $1}' "${TEMP_DIR}/glow.sha256")" actual="$(sha256sum "${TEMP_DIR}/glow" | awk '{print $1}')" @@ -57,7 +53,6 @@ install_minimal_wiki() { fi log_info "glow SHA256 verified" - # GPG signature verification (gnupg available from 04_vcs) if command -v gpg >/dev/null 2>&1; then if gpg --verify "${TEMP_DIR}/glow.sig" "${TEMP_DIR}/glow" >> "${LOG_FILE}" 2>&1; then log_info "glow GPG signature verified" @@ -74,11 +69,24 @@ install_minimal_wiki() { chmod +x "${TEMP_DIR}/glow" cp "${TEMP_DIR}/glow" "${INSTALL_DIR}/glow" rm -rf "${TEMP_DIR}" - run_test "glow installed" 'command -v glow >/dev/null 2>&1' warn log_info "glow installed to ${INSTALL_DIR}/glow" } +install_minimal_wiki() { + log_info "--- minimal/11_wiki: glow ---" + + if [[ "${ARCH}" == "x86_64" ]]; then + # glow available in Alpine edge/testing for x86_64 + ensure_testing_repo + install_pkg_testing "glow" + run_test "glow installed" 'command -v glow >/dev/null 2>&1' warn + else + # ARM: pull binary from CE repo (TODO: populate Forgejo bin/ tree per arch) + install_minimal_wiki_ce_repo + fi +} + if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" SCRIPT_NAME="11_wiki" diff --git a/lib/minimal/12_access.sh b/lib/minimal/12_access.sh index bf7f3a7..c8de139 100644 --- a/lib/minimal/12_access.sh +++ b/lib/minimal/12_access.sh @@ -36,10 +36,20 @@ install_minimal_access() { ensure_edge_repo install_pkg_edge "speech-dispatcher" - # ly login manager — CE repo, aarch64 only — skip on x86-64 - if [[ "${ARCH}" == "x86_64" ]]; then - log_info "NOTICE: ly login manager — CE repo aarch64 only, not available for x86-64 — skipped" - MANUAL_PKGS+=("ly: aarch64 CE repo only — not available for x86-64 (${ARCH})") + # ly login manager — testing for x86_64 + aarch64; armhf needs CE repo source build + if [[ "${ARCH}" == "armhf" ]]; then + log_warn "ly: not in Alpine testing for armhf — requires CE repo source build" + MANUAL_PKGS+=("ly: not in Alpine testing for armhf — CE repo source build required") + else + ensure_testing_repo + install_pkg_testing "ly" + if command -v ly >/dev/null 2>&1; then + doas rc-update add ly default >> "${LOG_FILE}" 2>&1 \ + || log_warn "ly: rc-update add failed — enable manually" + doas sed -i 's|^tty2::respawn:|#tty2::respawn:|' /etc/inittab >> "${LOG_FILE}" 2>&1 \ + || log_warn "ly: could not comment out tty2 getty in /etc/inittab — check manually" + log_info "ly installed and enabled on default runlevel" + fi fi }