-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot
More file actions
executable file
·41 lines (39 loc) · 1.07 KB
/
boot
File metadata and controls
executable file
·41 lines (39 loc) · 1.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
#!/bin/bash
nographic=false
kernelimage="bzImage"
initrdimage="init.cpio"
init="/sbin/openrc-init"
for arg in "$@"; do
# useful for debugging kernel or init system issues,
# because the errors don't dissapear when we get to the getty login screen
if [ "$arg" = "-nog" ]; then
nographic=true
elif [[ "$arg" == "-kernel="* ]]; then
kernelimage="${arg#-kernel=}"
elif [[ "$arg" == "-initrd="* ]]; then
initrdimage="${arg#-initrd=}"
elif [[ "$arg" == "-init="* ]]; then
init="${arg#-init=}"
else
echo "Unknown argument: $arg"
exit 1
fi
done
if [ "$nographic" = true ]; then
qemu-system-x86_64 \
-kernel "$kernelimage" \
-initrd "$initrdimage" \
-append "console=ttyS0 root=/dev/ram rdinit=$init" \
-m 1024M \
-nographic \
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
-device e1000,netdev=net0
else
qemu-system-x86_64 \
-kernel "$kernelimage" \
-initrd "$initrdimage" \
-append "console=tty1 root=/dev/ram rdinit=$init" \
-m 1024M \
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
-device e1000,netdev=net0
fi