Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
luv-test-manager: Reboot after tests complete
Browse files Browse the repository at this point in the history
For the purposes of wiring up LUV into an automated test environment,
it's handy to have the machine automatically reboot after a configurable
timeout period.

It's important that we don't synchronously wait for the reboot to occur
and continue to drop the user at a shell on the serial console,
otherwise we'll lose one of the most useful methods of debugging.

Read the timeout period, measured in seconds, from the EFI variable
named LuvTimeout with GUID 3b6bf55d-a6f6-45cf-9f7e-ebf3bdadf74e.

If the variable doesn't exist, use a default timeout value of 5 minutes.

The reboot functionality can be disabled by specifying the
"luv.noreboot" kernel command line parameter.

Acked-by: Ricardo Neri <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
  • Loading branch information
Matt Fleming committed Apr 14, 2015
1 parent 19534b7 commit 803a37e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions meta-luv/recipes-core/initscripts/initscripts/luv-test-manager
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,16 @@ grep -q luv.halt /proc/cmdline
if [ $? -ne 1 ]; then
halt -p
fi

REBOOT_TIMEOUT=$((5*60))

timeout_file="/sys/firmware/efi/efivars/LuvTimeout-3b6bf55d-a6f6-45cf-9f7e-ebf3bdadf74e"
[ -e ${timeout_file} ] && {
REBOOT_TIMEOUT=`hexdump -e '"%08u\n"' ${timeout_file} | tail -n1`
}

grep -q luv.noreboot /proc/cmdline
if [ $? -eq 1 ]; then
# Put reboot task into background and drop to a shell
$(sleep ${REBOOT_TIMEOUT} ; reboot)&
fi

0 comments on commit 803a37e

Please sign in to comment.