mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[fuchsia] Refactor fuchsia_ctl use to a function (#64736)
This commit is contained in:
parent
e825281745
commit
4a33ce7d53
@ -41,24 +41,31 @@ else
|
|||||||
echo "Connecting to device $device_name"
|
echo "Connecting to device $device_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Wrapper function to pass common args to fuchsia_ctl.
|
||||||
|
fuchsia_ctl() {
|
||||||
|
$script_dir/fuchsia_ctl -d $device_name \
|
||||||
|
--device-finder-path $script_dir/device-finder "$@"
|
||||||
|
}
|
||||||
|
|
||||||
reboot() {
|
reboot() {
|
||||||
$script_dir/fuchsia_ctl -d $device_name ssh \
|
echo "$(date) START:DEVICE_LOGS ------------------------------------------"
|
||||||
-c "log_listener --dump_logs yes --file /tmp/log.txt" \
|
fuchsia_ctl ssh \
|
||||||
--timeout-seconds $ssh_timeout_seconds \
|
--timeout-seconds $ssh_timeout_seconds \
|
||||||
--identity-file $pkey
|
--identity-file $pkey \
|
||||||
|
-c "log_listener --dump_logs yes --file /tmp/log.txt"
|
||||||
# As we are not using recipes we don't have a way to know the location
|
# As we are not using recipes we don't have a way to know the location
|
||||||
# to upload the log to isolated. We are saving the log to a file to avoid dart
|
# to upload the log to isolated. We are saving the log to a file to avoid dart
|
||||||
# hanging when running the process and then just using printing the content to
|
# hanging when running the process and then just using printing the content to
|
||||||
# the console.
|
# the console.
|
||||||
$script_dir/fuchsia_ctl -d $device_name ssh \
|
fuchsia_ctl ssh \
|
||||||
-c "cat /tmp/log.txt" \
|
|
||||||
--timeout-seconds $ssh_timeout_seconds \
|
--timeout-seconds $ssh_timeout_seconds \
|
||||||
--identity-file $pkey
|
--identity-file $pkey \
|
||||||
|
-c "cat /tmp/log.txt"
|
||||||
|
echo "$(date) END:DEVICE_LOGS ------------------------------------------"
|
||||||
echo "$(date) START:REBOOT ------------------------------------------"
|
echo "$(date) START:REBOOT ------------------------------------------"
|
||||||
# note: this will set an exit code of 255, which we can ignore.
|
# note: this will set an exit code of 255, which we can ignore.
|
||||||
$script_dir/fuchsia_ctl -d $device_name \
|
fuchsia_ctl ssh \
|
||||||
--device-finder-path $script_dir/device-finder \
|
--identity-file $pkey \
|
||||||
ssh --identity-file $pkey \
|
|
||||||
-c "dm reboot-recovery" || true
|
-c "dm reboot-recovery" || true
|
||||||
echo "$(date) END:REBOOT --------------------------------------------"
|
echo "$(date) END:REBOOT --------------------------------------------"
|
||||||
}
|
}
|
||||||
@ -67,13 +74,12 @@ trap reboot EXIT
|
|||||||
|
|
||||||
echo "$(date) START:PAVING ------------------------------------------"
|
echo "$(date) START:PAVING ------------------------------------------"
|
||||||
ssh-keygen -y -f $pkey > key.pub
|
ssh-keygen -y -f $pkey > key.pub
|
||||||
$script_dir/fuchsia_ctl -d $device_name pave -i $1 --public-key "key.pub"
|
fuchsia_ctl pave -i $1 --public-key "key.pub"
|
||||||
echo "$(date) END:PAVING --------------------------------------------"
|
echo "$(date) END:PAVING --------------------------------------------"
|
||||||
|
|
||||||
|
|
||||||
echo "$(date) START:PUSH_PACKAGES -------------------------------"
|
echo "$(date) START:PUSH_PACKAGES -------------------------------"
|
||||||
$script_dir/fuchsia_ctl push-packages \
|
fuchsia_ctl push-packages \
|
||||||
-d $device_name \
|
|
||||||
--identity-file $pkey \
|
--identity-file $pkey \
|
||||||
--repoArchive generic-x64.tar.gz \
|
--repoArchive generic-x64.tar.gz \
|
||||||
-p tiles -p tiles_ctl
|
-p tiles -p tiles_ctl
|
||||||
|
Loading…
Reference in New Issue
Block a user