From 4cbc1562f557b7c068867a01964afd278b92e4e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 11:25:35 +0000 Subject: [PATCH 1/3] chore: Remove outdated aios-install.sh --- aios-install.sh | 134 ------------------------------------------------ 1 file changed, 134 deletions(-) delete mode 100755 aios-install.sh diff --git a/aios-install.sh b/aios-install.sh deleted file mode 100755 index 03cc9f5..0000000 --- a/aios-install.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# aios installer - systemd-nspawn with aigpt + Claude Code - -set -e - -AIOS_VERSION="0.1.0" -AIOS_ROOT="/var/lib/machines/aios" -AIOS_CONFIG="$HOME/.config/syui/ai" - -echo "=== aios installer v${AIOS_VERSION} ===" -echo "" -echo "Installing: aigpt + Claude Code in systemd-nspawn" -echo "" - -# 1. Create shared memory directory -echo "[1/6] Creating shared memory directory..." -mkdir -p "${AIOS_CONFIG}/gpt" -chmod 700 "${AIOS_CONFIG}" -echo "✓ Created: ${AIOS_CONFIG}" - -# 2. Download bootstrap container (if not exists) -if [ ! -d "$AIOS_ROOT" ]; then - echo "[2/6] Downloading aios bootstrap container..." - if [ "$EUID" -eq 0 ]; then - mkdir -p /var/lib/machines - cd /var/lib/machines - curl -sL https://github.com/syui/aios/releases/download/latest/aios-bootstrap.tar.gz | tar xz - echo "✓ Bootstrap container extracted to: $AIOS_ROOT" - else - echo "⚠ Skipping (requires root)" - fi -else - echo "[2/6] Bootstrap container already exists" -fi - -# 3. Install aigpt (if not installed) -if ! command -v aigpt &>/dev/null; then - echo "[3/6] Installing aigpt..." - if command -v cargo &>/dev/null; then - cd /tmp - git clone https://git.syui.ai/ai/gpt || git clone https://github.com/syui/aigpt - cd gpt 2>/dev/null || cd aigpt - cargo build --release - - if [ "$EUID" -eq 0 ]; then - cp target/release/aigpt /usr/bin/ - else - mkdir -p ~/.local/bin - cp target/release/aigpt ~/.local/bin/ - echo " Add to PATH: export PATH=\$HOME/.local/bin:\$PATH" - fi - echo "✓ aigpt installed" - else - echo "⚠ cargo not found. Install rust first:" - echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" - fi -else - echo "[3/6] aigpt already installed" -fi - -# 4. Initialize aigpt database -if [ ! -f "${AIOS_CONFIG}/gpt/memory.db" ]; then - echo "[4/6] Initializing aigpt database..." - - # Start aigpt server temporarily to create DB - if command -v aigpt &>/dev/null; then - aigpt server --enable-layer4 & - AIGPT_PID=$! - sleep 2 - kill $AIGPT_PID 2>/dev/null || true - - # Enable WAL mode for concurrent access - if command -v sqlite3 &>/dev/null; then - sqlite3 "${AIOS_CONFIG}/gpt/memory.db" < /etc/systemd/nspawn/aios.nspawn - - echo "✓ systemd-nspawn configuration installed" - - # Enable and start container - echo "" - echo "Starting aios container..." - systemctl enable systemd-nspawn@aios - systemctl start systemd-nspawn@aios - echo "✓ aios container started" -else - echo "[6/6] Skipping systemd setup (requires root)" -fi - -echo "" -echo "================================================" -echo "✓ aios installation complete!" -echo "================================================" -echo "" -echo "Next steps:" -echo "" -echo " # Enter aios container:" -echo " $ sudo machinectl shell aios" -echo "" -echo " # Inside container, start Claude Code:" -echo " $ claude" -echo " # or" -echo " $ ai" -echo "" -echo "Configuration:" -echo " Shared memory: ${AIOS_CONFIG}/gpt/memory.db" -echo " MCP config: ${AIOS_CONFIG}/mcp.json" -echo "" From 74f6eea1a315b051c856647d224d0041c3a7ab34 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 11:27:35 +0000 Subject: [PATCH 2/3] fix: Uncomment install.sh in .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2e3716c..592174c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ aios-bootstrap*.tar.gz root.x86_64/ archiso/ -#install.sh +install.sh build.log From 5f4384d8128990f4e5904542ccf77f9386be6c5f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 11:29:55 +0000 Subject: [PATCH 3/3] feat: Remove existing images before cloning in install.sh - Check if aiosback and workspace already exist - Stop, terminate, and remove existing images before clone - Prevents 'File exists' error on re-installation --- cfg/install.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cfg/install.sh b/cfg/install.sh index 86703e9..e20af6f 100644 --- a/cfg/install.sh +++ b/cfg/install.sh @@ -86,12 +86,25 @@ mkdir -p /root/.config/syui/ai echo "4. Enabling systemd-machined..." systemctl enable --now systemd-machined +# Remove existing images if they exist +echo "5. Checking for existing images..." +for img in $BACKUP workspace; do + if machinectl list-images | grep -q "^$img"; then + echo " Removing existing image: $img" + machinectl poweroff $img 2>/dev/null || true + sleep 1 + machinectl terminate $img 2>/dev/null || true + sleep 1 + machinectl remove $img + fi +done + # Create initial backup -echo "5. Creating initial backup image..." +echo "6. Creating initial backup image..." machinectl clone $NAME $BACKUP # Create workspace container for AI operations -echo "6. Creating workspace container..." +echo "7. Creating workspace container..." machinectl clone $NAME workspace echo ""