-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.expect
More file actions
38 lines (34 loc) · 1.26 KB
/
install.expect
File metadata and controls
38 lines (34 loc) · 1.26 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
#!/usr/bin/expect -f
# DKVM installation expect script
# Auto-generated by Makefile
set timeout -1
set qemu [lindex $argv 0]
set ovmf_code [lindex $argv 1]
set ovmf_vars [lindex $argv 2]
set disk_file [lindex $argv 3]
set alpine_iso [lindex $argv 4]
set scripts_iso [lindex $argv 5]
spawn $qemu -smp 4 -m 16G -machine q35 \
-drive if=pflash,format=raw,unit=0,file=$ovmf_code,readonly=on \
-drive if=pflash,format=raw,unit=1,file=$ovmf_vars \
-drive if=none,format=raw,id=usbstick,file=$disk_file \
-usb -device usb-storage,drive=usbstick \
-kernel alpine_extract/vmlinuz-lts \
-initrd alpine_extract/initramfs-lts \
-append "console=ttyS0,9600 modules=loop,squashfs modloop=/dev/sr0:/boot/modloop-lts quiet" \
-drive format=raw,media=cdrom,readonly,file=$alpine_iso \
-drive format=raw,media=cdrom,readonly,file=$scripts_iso \
-netdev user,id=mynet0,net=10.200.200.0/24,dhcpstart=10.200.200.10 \
-device e1000,netdev=mynet0 \
-nographic \
-boot menu=on,splash-time=12000 \
-global ICH9-LPC.disable_s3=0 \
-global driver=cfi.pflash01,property=secure,value=off
expect "login: "
send "root\n"
expect "localhost:~# "
send "mkdir -p /media/cdrom\n"
send "mount /dev/sr1 /media/cdrom\n"
send "sh /media/cdrom/runme.sh /dev/sda\n"
send "echo INSTALLATION DONE\n"
expect "INSTALLATION DONE"