@@ -77,8 +77,17 @@ RebootConsoleRunTwoFiles() {
7777 return 1
7878 fi
7979 fi
80+ if [ ! -z " ${bitstream} " ]; then
81+ bitstreamfile=$( RemoteCommandOn ${HOST} " mktemp" )
82+ bitstreamflag=" --bitstream $bitstreamfile "
83+ if ! scp " ${bitstream} " " ${HOST} :${bitstreamfile} " ; then
84+ echo " Failed to copy bitstream file"
85+ RemoteCommandOn ${HOST} rm -f " ${kernelfile} " " ${rootserverfile} " " ${logfile} " " ${dtbfile} " " ${bitstreamfile} "
86+ return 1
87+ fi
88+ fi
8089
81- ssh -tt -oLogLevel=quiet ${HOST} " stty isig -echoctl -echo; /tftpboot/${machine} /reboot $linux $dtbflag -l '${logfile} ' -c '${completion} ' -t '${completion_timeout} ' -e '${errortxt} ' -k '${kernelfile} ' -u '${rootserverfile} ' ${ka_flag} "
90+ ssh -tt -oLogLevel=quiet ${HOST} " stty isig -echoctl -echo; /tftpboot/${machine} /reboot $linux $dtbflag $bitstreamflag -l '${logfile} ' -c '${completion} ' -t '${completion_timeout} ' -e '${errortxt} ' -k '${kernelfile} ' -u '${rootserverfile} ' ${ka_flag} "
8291 ret=$?
8392 if [ " ${output} " != " " ]; then
8493 scp " ${HOST} :${logfile} " " ${output} "
@@ -87,12 +96,15 @@ RebootConsoleRunTwoFiles() {
8796 if [ ! -z " ${dtb} " ]; then
8897 RemoteCommandOn ${HOST} rm -f " ${dtbfile} "
8998 fi
99+ if [ ! -z " ${bitstream} " ]; then
100+ RemoteCommandOn ${HOST} rm -f " ${bitstreamfile} "
101+ fi
90102 return $ret
91103 fi
92104 if [ " ${output} " = " " ]; then
93- " /tftpboot/${machine} /reboot" $linux $dtbflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -k " ${kernel} " -u " ${rootserver} " ${ka_flag}
105+ " /tftpboot/${machine} /reboot" $linux $dtbflag $bitstreamflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -k " ${kernel} " -u " ${rootserver} " ${ka_flag}
94106 else
95- " /tftpboot/${machine} /reboot" $linux $dtbflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -l " ${output} " -k " ${kernel} " -u " ${rootserver} " ${ka_flag}
107+ " /tftpboot/${machine} /reboot" $linux $dtbflag $bitstreamflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -l " ${output} " -k " ${kernel} " -u " ${rootserver} " ${ka_flag}
96108 fi
97109}
98110
@@ -106,6 +118,11 @@ RebootConsoleRunOneFile() {
106118 dtb=" $1 "
107119 shift
108120 }
121+ [ " $1 " = ' --bitstream' ] && {
122+ shift
123+ bitstream=" $1 "
124+ shift
125+ }
109126 completion=$1
110127 completion_timeout=$2
111128 errortxt=$3
@@ -134,13 +151,21 @@ RebootConsoleRunOneFile() {
134151 if [ ! -z " ${dtb} " ]; then
135152 dtbfile=$( RemoteCommandOn ${HOST} " mktemp" )
136153 dtbflag=" -b $dtbfile "
137- if ! scp " ${dtb} " " ${HOST} :${kernelfile } " ; then
154+ if ! scp " ${dtb} " " ${HOST} :${dtbfile } " ; then
138155 echo " Failed to copy dtb file"
139156 RemoteCommandOn ${HOST} rm -f " ${dtbfile} " " ${kernelfile} " " ${logfile} "
140157 fi
141158 fi
159+ if [ ! -z " ${bitstream} " ]; then
160+ bitstreamfile=$( RemoteCommandOn ${HOST} " mktemp" )
161+ bitstreamflag=" --bitstream $bitstreamfile "
162+ if ! scp " ${bitstream} " " ${HOST} :${bitstreamfile} " ; then
163+ echo " Failed to copy bitstream file"
164+ RemoteCommandOn ${HOST} rm -f " ${bitstreamfile} ${dtbfile} " " ${kernelfile} " " ${logfile} "
165+ fi
166+ fi
142167
143- ssh -tt -oLogLevel=quiet ${HOST} " stty isig -echoctl -echo; /tftpboot/${machine} /reboot $linux $dtbflag -l '${logfile} ' -c '${completion} ' -t '${completion_timeout} ' -e '${errortxt} ' -k '${kernelfile} ' ${ka_flag} "
168+ ssh -tt -oLogLevel=quiet ${HOST} " stty isig -echoctl -echo; /tftpboot/${machine} /reboot $linux $dtbflag $bitstreamflag -l '${logfile} ' -c '${completion} ' -t '${completion_timeout} ' -e '${errortxt} ' -k '${kernelfile} ' ${ka_flag} "
144169 ret=$?
145170 if [ " ${output} " != " " ]; then
146171 scp " ${HOST} :${logfile} " " ${output} "
@@ -149,11 +174,14 @@ RebootConsoleRunOneFile() {
149174 if [ ! -z " ${dtb} " ]; then
150175 RemoteCommandOn ${HOST} rm -f " ${dtbfile} "
151176 fi
177+ if [ ! -z " ${bitstream} " ]; then
178+ RemoteCommandOn ${HOST} rm -f " ${bitstreamfile} "
179+ fi
152180 return $ret
153181 fi
154182 if [ " ${output} " = " " ]; then
155- " /tftpboot/${machine} /reboot" $linux $dtbflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -k " ${kernel} " ${ka_flag}
183+ " /tftpboot/${machine} /reboot" $linux $dtbflag $bitstreamflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -k " ${kernel} " ${ka_flag}
156184 else
157- " /tftpboot/${machine} /reboot" $linux $dtbflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -l " ${output} " -k " ${kernel} " ${ka_flag}
185+ " /tftpboot/${machine} /reboot" $linux $dtbflag $bitstreamflag -t " ${completion_timeout} " -c " ${completion} " -e " ${errortxt} " -l " ${output} " -k " ${kernel} " ${ka_flag}
158186 fi
159187}
0 commit comments