diff --git a/checkbox-snap/common_series_uc/config_vars b/checkbox-snap/common_series_uc/config_vars index b6596b3bfe..3a4a17bf02 100644 --- a/checkbox-snap/common_series_uc/config_vars +++ b/checkbox-snap/common_series_uc/config_vars @@ -36,3 +36,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 \ No newline at end of file diff --git a/checkbox-snap/series_classic16/config_vars b/checkbox-snap/series_classic16/config_vars index b3133d6dc4..87eb8225e0 100644 --- a/checkbox-snap/series_classic16/config_vars +++ b/checkbox-snap/series_classic16/config_vars @@ -28,3 +28,4 @@ STRESS_S3_WAIT_DELAY=120 STRESS_BOOT_WAIT_DELAY=120 WIFI_AP_SETUPTIME=30 WWAN_SETUPTIME=30 +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/checkbox-snap/series_classic18/config_vars b/checkbox-snap/series_classic18/config_vars index 51b497d030..b57a9f917a 100644 --- a/checkbox-snap/series_classic18/config_vars +++ b/checkbox-snap/series_classic18/config_vars @@ -31,3 +31,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/checkbox-snap/series_classic20/config_vars b/checkbox-snap/series_classic20/config_vars index 484b1512d8..061843678c 100644 --- a/checkbox-snap/series_classic20/config_vars +++ b/checkbox-snap/series_classic20/config_vars @@ -35,3 +35,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/checkbox-snap/series_classic22/config_vars b/checkbox-snap/series_classic22/config_vars index b6596b3bfe..0ff12cd656 100644 --- a/checkbox-snap/series_classic22/config_vars +++ b/checkbox-snap/series_classic22/config_vars @@ -36,3 +36,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/checkbox-snap/series_classic24/config_vars b/checkbox-snap/series_classic24/config_vars index b6596b3bfe..0ff12cd656 100644 --- a/checkbox-snap/series_classic24/config_vars +++ b/checkbox-snap/series_classic24/config_vars @@ -36,3 +36,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/checkbox-snap/series_uc24/config_vars b/checkbox-snap/series_uc24/config_vars index b6596b3bfe..3a4a17bf02 100644 --- a/checkbox-snap/series_uc24/config_vars +++ b/checkbox-snap/series_uc24/config_vars @@ -36,3 +36,4 @@ WWAN_SETUPTIME=30 TPM2TOOLS_TCTI_NAME=device TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed +RTC_DEVICE_FILE=/dev/rtc0 \ No newline at end of file diff --git a/contrib/checkbox-ce-oem/README.md b/contrib/checkbox-ce-oem/README.md index 590588ace0..363459477e 100644 --- a/contrib/checkbox-ce-oem/README.md +++ b/contrib/checkbox-ce-oem/README.md @@ -63,6 +63,7 @@ WWAN_APN=internet WWAN_CONTROL_IF=ttyACM3 WWAN_NET_IF=ppp0 WWAN_SETUPTIME=30 +RTC_DEVICE_FILE=/dev/rtc0 # modify checkbox configuration $ sudo checkbox-ce-oem.configure WIFI_AP_SETUPTIME=50 ``` diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic20/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic20/config/config_vars index 0774b445b4..63d48eda74 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic20/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic20/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic22/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic22/config/config_vars index 22488acbf3..1e6bd45793 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic22/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic22/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 \ No newline at end of file diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic24/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic24/config/config_vars index 22488acbf3..a8ac47c2f3 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic24/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic24/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc20/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc20/config/config_vars index 22488acbf3..a8ac47c2f3 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc20/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc20/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc22/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc22/config/config_vars index 22488acbf3..a8ac47c2f3 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc22/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc22/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc24/config/config_vars b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc24/config/config_vars index 22488acbf3..a8ac47c2f3 100644 --- a/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc24/config/config_vars +++ b/contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_uc24/config/config_vars @@ -39,3 +39,4 @@ TPM2TOOLS_DEVICE_FILE=/dev/tpm0 MODEL_GRADE=signed WATCHDOG_TYPE=wdat_wdt WATCHDOG_IDENTITY=wdat_wdt +RTC_DEVICE_FILE=/dev/rtc0 diff --git a/providers/base/bin/suspend.sh b/providers/base/bin/suspend.sh index 6adba4981c..aa2517896e 100755 --- a/providers/base/bin/suspend.sh +++ b/providers/base/bin/suspend.sh @@ -10,6 +10,6 @@ if [ "$architecture" = "x86_64" ] || [ "$architecture" = "i386" ]; then checkbox-support-fwts_test -f none -s s3 --s3-device-check --s3-device-check-delay="${STRESS_S3_WAIT_DELAY:-45}" --s3-sleep-delay="${STRESS_S3_SLEEP_DELAY:-30}" rm /tmp/fwts_results.log else - rtcwake -v -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}" + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}" fi diff --git a/providers/base/units/power-management/jobs.pxu b/providers/base/units/power-management/jobs.pxu index b37ad4232c..06491543cd 100644 --- a/providers/base/units/power-management/jobs.pxu +++ b/providers/base/units/power-management/jobs.pxu @@ -394,14 +394,14 @@ requires: rtc.state == 'supported' rtc.wakealarm == 'supported' command: - rtcwake --mode no -s "${COLD_REBOOT_DELAY:-120}" + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" --mode no -s "${COLD_REBOOT_DELAY:-120}" sleep 5 - rtcwake -m show + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m show sleep 5 dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true user: root flags: preserve-locale noreturn autorestart -environ: COLD_REBOOT_DELAY +environ: COLD_REBOOT_DELAY RTC_DEVICE_FILE estimated_duration: 300 id: power-management/post-cold-reboot diff --git a/providers/base/units/rtc/jobs.pxu b/providers/base/units/rtc/jobs.pxu index a5874839ec..5cab4f5be0 100644 --- a/providers/base/units/rtc/jobs.pxu +++ b/providers/base/units/rtc/jobs.pxu @@ -6,9 +6,10 @@ _steps: 1. Start the test to power off the system (wakeup scheduled in 30s). _verification: RTC can wake up the system successfully. + environ: RTC_DEVICE_FILE command: - rtcwake -v -m disable - rtcwake -v -m off -s 30 + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m disable + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m off -s 30 plugin: user-interact user: root category_id: rtc_category diff --git a/providers/base/units/stress/boot.pxu b/providers/base/units/stress/boot.pxu index 077f9448b5..9f37184c31 100644 --- a/providers/base/units/stress/boot.pxu +++ b/providers/base/units/stress/boot.pxu @@ -53,8 +53,9 @@ _summary: Perform cold reboot 1 _description: Enter sleep mode after a configurable delay. unit: job plugin: shell -environ: STRESS_BOOT_WAKEUP_DELAY -command: rtcwake --mode off -s "${STRESS_BOOT_WAKEUP_DELAY:-120}" +environ: STRESS_BOOT_WAKEUP_DELAY RTC_DEVICE_FILE +command: + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" --mode off -s "${STRESS_BOOT_WAKEUP_DELAY:-120}" user: root flags: preserve-locale noreturn autorestart estimated_duration: 180.0 @@ -70,10 +71,10 @@ unit: template template-resource: reboot-run-generator template-unit: job plugin: shell -environ: STRESS_BOOT_WAKEUP_DELAY STRESS_BOOT_WAIT_DELAY +environ: STRESS_BOOT_WAKEUP_DELAY STRESS_BOOT_WAIT_DELAY RTC_DEVICE_FILE command: sleep "${{STRESS_BOOT_WAIT_DELAY:-120}}" - rtcwake --mode off -s "${{STRESS_BOOT_WAKEUP_DELAY:-120}}" + rtcwake -v -d "${{RTC_DEVICE_FILE:-rtc0}}" --mode off -s "${{STRESS_BOOT_WAKEUP_DELAY:-120}}" user: root flags: preserve-locale noreturn autorestart estimated_duration: 180.0 diff --git a/providers/base/units/stress/s3s4.pxu b/providers/base/units/stress/s3s4.pxu index 841f32aa0a..d4b617fbcf 100644 --- a/providers/base/units/stress/s3s4.pxu +++ b/providers/base/units/stress/s3s4.pxu @@ -58,7 +58,7 @@ requires: sleep.mem == 'supported' rtc.state == 'supported' estimated_duration: 2400.0 -environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH +environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH RTC_DEVICE_FILE user: root command: {%- if fwts == "supported" %} @@ -68,7 +68,7 @@ command: for i in {1..{{ s3_iterations }}}; do echo "Iteration $i" - rtcwake -v -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}" + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}" done {% endif -%} _purpose: diff --git a/providers/base/units/stress/suspend_cycles_reboot.pxu b/providers/base/units/stress/suspend_cycles_reboot.pxu index 58c1393a44..732fc49d50 100644 --- a/providers/base/units/stress/suspend_cycles_reboot.pxu +++ b/providers/base/units/stress/suspend_cycles_reboot.pxu @@ -76,7 +76,7 @@ requires: sleep.mem == 'supported' rtc.state == 'supported' estimated_duration: 75.0 -environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH +environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH RTC_DEVICE_FILE user: root command: suspend.sh 2>&1 | tee -a "$PLAINBOX_SESSION_SHARE"/suspend_cycles_with_reboot_total.log @@ -100,7 +100,7 @@ requires: sleep.mem == 'supported' rtc.state == 'supported' estimated_duration: 75.0 -environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH +environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH RTC_DEVICE_FILE after: stress-tests/suspend_cycles_reboot{{suspend_reboot_previous}} user: root command: diff --git a/providers/genio/units/thermal/jobs.pxu b/providers/genio/units/thermal/jobs.pxu index 1e71a7d972..ad607540b7 100644 --- a/providers/genio/units/thermal/jobs.pxu +++ b/providers/genio/units/thermal/jobs.pxu @@ -6,7 +6,7 @@ flags: preserve-locale noreturn autorestart also-after-suspend user: root plugin: shell estimated_duration: 60 -environ: PLAINBOX_SESSION_SHARE +environ: PLAINBOX_SESSION_SHARE RTC_DEVICE_FILE command: # Clean up if [ -f "$PLAINBOX_SESSION_SHARE/thermal-is-malfunction" ]; then @@ -14,7 +14,7 @@ command: fi # Feed the super high temperature to the emul_temp of thermal_zone0 # to make thermal shuts system down and rtcwake will wake system up. - rtcwake -v -m no -s 60 + rtcwake -v -d "${RTC_DEVICE_FILE:-rtc0}" -m no -s 60 echo 999999 > /sys/class/thermal/thermal_zone0/emul_temp # If thermal's protection mechanism doesn't work, reboot the system # to prevent Checkbox stucks here due to noreturn flag