Skip to content

Commit ca10fef

Browse files
authored
feat(build): Add software installation step (v5.7)
1 parent 854d49e commit ca10fef

File tree

1 file changed

+3
-78
lines changed

1 file changed

+3
-78
lines changed

build.sh

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
echo "===== LUMINOS MASTER BUILD SCRIPT (v5.6 - Full AI Integration) ====="
4+
echo "===== LUMINOS MASTER BUILD SCRIPT (v5.7 - With Software Pack) ====="
55
if [ "$(id -u)" -ne 0 ]; then echo "ERROR: This script must be run as root."; exit 1; fi
66

77
# --- 1. Define Directories & Vars ---
@@ -10,7 +10,7 @@ WORK_DIR="${BASE_DIR}/work"
1010
CHROOT_DIR="${WORK_DIR}/chroot"
1111
ISO_DIR="${WORK_DIR}/iso"
1212
AI_BUILD_DIR="${WORK_DIR}/ai_build"
13-
ISO_NAME="LuminOS-0.2-amd64.iso"
13+
ISO_NAME="LuminOS-0.2.1-amd64.iso" # Updated version number
1414

1515
# --- 2. Clean Up ---
1616
echo "--> Cleaning up previous build artifacts..."
@@ -36,7 +36,6 @@ apt-get install -y debootstrap squashfs-tools xorriso grub-pc-bin grub-efi-amd64
3636
echo "====================================================="
3737
echo "PHASE 0: Pre-downloading AI Models"
3838
echo "====================================================="
39-
# Force Ollama to use our specific directory
4039
export OLLAMA_MODELS="${AI_BUILD_DIR}/models"
4140
mkdir -p "${OLLAMA_MODELS}"
4241

@@ -45,26 +44,21 @@ curl -fL "https://github.com/ollama/ollama/releases/download/v0.1.32/ollama-linu
4544
chmod +x "${AI_BUILD_DIR}/ollama"
4645

4746
echo "--> Starting temporary Ollama server..."
48-
# Start server in background using our custom models dir
4947
OLLAMA_MODELS="${OLLAMA_MODELS}" "${AI_BUILD_DIR}/ollama" serve > "${AI_BUILD_DIR}/server.log" 2>&1 &
5048
OLLAMA_PID=$!
5149
echo "Waiting for Ollama server (PID ${OLLAMA_PID})..."
5250
sleep 10
5351

5452
echo "--> Pulling base model (llama3)..."
55-
# We use the binary we just downloaded
5653
OLLAMA_MODELS="${OLLAMA_MODELS}" "${AI_BUILD_DIR}/ollama" pull llama3
5754

5855
echo "--> Stopping temporary Ollama server..."
5956
kill ${OLLAMA_PID} || true
6057
wait ${OLLAMA_PID} || true
6158

62-
# VERIFICATION STEP
6359
SIZE_CHECK=$(du -s "${OLLAMA_MODELS}" | cut -f1)
64-
# 4000000 KB is roughly 4GB. If it's smaller, something failed.
6560
if [ "$SIZE_CHECK" -lt 4000000 ]; then
6661
echo "ERROR: Model download failed or is too small ($SIZE_CHECK KB)."
67-
echo "Check ${AI_BUILD_DIR}/server.log for details."
6862
exit 1
6963
else
7064
echo "SUCCESS: AI Models downloaded (${SIZE_CHECK} KB)."
@@ -101,78 +95,9 @@ cp "${BASE_DIR}/assets/"* "${CHROOT_DIR}/usr/share/wallpapers/luminos/"
10195

10296
echo "--> Injecting AI files into system..."
10397
cp "${AI_BUILD_DIR}/ollama" "${CHROOT_DIR}/usr/local/bin/"
104-
# Create the directory structure exactly as Ollama expects
10598
mkdir -p "${CHROOT_DIR}/usr/share/ollama/.ollama"
106-
# Copy the models we just verified
10799
cp -r "${AI_BUILD_DIR}/models" "${CHROOT_DIR}/usr/share/ollama/.ollama/"
108-
echo "--> AI Injection Complete."
109100

110101

111102
# --- 7. Run Customization Scripts ---
112-
echo "--> Running customization scripts..."
113-
cp "${BASE_DIR}/02-configure-system.sh" "${CHROOT_DIR}/tmp/"
114-
cp "${BASE_DIR}/03-install-desktop.sh" "${CHROOT_DIR}/tmp/"
115-
cp "${BASE_DIR}/04-customize-desktop.sh" "${CHROOT_DIR}/tmp/"
116-
cp "${BASE_DIR}/05-install-ai.sh" "${CHROOT_DIR}/tmp/"
117-
cp "${BASE_DIR}/07-install-plymouth-theme.sh" "${CHROOT_DIR}/tmp/"
118-
cp "${BASE_DIR}/06-final-cleanup.sh" "${CHROOT_DIR}/tmp/"
119-
120-
chmod +x "${CHROOT_DIR}/tmp/"*.sh
121-
122-
echo ":: Running 02-configure-system.sh"
123-
chroot "${CHROOT_DIR}" /tmp/02-configure-system.sh
124-
echo ":: Running 03-install-desktop.sh"
125-
chroot "${CHROOT_DIR}" /tmp/03-install-desktop.sh
126-
echo ":: Running 04-customize-desktop.sh"
127-
chroot "${CHROOT_DIR}" /tmp/04-customize-desktop.sh
128-
echo ":: Running 05-install-ai.sh"
129-
chroot "${CHROOT_DIR}" /tmp/05-install-ai.sh
130-
echo ":: Running 07-install-plymouth-theme.sh"
131-
chroot "${CHROOT_DIR}" /tmp/07-install-plymouth-theme.sh
132-
echo ":: Running 06-final-cleanup.sh"
133-
chroot "${CHROOT_DIR}" /tmp/06-final-cleanup.sh
134-
135-
echo "--> Unmounting..."
136-
umount "${CHROOT_DIR}/sys"
137-
umount "${CHROOT_DIR}/proc"
138-
umount "${CHROOT_DIR}/dev/pts"
139-
umount "${CHROOT_DIR}/dev"
140-
141-
# --- 8. Build the ISO ---
142-
echo "--> Compressing filesystem (SquashFS)..."
143-
# Added -comp zstd for faster decompression and boot
144-
mksquashfs "${CHROOT_DIR}" "${ISO_DIR}/live/filesystem.squashfs" -e boot -comp zstd
145-
146-
echo "--> Preparing Bootloader (GRUB)..."
147-
cp "${CHROOT_DIR}/boot"/vmlinuz* "${ISO_DIR}/live/vmlinuz"
148-
cp "${CHROOT_DIR}/boot"/initrd.img* "${ISO_DIR}/live/initrd.img"
149-
150-
cat > "${ISO_DIR}/boot/grub/grub.cfg" << EOF
151-
set default="0"
152-
set timeout=5
153-
menuentry "LuminOS v0.2 Live" {
154-
linux /live/vmlinuz boot=live quiet splash
155-
initrd /live/initrd.img
156-
}
157-
EOF
158-
159-
echo "--> Generating ISO image..."
160-
grub-mkrescue -o "${BASE_DIR}/${ISO_NAME}" "${ISO_DIR}"
161-
162-
echo "--> Cleaning up work directory..."
163-
sudo rm -rf "${WORK_DIR}"
164-
165-
echo ""
166-
echo "========================================="
167-
if [ -f "${BASE_DIR}/${ISO_NAME}" ]; then
168-
echo "SUCCESS: LuminOS ISO build is complete!"
169-
echo "Find your image at: ${BASE_DIR}/${ISO_NAME}"
170-
# Basic size check just to make sure...
171-
ISO_SIZE=$(du -h "${BASE_DIR}/${ISO_NAME}" | cut -f1)
172-
echo "ISO Size: $ISO_SIZE (Should be > 5G)"
173-
else
174-
echo "ERROR: Build finished but ISO file not found. Sorry."
175-
exit 1
176-
fi
177-
echo "========================================="
178-
exit 0
103+
echo "--> Running customization

0 commit comments

Comments
 (0)