Skip to content

Commit 680f945

Browse files
committed
Remake trios builder
1 parent 41f6b34 commit 680f945

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

builder/build-trios.sh

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
1-
docker build -t trios-builder .
2-
docker run --privileged -it \
3-
-v ~/TriOs/Trixie:/TriOs \
4-
-v ~/TriOs_Output:/TriOs_Output \
5-
trios-builder
1+
#!/bin/bash
2+
set -e
3+
4+
# === Configuration ===
5+
_repo_dir="$HOME/TriOs"
6+
_builder_dir="$_repo_dir/builder"
7+
_trios_dir="$_repo_dir/Trixie"
8+
_output_dir="$_repo_dir/TriOs_Output"
9+
_release_file="$_trios_dir/config/includes.chroot/etc/trios/release"
10+
_runner_name="$(hostname)"
11+
_image_name="trios-builder-${_runner_name}"
12+
_container_name="${_image_name}"
13+
14+
# === Preparation ===
15+
echo "Preparing TriOS build environment..."
16+
cd "$_repo_dir"
17+
18+
# Get short commit hash
19+
_commit_hash=$(git rev-parse --short HEAD)
20+
21+
# Ensure output directory exists
22+
mkdir -p "$_output_dir"
23+
24+
# Write 'custombuild' to release file
25+
echo "custombuild" > "$_release_file"
26+
echo "Wrote 'custombuild' to: $_release_file"
27+
28+
# Debug info
29+
echo "Commit hash: $_commit_hash"
30+
echo "Runner name: $_runner_name"
31+
echo "Output directory: $_output_dir"
32+
33+
# === Build Docker Image ===
34+
echo "Building Docker image: $_image_name"
35+
cd "$_builder_dir"
36+
docker build -t "$_image_name" .
37+
38+
# === Run Docker Container (attached, auto-remove) ===
39+
echo "Running Docker container (privileged mode)..."
40+
docker run -it --rm \
41+
--privileged \
42+
--name "$_container_name" \
43+
-v "$_trios_dir:/TriOs" \
44+
-v "$_output_dir:/TriOs_Output" \
45+
"$_image_name"
46+
47+
# === Verify Output ===
48+
echo "Build completed. ISO output contents:"
49+
ls -lh "$_output_dir" || true
50+
51+
echo "TriOS ISO build finished successfully!"
52+

0 commit comments

Comments
 (0)