-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcmake-iso.sh
More file actions
executable file
·62 lines (57 loc) · 2.07 KB
/
Copy pathcmake-iso.sh
File metadata and controls
executable file
·62 lines (57 loc) · 2.07 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
59
60
61
62
#!/usr/bin/env sh
#
# ArtOS - hobby operating system by Artie Poole
# Copyright (C) 2025 Stuart Forbes Poole <artiepoole>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>
#
set -e
GRUB_SRC=".${CMAKE_SOURCE_DIR}/../grub.cfg"
BIN_SRC=".${CMAKE_BUILD_DIR}/ArtOS.bin"
BART_SRC=".${CMAKE_BUILD_DIR}/b.art"
HELLO_SRC=".${CMAKE_BUILD_DIR}/hello.art"
DOOM_SRC=".${CMAKE_BUILD_DIR}/doom.art"
DOOMWAD_SRC=".${CMAKE_SOURCE_DIR}/../external_resources/doomwad/doom1.wad"
echo "Grub source: ${GRUB_SRC}"
echo "ArtOS bin loc: ${BIN_SRC}"
echo "b.art source: ${BART_SRC}"
echo "hello.art source: ${HELLO_SRC}"
echo "doom.art source: ${DOOM_SRC}"
echo "DOOMWAD source: ${DOOMWAD_SRC}"
if grub-file --is-x86-multiboot2 ArtOS.bin; then
if test -f $GRUB_SRC; then
echo multiboot2 confirmed
mkdir -p isodir/boot/grub
mkdir -p isodir/fs
if ! test -f "${DOOMWAD_SRC}"; then
mkdir -p .${CMAKE_SOURCE_DIR}/../external_resources/doomwad/
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O .${CMAKE_SOURCE_DIR}/../external_resources/doomwad/doom1.wad
fi
cp "${BIN_SRC}" isodir/boot/ArtOS.bin
cp "${GRUB_SRC}" isodir/boot/grub/grub.cfg
cp "${DOOMWAD_SRC}" isodir/fs/doom1.wad
cp "${BART_SRC}" isodir/fs/
cp "${HELLO_SRC}" isodir/fs/
cp "${DOOM_SRC}" isodir/fs/
grub-mkrescue -o ArtOS.iso isodir
# rm -rf isodir
else
echo could not find grub config
exit 1
fi
else
echo the file is not multiboot2
exit 1
fi
exit 0