Skip to content

Commit e24fe62

Browse files
Copilot0xrinegade
andcommitted
Add GitHub Actions workflow for building ISO images for multiple architectures
Co-authored-by: 0xrinegade <[email protected]>
1 parent 38b9e6e commit e24fe62

File tree

4 files changed

+550
-0
lines changed

4 files changed

+550
-0
lines changed

.github/workflows/build-iso.yml

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
name: Build OSVMarchi ISO Images
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-iso:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- arch: x86_64
17+
name: generic-x86_64
18+
march: x86-64
19+
mtune: generic
20+
- arch: amd64
21+
name: amd64
22+
march: x86-64
23+
mtune: generic
24+
- arch: zen4
25+
name: zen4-optimized
26+
march: znver4
27+
mtune: znver4
28+
- arch: zen5
29+
name: zen5-optimized
30+
march: znver5
31+
mtune: znver5
32+
- arch: epyc
33+
name: epyc-optimized
34+
march: znver2
35+
mtune: znver2
36+
- arch: threadripper
37+
name: threadripper-optimized
38+
march: znver3
39+
mtune: znver3
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Cache Docker layers
49+
uses: actions/cache@v4
50+
with:
51+
path: /tmp/.buildx-cache
52+
key: ${{ runner.os }}-buildx-${{ matrix.arch }}-${{ github.sha }}
53+
restore-keys: |
54+
${{ runner.os }}-buildx-${{ matrix.arch }}-
55+
${{ runner.os }}-buildx-
56+
57+
- name: Install dependencies
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y \
61+
qemu-user-static \
62+
binfmt-support \
63+
arch-install-scripts \
64+
dosfstools \
65+
e2fsprogs \
66+
erofs-utils \
67+
libarchive-tools \
68+
libisoburn1 \
69+
mtools \
70+
squashfs-tools
71+
72+
- name: Create OSVMarchi ISO build environment
73+
run: |
74+
# Create working directory
75+
mkdir -p iso-build/archiso-${{ matrix.arch }}
76+
cd iso-build
77+
78+
# Download archiso profile
79+
git clone https://gitlab.archlinux.org/archlinux/archiso.git
80+
cp -r archiso/configs/releng archiso-${{ matrix.arch }}
81+
82+
# Create custom packages list including OSVMarchi dependencies
83+
cat > archiso-${{ matrix.arch }}/packages.x86_64 << 'EOF'
84+
# Base system
85+
base
86+
base-devel
87+
linux
88+
linux-firmware
89+
90+
# Bootloader and filesystem
91+
syslinux
92+
efibootmgr
93+
dosfstools
94+
e2fsprogs
95+
96+
# Network and utilities
97+
networkmanager
98+
openssh
99+
git
100+
curl
101+
wget
102+
103+
# Development tools
104+
gcc
105+
make
106+
cmake
107+
108+
# OSVMarchi core dependencies (subset of the 118 packages)
109+
hyprland
110+
alacritty
111+
waybar
112+
nvim
113+
fastfetch
114+
btop
115+
docker
116+
docker-compose
117+
nodejs
118+
npm
119+
python
120+
python-pip
121+
122+
# Additional tools for ISO building
123+
archiso
124+
EOF
125+
126+
- name: Configure OSVMarchi integration
127+
run: |
128+
cd iso-build/archiso-${{ matrix.arch }}
129+
130+
# Create airootfs structure
131+
mkdir -p airootfs/etc/systemd/system/multi-user.target.wants
132+
mkdir -p airootfs/etc/osvmarchi
133+
mkdir -p airootfs/usr/local/bin
134+
135+
# Copy OSVMarchi files
136+
cp -r ../../* airootfs/etc/osvmarchi/ || true
137+
138+
# Create OSVMarchi installer service
139+
cat > airootfs/etc/systemd/system/osvmarchi-installer.service << 'EOF'
140+
[Unit]
141+
Description=OSVMarchi Installer Service
142+
After=network-online.target
143+
Wants=network-online.target
144+
145+
[Service]
146+
Type=oneshot
147+
ExecStart=/usr/local/bin/osvmarchi-auto-install
148+
RemainAfterExit=yes
149+
StandardOutput=journal
150+
151+
[Install]
152+
WantedBy=multi-user.target
153+
EOF
154+
155+
# Create auto-installer script
156+
cat > airootfs/usr/local/bin/osvmarchi-auto-install << 'EOF'
157+
#!/bin/bash
158+
# OSVMarchi Auto Installer for ISO
159+
160+
echo "OSVMarchi ISO Image - ${{ matrix.name }}"
161+
echo "Architecture: ${{ matrix.arch }}"
162+
echo "Compiler flags: -march=${{ matrix.march }} -mtune=${{ matrix.mtune }}"
163+
echo
164+
echo "This ISO contains OSVMarchi pre-configured for ${{ matrix.arch }} processors."
165+
echo "Run 'osvmarchi-install' to begin installation on this system."
166+
echo
167+
168+
# Make OSVMarchi available
169+
if [ -d /etc/osvmarchi ]; then
170+
ln -sf /etc/osvmarchi/boot.sh /usr/local/bin/osvmarchi-install
171+
chmod +x /usr/local/bin/osvmarchi-install
172+
fi
173+
EOF
174+
175+
chmod +x airootfs/usr/local/bin/osvmarchi-auto-install
176+
177+
# Enable the service
178+
ln -sf ../osvmarchi-installer.service airootfs/etc/systemd/system/multi-user.target.wants/
179+
180+
- name: Configure architecture-specific optimizations
181+
run: |
182+
cd iso-build/archiso-${{ matrix.arch }}
183+
184+
# Create makepkg.conf with architecture optimizations
185+
cat > airootfs/etc/makepkg.conf << EOF
186+
# Architecture-specific optimizations for ${{ matrix.arch }}
187+
CARCH="x86_64"
188+
CHOST="x86_64-pc-linux-gnu"
189+
190+
# Compiler flags optimized for ${{ matrix.arch }}
191+
CFLAGS="-march=${{ matrix.march }} -mtune=${{ matrix.mtune }} -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
192+
CXXFLAGS="\$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
193+
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs"
194+
LTOFLAGS="-flto=auto"
195+
RUSTFLAGS="-C opt-level=2 -C target-cpu=${{ matrix.mtune }}"
196+
197+
# Make options
198+
MAKEFLAGS="-j\$(nproc)"
199+
200+
# Package options
201+
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)
202+
203+
# Architecture
204+
INTEGRITY_CHECK=(sha256)
205+
BUILDENV=(!distcc color !ccache check !sign)
206+
EOF
207+
208+
- name: Customize ISO profile
209+
run: |
210+
cd iso-build/archiso-${{ matrix.arch }}
211+
212+
# Update profile configuration
213+
sed -i "s/iso_name=\"archlinux\"/iso_name=\"osvmarchi-${{ matrix.name }}\"/" profiledef.sh
214+
sed -i "s/iso_label=\"ARCH_.*\"/iso_label=\"OSVMARCHI_${{ matrix.arch }}\"/" profiledef.sh
215+
sed -i "s/iso_publisher=\"Arch Linux <https:\/\/archlinux.org>\"/iso_publisher=\"OSVMarchi <https:\/\/osvm.archi>\"/" profiledef.sh
216+
sed -i "s/iso_application=\"Arch Linux Live\/Rescue CD\"/iso_application=\"OSVMarchi Live\/Install CD - ${{ matrix.name }}\"/" profiledef.sh
217+
218+
# Set version
219+
echo "$(date +%Y.%m.%d)-${{ matrix.name }}" > airootfs/etc/osvmarchi-version
220+
221+
- name: Build ISO image
222+
run: |
223+
cd iso-build/archiso-${{ matrix.arch }}
224+
225+
# Build the ISO with verbose output
226+
echo "Building ISO for ${{ matrix.arch }} architecture..."
227+
sudo mkarchiso -v -w work -o out . 2>&1 | tee build.log
228+
229+
# Check if build was successful
230+
if [ ${PIPESTATUS[0]} -ne 0 ]; then
231+
echo "ISO build failed!"
232+
cat build.log
233+
exit 1
234+
fi
235+
236+
# Verify ISO was created
237+
if [ ! -d out ] || [ -z "$(ls out/*.iso 2>/dev/null)" ]; then
238+
echo "No ISO file found in output directory!"
239+
ls -la out/ || echo "Output directory does not exist"
240+
exit 1
241+
fi
242+
243+
# Get ISO filename
244+
ISO_FILE=$(ls out/*.iso | head -1)
245+
echo "Built ISO: $ISO_FILE"
246+
247+
# Move to predictable location
248+
sudo mv "$ISO_FILE" "../osvmarchi-${{ matrix.name }}-$(date +%Y%m%d).iso"
249+
sudo chown $USER:$USER "../osvmarchi-${{ matrix.name }}-$(date +%Y%m%d).iso"
250+
251+
- name: Generate checksums
252+
run: |
253+
cd iso-build
254+
ISO_FILE="osvmarchi-${{ matrix.name }}-$(date +%Y%m%d).iso"
255+
256+
# Generate checksums
257+
sha256sum "$ISO_FILE" > "$ISO_FILE.sha256"
258+
md5sum "$ISO_FILE" > "$ISO_FILE.md5"
259+
260+
# Display info
261+
ls -lh "$ISO_FILE"*
262+
echo "SHA256: $(cat $ISO_FILE.sha256)"
263+
264+
- name: Upload ISO artifact
265+
uses: actions/upload-artifact@v4
266+
with:
267+
name: osvmarchi-iso-${{ matrix.name }}
268+
path: |
269+
iso-build/osvmarchi-${{ matrix.name }}-*.iso
270+
iso-build/osvmarchi-${{ matrix.name }}-*.iso.sha256
271+
iso-build/osvmarchi-${{ matrix.name }}-*.iso.md5
272+
retention-days: 30
273+
compression-level: 0 # ISOs are already compressed
274+
275+
- name: Upload build logs
276+
if: failure()
277+
uses: actions/upload-artifact@v4
278+
with:
279+
name: build-logs-${{ matrix.name }}
280+
path: |
281+
iso-build/archiso-${{ matrix.arch }}/work/
282+
retention-days: 7

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# OSVMarchi
22

3+
[![Build ISO Images](https://github.com/openSVM/osvmarchi/actions/workflows/build-iso.yml/badge.svg)](https://github.com/openSVM/osvmarchi/actions/workflows/build-iso.yml)
4+
35
Turn a fresh Arch installation into a fully-configured, beautiful, and modern solana and web development system based on Hyprland by running a single command. OSVMarchi is an opinionated take on what Solana user Linux can be at its best.
46

57
████████████████████████████████████████████████████████████████
@@ -27,6 +29,61 @@ Turn a fresh Arch installation into a fully-configured, beautiful, and modern so
2729

2830
Read more at [osvm.archi](https://osvm.archi).
2931

32+
## ISO Images
33+
34+
OSVMarchi provides pre-built ISO images optimized for different AMD processor architectures. These bootable ISO images contain OSVMarchi pre-configured and ready to install.
35+
36+
### Available Architectures
37+
38+
| Architecture | Optimization | Target Processors |
39+
|-------------|-------------|------------------|
40+
| **x86_64** | Generic x86_64 | All 64-bit processors |
41+
| **amd64** | AMD64 baseline | All AMD 64-bit processors |
42+
| **Zen4** | Zen4 optimized (-march=znver4) | AMD Ryzen 7000 series, EPYC Genoa |
43+
| **Zen5** | Zen5 optimized (-march=znver5) | AMD Ryzen 9000 series, EPYC Turin |
44+
| **EPYC** | EPYC optimized (-march=znver2) | AMD EPYC Rome/Milan server processors |
45+
| **Threadripper** | Threadripper optimized (-march=znver3) | AMD Threadripper PRO/WX series |
46+
47+
### Downloading ISO Images
48+
49+
ISO images are automatically built on every push to the main branch and are available as workflow artifacts:
50+
51+
1. Go to the [Actions tab](https://github.com/openSVM/osvmarchi/actions/workflows/build-iso.yml)
52+
2. Click on the latest successful workflow run
53+
3. Download the ISO for your target architecture from the artifacts section
54+
55+
Each ISO includes:
56+
- SHA256 and MD5 checksums for verification
57+
- Architecture-specific compiler optimizations
58+
- OSVMarchi pre-installed and ready to configure
59+
60+
### Using the ISOs
61+
62+
1. **Download** the appropriate ISO for your processor architecture
63+
2. **Verify** the download using the provided checksums
64+
3. **Create** a bootable USB drive using tools like `dd`, Rufus, or Balena Etcher
65+
4. **Boot** from the USB drive
66+
5. **Run** `osvmarchi-install` to begin the installation process
67+
68+
### Building Custom ISOs
69+
70+
The ISO building process is automated via GitHub Actions. To build custom ISOs:
71+
72+
1. Fork this repository
73+
2. Modify the `.github/workflows/build-iso.yml` as needed
74+
3. Push changes to trigger the build workflow
75+
4. Download your custom ISOs from the workflow artifacts
76+
77+
### Architecture Selection Guide
78+
79+
- **x86_64/amd64**: Universal compatibility, works on all 64-bit processors
80+
- **Zen4**: Best performance on AMD Ryzen 7000 series and newer
81+
- **Zen5**: Optimal for cutting-edge AMD Ryzen 9000 series
82+
- **EPYC**: Server/workstation optimization for AMD EPYC processors
83+
- **Threadripper**: High-end desktop optimization for AMD Threadripper
84+
85+
Choose the most specific architecture that matches your processor for optimal performance.
86+
3087
## License
3188

3289
OSVMarchi is released under the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)