-
Notifications
You must be signed in to change notification settings - Fork 2
/
mkiso.sh
executable file
·126 lines (107 loc) · 3.18 KB
/
mkiso.sh
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bash
TARGET_BOOT=i686-unknown-none-norostbkernel
TARGET_KERNEL=x86_64-unknown-none-norostbkernel
TARGET_USER=x86_64-unknown-norostb
TOOLCHAIN=dev-x86_64-unknown-norostb
set -e
set -x
if [ "$1" == --release ]
then
args="--release"
build_dir=release
else
args=
build_dir=debug
fi
. ./env.sh
./mkkernel.sh $args || exit $?
./mkboot.sh $args || exit $?
O=$(mktemp -d)
A=$(mktemp -d)
trap 'rm -rf "$O" "$A"' EXIT
mkdir -p $O/boot/grub
cp target/$TARGET_KERNEL/$build_dir/nora $O/boot/nora
cp target/$TARGET_BOOT/$build_dir/noraboot $O/boot/noraboot
cp boot/$ARCH/grub/grub.cfg $O/boot/grub/grub.cfg
cp init.scf $A/init.scf
cp pci.scf $A/pci.scf
cp usb.scf $A/usb.scf
cp keyboard/azerty.scf $A/keyboard.scf
cp fs.example/cfg/userdb.scf $A/userdb.scf
cp fs.example/cfg/ssh.scf $A/sshd.scf
cp fs.example/cfg/ssh_secret.scf $A/sshd_secret.scf
mkdir $A/cfg
cp fs.example/users/test/cfg/password.scf $A/cfg/password.scf
cp fs.example/users/test/cfg/ssh.scf $A/cfg/ssh.scf
if [ "$1" == --release ] # stuff's broken otherwise
then
export RUSTFLAGS="-Z unstable-options -C split-debuginfo=off"
else
export RUSTFLAGS="-Z unstable-options -C split-debuginfo=unpacked"
fi
# Separate std and no_std builds because Cargo is retarded
cargo build $args \
--target $TARGET_USER \
--workspace \
--exclude nora \
--exclude noraboot \
--exclude image_viewer \
--exclude minish \
--exclude ssh \
--exclude driver_fs_fat \
cargo build $args \
--target $TARGET_USER \
--package image_viewer \
--package minish \
--package ssh \
--package driver_fs_fat \
install () {
cp target/$TARGET_USER/$build_dir/$2 $A/$1
}
install_ext () {
(cd $2 && cargo +$TOOLCHAIN b $args --target $TARGET_USER)
cp $2/target/$TARGET_USER/$build_dir/$1 $A/$1
}
install framebuffer driver_framebuffer
install fs_fat driver_fs_fat
install gpt driver_gpt
install intel_hd_graphics driver_intel_hd_graphics
install pci driver_pci
install ps2 driver_ps2
install scancode_to_char driver_scancode_to_char
install usb driver_usb
install usb_hid driver_usb_hid
install usb_storage driver_usb_storage
install virtio_block driver_virtio_block
install virtio_gpu driver_virtio_gpu
install virtio_net driver_virtio_net
install join join
install init init
install gui_cli gui_cli
install image_viewer image_viewer
install minish minish
install ssh ssh
install static_http_server static_http_server
install window_manager window_manager
(
exit
cd tools
make nora_scp
cp nora_ssh/target/x86_64-unknown-norostb/release/nora_scp $A/scp
)
install_ext userdb ../bin/userdb
for img in button cursor
do
cp /tank/notes/norost/gui_sketches/$img.png $A/$img.png
done
cp thirdparty/font/inconsolata/Inconsolata-VF.ttf $A/font.tff
./tools/nrofs.py -rv -C $A $O/boot/norost.nrofs .
# Note: make sure grub-pc-bin is installed! Otherwise QEMU may hang on
# "Booting from disk" or return error code 0009
grub-mkrescue -o norost.iso $O \
--locales= \
--fonts= \
--install-modules="multiboot2 normal" \
--modules=all_video \
--compress=xz
./tools/nrofs.py -lv $O/boot/norost.nrofs