Skip to content

Commit ce95097

Browse files
committed
more
1 parent 2823bee commit ce95097

File tree

9 files changed

+508
-10
lines changed

9 files changed

+508
-10
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: 🐬 Create RunImage Images (aarch64) 🐬
2+
concurrency:
3+
group: "${{ github.workflow }}-${{ github.ref }}"
4+
cancel-in-progress: true
5+
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
- cron: "0 0 */3 * *" #every 3 Days @5:45 AM NPT
10+
jobs:
11+
push-aarch64:
12+
#runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04-arm
14+
timeout-minutes: 200
15+
permissions:
16+
attestations: write
17+
contents: write
18+
id-token: write
19+
packages: write
20+
statuses: read
21+
strategy:
22+
matrix:
23+
include:
24+
- image: "alpine"
25+
script: "${GITHUB_WORKSPACE}/main/alpine.sh"
26+
arch: "aarch64"
27+
file: "/tmp/runimage"
28+
29+
- image: "archlinux"
30+
script: "${GITHUB_WORKSPACE}/main/archlinux.sh"
31+
arch: "aarch64"
32+
file: "/tmp/runimage"
33+
34+
- image: "debian"
35+
script: "${GITHUB_WORKSPACE}/main/debian.sh"
36+
arch: "aarch64"
37+
file: "/tmp/runimage"
38+
39+
- image: "eweos"
40+
script: "${GITHUB_WORKSPACE}/main/eweos.sh"
41+
arch: "aarch64"
42+
file: "/tmp/runimage"
43+
44+
- image: "ubuntu"
45+
script: "${GITHUB_WORKSPACE}/main/ubuntu.sh"
46+
arch: "aarch64"
47+
file: "/tmp/runimage"
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
with:
53+
path: main
54+
filter: "blob:none"
55+
56+
- name: Setup Env
57+
run: |
58+
#presets
59+
set +x ; set +e
60+
#-------------#
61+
#tmp
62+
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
63+
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
64+
#-------------#
65+
##User-Agent
66+
USER_AGENT="$(curl -qfsSL 'https://pub.ajam.dev/repos/Azathothas/Wordlists/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}"
67+
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}"
68+
continue-on-error: true
69+
70+
- name: Create (${{ matrix.image }}/${{ matrix.arch }})
71+
run: |
72+
#presets
73+
set +x ; set +e
74+
#-------------#
75+
dos2unix --quiet "${{ matrix.script }}"
76+
chmod +x "${{ matrix.script }}"
77+
bash "${{ matrix.script }}"
78+
continue-on-error: true
79+
80+
- name: Check
81+
run: |
82+
#presets
83+
set +x ; set +e
84+
#-------------#
85+
if [[ -s "${{ matrix.file }}" ]] && [[ $(stat -c%s "${{ matrix.file }}") -gt 10000 ]]; then
86+
export HAS_RUNIMAGE="TRUE"
87+
echo "HAS_RUNIMAGE=${HAS_RUNIMAGE}" >> "${GITHUB_ENV}"
88+
UTC_TIME="$(TZ='UTC' date +'%Y_%m_%d')"
89+
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
90+
else
91+
export HAS_RUNIMAGE="FALSE"
92+
echo "HAS_RUNIMAGE=${HAS_RUNIMAGE}" >> "${GITHUB_ENV}"
93+
fi
94+
continue-on-error: true
95+
96+
- name: Fail (If Push Failed)
97+
if: env.HAS_RUNIMAGE == 'FALSE'
98+
run: |
99+
#presets
100+
set +x ; set +e
101+
#-------------#
102+
exit 1
103+
continue-on-error: false
104+
105+
#Artifacts
106+
- name: Upload (Build) Artifacts
107+
if: env.HAS_RUNIMAGE == 'TRUE'
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: "ARTIFACTS-${{ matrix.image }}_${{ matrix.arch }}"
111+
path: |
112+
${{ matrix.file }}
113+
compression-level: 0 #no compression, [Default: 6 (GNU Gzip)]
114+
retention-days: 90 #max
115+
overwrite: true
116+
continue-on-error: true
117+
118+
#continuous
119+
- name: Releaser (Continuous)
120+
if: env.HAS_RUNIMAGE == 'TRUE'
121+
uses: softprops/[email protected]
122+
with:
123+
name: "Continuous ${{ matrix.image }}_${{ matrix.arch }}"
124+
tag_name: "${{ matrix.image }}_${{ matrix.arch }}"
125+
prerelease: true
126+
draft: false
127+
generate_release_notes: false
128+
files: |
129+
${{ matrix.file }}
130+
continue-on-error: true
131+
132+
#Snapshot
133+
- name: Releaser (Snapshot)
134+
if: env.HAS_RUNIMAGE == 'TRUE'
135+
uses: softprops/[email protected]
136+
with:
137+
name: "Snapshot-(${{ matrix.image }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
138+
tag_name: "${{ matrix.image }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
139+
prerelease: false
140+
draft: false
141+
generate_release_notes: false
142+
make_latest: false
143+
files: |
144+
${{ matrix.file }}
145+
continue-on-error: true
146+
147+
#Build Provenance
148+
- name: Attest Build Provenance
149+
if: env.HAS_RUNIMAGE == 'TRUE'
150+
uses: actions/[email protected]
151+
with:
152+
subject-name: "image-${{ matrix.image }}-${{ matrix.arch }}"
153+
subject-path: ${{ matrix.file }}
154+
show-summary: true
155+
continue-on-error: true

.github/workflows/create_x86_64-Linux.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,37 @@ jobs:
2323
- image: "alpine"
2424
script: "${GITHUB_WORKSPACE}/main/alpine.sh"
2525
arch: "x86_64"
26-
file: "/tmp/alpine-x86_64"
26+
file: "/tmp/runimage"
2727

2828
- image: "archlinux"
2929
script: "${GITHUB_WORKSPACE}/main/archlinux.sh"
3030
arch: "x86_64"
31-
file: "/tmp/archlinux-x86_64"
31+
file: "/tmp/runimage"
3232

3333
- image: "artix"
3434
script: "${GITHUB_WORKSPACE}/main/artix.sh"
3535
arch: "x86_64"
36-
file: "/tmp/artix-x86_64"
36+
file: "/tmp/runimage"
3737

3838
- image: "cachyos"
3939
script: "${GITHUB_WORKSPACE}/main/cachyos.sh"
4040
arch: "x86_64"
41-
file: "/tmp/cachyos-x86_64"
41+
file: "/tmp/runimage"
4242

4343
- image: "debian"
4444
script: "${GITHUB_WORKSPACE}/main/debian.sh"
4545
arch: "x86_64"
46-
file: "/tmp/debian-x86_64"
46+
file: "/tmp/runimage"
4747

4848
- image: "eweos"
4949
script: "${GITHUB_WORKSPACE}/main/eweos.sh"
5050
arch: "x86_64"
51-
file: "/tmp/eweos-x86_64"
51+
file: "/tmp/runimage"
5252

5353
- image: "ubuntu"
5454
script: "${GITHUB_WORKSPACE}/main/ubuntu.sh"
5555
arch: "x86_64"
56-
file: "/tmp/ubuntu-x86_64"
56+
file: "/tmp/runimage"
5757

5858
steps:
5959
- name: Checkout repository

alpine.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
BASE_PKGS=(bash binutils coreutils curl file findutils gawk gocryptfs grep gzip iproute2 iptables iputils jq kmod libnotify lsof lz4 nftables openresolv patchelf procps-ng slirp4netns sed socat tar util-linux which xhost xz zstd)
3636
apk update --no-interactive
3737
apk upgrade --no-interactive
38-
apk add "${BASE_PKGS[@]}" --latest --upgrade --no-interactive
38+
#apk add "${BASE_PKGS[@]}" --no-cache --latest --upgrade --no-interactive
39+
for pkg in "${BASE_PKGS[@]}"; do apk add "${pkg}" --no-cache --latest --upgrade --no-interactive 2>/dev/null; done
3940
#Cleanup
4041
chmod 755 "/bin/bbsuid"
4142
rm -rfv "/var/cache/apk/"* 2>/dev/null
@@ -45,13 +46,15 @@
4546
rm -rfv "/usr/share/man/"* 2>/dev/null
4647
apk cache clean
4748
ln -s "/dev/null" "/etc/apk/cache"
48-
rim-shrink --all 2>/dev/null
49+
rim-shrink --all --verbose 2>/dev/null
4950
#Rebuild [Dwarfs ZSTD 22]
50-
rim-build --bsize '24' --clvl '22' --dwfs "/tmp/alpine-$(uname -m)"
51+
rim-build --bsize '22' --clvl '22' --dwfs "/tmp/runimage"
5152
}
5253
export -f build_image
5354
##Rebuild
55+
rm -rvf "/tmp/runimage" 2>/dev/null
5456
"./runimage" bash -c "build_image"
57+
echo "/tmp/runimage" | xargs -I "{}" bash -c 'du -sh "{}" && file "{}" && sha256sum "{}"'
5558
##End
5659
set +x
5760
popd >/dev/null 2>&1

archlinux.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge-dev/runimage-base/refs/heads/main/archlinux.sh")
5+
# HOST: x86_64-Linux
6+
#-------------------------------------------------------#
7+
8+
#-------------------------------------------------------#
9+
##Debug
10+
set -x
11+
pushd "$(mktemp -d)" >/dev/null 2>&1
12+
##RunImage
13+
curl -qfsSL "https://github.com/VHSgunzo/runimage/releases/download/continuous/runimage-$(uname -m)" -o "./runimage"
14+
chmod -v 'a+x' "./runimage"
15+
[[ -s "./runimage" ]] || exit 1
16+
##Get Rootfs
17+
"./runimage" getdimg --extract rootfs "pkgforge/archlinux-base:$(uname -m)"
18+
RIM_NO_NET="0"
19+
RIM_NO_NVIDIA_CHECK="1"
20+
RIM_OVERFS_MODE="1"
21+
RIM_ROOT="1"
22+
RIM_ROOTFS="$(find '.' -maxdepth 1 -type d -iname "*root*" -exec sh -c '[ -d "{}" ] && realpath "{}"' \; | head -n 1 | tr -d '[:space:]')"
23+
export RIM_NO_NET RIM_NO_NVIDIA_CHECK RIM_OVERFS_MODE RIM_ROOTFS RIM_ROOT
24+
if [ ! -d "${RIM_ROOTFS}" ] || [ ! "$(find "${RIM_ROOTFS}" -mindepth 1 -print -quit 2>/dev/null)" ]; then
25+
echo -e "\n[-] FATAL: Failed to Fetch RootFS"
26+
exit 1
27+
fi
28+
##Base Deps
29+
build_image()
30+
{
31+
#Fix & Patches
32+
echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
33+
echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
34+
#Requirements
35+
BASE_PKGS=(bash binutils coreutils curl file findutils gawk gocryptfs grep gzip iproute2 iptables iputils jq kmod libnotify lsof lz4 nftables openresolv patchelf procps-ng slirp4netns sed socat tar util-linux which xorg-xhost xz zstd)
36+
pacman -Scc --noconfirm ; rm "/var/lib/pacman/sync/"*
37+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm
38+
#pacman -S "${BASE_PKGS[@]}" --needed --noconfirm
39+
for pkg in "${BASE_PKGS[@]}"; do pacman -S "${pkg}" --needed --noconfirm 2>/dev/null; done
40+
#Cleanup
41+
pacman -Rsn base-devel --noconfirm 2>/dev/null
42+
pacman -Rsn perl --noconfirm 2>/dev/null
43+
pacman -Rsn python --noconfirm 2>/dev/null
44+
pacman -Scc --noconfirm 2>/dev/null
45+
rim-shrink --all --verbose 2>/dev/null
46+
#Rebuild [Dwarfs ZSTD 22]
47+
rim-build --bsize '24' --clvl '22' --dwfs "/tmp/runimage"
48+
}
49+
export -f build_image
50+
##Rebuild
51+
rm -rvf "/tmp/runimage" 2>/dev/null
52+
"./runimage" bash -c "build_image"
53+
echo "/tmp/runimage" | xargs -I "{}" bash -c 'du -sh "{}" && file "{}" && sha256sum "{}"'
54+
##End
55+
set +x
56+
popd >/dev/null 2>&1
57+
#-------------------------------------------------------#

artix.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge-dev/runimage-base/refs/heads/main/artix.sh")
5+
# HOST: x86_64-Linux
6+
#-------------------------------------------------------#
7+
8+
#-------------------------------------------------------#
9+
##Debug
10+
set -x
11+
pushd "$(mktemp -d)" >/dev/null 2>&1
12+
##RunImage
13+
curl -qfsSL "https://github.com/VHSgunzo/runimage/releases/download/continuous/runimage-$(uname -m)" -o "./runimage"
14+
chmod -v 'a+x' "./runimage"
15+
[[ -s "./runimage" ]] || exit 1
16+
##Get Rootfs
17+
"./runimage" getdimg --extract rootfs "pkgforge/artix-base:$(uname -m)"
18+
RIM_NO_NET="0"
19+
RIM_NO_NVIDIA_CHECK="1"
20+
RIM_OVERFS_MODE="1"
21+
RIM_ROOT="1"
22+
RIM_ROOTFS="$(find '.' -maxdepth 1 -type d -iname "*root*" -exec sh -c '[ -d "{}" ] && realpath "{}"' \; | head -n 1 | tr -d '[:space:]')"
23+
export RIM_NO_NET RIM_NO_NVIDIA_CHECK RIM_OVERFS_MODE RIM_ROOTFS RIM_ROOT
24+
if [ ! -d "${RIM_ROOTFS}" ] || [ ! "$(find "${RIM_ROOTFS}" -mindepth 1 -print -quit 2>/dev/null)" ]; then
25+
echo -e "\n[-] FATAL: Failed to Fetch RootFS"
26+
exit 1
27+
fi
28+
##Base Deps
29+
build_image()
30+
{
31+
#Fix & Patches
32+
echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
33+
echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
34+
#Requirements
35+
BASE_PKGS=(bash binutils coreutils curl file findutils gawk gocryptfs grep gzip iproute2 iptables iputils jq kmod libnotify lsof lz4 nftables openresolv patchelf procps-ng slirp4netns sed socat tar util-linux which xorg-xhost xz zstd)
36+
pacman -Scc --noconfirm ; rm "/var/lib/pacman/sync/"*
37+
pacman -y --sync --refresh --refresh --sysupgrade --noconfirm
38+
#pacman -S "${BASE_PKGS[@]}" --needed --noconfirm
39+
for pkg in "${BASE_PKGS[@]}"; do pacman -S "${pkg}" --needed --noconfirm 2>/dev/null; done
40+
#Cleanup
41+
pacman -Rsn base-devel --noconfirm 2>/dev/null
42+
pacman -Rsn perl --noconfirm 2>/dev/null
43+
pacman -Rsn python --noconfirm 2>/dev/null
44+
pacman -Scc --noconfirm 2>/dev/null
45+
rim-shrink --all --verbose 2>/dev/null
46+
#Rebuild [Dwarfs ZSTD 22]
47+
rim-build --bsize '24' --clvl '22' --dwfs "/tmp/runimage"
48+
}
49+
export -f build_image
50+
##Rebuild
51+
rm -rvf "/tmp/runimage" 2>/dev/null
52+
"./runimage" bash -c "build_image"
53+
echo "/tmp/runimage" | xargs -I "{}" bash -c 'du -sh "{}" && file "{}" && sha256sum "{}"'
54+
##End
55+
set +x
56+
popd >/dev/null 2>&1
57+
#-------------------------------------------------------#

0 commit comments

Comments
 (0)