Compare commits
4 Commits
main
...
dab6f6dfa2
| Author | SHA1 | Date | |
|---|---|---|---|
|
dab6f6dfa2
|
|||
|
fe811ac2d9
|
|||
|
8ac1ac1597
|
|||
|
1f01f6b0e9
|
@@ -1,6 +0,0 @@
|
|||||||
# https://github.com/containers/shortnames
|
|
||||||
# ~/.config/containers/registries.conf.d/ai.conf
|
|
||||||
unqualified-search-registries=["git.syui.ai", "docker.io", "ghcr.io"]
|
|
||||||
|
|
||||||
[aliases]
|
|
||||||
"aios"="git.syui.ai/ai/os"
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
name: release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
env:
|
|
||||||
TAG: latest
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
|
||||||
APP_TOKEN: ${{ secrets.APP_TOKEN }}
|
|
||||||
REGISTRY: localhost:8088
|
|
||||||
GITEA_URL: https://git.syui.ai
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ghcr.io/syui/aios
|
|
||||||
options: --privileged
|
|
||||||
steps:
|
|
||||||
- name: Pull and push to local registry
|
|
||||||
run: |
|
|
||||||
pacman -Sy --noconfirm docker
|
|
||||||
docker pull ghcr.io/syui/aios
|
|
||||||
docker tag ghcr.io/syui/aios ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
||||||
echo "${{ env.APP_TOKEN }}" | docker login ${{ env.REGISTRY }} -u syui --password-stdin
|
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
run: |
|
|
||||||
existing=$(curl -s -H "Authorization: token ${{ env.APP_TOKEN }}" "${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases/tags/${{ env.TAG }}" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
|
||||||
if [ -n "$existing" ]; then
|
|
||||||
curl -s -X DELETE -H "Authorization: token ${{ env.APP_TOKEN }}" "${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases/$existing"
|
|
||||||
fi
|
|
||||||
git tag -f ${{ env.TAG }} 2>/dev/null || true
|
|
||||||
curl -s -X POST -H "Authorization: token ${{ env.APP_TOKEN }}" -H "Content-Type: application/json" \
|
|
||||||
-d '{"tag_name":"${{ env.TAG }}","name":"${{ env.TAG }}","body":"build '$(date +%Y.%m.%d)'\n\ndownload: https://github.com/syui/aios/releases/download/latest/aios.tar.gz"}' \
|
|
||||||
"${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases"
|
|
||||||
54
.github/workflows/release.yml
vendored
54
.github/workflows/release.yml
vendored
@@ -1,49 +1,41 @@
|
|||||||
name: release
|
name: release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
|
||||||
APP_TOKEN: ${{ secrets.APP_TOKEN }}
|
|
||||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: archlinux:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
|
- name: Initialize
|
||||||
- name: Build aios
|
|
||||||
run: |
|
|
||||||
docker run --rm --privileged \
|
|
||||||
-v ${{ github.workspace }}:/work -w /work \
|
|
||||||
archlinux:latest \
|
|
||||||
bash -c "pacman -Sy --noconfirm arch-install-scripts zsh && zsh ./build.zsh"
|
|
||||||
|
|
||||||
- name: Push to Docker Hub
|
|
||||||
run: |
|
|
||||||
cat aios.tar.gz | docker import - syui/aios
|
|
||||||
echo "${{ env.DOCKER_TOKEN }}" | docker login -u syui --password-stdin
|
|
||||||
docker push syui/aios
|
|
||||||
|
|
||||||
- name: Push to GitHub Container Registry
|
|
||||||
run: |
|
|
||||||
echo "${{ env.APP_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
|
||||||
docker tag syui/aios ghcr.io/syui/aios
|
|
||||||
docker push ghcr.io/syui/aios
|
|
||||||
|
|
||||||
- name: Create new release
|
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ env.APP_TOKEN }}
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
gh release delete latest --yes --cleanup-tag || true
|
pacman -Syuu --noconfirm base-devel archiso docker
|
||||||
git tag -f latest
|
./build.zsh gh
|
||||||
git push -f origin latest
|
mv *.tar.gz ./aios-bootstrap.tar.gz
|
||||||
gh release create latest aios.tar.gz --title "latest" --notes "build $(date +%Y.%m.%d)" --target main
|
systemctl start docker
|
||||||
|
docker login -u=$DOCKER_USER -p=$DOCKER_PASSWORD
|
||||||
|
tar -C ./root.x86_64 -c . | docker import - syui/aios
|
||||||
|
docker push syui/aios
|
||||||
|
- name: Create new release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: Release latest
|
||||||
|
tag_name: latest
|
||||||
|
files:
|
||||||
|
aios-bootstrap.tar.gz
|
||||||
|
|||||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,9 +1 @@
|
|||||||
/.config/ai
|
.config/ai
|
||||||
/claude.md
|
|
||||||
/CLAUDE.md
|
|
||||||
**.DS_Store
|
|
||||||
aios-bootstrap*.tar.gz
|
|
||||||
root.x86_64/
|
|
||||||
archiso/
|
|
||||||
build.log
|
|
||||||
.claude
|
|
||||||
|
|||||||
58
README.md
58
README.md
@@ -1,7 +1,59 @@
|
|||||||
# aios
|
## ai `os`
|
||||||
|
|
||||||
|
<img src="./icon/ai.png" width="100">
|
||||||
|
|
||||||
|
- name : ai os
|
||||||
|
- base : [archlinux](https://gitlab.archlinux.org/archlinux)
|
||||||
|
|
||||||
|
### docker
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
AI: claude
|
$ docker run --rm syui/aios ai
|
||||||
- os: archlinux(systemd-nspawn, pacman)
|
```
|
||||||
|
|
||||||
|
### archiso
|
||||||
|
|
||||||
|
- [profile.rst](https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/docs/README.profile.rst)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ pacman -S archiso
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git clone https://git.syui.ai/ai/os
|
||||||
|
$ cd os
|
||||||
|
$ git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
||||||
|
$ git clone https://gitlab.archlinux.org/archlinux/archiso
|
||||||
|
|
||||||
|
$ vim ./archiso/configs/releng/profiledef.sh
|
||||||
|
|
||||||
|
$ mkarchiso -v -o ./ ./archiso/configs/releng
|
||||||
|
```
|
||||||
|
|
||||||
|
### system
|
||||||
|
|
||||||
|
> ./archiso/configs/releng/profiledef.sh
|
||||||
|
|
||||||
|
```sh
|
||||||
|
buildmodes=('bootstrap')
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mkarchiso -v -o ./ ./archiso/configs/releng
|
||||||
|
$ tar xf aios-bootstrap*.tar.gz
|
||||||
|
$ echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch\nServer = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist
|
||||||
|
$ sed -i s/CheckSpace/#CheckeSpace/ root.x86_64/etc/pacman.conf
|
||||||
|
$ arch-chroot ./root.x86_64
|
||||||
|
---
|
||||||
|
$ pacman -S base base-devel linux vim git zsh rust
|
||||||
|
$ pacman-key --init
|
||||||
|
$ pacman-key --populate archlinux
|
||||||
|
$ exit
|
||||||
|
---
|
||||||
|
$ tar -C root.x86_64 -c . | docker import - syui/aios
|
||||||
|
$ docker images
|
||||||
|
|
||||||
|
$ docker run --rm syui/aios cargo version
|
||||||
|
cargo 1.75.0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
1
archiso
Submodule
1
archiso
Submodule
Submodule archiso added at 1f65b695d3
1
archlinux-docker
Submodule
1
archlinux-docker
Submodule
Submodule archlinux-docker added at 98cd79111d
126
build.zsh
126
build.zsh
@@ -1,79 +1,65 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
set -e
|
d=${0:a:h}
|
||||||
|
case $1 in
|
||||||
|
bsae)
|
||||||
|
a=baseline
|
||||||
|
docker=true
|
||||||
|
;;
|
||||||
|
gh)
|
||||||
|
a=releng
|
||||||
|
docker=false
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
a=releng
|
||||||
|
docker=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
ROOTFS="$(pwd)/root.x86_64"
|
|
||||||
BUILD_MODE="${1:-tarball}"
|
|
||||||
BUILD_DATE=$(date +%Y.%m.%d)
|
|
||||||
|
|
||||||
echo "=== aios build $BUILD_DATE (mode: $BUILD_MODE) ==="
|
if ! ls $d/*.tar.gz;then
|
||||||
|
rm -rf $d/*.tar.gz
|
||||||
rm -rf $ROOTFS
|
|
||||||
mkdir -p $ROOTFS
|
|
||||||
|
|
||||||
# --- rootfs構築 (共通) ---
|
|
||||||
|
|
||||||
pacstrap -c $ROOTFS base
|
|
||||||
|
|
||||||
# pacman.conf がない場合はホストからコピー
|
|
||||||
if [[ ! -f $ROOTFS/etc/pacman.conf ]]; then
|
|
||||||
cp /etc/pacman.conf $ROOTFS/etc/pacman.conf
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch
|
if [ -d $d/work ];then
|
||||||
Server = http://mirrors.cat.net/archlinux/$repo/os/$arch' > $ROOTFS/etc/pacman.d/mirrorlist
|
rm -rf $d/work
|
||||||
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 -Syu --noconfirm base-devel vim git zsh rust openssh jq nodejs npm zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search'
|
|
||||||
|
|
||||||
if [[ "$BUILD_MODE" == "image" ]]; then
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'pacman -S --noconfirm linux linux-firmware mkinitcpio'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'npm i -g @anthropic-ai/claude-code'
|
if [ -d $d/root.x86_64 ];then
|
||||||
|
rm -rf $d/root.x86_64
|
||||||
bash cfg/pkg.sh $ROOTFS
|
fi
|
||||||
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chsh -s /bin/zsh'
|
if [ -d $d/archiso ];then
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai'
|
rm -rf $d/archiso
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'echo "ai:ai" | chpasswd'
|
fi
|
||||||
echo "ai ALL=(ALL:ALL) NOPASSWD: ALL" >> $ROOTFS/etc/sudoers
|
|
||||||
|
git clone https://gitlab.archlinux.org/archlinux/archiso
|
||||||
mkdir -p $ROOTFS/etc/systemd/system/console-getty.service.d
|
|
||||||
cat > $ROOTFS/etc/systemd/system/console-getty.service.d/override.conf <<'EOF'
|
# rm -rf $d/archlinux-docker
|
||||||
[Service]
|
# git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
||||||
ExecStart=
|
|
||||||
ExecStart=-/usr/bin/agetty --autologin ai --noclear --keep-baud console 115200,38400,9600 $TERM
|
cp -rf $d/cfg/profiledef.sh $d/archiso/configs/$a/profiledef.sh
|
||||||
EOF
|
cp -rf $d/scpt/mkarchiso $d/archiso/archiso/mkarchiso
|
||||||
|
|
||||||
cp cfg/zshrc $ROOTFS/home/ai/.zshrc
|
$d/archiso/archiso/mkarchiso -v -o $d/ $d/archiso/configs/releng
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc'
|
|
||||||
|
if [ ! -d $d/root.x86_64 ];then
|
||||||
mkdir -p $ROOTFS/home/ai/.config/claude
|
tar xf $d/aios-bootstrap*.tar.gz
|
||||||
cp cfg/mcp.json $ROOTFS/home/ai/.config/claude/mcp.json
|
fi
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config'
|
|
||||||
|
echo -e 'Server = http://mirrors.cat.net/archlinux/$repo/os/$arch\nServer = https://geo.mirror.pkgbuild.com/$repo/os/$arch' >> ./root.x86_64/etc/pacman.d/mirrorlist
|
||||||
cat > $ROOTFS/etc/os-release <<EOF
|
sed -i s/CheckSpace/#CheckeSpace/ root.x86_64/etc/pacman.conf
|
||||||
NAME=aios
|
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --init'
|
||||||
PRETTY_NAME=aios
|
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --populate archlinux'
|
||||||
ID=ai
|
arch-chroot root.x86_64 /bin/sh -c 'pacman -Syu --noconfirm base base-devel linux vim git zsh rust openssh openssl jq'
|
||||||
ID_LIKE=arch
|
arch-chroot root.x86_64 /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/ai /bin/ && ai ai'
|
||||||
BUILD_ID=rolling
|
|
||||||
IMAGE_ID=aios
|
# docker image
|
||||||
IMAGE_VERSION=0.0.1
|
if [ $docker = true ];then
|
||||||
HOME_URL=https://git.syui.ai/ai/os
|
systemctl start docker
|
||||||
EOF
|
tar -C $d/root.x86_64 -c . | docker import - syui/aios
|
||||||
|
|
||||||
echo "aios" > $ROOTFS/etc/hostname
|
docker images -a
|
||||||
|
docker run --rm syui/aios ai
|
||||||
# --- 出力 ---
|
docker push syui/aios
|
||||||
|
|
||||||
if [[ "$BUILD_MODE" == "image" ]]; then
|
|
||||||
bash cfg/image.sh $ROOTFS
|
|
||||||
echo "=== build complete: aios.img ==="
|
|
||||||
else
|
|
||||||
tar czf aios.tar.gz -C $ROOTFS .
|
|
||||||
echo "=== build complete: aios.tar.gz ==="
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
[Exec]
|
|
||||||
Boot=yes
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
Private=no
|
|
||||||
1
cfg/hostname
Normal file
1
cfg/hostname
Normal file
@@ -0,0 +1 @@
|
|||||||
|
aios
|
||||||
89
cfg/image.sh
89
cfg/image.sh
@@ -1,89 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
ROOTFS="$1"
|
|
||||||
IMG="aios.img"
|
|
||||||
IMG_SIZE="4G"
|
|
||||||
ESP_SIZE=512 # MiB
|
|
||||||
LOOP=""
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
set +e
|
|
||||||
umount -R /mnt/aios 2>/dev/null
|
|
||||||
[[ -n "$LOOP" ]] && losetup -d "$LOOP" 2>/dev/null
|
|
||||||
rmdir /mnt/aios 2>/dev/null
|
|
||||||
set -e
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
if [[ -z "$ROOTFS" || ! -d "$ROOTFS" ]]; then
|
|
||||||
echo "Usage: $0 <rootfs-dir>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f "$IMG"
|
|
||||||
|
|
||||||
echo "--- Creating raw image ($IMG_SIZE) ---"
|
|
||||||
fallocate -l "$IMG_SIZE" "$IMG"
|
|
||||||
|
|
||||||
echo "--- Partitioning (GPT: ESP + root) ---"
|
|
||||||
sgdisk -Z "$IMG"
|
|
||||||
sgdisk -n 1:0:+${ESP_SIZE}M -t 1:EF00 -c 1:"ESP" "$IMG"
|
|
||||||
sgdisk -n 2:0:0 -t 2:8300 -c 2:"root" "$IMG"
|
|
||||||
|
|
||||||
echo "--- Setting up loop device ---"
|
|
||||||
LOOP=$(losetup --find --show --partscan "$IMG")
|
|
||||||
PART_ESP="${LOOP}p1"
|
|
||||||
PART_ROOT="${LOOP}p2"
|
|
||||||
|
|
||||||
# Wait for partition devices
|
|
||||||
udevadm settle
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
echo "--- Formatting partitions ---"
|
|
||||||
mkfs.fat -F 32 "$PART_ESP"
|
|
||||||
mkfs.ext4 -F "$PART_ROOT"
|
|
||||||
|
|
||||||
echo "--- Mounting and copying rootfs ---"
|
|
||||||
mkdir -p /mnt/aios
|
|
||||||
mount "$PART_ROOT" /mnt/aios
|
|
||||||
mkdir -p /mnt/aios/boot
|
|
||||||
mount "$PART_ESP" /mnt/aios/boot
|
|
||||||
|
|
||||||
cp -a "$ROOTFS"/. /mnt/aios/
|
|
||||||
|
|
||||||
echo "--- Generating fstab ---"
|
|
||||||
genfstab -U /mnt/aios > /mnt/aios/etc/fstab
|
|
||||||
|
|
||||||
echo "--- Installing systemd-boot ---"
|
|
||||||
arch-chroot /mnt/aios bootctl install
|
|
||||||
|
|
||||||
echo "--- Creating boot entry ---"
|
|
||||||
ROOT_UUID=$(blkid -s UUID -o value "$PART_ROOT")
|
|
||||||
|
|
||||||
mkdir -p /mnt/aios/boot/loader/entries
|
|
||||||
|
|
||||||
cat > /mnt/aios/boot/loader/loader.conf <<'EOF'
|
|
||||||
default aios.conf
|
|
||||||
timeout 3
|
|
||||||
console-mode max
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > /mnt/aios/boot/loader/entries/aios.conf <<EOF
|
|
||||||
title aios
|
|
||||||
linux /vmlinuz-linux
|
|
||||||
initrd /initramfs-linux.img
|
|
||||||
options root=UUID=$ROOT_UUID rw
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "--- Generating initramfs ---"
|
|
||||||
arch-chroot /mnt/aios mkinitcpio -P
|
|
||||||
|
|
||||||
echo "--- Unmounting ---"
|
|
||||||
umount -R /mnt/aios
|
|
||||||
losetup -d "$LOOP"
|
|
||||||
LOOP=""
|
|
||||||
rmdir /mnt/aios 2>/dev/null
|
|
||||||
|
|
||||||
echo "--- $IMG ready ---"
|
|
||||||
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/ai/log/public/content/did:plc:6qyecktefllvenje24fcxnie/ai.syui.gpt.core/self.json",
|
|
||||||
"CHAT_OUTPUT": "/home/ai/ai/log/public/content"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
13
cfg/os-release
Normal file
13
cfg/os-release
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
BUILD_ID=rolling
|
||||||
|
ANSI_COLOR="38;2;23;147;209"
|
||||||
|
IMAGE_ID=aios
|
||||||
|
IMAGE_VERSION=2024.02.11
|
||||||
|
NAME=ai os
|
||||||
|
PRETTY_NAME=ai os
|
||||||
|
ID=ai
|
||||||
|
HOME_URL=https://git.syui.ai/ai/os
|
||||||
|
DOCUMENTATION_URL=https://git.syui.ai/ai/os/wiki
|
||||||
|
SUPPORT_URL=https://git.syui.ai/ai/os/issues
|
||||||
|
BUG_REPORT_URL=https://git.syui.ai/ai/os/issues
|
||||||
|
PRIVACY_POLICY_URL=https://git.syui.ai/ai/os
|
||||||
|
LOGO=ai-logo
|
||||||
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'
|
|
||||||
27
cfg/profiledef.sh
Normal file
27
cfg/profiledef.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
|
||||||
|
iso_name="aios"
|
||||||
|
iso_label="AI_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)"
|
||||||
|
iso_publisher="ai os <https://git.syui.ai/ai/os>"
|
||||||
|
iso_application="ai os Live/Rescue DVD"
|
||||||
|
iso_version="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)"
|
||||||
|
install_dir="ai"
|
||||||
|
#buildmodes=('iso')
|
||||||
|
buildmodes=('bootstrap')
|
||||||
|
bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito'
|
||||||
|
'uefi-ia32.grub.esp' 'uefi-x64.grub.esp'
|
||||||
|
'uefi-ia32.grub.eltorito' 'uefi-x64.grub.eltorito')
|
||||||
|
arch="x86_64"
|
||||||
|
pacman_conf="pacman.conf"
|
||||||
|
airootfs_image_type="squashfs"
|
||||||
|
airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M')
|
||||||
|
file_permissions=(
|
||||||
|
["/etc/shadow"]="0:0:400"
|
||||||
|
["/root"]="0:0:750"
|
||||||
|
["/root/.automated_script.sh"]="0:0:755"
|
||||||
|
["/root/.gnupg"]="0:0:700"
|
||||||
|
["/usr/local/bin/choose-mirror"]="0:0:755"
|
||||||
|
["/usr/local/bin/Installation_guide"]="0:0:755"
|
||||||
|
["/usr/local/bin/livecd-sound"]="0:0:755"
|
||||||
|
)
|
||||||
29
cfg/zshrc
29
cfg/zshrc
@@ -1,29 +0,0 @@
|
|||||||
export PATH=$HOME/.cargo/bin:$PATH
|
|
||||||
|
|
||||||
alias u="sudo pacman -Syu --noconfirm"
|
|
||||||
alias zs="vim ~/.zshrc"
|
|
||||||
alias zr="exec $SHELL && source ~/.zshrc"
|
|
||||||
|
|
||||||
autoload -Uz compinit
|
|
||||||
compinit
|
|
||||||
fpath=(/usr/share/zsh/site-functions $fpath)
|
|
||||||
|
|
||||||
#source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
||||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
|
|
||||||
|
|
||||||
HISTSIZE=10000
|
|
||||||
SAVEHIST=10000
|
|
||||||
HISTFILE=~/.zsh_history
|
|
||||||
setopt SHARE_HISTORY
|
|
||||||
setopt HIST_IGNORE_DUPS
|
|
||||||
bindkey '^[[A' history-substring-search-up
|
|
||||||
bindkey '^[[B' history-substring-search-down
|
|
||||||
|
|
||||||
if [[ -o login ]] && [[ -o interactive ]] && command -v aishell &>/dev/null; then
|
|
||||||
exec aishell
|
|
||||||
fi
|
|
||||||
|
|
||||||
function setup() {
|
|
||||||
aigpt setup
|
|
||||||
}
|
|
||||||
BIN
icon/ai.png
Normal file
BIN
icon/ai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
BIN
icon/avatar.png
Normal file
BIN
icon/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 557 KiB |
BIN
icon/wall.png
Normal file
BIN
icon/wall.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 149 KiB |
25
install.sh
25
install.sh
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
NAME="aios"
|
|
||||||
TARBALL="aios.tar.gz"
|
|
||||||
DEST="/var/lib/machines/$NAME"
|
|
||||||
|
|
||||||
if [[ ! -f "$TARBALL" ]]; then
|
|
||||||
echo "error: $TARBALL not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== aios install ==="
|
|
||||||
|
|
||||||
mkdir -p "$DEST"
|
|
||||||
tar xzf "$TARBALL" -C "$DEST"
|
|
||||||
|
|
||||||
mkdir -p /etc/systemd/nspawn
|
|
||||||
cp cfg/aios.nspawn /etc/systemd/nspawn/$NAME.nspawn
|
|
||||||
|
|
||||||
echo "=== install complete ==="
|
|
||||||
echo ""
|
|
||||||
echo " sudo machinectl start $NAME"
|
|
||||||
echo " sudo machinectl shell $NAME /bin/su - ai"
|
|
||||||
2058
scpt/mkarchiso
Executable file
2058
scpt/mkarchiso
Executable file
File diff suppressed because it is too large
Load Diff
24
scpt/sed.zsh
Executable file
24
scpt/sed.zsh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
d=${0:a:h}
|
||||||
|
cd $d
|
||||||
|
|
||||||
|
t=`grep -Rs archlinux .|grep -v t.zsh|grep -v http|grep -v systemd|grep -v pacman`
|
||||||
|
n=`echo $t|wc -l`
|
||||||
|
for ((i=1;i<=$n;i++))
|
||||||
|
do
|
||||||
|
tt=`echo $t|awk "NR==$i"`
|
||||||
|
echo $tt
|
||||||
|
f=`echo $tt|cut -d : -f 1`
|
||||||
|
echo sed -i s/archlinux/aios/g $f
|
||||||
|
done
|
||||||
|
|
||||||
|
t=`grep -Rs "Arch Linux" .|grep -v t.zsh|grep -v http|grep -v systemd|grep -v pacman`
|
||||||
|
n=`echo $t|wc -l`
|
||||||
|
for ((i=1;i<=$n;i++))
|
||||||
|
do
|
||||||
|
tt=`echo $t|awk "NR==$i"`
|
||||||
|
echo $tt
|
||||||
|
f=`echo $tt|cut -d : -f 1`
|
||||||
|
echo sed -i "s/Arch\ Linux/aios/g" $f
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user