Skip to content

Commit 865bb77

Browse files
authored
fix(build): Add lb clean and simplify lb config mirrors
1 parent f5acb3b commit 865bb77

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

build.sh

Lines changed: 27 additions & 12 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 ====="
4+
echo "====== LUMINOS MASTER BUILD SCRIPT ======"
55
if [ "$(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..."
3232
mkdir -p live-build-config
3333
cd 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..."
3941
lb 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
5859
echo "--> Copying the customized LuminOS system into the build environment..."
60+
# Ensure the target directory exists WITHIN the config structure lb expects
5961
mkdir -p config/includes.chroot/
6062
rsync -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
6466
sudo 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

6979
cd ..
7080
echo "--> Cleaning up live-build configuration directory..."
7181
sudo rm -rf live-build-config
7282

7383
echo ""
7484
echo "========================================="
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
7792
echo "========================================="
7893
exit 0

0 commit comments

Comments
 (0)