Skip to content

Commit 00b96ed

Browse files
author
MilkywayRides
committed
Setup USB build environment and start automated build
1 parent 2554fcf commit 00b96ed

4 files changed

Lines changed: 83 additions & 0 deletions

File tree

auto-build.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
set -e
3+
4+
export BUILD_ROOT="/media/ankit/133f8f70-3409-4fdf-9112-2ef66d30e298/mlfs-build"
5+
export MLFS_TARGET="x86_64-mlfs-linux-musl"
6+
export MLFS_ARCH="x86_64"
7+
export PATH="/tools/bin:/cross-tools/bin:$PATH"
8+
9+
cd "$BUILD_ROOT"
10+
11+
# Download remaining sources
12+
echo "Downloading sources..."
13+
cd sources && wget -i sources.list -P packages/ --continue -q &
14+
WGET_PID=$!
15+
16+
# Start cross-tools build
17+
echo "Starting cross-tools build..."
18+
cd /home/ankit/Documents/Code/LinuxFork/Musl-LFS
19+
sudo mkdir -p /cross-tools /tools
20+
sudo chown -R $USER:$USER /cross-tools /tools
21+
22+
# Build cross-tools
23+
./build-scripts/build-cross-tools.sh 2>&1 | tee "$BUILD_ROOT/cross-tools-build.log" &
24+
BUILD_PID=$!
25+
26+
# Monitor and commit progress
27+
while kill -0 $BUILD_PID 2>/dev/null; do
28+
sleep 300
29+
git add -A && git commit -m "Build progress: $(date)" --author="MilkywayRides <milkywayrides@github.com>" || true
30+
git push origin main || true
31+
done
32+
33+
wait $BUILD_PID
34+
echo "Cross-tools build completed"
35+
36+
# Build tools
37+
echo "Starting tools build..."
38+
./build-scripts/build-toolchain.sh 2>&1 | tee "$BUILD_ROOT/tools-build.log"
39+
40+
git add -A && git commit -m "MLFS build completed successfully" --author="MilkywayRides <milkywayrides@github.com>"
41+
git push origin main
42+
43+
echo "Build completed successfully!"

build-config.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# Space-optimized MLFS build configuration
3+
4+
export MLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
5+
export MLFS_TARGET="x86_64-mlfs-linux-musl"
6+
export MLFS_ARCH="x86_64"
7+
export BUILD_ROOT="$(pwd)/mlfs-build"
8+
export SRC_ROOT=${BUILD_ROOT}/sources
9+
export SRC_PKGS=${SRC_ROOT}/packages
10+
export SRC_PATCHES=${SRC_ROOT}/patches
11+
export SRC_FILES=${SRC_ROOT}/files
12+
export MJ="-j$(nproc)"
13+
14+
# Create directories
15+
mkdir -p ${BUILD_ROOT}/{sources,cross-tools,tools}
16+
mkdir -p ${SRC_PKGS} ${SRC_PATCHES} ${SRC_FILES}
17+
18+
echo "Build environment configured:"
19+
echo "BUILD_ROOT: $BUILD_ROOT"
20+
echo "Available space: $(df -h . | tail -1 | awk '{print $4}')"

build.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Downloading sources...
2+
Starting cross-tools build...

usb-build-config.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
export BUILD_ROOT="/media/ankit/133f8f70-3409-4fdf-9112-2ef66d30e298/mlfs-build"
3+
export MLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
4+
export MLFS_TARGET="x86_64-mlfs-linux-musl"
5+
export MLFS_ARCH="x86_64"
6+
export SRC_ROOT=${BUILD_ROOT}/sources
7+
export MJ="-j$(nproc)"
8+
9+
mkdir -p ${BUILD_ROOT}/{sources,cross-tools,tools}
10+
mkdir -p ${SRC_ROOT}/{packages,patches,files}
11+
12+
# Copy sources and patches to USB
13+
cp -r patches ${SRC_ROOT}/
14+
cp -r files ${SRC_ROOT}/
15+
cp sources.list ${SRC_ROOT}/
16+
cp sources.md5 ${SRC_ROOT}/
17+
18+
echo "USB Build configured: $BUILD_ROOT"

0 commit comments

Comments
 (0)