2024-04-04 00:17:36 +02:00
|
|
|
set timeout 10
|
|
|
|
|
|
|
|
proc chat {instr outstr} {
|
|
|
|
expect {
|
|
|
|
$instr { send $outstr }
|
|
|
|
timeout { exit 1 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
spawn socat -,echo=0,icanon=1 unix-connect:vm/monitor
|
|
|
|
set monitor_id $spawn_id
|
|
|
|
|
|
|
|
spawn socat unix-connect:vm/console -
|
|
|
|
set console_id $spawn_id
|
|
|
|
|
|
|
|
expect "BusyBox"
|
|
|
|
chat "#" "PS1=RE\\ADY_\\ ; stty -echo \r"
|
2024-04-15 23:15:27 +02:00
|
|
|
chat "READY_" "tail -f /run/uncaught-logs/current & \rs6-rc -b -a list\r"
|
2024-04-04 00:17:36 +02:00
|
|
|
|
2024-04-15 23:15:27 +02:00
|
|
|
chat "mount" "\r"
|
2024-04-04 00:17:36 +02:00
|
|
|
|
|
|
|
set spawn_id $monitor_id
|
|
|
|
chat "QEMU" "device_add usb-storage,bus=xhci.0,drive=usbstick\n"
|
|
|
|
chat "(qemu)" "version\r"
|
|
|
|
|
|
|
|
set spawn_id $console_id
|
|
|
|
|
|
|
|
expect {
|
2024-04-15 23:15:27 +02:00
|
|
|
"sda: sda1" { }
|
2024-04-04 00:17:36 +02:00
|
|
|
timeout { exit 1 }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
send "\r"
|
2024-04-15 23:15:27 +02:00
|
|
|
chat "READY_" "sleep 3; grep /srv /proc/mounts && hostname\r"
|
2024-04-04 00:17:36 +02:00
|
|
|
|
|
|
|
expect {
|
2024-04-15 23:15:27 +02:00
|
|
|
"inout" { }
|
2024-04-04 00:17:36 +02:00
|
|
|
timeout { exit 1 }
|
|
|
|
}
|