powerd should read a directory for lockfiles |
||
Issue descriptionpowerd currently has a hardcoded list of lockfiles (generally written by firmware-updating tools) to check before it tries to suspend or shut down the system. It'd be cleaner to just check a directory for files; then powerd won't need to be updated whenever another updater is added. (from discussion on https://crrev.com/c/756333)
,
Nov 25 2017
I'll keep this open to track updating existing programs to write to the directory.
,
Dec 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/131afcd81abb60720aaaa39bbeb7861373da8d0a commit 131afcd81abb60720aaaa39bbeb7861373da8d0a Author: Daniel Erat <derat@chromium.org> Date: Thu Dec 07 04:24:12 2017 ec: Create lockfile in /run/lock/power_override. Create a lockfile at /run/lock/power_override/battery_tool.lock rather than /run/lock/battery_tool_powerd.lock so that powerd doesn't need to special-case the file's path. BUG= chromium:784651 BRANCH=None TEST=None Change-Id: I151cf26d635dc969d113e9d80c93177985a7ab2f Signed-off-by: Daniel Erat <derat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/809921 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org> [modify] https://crrev.com/131afcd81abb60720aaaa39bbeb7861373da8d0a/util/powerd_lock.c
,
Feb 3 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/3b510d3800b083ba96ad8e6568d8ec22fe8bed58 commit 3b510d3800b083ba96ad8e6568d8ec22fe8bed58 Author: Daniel Erat <derat@chromium.org> Date: Sat Feb 03 10:37:54 2018 init/power: Create power override dir in chromeos_startup. Create /run/lock/power_override in the chromeos_startup script rather than in the powerd job's pre-start stanza. This directory should exist if flashrom runs early in the boot process before powerd has started. BUG= chromium:784651 TEST=manual: verified that lockfiles can be created from within chromeos_startup Change-Id: Icdc2983707c19480abbde020276c0e2b4ec2e958 Reviewed-on: https://chromium-review.googlesource.com/886831 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/3b510d3800b083ba96ad8e6568d8ec22fe8bed58/power_manager/init/shared/powerd-pre-start.sh [modify] https://crrev.com/3b510d3800b083ba96ad8e6568d8ec22fe8bed58/init/chromeos_startup [modify] https://crrev.com/3b510d3800b083ba96ad8e6568d8ec22fe8bed58/power_manager/init/systemd/powerd_directories.conf
,
Feb 3 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/4166d34d881200733da1ac8b04fb1d12f7b180de commit 4166d34d881200733da1ac8b04fb1d12f7b180de Author: Daniel Erat <derat@chromium.org> Date: Sat Feb 03 10:37:54 2018 flashrom: Move lock file to /run/lock/power_override. Make flashrom create a lockfile at /run/lock/power_override/flashrom.lock rather than /run/lock/flashrom_powerd.lock so that powerd doesn't need to special-case the file's location. BUG= chromium:784651 BRANCH=None CQ-DEPEND=Icdc2983707c19480abbde020276c0e2b4ec2e958 TEST=ran "flashrom -w <file>" and verified that lockfile was created at /run/lock/power_override/flashrom.lock, then moved the power_override dir away and checked that flashrom doesn't log an error Change-Id: I5b85e13c3a71ab33a08add33c2b815d6bfd49208 Signed-off-by: Daniel Erat <derat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/809853 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/4166d34d881200733da1ac8b04fb1d12f7b180de/power.c
,
Feb 4 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/42fa285ca02fdd6acdae1de40b5e0d78d06d4cf0 commit 42fa285ca02fdd6acdae1de40b5e0d78d06d4cf0 Author: Daniel Erat <derat@chromium.org> Date: Sun Feb 04 15:31:55 2018 autotest: Update path in power_DeferForFlashrom. Make the power_DeferForFlashrom watch for the updated /run/lock/power_override/flashrom.lock lockfile written by flashrom. BUG= chromium:784651 TEST=none TBR=hungte@chromium.org Change-Id: I7eae253c5f894156b1b27d6c09f0821a0192c42b Reviewed-on: https://chromium-review.googlesource.com/900553 Reviewed-by: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> [modify] https://crrev.com/42fa285ca02fdd6acdae1de40b5e0d78d06d4cf0/server/site_tests/power_DeferForFlashrom/power_DeferForFlashrom.py
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/d6fca5dd1937a187e6d71b350b6c0f760be7862d commit d6fca5dd1937a187e6d71b350b6c0f760be7862d Author: Daniel Erat <derat@chromium.org> Date: Tue Feb 06 03:09:05 2018 flashrom: Retain support for /run/lock/flashrom_powerd.lock. Make flashrom fall back to creating a lock file at /run/lock/flashrom_powerd.lock if /run/lock/power_override doesn't exist. This is needed to support the case during system updates where a recent version of flashrom is running on an old system image. BUG= chromium:784651 BRANCH=None TEST=manual: "flashrom -w" creates a file in /run/lock/power_override if it exists or at /run/lock/flashrom_powerd.lock otherwise Change-Id: Ia3bba0a01f40f5245c4b667de1ca638febe48acc Signed-off-by: Daniel Erat <derat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/902169 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> [modify] https://crrev.com/d6fca5dd1937a187e6d71b350b6c0f760be7862d/power.c
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/a7cfbed63756215cc555640d8ad6278d99025173 commit a7cfbed63756215cc555640d8ad6278d99025173 Author: Daniel Erat <derat@chromium.org> Date: Tue Feb 06 03:09:04 2018 power: Stop checking for one-off lockfiles. Make powerd stop checking for lockfiles at /run/lock/flashrom_powerd.lock and /run/lock/battery_tool_powerd.lock. These are created in the /run/lock/power_override directory now. BUG= chromium:784651 TEST=unit tests pass; no remaining references to old files in codebase Change-Id: Ia6492683eb279454e88971aa9832b7ea00117233 Reviewed-on: https://chromium-review.googlesource.com/900554 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Eric Caruso <ejcaruso@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/a7cfbed63756215cc555640d8ad6278d99025173/power_manager/powerd/daemon.cc [modify] https://crrev.com/a7cfbed63756215cc555640d8ad6278d99025173/power_manager/docs/suspend_resume.md
,
Feb 6 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Nov 25 2017