11#! /bin/bash
22set -e
33
4- echo " ===== LUMINOS MASTER BUILD SCRIPT ====="
4+ echo " ====== LUMINOS MASTER BUILD SCRIPT = ====="
55if [ " $( id -u) " -ne 0 ]; then echo " ERROR: This script must be run as root." ; exit 1; fi
66
77# Clean up previous build attempts first
@@ -32,20 +32,21 @@ echo "--> Configuring live-build for ISO creation..."
3232mkdir -p live-build-config
3333cd live-build-config
3434
35- # Explicitly set Debian mirrors and force Debian mode
36- DEBIAN_MIRROR= " http://deb.debian.org/debian/ "
37- SECURITY_COMPONENT= " trixie-security "
35+ # Explicitly clean any previous live-build state
36+ echo " --> Forcing clean of live-build environment... "
37+ sudo lb clean --purge
3838
39+ # Configure live-build
40+ echo " --> Running lb config..."
3941lb config \
4042 --mode debian \
4143 --architectures amd64 \
4244 --distribution trixie \
4345 --archive-areas " main contrib non-free-firmware" \
4446 --security true \
45- --mirror-bootstrap " ${DEBIAN_MIRROR} " \
46- --mirror-chroot " ${DEBIAN_MIRROR} " \
47- --mirror-binary " ${DEBIAN_MIRROR} " \
48- --mirror-binary-security " http://security.debian.org/debian-security/ ${SECURITY_COMPONENT} /main contrib non-free-firmware" \
47+ --mirror-bootstrap " http://deb.debian.org/debian/" \
48+ --mirror-binary " http://deb.debian.org/debian/" \
49+ --mirror-binary-security " http://security.debian.org/debian-security/" \
4950 --bootappend-live " boot=live components locales=en_US.UTF-8" \
5051 --iso-application " LuminOS" \
5152 --iso-publisher " LuminOS Project" \
@@ -56,23 +57,37 @@ lb config \
5657
5758# Copy our custom-built system into the live-build chroot overlay
5859echo " --> Copying the customized LuminOS system into the build environment..."
60+ # Ensure the target directory exists WITHIN the config structure lb expects
5961mkdir -p config/includes.chroot/
6062rsync -a ../chroot/ config/includes.chroot/
6163
62- echo " --> Building the ISO (DEBUG MODE). This will probably take a significant amount of time..."
64+ echo " --> Building the ISO (DEBUG MODE). This will could a significant amount of time..."
6365# Run build with sudo and debug flags
6466sudo lb build --debug --verbose
6567
6668# Move the final ISO to the root of the project directory
67- mv * .iso ..
69+ # Check if ISO exists before moving
70+ if ls * .iso 1> /dev/null 2>&1 ; then
71+ echo " --> Moving ISO to project root..."
72+ mv * .iso ..
73+ else
74+ echo " ERROR: ISO file was not found after build!"
75+ # Optionally: keep build dir for inspection
76+ # exit 1
77+ fi
6878
6979cd ..
7080echo " --> Cleaning up live-build configuration directory..."
7181sudo rm -rf live-build-config
7282
7383echo " "
7484echo " ========================================="
75- echo " SUCCESS: LuminOS ISO build is complete!"
76- echo " Find your image in the main project folder"
85+ # Check again if ISO exists in parent dir
86+ if ls * .iso 1> /dev/null 2>&1 ; then
87+ echo " SUCCESS: LuminOS ISO build is complete!"
88+ echo " Find your image in the main project folder"
89+ else
90+ echo " ERROR: Build finished but ISO file is missing!"
91+ fi
7792echo " ========================================="
7893exit 0
0 commit comments