Skip to content

Commit fb3f7ab

Browse files
committed
more
1 parent 622978b commit fb3f7ab

File tree

5 files changed

+409
-6
lines changed

5 files changed

+409
-6
lines changed

.github/workflows/build_bootstrap_images_x86_64.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,26 @@ jobs:
2020
strategy:
2121
matrix:
2222
include:
23-
#- image: "archlinux-base"
24-
# script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/archlinux.sh"
25-
# arch: "x86_64"
26-
# file: "/tmp/archlinux.tar"
23+
- image: "archlinux-base"
24+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/archlinux.sh"
25+
arch: "x86_64"
26+
file: "/tmp/rootfs.tar"
27+
28+
- image: "artix-base"
29+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/artix.sh"
30+
arch: "x86_64"
31+
file: "/tmp/rootfs.tar"
2732

2833
- image: "cachyos-base"
2934
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/cachyos.sh"
3035
arch: "x86_64"
31-
file: "/tmp/cachyos-base.tar"
36+
file: "/tmp/rootfs.tar"
37+
38+
- image: "eweos-base"
39+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/eweos.sh"
40+
arch: "x86_64"
41+
file: "/tmp/rootfs.tar"
42+
3243
steps:
3344
- name: Checkout repository
3445
uses: actions/checkout@v4
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/archlinux.sh")
5+
#-------------------------------------------------------#
6+
7+
#-------------------------------------------------------#
8+
set -x
9+
#-------------------------------------------------------#
10+
11+
#-------------------------------------------------------#
12+
##Bootstrap
13+
pushd "$(mktemp -d)" >/dev/null 2>&1
14+
docker stop "archlinux-base" 2>/dev/null ; docker rm "archlinux-base" 2>/dev/null
15+
docker run --name "archlinux-base" --privileged "azathothas/archlinux:latest" bash -l -c '
16+
#Bootstrap
17+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm --debug
18+
packages="bash binutils curl fakechroot fakeroot git wget"
19+
for pkg in $packages; do pacman -Sy "${pkg}" --noconfirm ; done
20+
for pkg in $packages; do pacman -Sy "${pkg}" --needed --noconfirm ; done
21+
#Fix & Patches
22+
sed '\''/DownloadUser/d'\'' -i "/etc/pacman.conf"
23+
#sed '\''s/^.*Architecture\s*=.*$/Architecture = auto/'\'' -i "/etc/pacman.conf"
24+
sed '\''0,/^.*SigLevel\s*=.*/s//SigLevel = Never/'\'' -i "/etc/pacman.conf"
25+
#sed '\''s/^.*SigLevel\s*=.*$/SigLevel = Never/'\'' -i "/etc/pacman.conf"
26+
sed '\''/#\[multilib\]/,/#Include = .*/s/^#//'\'' -i "/etc/pacman.conf"
27+
echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
28+
echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
29+
unlink "/var/lib/dbus/machine-id" 2>/dev/null
30+
unlink "/etc/machine-id" 2>/dev/null
31+
rm -rvf "/etc/machine-id"
32+
systemd-machine-id-setup --print 2>/dev/null | tee "/var/lib/dbus/machine-id"
33+
cat "/var/lib/dbus/machine-id" | tee "/etc/machine-id"
34+
pacman -Scc --noconfirm
35+
echo "disable-scdaemon" | tee "/etc/pacman.d/gnupg/gpg-agent.conf"
36+
curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/archlinux_hooks.sh" -o "/arch_hooks.sh"
37+
chmod +x "/arch_hooks.sh" ; "/arch_hooks.sh"
38+
rm -rfv "/arch_hooks.sh"
39+
echo "LANG=en_US.UTF-8" | tee "/etc/locale.conf"
40+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
41+
echo "LANGUAGE=en_US:en" | tee -a "/etc/locale.conf"
42+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/locale.conf"
43+
echo "en_US.UTF-8 UTF-8" | tee -a "/etc/locale.gen"
44+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/environment"
45+
locale-gen ; locale-gen "en_US.UTF-8"
46+
#Cleanup
47+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm
48+
pacman -Rsn base-devel --noconfirm
49+
pacman -Rsn perl --noconfirm
50+
pacman -Rsn python --noconfirm
51+
pacman -Scc --noconfirm
52+
#Fake-Sudo
53+
pacman -Rsndd sudo 2>/dev/null
54+
rm -rvf "/usr/bin/sudo" 2>/dev/null
55+
curl -qfsSL "https://github.com/pkgforge/devscripts/releases/download/common-utils/fake-sudo-pkexec.tar.zst" -o "./fake-sudo-pkexec.tar.zst" && chmod +x "./fake-sudo-pkexec.tar.zst"
56+
pacman -Uddd "./fake-sudo-pkexec.tar.zst" --noconfirm
57+
pacman -Syy fakeroot --needed --noconfirm
58+
rm -rvf "./fake-sudo-pkexec.tar.zst"
59+
#Yay
60+
curl -qfsSL "https://github.com/pkgforge/devscripts/releases/download/common-utils/yay-$(uname -m)" -o "/usr/bin/yay" && chmod +x "/usr/bin/yay"
61+
yay --version ; which fakeroot yay sudo
62+
#More cleanup
63+
rm -rfv "/usr/share/gtk-doc/"* 2>/dev/null
64+
rm -rfv "/usr/share/man/"* 2>/dev/null
65+
rm -rfv "/usr/share/help/"* 2>/dev/null
66+
rm -rfv "/usr/share/info/"* 2>/dev/null
67+
rm -rfv "/usr/share/doc/"* 2>/dev/null
68+
rm -rfv "/var/tmp/"* 2>/dev/null
69+
rm -rfv "/var/lib/pacman/sync/"* 2>/dev/null
70+
rm -rfv "/var/cache/pacman/pkg/"* 2>/dev/null
71+
find "/boot" -mindepth 1 -delete 2>/dev/null
72+
find "/dev" -mindepth 1 -delete 2>/dev/null
73+
find "/proc" -mindepth 1 -delete 2>/dev/null
74+
find "/run" -mindepth 1 -delete 2>/dev/null
75+
find "/sys" -mindepth 1 -delete 2>/dev/null
76+
find "/tmp" -mindepth 1 -delete 2>/dev/null
77+
find "/usr/include" -mindepth 1 -delete 2>/dev/null
78+
find "/usr/lib" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
79+
find "/usr/lib32" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
80+
find "/etc/pacman.d/gnupg" -type f -name "S.*" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
81+
find "/usr/share/locale" -mindepth 1 -maxdepth 1 ! -regex ".*/\(locale.alias\|en\|en_US\)$" -exec rm -rfv "{}" + 2>/dev/null
82+
find "/usr/share/doc" -mindepth 1 -delete 2>/dev/null
83+
find "/usr/share/gtk-doc" -mindepth 1 -delete 2>/dev/null
84+
find "/usr/share/help" -mindepth 1 -delete 2>/dev/null
85+
find "/usr/share/info" -mindepth 1 -delete 2>/dev/null
86+
find "/usr/share/man" -mindepth 1 -delete 2>/dev/null
87+
find "." -type d -name "__pycache__" -exec rm -rfv "{}" \; 2>/dev/null
88+
find "." -type f -name "*.pacnew" -exec rm -rfv "{}" \; 2>/dev/null
89+
find "." -type f -name "*.pacsave" -exec rm -rfv "{}" \; 2>/dev/null
90+
find "/var/log" -type f -name "*.log" -exec rm -rfv "{}" \; 2>/dev/null
91+
rm -rfv "/"{tmp,proc,sys,dev,run} 2>/dev/null
92+
mkdir -pv "/"{tmp,proc,sys,dev,run/media,mnt,media,home} 2>/dev/null
93+
rm -fv ""/etc/{host.conf,hosts,nsswitch.conf} 2>/dev/null
94+
touch ""/etc/{host.conf,hosts,nsswitch.conf} 2>/dev/null
95+
hostname 2>/dev/null; cat "/etc/os-release" 2>/dev/null'
96+
##Export
97+
docker export "$(docker ps -aqf 'name=archlinux-base')" --output "rootfs.tar"
98+
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
99+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
100+
else
101+
echo "\n[-] FATAL: Failed to export ROOTFS\n"
102+
exit 1
103+
fi
104+
popd "$(mktemp -d)" >/dev/null 2>&1
105+
#-------------------------------------------------------#
106+
107+
108+
#-------------------------------------------------------#
109+
##Push
110+
#ENV
111+
D_ID="$(docker ps -aqf 'name=archlinux-base' | tr -d '[:space:]')"
112+
D_TAG="v$(date +'%Y.%m.%d' | tr -d '[:space:]')"
113+
export D_ID D_TAG
114+
#Tags
115+
docker commit "${D_ID}" "pkgforge/archlinux-base:latest"
116+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/archlinux-base:latest"
117+
docker commit "${D_ID}" "pkgforge/archlinux-base:${D_TAG}"
118+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/archlinux-base:${D_TAG}"
119+
docker commit "${D_ID}" "pkgforge/archlinux-base:$(uname -m)"
120+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/archlinux-base:$(uname -m)"
121+
#Push
122+
docker push "pkgforge/archlinux-base:latest"
123+
docker push "ghcr.io/pkgforge/devscripts/archlinux-base:latest"
124+
docker push "pkgforge/archlinux-base:${D_TAG}"
125+
docker push "ghcr.io/pkgforge/devscripts/archlinux-base:${D_TAG}"
126+
docker push "pkgforge/archlinux-base:$(uname -m)"
127+
docker push "ghcr.io/pkgforge/devscripts/archlinux-base:$(uname -m)"
128+
#-------------------------------------------------------#

Github/Runners/bootstrap/artix.sh

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/artix.sh")
5+
#-------------------------------------------------------#
6+
7+
#-------------------------------------------------------#
8+
set -x
9+
## No aarch64 docker yet: https://hub.docker.com/r/artixlinux/artixlinux
10+
## Though it does exist: https://wiki.artixlinux.org/Main/Aarch64
11+
## https://armtixlinux.org/
12+
## https://gitea.artixlinux.org/artixdocker/artixlinux-docker
13+
if [ "$(uname -m)" == "aarch64" ]; then
14+
exit 0
15+
fi
16+
#-------------------------------------------------------#
17+
18+
#-------------------------------------------------------#
19+
##Bootstrap
20+
pushd "$(mktemp -d)" >/dev/null 2>&1
21+
docker stop "artix-base" 2>/dev/null ; docker rm "artix-base" 2>/dev/null
22+
docker run --name "artix-base" --privileged "artixlinux/artixlinux:latest" bash -l -c '
23+
#Bootstrap
24+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm --debug
25+
packages="bash binutils curl fakechroot fakeroot git wget"
26+
for pkg in $packages; do pacman -Sy "${pkg}" --noconfirm ; done
27+
for pkg in $packages; do pacman -Sy "${pkg}" --needed --noconfirm ; done
28+
#Fix & Patches
29+
sed '\''/DownloadUser/d'\'' -i "/etc/pacman.conf"
30+
#sed '\''s/^.*Architecture\s*=.*$/Architecture = auto/'\'' -i "/etc/pacman.conf"
31+
sed '\''0,/^.*SigLevel\s*=.*/s//SigLevel = Never/'\'' -i "/etc/pacman.conf"
32+
#sed '\''s/^.*SigLevel\s*=.*$/SigLevel = Never/'\'' -i "/etc/pacman.conf"
33+
sed '\''/#\[multilib\]/,/#Include = .*/s/^#//'\'' -i "/etc/pacman.conf"
34+
echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
35+
echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
36+
unlink "/var/lib/dbus/machine-id" 2>/dev/null
37+
unlink "/etc/machine-id" 2>/dev/null
38+
rm -rvf "/etc/machine-id"
39+
systemd-machine-id-setup --print 2>/dev/null | tee "/var/lib/dbus/machine-id"
40+
cat "/var/lib/dbus/machine-id" | tee "/etc/machine-id"
41+
pacman -Scc --noconfirm
42+
echo "disable-scdaemon" | tee "/etc/pacman.d/gnupg/gpg-agent.conf"
43+
curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/archlinux_hooks.sh" -o "/arch_hooks.sh"
44+
chmod +x "/arch_hooks.sh" ; "/arch_hooks.sh"
45+
rm -rfv "/arch_hooks.sh"
46+
echo "LANG=en_US.UTF-8" | tee "/etc/locale.conf"
47+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
48+
echo "LANGUAGE=en_US:en" | tee -a "/etc/locale.conf"
49+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/locale.conf"
50+
echo "en_US.UTF-8 UTF-8" | tee -a "/etc/locale.gen"
51+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/environment"
52+
locale-gen ; locale-gen "en_US.UTF-8"
53+
#Cleanup
54+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm
55+
pacman -Rsn base-devel --noconfirm
56+
pacman -Rsn perl --noconfirm
57+
pacman -Rsn python --noconfirm
58+
pacman -Scc --noconfirm
59+
#Fake-Sudo
60+
pacman -Rsndd sudo 2>/dev/null
61+
rm -rvf "/usr/bin/sudo" 2>/dev/null
62+
curl -qfsSL "https://github.com/pkgforge/devscripts/releases/download/common-utils/fake-sudo-pkexec.tar.zst" -o "./fake-sudo-pkexec.tar.zst" && chmod +x "./fake-sudo-pkexec.tar.zst"
63+
pacman -Uddd "./fake-sudo-pkexec.tar.zst" --noconfirm
64+
pacman -Syy fakeroot --needed --noconfirm
65+
rm -rvf "./fake-sudo-pkexec.tar.zst"
66+
#Yay
67+
curl -qfsSL "https://github.com/pkgforge/devscripts/releases/download/common-utils/yay-$(uname -m)" -o "/usr/bin/yay" && chmod +x "/usr/bin/yay"
68+
yay --version ; which fakeroot yay sudo
69+
#More cleanup
70+
rm -rfv "/usr/share/gtk-doc/"* 2>/dev/null
71+
rm -rfv "/usr/share/man/"* 2>/dev/null
72+
rm -rfv "/usr/share/help/"* 2>/dev/null
73+
rm -rfv "/usr/share/info/"* 2>/dev/null
74+
rm -rfv "/usr/share/doc/"* 2>/dev/null
75+
rm -rfv "/var/tmp/"* 2>/dev/null
76+
rm -rfv "/var/lib/pacman/sync/"* 2>/dev/null
77+
rm -rfv "/var/cache/pacman/pkg/"* 2>/dev/null
78+
find "/boot" -mindepth 1 -delete 2>/dev/null
79+
find "/dev" -mindepth 1 -delete 2>/dev/null
80+
find "/proc" -mindepth 1 -delete 2>/dev/null
81+
find "/run" -mindepth 1 -delete 2>/dev/null
82+
find "/sys" -mindepth 1 -delete 2>/dev/null
83+
find "/tmp" -mindepth 1 -delete 2>/dev/null
84+
find "/usr/include" -mindepth 1 -delete 2>/dev/null
85+
find "/usr/lib" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
86+
find "/usr/lib32" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
87+
find "/etc/pacman.d/gnupg" -type f -name "S.*" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
88+
find "/usr/share/locale" -mindepth 1 -maxdepth 1 ! -regex ".*/\(locale.alias\|en\|en_US\)$" -exec rm -rfv "{}" + 2>/dev/null
89+
find "/usr/share/doc" -mindepth 1 -delete 2>/dev/null
90+
find "/usr/share/gtk-doc" -mindepth 1 -delete 2>/dev/null
91+
find "/usr/share/help" -mindepth 1 -delete 2>/dev/null
92+
find "/usr/share/info" -mindepth 1 -delete 2>/dev/null
93+
find "/usr/share/man" -mindepth 1 -delete 2>/dev/null
94+
find "." -type d -name "__pycache__" -exec rm -rfv "{}" \; 2>/dev/null
95+
find "." -type f -name "*.pacnew" -exec rm -rfv "{}" \; 2>/dev/null
96+
find "." -type f -name "*.pacsave" -exec rm -rfv "{}" \; 2>/dev/null
97+
find "/var/log" -type f -name "*.log" -exec rm -rfv "{}" \; 2>/dev/null
98+
rm -rfv "/"{tmp,proc,sys,dev,run} 2>/dev/null
99+
mkdir -pv "/"{tmp,proc,sys,dev,run/media,mnt,media,home} 2>/dev/null
100+
rm -fv ""/etc/{host.conf,hosts,nsswitch.conf} 2>/dev/null
101+
touch ""/etc/{host.conf,hosts,nsswitch.conf} 2>/dev/null
102+
hostname 2>/dev/null; cat "/etc/os-release" 2>/dev/null'
103+
##Export
104+
docker export "$(docker ps -aqf 'name=artix-base')" --output "rootfs.tar"
105+
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
106+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
107+
else
108+
echo "\n[-] FATAL: Failed to export ROOTFS\n"
109+
exit 1
110+
fi
111+
popd "$(mktemp -d)" >/dev/null 2>&1
112+
#-------------------------------------------------------#
113+
114+
115+
#-------------------------------------------------------#
116+
##Push
117+
#ENV
118+
D_ID="$(docker ps -aqf 'name=artix-base' | tr -d '[:space:]')"
119+
D_TAG="v$(date +'%Y.%m.%d' | tr -d '[:space:]')"
120+
export D_ID D_TAG
121+
#Tags
122+
docker commit "${D_ID}" "pkgforge/artix-base:latest"
123+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/artix-base:latest"
124+
docker commit "${D_ID}" "pkgforge/artix-base:${D_TAG}"
125+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/artix-base:${D_TAG}"
126+
docker commit "${D_ID}" "pkgforge/artix-base:$(uname -m)"
127+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/artix-base:$(uname -m)"
128+
#Push
129+
docker push "pkgforge/artix-base:latest"
130+
docker push "ghcr.io/pkgforge/devscripts/artix-base:latest"
131+
docker push "pkgforge/artix-base:${D_TAG}"
132+
docker push "ghcr.io/pkgforge/devscripts/artix-base:${D_TAG}"
133+
docker push "pkgforge/artix-base:$(uname -m)"
134+
docker push "ghcr.io/pkgforge/devscripts/artix-base:$(uname -m)"
135+
#-------------------------------------------------------#

Github/Runners/bootstrap/cachyos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fi
102102
##Export
103103
docker export "$(docker ps -aqf 'name=cachyos-base')" --output "rootfs.tar"
104104
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
105-
rsync -achLv --mkpath "./rootfs.tar" "/tmp/cachyos-base.tar"
105+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
106106
else
107107
echo "\n[-] FATAL: Failed to export ROOTFS\n"
108108
exit 1

0 commit comments

Comments
 (0)