mirror of
https://github.com/rxrbln/t2sde.git
synced 2025-05-08 20:21:59 +08:00
53 lines
776 B
Plaintext
53 lines
776 B
Plaintext
#!/usr/bin/expect -f
|
|
|
|
set qemu [lindex $argv 0]
|
|
set kernel [lindex $argv 1]
|
|
set initrd [lindex $argv 2]
|
|
set append [lindex $argv 3]
|
|
set argv [lreplace $argv 0 3]
|
|
|
|
# Wait enough (forever) until a long-time boot
|
|
set timeout 30
|
|
#timeout {exit 1}
|
|
set send_slow {8 .1}
|
|
|
|
# Start the guest VM
|
|
spawn $qemu -kernel $kernel -initrd $initrd -nographic -append "$append" {*}$argv
|
|
|
|
expect {
|
|
timeout {exit 1}
|
|
"T2 SDE installer first stage*"
|
|
}
|
|
|
|
expect {
|
|
timeout {exit 1}
|
|
"* hit enter otherwise. (default:*"
|
|
}
|
|
|
|
send "\n"
|
|
expect {
|
|
timeout {exit 1}
|
|
"install:/#"
|
|
}
|
|
|
|
|
|
send "fdisk --version\n"
|
|
expect {
|
|
timeout {exit 1}
|
|
"fdisk from*"
|
|
}
|
|
|
|
|
|
send "mkfs.btrfs -V\n"
|
|
expect {
|
|
timeout {exit 1}
|
|
"mkfs.btrfs*part*"
|
|
}
|
|
|
|
|
|
send "echo o > /proc/sysrq-trigger\n"
|
|
expect {
|
|
timeout {exit 1}
|
|
"reboot: Power down"
|
|
}
|