Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

ac-os: add `pull` command + fix oven skipping binary rebuild

- `ac-os pull`: downloads latest OTA kernel from CDN, verifies SHA256,
injects user creds, and flashes to USB — no local build needed (~30s)
- Remove --skip-binary from oven builds: AC_BUILD_NAME and AC_GIT_HASH
are compiled into the binary and change every commit. Skipping the
binary caused devices to show stale build names. The Makefile's CFLAGS
signature check handles incremental rebuilds efficiently already.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+55 -12
+49 -1
fedac/native/ac-os
··· 5 5 # ac-os build Build everything (no flash) 6 6 # ac-os upload Upload current build as OTA release 7 7 # ac-os flash+upload Build + flash USB + upload OTA release 8 + # ac-os pull Download latest OTA kernel + flash USB (no local build) 8 9 set -e 9 10 10 11 SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" ··· 939 940 } 940 941 trap cleanup_stash EXIT 941 942 943 + CDN_BASE="https://releases-aesthetic-computer.sfo3.digitaloceanspaces.com/os" 944 + 945 + pull_ota() { 946 + # Download latest OTA kernel from CDN and flash to USB (no local build) 947 + local VERSION_URL="${CDN_BASE}/native-notepat-latest.version" 948 + local KERNEL_URL="${CDN_BASE}/native-notepat-latest.vmlinuz" 949 + local HASH_URL="${CDN_BASE}/native-notepat-latest.sha256" 950 + 951 + log "Fetching latest OTA version..." 952 + local VERSION_INFO 953 + VERSION_INFO=$(curl -sf "${VERSION_URL}") || { err "Failed to fetch version from CDN"; exit 1; } 954 + local BUILD_NAME=$(echo "${VERSION_INFO}" | head -1) 955 + local KERNEL_SIZE=$(echo "${VERSION_INFO}" | tail -1) 956 + log "Latest OTA: ${BUILD_NAME} (${KERNEL_SIZE} bytes)" 957 + 958 + # Download kernel (use /tmp — build dir may be a broken symlink in devcontainers) 959 + local PULL_DIR="/tmp/ac-os-pull" 960 + mkdir -p "${PULL_DIR}" 961 + local PULLED_KERNEL="${PULL_DIR}/vmlinuz" 962 + 963 + log "Downloading kernel (~$(( KERNEL_SIZE / 1048576 ))MB)..." 964 + curl -f --progress-bar -o "${PULLED_KERNEL}" "${KERNEL_URL}" || { err "Download failed"; exit 1; } 965 + 966 + # Verify SHA256 967 + log "Verifying SHA256..." 968 + local EXPECTED_HASH 969 + EXPECTED_HASH=$(curl -sf "${HASH_URL}") || { err "Failed to fetch hash"; exit 1; } 970 + local ACTUAL_HASH 971 + ACTUAL_HASH=$(sha256sum "${PULLED_KERNEL}" | cut -d' ' -f1) 972 + if [ "${ACTUAL_HASH}" != "${EXPECTED_HASH}" ]; then 973 + err "SHA256 mismatch!" 974 + err " expected: ${EXPECTED_HASH}" 975 + err " got: ${ACTUAL_HASH}" 976 + exit 1 977 + fi 978 + log "SHA256 verified: ${ACTUAL_HASH:0:16}..." 979 + 980 + # Override VMLINUZ so flash_usb uses the downloaded kernel 981 + VMLINUZ="${PULLED_KERNEL}" 982 + log "Ready to flash: ${BUILD_NAME}" 983 + } 984 + 942 985 case "${CMD}" in 943 986 build) 944 987 build_binary ··· 1010 1053 wait ${QEMU_PID} 2>/dev/null 1011 1054 sudo docker rm -f ac-os-qemu 2>/dev/null || true 1012 1055 ;; 1056 + pull) 1057 + require_login 1058 + pull_ota 1059 + flash_usb 1060 + ;; 1013 1061 *) 1014 - echo "Usage: ac-os {build|flash|upload|flash+upload|bfu|qemu}" 1062 + echo "Usage: ac-os {build|flash|upload|flash+upload|bfu|pull|qemu}" 1015 1063 exit 1 1016 1064 ;; 1017 1065 esac
+6 -11
oven/native-builder.mjs
··· 93 93 } 94 94 95 95 // Determine build-and-flash.sh flags based on which paths changed. 96 - // - src/ or Makefile changed → full build (binary + initramfs + kernel) 97 - // - kernel/config-minimal changed → full build (forces kernel reconfigure) 98 - // - anything else (pieces/, initramfs/, initramfs-scripts/) → --skip-binary 96 + // Never skip binary: AC_BUILD_NAME and AC_GIT_HASH are compiled into the 97 + // binary via CFLAGS and change on every commit. The Makefile's CFLAGS 98 + // signature check (`.cflags` md5) handles incremental rebuilds efficiently — 99 + // only object files are recompiled when flags change, not the full kernel. 100 + // Skipping the binary causes version string mismatch (device shows stale name). 99 101 function buildFlagsFor(changedPaths = "") { 100 - const paths = changedPaths.split(",").filter(Boolean); 101 - const needsFullBuild = paths.some( 102 - (p) => 103 - p.includes("fedac/native/src/") || 104 - p.includes("fedac/native/Makefile") || 105 - p.includes("fedac/native/kernel/") 106 - ); 107 - return needsFullBuild ? [] : ["--skip-binary"]; 102 + return []; 108 103 } 109 104 110 105 // Symlink fedac/native/build → CACHE_DIR so kernel object files survive