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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/usr/bin/expect --
###############################################################################
# Written by Chris Dunlap <cdunlap@llnl.gov>.
# Copyright (C) 2007-2022 Lawrence Livermore National Security, LLC.
# Copyright (C) 2001-2007 The Regents of the University of California.
# UCRL-CODE-2002-009.
#
# This file is part of ConMan: The Console Manager.
# For details, see <https://dun.github.io/conman/>.
###############################################################################
set env(PATH) "/bin:/usr/bin:/usr/local/bin"
source /usr/share/conman/lib/conman.exp
source /usr/share/conman/lib/alpha.exp
log_user 0
proc pre_boot_alpha {spawn_id output_id console} {
exec powerman -r $console
if {! [alpha_is_at_srm $spawn_id $output_id $console 150]} {
return 0
}
set cmds [list \
{set boot_osflags "ip=dhcp root=/dev/nfs console=ttyS0,19200"} \
{set eib0_mode Auto-Negotiate} \
{set eib0_protocols BOOTP} \
{set boot_reset OFF} \
{set auto_action halt} \
{set bootdef_dev eib0} \
]
foreach cmd $cmds {
alpha_do_srm_cmd $spawn_id $output_id $console 0 $cmd
}
return 1
}
proc boot_alpha {spawn_id output_id console} {
send_user "Booting $console.\n"
alpha_do_srm_cmd $spawn_id $output_id $console 0 "boot" 60
return 1
}
set consoles [conman_query $argv]
set n [llength $consoles]
if {$n == 0} {
send_error "Found no matching consoles.\n"
exit 1
} elseif {$n == 1} {
send_user "Resetting console [lindex $consoles 0].\n"
} else {
send_user "Resetting $n consoles.\n"
}
conman_run 128 "-j $argv" pre_boot_alpha
conman_run 4 "-j $argv" boot_alpha
exit 0
|