add docker
This commit is contained in:
parent
225d7af6a8
commit
b90fcbdd0d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.config/ai
|
55
README.md
55
README.md
@ -1,7 +1,60 @@
|
|||||||
## ai `os`
|
## ai `os`
|
||||||
|
|
||||||
|
<img src="./icon/ai.png" width="100">
|
||||||
|
|
||||||
- name : ai os
|
- name : ai os
|
||||||
|
- base : [archlinux](https://gitlab.archlinux.org/archlinux)
|
||||||
|
|
||||||
- base : [archlinux](https://gitlab.archlinux.org/archlinux/archlinux-docker)
|
### docker
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ docker run --rm syui/aios ai
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 1f65b695d309d6089bdc2251bb4c9aa00bd11a51
|
1
archlinux-docker
Submodule
1
archlinux-docker
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 98cd79111dd530447f491d547d14f3c38e227e46
|
59
build.zsh
Executable file
59
build.zsh
Executable file
@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
d=${0:a:h}
|
||||||
|
case $1 in
|
||||||
|
bsae)
|
||||||
|
a=baseline
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
a=releng
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
if ! ls $d/*.tar.gz;then
|
||||||
|
rm -rf $d/*.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/work ];then
|
||||||
|
rm -rf $d/work
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/root.x86_64 ];then
|
||||||
|
rm -rf $d/root.x86_64
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $d/archiso ];then
|
||||||
|
rm -rf $d/archiso
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone https://gitlab.archlinux.org/archlinux/archiso
|
||||||
|
|
||||||
|
# rm -rf $d/archlinux-docker
|
||||||
|
# git clone https://gitlab.archlinux.org/archlinux/archlinux-docker
|
||||||
|
|
||||||
|
cp -rf $d/cfg/profiledef.sh $d/archiso/configs/$a/profiledef.sh
|
||||||
|
cp -rf $d/scpt/mkarchiso $d/archiso/archiso/mkarchiso
|
||||||
|
|
||||||
|
$d/archiso/archiso/mkarchiso -v -o $d/ $d/archiso/configs/releng
|
||||||
|
|
||||||
|
if [ ! -d $d/root.x86_64 ];then
|
||||||
|
tar xf $d/aios-bootstrap*.tar.gz
|
||||||
|
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'
|
||||||
|
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'
|
||||||
|
|
||||||
|
# docker image
|
||||||
|
systemctl start docker
|
||||||
|
tar -C $d/root.x86_64 -c . | docker import - syui/aios
|
||||||
|
|
||||||
|
docker images -a
|
||||||
|
docker run --rm syui/aios ai
|
||||||
|
docker push syui/aios
|
||||||
|
|
||||||
|
# docker run -it syui/aios zsh
|
1
cfg/hostname
Normal file
1
cfg/hostname
Normal file
@ -0,0 +1 @@
|
|||||||
|
aios
|
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
|
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"
|
||||||
|
)
|
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 |
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
|
Loading…
Reference in New Issue
Block a user