-
Notifications
You must be signed in to change notification settings - Fork 4
/
remote_zram_swap.exp
35 lines (29 loc) · 1019 Bytes
/
remote_zram_swap.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
#!/usr/bin/expect --
set timeout -1
# Make a remote target host to use a zram block device as a swap device
#
# Internally, setting swap area as a zram block device is done via
# `scripts/zram_swap.sh` 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] < 6 } {
puts "usage: "
puts "expect remote_zram_swap.exp \\"
puts " <username> <target> <ssh port> <password> \\"
puts " <lazybox path> <zram swap size>"
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 zram_size [lindex $argv 5]
source "remote.tcl"
remote_sudocmd $username $target $ssh_port $password \
"cd $lbpath; ./scripts/zram_swap.sh $zram_size"
puts "\nremote_zram_swap.exp FINISHED"