-
Notifications
You must be signed in to change notification settings - Fork 4
/
remote_set_kernel.exp
54 lines (47 loc) · 1.35 KB
/
remote_set_kernel.exp
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
#!/usr/bin/expect --
set timeout -1
# Set kernel of a remote target host as user specified
#
# Internally, kernel setting is done via `scripts/set_kernel/set_kernel.py` of
# lazybox. For the reason, lazybox should be installed on the remote target
# machine before execution of this program.
#
# Usage:
# expect remote_set_kernel.exp <username> <target> <ssh port> <password> \
# <lazybox path> <bootloader> \
# <kernel name> <kernel param>
if { [llength $argv] < 7 } {
puts "usage: "
puts "expect remote_set_kernel.exp \\"
puts " <username> <target> <ssh port> <password> \\"
puts " <lazybox path> <bootloader> \\"
puts " <kernel name> \[kernel param\]"
exit 1
}
set username [lindex $argv 0]
set target [lindex $argv 1]
set ssh_port [lindex $argv 2]
set password [lindex $argv 3]
set lbpath [lindex $argv 4]
set bootloader [lindex $argv 5]
set kern_name [lindex $argv 6]
set kern_param ""
if { [llength $argv] > 7 } {
set kern_param [lindex $argv 7]
}
source "remote.tcl"
remote_sudocmd $username $target $ssh_port $password \
"cd $lbpath; \
./scripts/set_kernel/set_kernel.py \
$bootloader $kern_name $kern_param; \
sync; \
reboot"
# wait 30 seconds for reboot
set count 30
puts "\nwait $count seconds for reboot"
while { $count > 0 } {
sleep 1
send_user "$count "
set count [expr $count - 1]
}
puts "\nremote_set_kernel.exp FINISHED"