os/build.zsh

53 lines
1.6 KiB
Bash
Raw Normal View History

2024-02-08 10:04:45 +00:00
#!/bin/zsh
d=${0:a:h}
2024-02-12 01:18:52 +00:00
cd $d
if ! ls ./*.tar.gz;then
rm -rf ./*.tar.gz
2024-02-08 10:04:45 +00:00
fi
2024-02-12 01:18:52 +00:00
if [ -d ./work ];then
rm -rf ./work
2024-02-08 10:04:45 +00:00
fi
2024-02-12 01:18:52 +00:00
if [ -d ./root.x86_64 ];then
rm -rf ./root.x86_64
2024-02-08 10:04:45 +00:00
fi
2024-02-12 01:18:52 +00:00
if [ -d ./archiso ];then
rm -rf ./archiso
2024-02-08 10:04:45 +00:00
fi
git clone https://gitlab.archlinux.org/archlinux/archiso
# rm -rf $d/archlinux-docker
# git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
2024-02-12 01:18:52 +00:00
cp -rf ./cfg/profiledef.sh /usr/share/archiso/configs/releng/
cp -rf ./cfg/profiledef.sh ./archiso/configs/releng/profiledef.sh
cp -rf ./cfg/profiledef.sh ./archiso/configs/baseline/profiledef.sh
cp -rf ./scpt/mkarchiso ./archiso/archiso/mkarchiso
2024-02-08 10:04:45 +00:00
2024-02-12 01:18:52 +00:00
./archiso/archiso/mkarchiso -v -o ./ ./archiso/configs/releng
2024-02-08 10:04:45 +00:00
2024-02-12 01:18:52 +00:00
if [ ! -d ./root.x86_64 ];then
tar xf ./aios-bootstrap*.tar.gz
2024-02-08 10:04:45 +00:00
fi
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 /bin/sh -c 'pacman-key --init'
arch-chroot root.x86_64 /bin/sh -c 'pacman-key --populate archlinux'
arch-chroot root.x86_64 /bin/sh -c 'pacman -Syu --noconfirm base base-devel linux vim git zsh rust openssh openssl jq'
2024-02-13 00:48:49 +00:00
arch-chroot root.x86_64 /bin/sh -c 'chsh -s /bin/zsh'
2024-02-08 10:04:45 +00:00
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'
systemctl start docker
2024-02-12 01:18:52 +00:00
tar -C ./root.x86_64 -c . | docker import - syui/aios
2024-02-08 10:04:45 +00:00
docker images -a
docker run --rm syui/aios ai
2024-02-13 00:51:49 +00:00
#arch-chroot root.x86_64
2024-02-13 00:49:54 +00:00
#docker push syui/aios