mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 18:11:05 +00:00
The switch to PID namespaces inside the chroot broke flash_ec's ability to detect (and then kill) other processes that use the EC serial PTY (leading to potential flashing failures). After a long discussion we decided that users who need features like this should be forced to run their chroot without PID namespacing (using cros_sdk --no-ns-pid). This patch adds a hard check for this to flash_ec, so that using it in an unsafe way becomes impossible. In addition, this ports the more advanced SIGSTOP/SIGCONT logic to flash_ec that was pioneered in fwgdb. With this, other processes accessing that PTY will just freeze and become available again after flash_ec finished. BRANCH=none BUG=chromium:444931 TEST=Ran on a Jerry with and without --no-ns-pid, with and without an open EC terminal, all results as expected. Change-Id: I45ffc3ec6cfe9c25a0b82b4d5288a41485c326c4 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/249835 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>