This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -46,4 +46,4 @@ jobs:
|
|||||||
gh release delete latest --yes --cleanup-tag || true
|
gh release delete latest --yes --cleanup-tag || true
|
||||||
git tag -f latest
|
git tag -f latest
|
||||||
git push -f origin latest
|
git push -f origin latest
|
||||||
gh release create latest aios.tar.gz --title "latest" --notes "build $(date +%Y.%m.%d)"
|
gh release create latest aios.tar.gz --title "latest" --notes "build $(date +%Y.%m.%d)" --target main
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ root.x86_64/
|
|||||||
archiso/
|
archiso/
|
||||||
build.log
|
build.log
|
||||||
.claude
|
.claude
|
||||||
|
/cfg/repo.sh
|
||||||
|
|||||||
26
build.zsh
26
build.zsh
@@ -5,6 +5,7 @@ set -e
|
|||||||
ROOTFS="$(pwd)/root.x86_64"
|
ROOTFS="$(pwd)/root.x86_64"
|
||||||
BUILD_MODE="${1:-tarball}"
|
BUILD_MODE="${1:-tarball}"
|
||||||
BUILD_DATE=$(date +%Y.%m.%d)
|
BUILD_DATE=$(date +%Y.%m.%d)
|
||||||
|
GPG_KEY=B6A582E551A2F6181A5CC99E338E6F42F9544D9B
|
||||||
|
|
||||||
echo "=== aios build $BUILD_DATE (mode: $BUILD_MODE) ==="
|
echo "=== aios build $BUILD_DATE (mode: $BUILD_MODE) ==="
|
||||||
|
|
||||||
@@ -20,12 +21,12 @@ if [[ ! -f $ROOTFS/etc/pacman.conf ]]; then
|
|||||||
cp /etc/pacman.conf $ROOTFS/etc/pacman.conf
|
cp /etc/pacman.conf $ROOTFS/etc/pacman.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch
|
echo 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' > $ROOTFS/etc/pacman.d/mirrorlist
|
||||||
Server = http://mirrors.cat.net/archlinux/$repo/os/$arch' > $ROOTFS/etc/pacman.d/mirrorlist
|
|
||||||
sed -i 's/CheckSpace/#CheckSpace/' $ROOTFS/etc/pacman.conf
|
sed -i 's/CheckSpace/#CheckSpace/' $ROOTFS/etc/pacman.conf
|
||||||
|
sed -i '/\[options\]/a NoUpgrade = etc/os-release' $ROOTFS/etc/pacman.conf
|
||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'pacman-key --init && pacman-key --populate archlinux'
|
arch-chroot $ROOTFS /bin/sh -c 'pacman-key --init && pacman-key --populate archlinux'
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'pacman -Syu --noconfirm base-devel vim git zsh rust openssh jq nodejs npm zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search'
|
arch-chroot $ROOTFS /bin/sh -c 'pacman -Syu --noconfirm base-devel vim git zsh rust clang openssh jq nodejs npm zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search'
|
||||||
|
|
||||||
if [[ "$BUILD_MODE" == "image" ]]; then
|
if [[ "$BUILD_MODE" == "image" ]]; then
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'pacman -S --noconfirm linux linux-firmware mkinitcpio'
|
arch-chroot $ROOTFS /bin/sh -c 'pacman -S --noconfirm linux linux-firmware mkinitcpio'
|
||||||
@@ -33,7 +34,20 @@ fi
|
|||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'npm i -g @anthropic-ai/claude-code'
|
arch-chroot $ROOTFS /bin/sh -c 'npm i -g @anthropic-ai/claude-code'
|
||||||
|
|
||||||
bash cfg/pkg.sh $ROOTFS
|
cat >> $ROOTFS/etc/pacman.conf <<'EOF'
|
||||||
|
|
||||||
|
[aios]
|
||||||
|
SigLevel = Required DatabaseOptional
|
||||||
|
Server = https://git.syui.ai/ai/repo/raw/branch/main/$arch
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mv cfg/aios.gpg $ROOTFS/aios.gpg
|
||||||
|
arch-chroot $ROOTFS /bin/sh -c "
|
||||||
|
pacman-key --add /aios.gpg
|
||||||
|
pacman-key --lsign-key $GPG_KEY
|
||||||
|
rm /aios.gpg
|
||||||
|
"
|
||||||
|
arch-chroot $ROOTFS /bin/sh -c 'pacman -Sy --noconfirm ailog aigpt aishell'
|
||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chsh -s /bin/zsh'
|
arch-chroot $ROOTFS /bin/sh -c 'chsh -s /bin/zsh'
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai'
|
arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai'
|
||||||
@@ -50,10 +64,6 @@ EOF
|
|||||||
cp cfg/zshrc $ROOTFS/home/ai/.zshrc
|
cp cfg/zshrc $ROOTFS/home/ai/.zshrc
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc'
|
arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc'
|
||||||
|
|
||||||
mkdir -p $ROOTFS/home/ai/.config/claude
|
|
||||||
cp cfg/mcp.json $ROOTFS/home/ai/.config/claude/mcp.json
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config'
|
|
||||||
|
|
||||||
cat > $ROOTFS/etc/os-release <<EOF
|
cat > $ROOTFS/etc/os-release <<EOF
|
||||||
NAME=aios
|
NAME=aios
|
||||||
PRETTY_NAME=aios
|
PRETTY_NAME=aios
|
||||||
|
|||||||
BIN
cfg/aios.gpg
Normal file
BIN
cfg/aios.gpg
Normal file
Binary file not shown.
17
cfg/mcp.json
17
cfg/mcp.json
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"mcpServers": {
|
|
||||||
"aigpt": {
|
|
||||||
"command": "aigpt",
|
|
||||||
"args": ["server"],
|
|
||||||
"env": {}
|
|
||||||
},
|
|
||||||
"ailog": {
|
|
||||||
"command": "ailog",
|
|
||||||
"args": ["mcp"],
|
|
||||||
"env": {
|
|
||||||
"CHAT_SYSTEM_FILE": "/home/ai/.config/aigpt/core.md",
|
|
||||||
"CHAT_OUTPUT": "/home/ai/log/public/content"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
cfg/pkg.sh
17
cfg/pkg.sh
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
ROOTFS="$1"
|
|
||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'rm -rf /tmp/gpt /tmp/log /tmp/shell'
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c '
|
|
||||||
cd /tmp && git clone https://git.syui.ai/ai/gpt && cd /tmp/gpt && cargo build --release && cp target/release/aigpt /usr/local/bin/
|
|
||||||
'
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c '
|
|
||||||
cd /tmp && git clone -b main https://git.syui.ai/ai/log && cd /tmp/log && cargo build --release && cp target/release/ailog /usr/local/bin/
|
|
||||||
'
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c '
|
|
||||||
cd /tmp && git clone https://git.syui.ai/ai/shell && cd /tmp/shell && cargo build --release && cp target/release/aishell /usr/local/bin/
|
|
||||||
'
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'rm -rf /tmp/gpt /tmp/log /tmp/shell'
|
|
||||||
14
cfg/zshrc
14
cfg/zshrc
@@ -3,8 +3,6 @@ export PATH=$HOME/.cargo/bin:$PATH
|
|||||||
alias u="sudo pacman -Syu --noconfirm"
|
alias u="sudo pacman -Syu --noconfirm"
|
||||||
alias zs="vim ~/.zshrc"
|
alias zs="vim ~/.zshrc"
|
||||||
alias zr="exec $SHELL && source ~/.zshrc"
|
alias zr="exec $SHELL && source ~/.zshrc"
|
||||||
alias claude='claude --dangerously-skip-permissions'
|
|
||||||
alias c='claude --dangerously-skip-permissions'
|
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
@@ -25,3 +23,15 @@ bindkey '^[[B' history-substring-search-down
|
|||||||
if [[ -o login ]] && [[ -o interactive ]] && command -v aishell &>/dev/null; then
|
if [[ -o login ]] && [[ -o interactive ]] && command -v aishell &>/dev/null; then
|
||||||
exec aishell
|
exec aishell
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
ailog setup
|
||||||
|
# --- login ---
|
||||||
|
# ailog oauth $handle
|
||||||
|
# ailog oauth $handle_bot --bot
|
||||||
|
# --- login ---
|
||||||
|
ailog gpt core -d
|
||||||
|
ailog gpt memory -d
|
||||||
|
aigpt setup
|
||||||
|
claude
|
||||||
|
}
|
||||||
|
|||||||
24
pkg/aigpt/PKGBUILD
Normal file
24
pkg/aigpt/PKGBUILD
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
pkgname=aigpt
|
||||||
|
pkgver=0.0.1
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='ai memory and personality system for aios'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.syui.ai/ai/gpt'
|
||||||
|
license=('MIT')
|
||||||
|
depends=('gcc-libs')
|
||||||
|
makedepends=('rust' 'cargo' 'git')
|
||||||
|
options=('!lto')
|
||||||
|
source=("git+https://git.syui.ai/ai/gpt.git#branch=main")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd gpt
|
||||||
|
export CC=gcc
|
||||||
|
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc
|
||||||
|
cargo build --release
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd gpt
|
||||||
|
install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
||||||
|
}
|
||||||
24
pkg/ailog/PKGBUILD
Normal file
24
pkg/ailog/PKGBUILD
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
pkgname=ailog
|
||||||
|
pkgver=0.0.1
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='atproto blog cli for aios'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.syui.ai/ai/log'
|
||||||
|
license=('MIT')
|
||||||
|
depends=('gcc-libs')
|
||||||
|
makedepends=('rust' 'cargo' 'git')
|
||||||
|
options=('!lto')
|
||||||
|
source=("git+https://git.syui.ai/ai/log.git#branch=main")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd log
|
||||||
|
export CC=gcc
|
||||||
|
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc
|
||||||
|
cargo build --release
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd log
|
||||||
|
install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
||||||
|
}
|
||||||
24
pkg/aishell/PKGBUILD
Normal file
24
pkg/aishell/PKGBUILD
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
pkgname=aishell
|
||||||
|
pkgver=0.0.1
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='custom shell for aios'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.syui.ai/ai/shell'
|
||||||
|
license=('MIT')
|
||||||
|
depends=('gcc-libs')
|
||||||
|
makedepends=('rust' 'cargo' 'git')
|
||||||
|
options=('!lto')
|
||||||
|
source=("git+https://git.syui.ai/ai/shell.git#branch=main")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd shell
|
||||||
|
export CC=gcc
|
||||||
|
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc
|
||||||
|
cargo build --release
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd shell
|
||||||
|
install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user