-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdamn.sh
More file actions
executable file
·58 lines (46 loc) · 1.01 KB
/
damn.sh
File metadata and controls
executable file
·58 lines (46 loc) · 1.01 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
IMAGE=uwuos
ROOT="$(cd "$(dirname "$0")" && pwd)"
KERNEL="$ROOT/kernel"
BUILD="$KERNEL/build"
ISO_DIR="$BUILD/iso"
echo "building docker image"
docker build --platform=linux/amd64 -t "$IMAGE" "$ROOT"
echo "building kernel"
docker run --rm \
--platform=linux/amd64 \
-v "$ROOT:/kernel" \
"$IMAGE" \
bash -c "cd /kernel/kernel && make clean && make"
echo
echo "1) img"
echo "2) iso"
echo "3) both"
read -p "> " choice
if [[ "$choice" == "1" ]]; then
echo "done -> $BUILD/uwuos.img"
exit 0
fi
echo "making iso"
rm -rf "$ISO_DIR"
mkdir -p "$ISO_DIR"
cp "$BUILD/uwuos.img" "$ISO_DIR/boot.img"
docker run --rm \
--platform=linux/amd64 \
-v "$ROOT:/kernel" \
"$IMAGE" \
bash -c "
xorriso -as mkisofs \
-R -J \
-b boot.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-o /kernel/kernel/build/uwuos.iso \
/kernel/kernel/build/iso
"
echo "iso -> $BUILD/uwuos.iso"
if [[ "$choice" == "3" ]]; then
echo "img -> $BUILD/uwuos.img"
fi