Skip to content

Instantly share code, notes, and snippets.

@grahamc

grahamc/oeut.tcl Secret

Last active June 13, 2018 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/6102cf7acb8b631a65348c944e565a4a to your computer and use it in GitHub Desktop.
Save grahamc/6102cf7acb8b631a65348c944e565a4a to your computer and use it in GitHub Desktop.
set attempts 0
while true {
expect {
-i $console -exact "*NixOS - Default" {
# Fallback from the above, go down an entry
send -i $console -- \x1B\[B;
}
-i $console -exact "*NixOS - All configurations" {
# Enter the All configs menu when it is selected (*)
send -i $console "\n"
puts ">>> WOULD ENTER ALL CONFIGURATIONS"
}
-i $console -exact "NixOS - All configurations" {
# Fallback from the above, go down an entry
send -i $console -- \x1B\[A;
}
-i $console -exact "Configuration 2" {
puts ">>>> CONFIGURATION 2 LOOKS GOOD"
break
}
-i $console "NixOS Stage" {
puts "!!!!!!!! MISSED GRUB !!!!!!!"
exit 1
}
timeout {
# Zip up to the top/bottom/top to try again ...
for {set x 0} {$x<5} {incr x} {
after 100
send -i $console -- \x1B\[A;
}
for {set x 0} {$x<5} {incr x} {
after 100
send -i $console -- \x1B\[B;
}
for {set x 0} {$x<5} {incr x} {
after 100
send -i $console -- \x1B\[A;
}
for {set x 0} {$x<5} {incr x} {
after 100
send -i $console -- \x1B\[B;
}
if { $attempts > 1000 } {
puts "failed to find the Configuration 2 in the bootloader"
exit 1
}
incr attempts
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment