Bundle current Clawdie AI for install validation
This commit is contained in:
parent
1a4d98acf8
commit
f9cc62bb02
2 changed files with 28 additions and 17 deletions
|
|
@ -23,9 +23,12 @@ FREEBSD_MEMSTICK_SHA256_URL="${FREEBSD_ISO_BASE_URL}/CHECKSUM.SHA256-FreeBSD-${F
|
||||||
IMAGE_SIZE="50G"
|
IMAGE_SIZE="50G"
|
||||||
IMAGE_NAME="clawdie-iso-$(date +%d.%b.%Y | tr 'A-Z' 'a-z').img"
|
IMAGE_NAME="clawdie-iso-$(date +%d.%b.%Y | tr 'A-Z' 'a-z').img"
|
||||||
|
|
||||||
# Clawdie-AI release to bundle (fetched from Codeberg)
|
# Clawdie-AI ref to bundle from Codeberg.
|
||||||
CLAWDIE_VERSION="0.9.1"
|
# Use main for install validation so ISO firstboot exercises the current
|
||||||
CLAWDIE_TARBALL_URL="https://codeberg.org/Clawdie/Clawdie-AI/archive/v${CLAWDIE_VERSION}.tar.gz"
|
# post-install setup/token flow. Use --clawdie-version X.Y.Z for release builds.
|
||||||
|
CLAWDIE_VERSION="main"
|
||||||
|
CLAWDIE_REF="${CLAWDIE_REF:-main}"
|
||||||
|
CLAWDIE_TARBALL_URL="https://codeberg.org/Clawdie/Clawdie-AI/archive/${CLAWDIE_REF}.tar.gz"
|
||||||
|
|
||||||
# Default installer choices (can be overridden by setup.txt on the writable USB config partition)
|
# Default installer choices (can be overridden by setup.txt on the writable USB config partition)
|
||||||
DEFAULT_PKG_BRANCH="latest" # latest or quarterly
|
DEFAULT_PKG_BRANCH="latest" # latest or quarterly
|
||||||
|
|
|
||||||
36
build.sh
36
build.sh
|
|
@ -10,7 +10,8 @@
|
||||||
# ./build.sh # full build (fetch + assemble)
|
# ./build.sh # full build (fetch + assemble)
|
||||||
# ./build.sh --fetch-only # fetch packages/memstick only (no root needed)
|
# ./build.sh --fetch-only # fetch packages/memstick only (no root needed)
|
||||||
# ./build.sh --skip-fetch # assemble only (use cached packages)
|
# ./build.sh --skip-fetch # assemble only (use cached packages)
|
||||||
# ./build.sh --clawdie-version 1.0.2 # pin Clawdie-AI version
|
# ./build.sh --clawdie-version 1.0.2 # pin Clawdie-AI release tag v1.0.2
|
||||||
|
# ./build.sh --clawdie-ref main # bundle a branch/tag/commit ref
|
||||||
#
|
#
|
||||||
# Requirements (run on FreeBSD host):
|
# Requirements (run on FreeBSD host):
|
||||||
# pkg install curl # for fetching
|
# pkg install curl # for fetching
|
||||||
|
|
@ -40,7 +41,8 @@ SKIP_FETCH=0
|
||||||
FETCH_ONLY=0
|
FETCH_ONLY=0
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--clawdie-version) CLAWDIE_VERSION="$2"; shift 2 ;;
|
--clawdie-version) CLAWDIE_VERSION="$2"; CLAWDIE_REF="v$2"; shift 2 ;;
|
||||||
|
--clawdie-ref) CLAWDIE_REF="$2"; CLAWDIE_VERSION="$2"; shift 2 ;;
|
||||||
--skip-fetch) SKIP_FETCH=1; shift ;;
|
--skip-fetch) SKIP_FETCH=1; shift ;;
|
||||||
--fetch-only) FETCH_ONLY=1; shift ;;
|
--fetch-only) FETCH_ONLY=1; shift ;;
|
||||||
--assistant-name) ASSISTANT_NAME="$2"; shift 2 ;;
|
--assistant-name) ASSISTANT_NAME="$2"; shift 2 ;;
|
||||||
|
|
@ -75,7 +77,7 @@ fi
|
||||||
|
|
||||||
echo "==> clawdie-iso build"
|
echo "==> clawdie-iso build"
|
||||||
echo " FreeBSD : ${FREEBSD_VERSION} ${FREEBSD_ARCH}"
|
echo " FreeBSD : ${FREEBSD_VERSION} ${FREEBSD_ARCH}"
|
||||||
echo " Clawdie : v${CLAWDIE_VERSION}"
|
echo " Clawdie : ${CLAWDIE_REF}"
|
||||||
echo " Desktop : ${DEFAULT_DESKTOP}"
|
echo " Desktop : ${DEFAULT_DESKTOP}"
|
||||||
echo " Pkg : ${DEFAULT_PKG_BRANCH}"
|
echo " Pkg : ${DEFAULT_PKG_BRANCH}"
|
||||||
echo " GPU : ${GPU_DRIVER:-auto-detect}"
|
echo " GPU : ${GPU_DRIVER:-auto-detect}"
|
||||||
|
|
@ -430,26 +432,28 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- step 4: fetch + prepare Clawdie-AI tarball (offline-ready) ---
|
# --- step 4: fetch + prepare Clawdie-AI tarball (offline-ready) ---
|
||||||
# Resolve "latest" to the most recent Codeberg tag
|
# Resolve "latest" to the most recent Codeberg tag.
|
||||||
if [ "$CLAWDIE_VERSION" = "latest" ] || [ -z "$CLAWDIE_VERSION" ]; then
|
if [ "${CLAWDIE_REF:-${CLAWDIE_VERSION:-}}" = "latest" ] || [ -z "${CLAWDIE_REF:-}" ]; then
|
||||||
echo "==> [4/7] Resolving latest Clawdie-AI version..."
|
echo "==> [4/7] Resolving latest Clawdie-AI version..."
|
||||||
CLAWDIE_VERSION=$(curl -s "https://codeberg.org/api/v1/repos/Clawdie/Clawdie-AI/releases?limit=1" \
|
CLAWDIE_VERSION=$(curl -s "https://codeberg.org/api/v1/repos/Clawdie/Clawdie-AI/releases?limit=1" \
|
||||||
| grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4 | sed 's/^v//')
|
| grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4 | sed 's/^v//')
|
||||||
echo " Resolved: v${CLAWDIE_VERSION}"
|
CLAWDIE_REF="v${CLAWDIE_VERSION}"
|
||||||
|
echo " Resolved: ${CLAWDIE_REF}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CLAWDIE_TARBALL="${CACHE_DIR}/clawdie-ai-v${CLAWDIE_VERSION}.tar.gz"
|
CLAWDIE_CACHE_KEY=$(printf '%s' "$CLAWDIE_REF" | tr -c 'A-Za-z0-9._-' '_')
|
||||||
|
CLAWDIE_TARBALL="${CACHE_DIR}/clawdie-ai-${CLAWDIE_CACHE_KEY}.tar.gz"
|
||||||
|
CLAWDIE_TARBALL_URL="https://codeberg.org/Clawdie/Clawdie-AI/archive/${CLAWDIE_REF}.tar.gz"
|
||||||
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL" ]; then
|
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL" ]; then
|
||||||
echo "==> [4/7] Fetching Clawdie-AI v${CLAWDIE_VERSION}..."
|
echo "==> [4/7] Fetching Clawdie-AI ${CLAWDIE_REF}..."
|
||||||
mkdir -p "$CACHE_DIR"
|
mkdir -p "$CACHE_DIR"
|
||||||
curl -L --progress-bar -o "$CLAWDIE_TARBALL" \
|
curl -L --progress-bar -o "$CLAWDIE_TARBALL" "$CLAWDIE_TARBALL_URL"
|
||||||
"https://codeberg.org/Clawdie/Clawdie-AI/archive/v${CLAWDIE_VERSION}.tar.gz"
|
|
||||||
else
|
else
|
||||||
echo "==> [4/7] Clawdie-AI v${CLAWDIE_VERSION} cached."
|
echo "==> [4/7] Clawdie-AI ${CLAWDIE_REF} cached."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build an ISO-ready tarball that includes node_modules for offline firstboot.
|
# Build an ISO-ready tarball that includes node_modules for offline firstboot.
|
||||||
CLAWDIE_TARBALL_ISO="${CACHE_DIR}/clawdie-ai-v${CLAWDIE_VERSION}-iso.tar.gz"
|
CLAWDIE_TARBALL_ISO="${CACHE_DIR}/clawdie-ai-${CLAWDIE_CACHE_KEY}-iso.tar.gz"
|
||||||
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL_ISO" ]; then
|
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL_ISO" ]; then
|
||||||
echo "==> [4/7] Preparing Clawdie-AI offline tarball (node_modules)..."
|
echo "==> [4/7] Preparing Clawdie-AI offline tarball (node_modules)..."
|
||||||
|
|
||||||
|
|
@ -655,8 +659,12 @@ mkdir -p "$OUTPUT_DIR"
|
||||||
cp "$WORK_IMG" "${OUTPUT_DIR}/${IMAGE_NAME}"
|
cp "$WORK_IMG" "${OUTPUT_DIR}/${IMAGE_NAME}"
|
||||||
sync
|
sync
|
||||||
echo ""
|
echo ""
|
||||||
echo " Done : ${OUTPUT_DIR}/${IMAGE_NAME}"
|
OUTPUT_IMAGE="${OUTPUT_DIR}/${IMAGE_NAME}"
|
||||||
echo " Size : $(du -sh "${OUTPUT_DIR}/${IMAGE_NAME}" | cut -f1)"
|
IMAGE_LOGICAL_SIZE=$(ls -lh "$OUTPUT_IMAGE" | awk '{print $5}')
|
||||||
|
IMAGE_ALLOCATED_SIZE=$(du -sh "$OUTPUT_IMAGE" | awk '{print $1}')
|
||||||
|
echo " Done : ${OUTPUT_IMAGE}"
|
||||||
|
echo " Image size : ${IMAGE_LOGICAL_SIZE}"
|
||||||
|
echo " Allocated : ${IMAGE_ALLOCATED_SIZE} (sparse on build host)"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Write to USB:"
|
echo " Write to USB:"
|
||||||
echo " dd if=${IMAGE_NAME} of=/dev/daX bs=1M status=progress"
|
echo " dd if=${IMAGE_NAME} of=/dev/daX bs=1M status=progress"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue