-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (30 loc) · 1.17 KB
/
build.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Build SimpleOS with Docker when a local cross-toolchain is unavailable.
set -euo pipefail
if ! command -v docker >/dev/null 2>&1; then
echo "Docker is not installed or not on PATH."
echo "Install Docker, or build locally with the required i686 ELF cross-toolchain."
exit 1
fi
echo "Building SimpleOS with Docker..."
docker build -t simpleos-builder .
docker run --rm -v "$(pwd)":/src simpleos-builder \
sh -c "make CROSS_PREFIX=x86_64-elf- GRUB_MKRESCUE=grub-mkrescue clean && cd userspace && make distclean"
docker run --rm -v "$(pwd)":/src simpleos-builder \
sh -c "cd userspace && make CROSS_PREFIX=x86_64-elf- headers && cd /src && make CROSS_PREFIX=x86_64-elf- GRUB_MKRESCUE=grub-mkrescue"
echo ""
if [ -f simpleos.iso ]; then
echo "Build successful. ISO created: simpleos.iso"
# Copy to web app demo path
if [ -d "web/public" ]; then
mkdir -p web/public/os
cp simpleos.iso web/public/os/simpleos.iso
echo "Copied ISO to web/public/os/simpleos.iso"
echo ""
echo "Run the web app:"
echo " cd web && npm run dev"
fi
else
echo "Build failed: simpleos.iso was not created."
exit 1
fi