New issue
Advanced search Search tips

Issue 815399 link

Starred by 1 user

Issue metadata

Status: Unconfirmed
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Add firmware update support package for Goodix touchscreen devices

Reported by charles....@gmail.com, Feb 24 2018

Issue description

This is actually not a bug, but for tracking changes during add new package to support flash Goodix touchscreen devices.
 
Components: OS>Packages
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/8841bb3d396c14c9d3b910e5e76cb6bea41edf15

commit 8841bb3d396c14c9d3b910e5e76cb6bea41edf15
Author: Charles Wang <charles.goodix@gmail.com>
Date: Mon Apr 02 03:58:45 2018

gdixupdate: new package for updating Goodix's firmware

BUG=chromium:815399
TEST=Tested updating firmware on retrofitted Yoga 710

Change-Id: Idba8e3c6a5060a8489142b529ea0d65926194053
Reviewed-on: https://chromium-review.googlesource.com/936501
Commit-Ready: Charles Wang <charles.goodix@gmail.com>
Tested-by: Charles Wang <charles.goodix@gmail.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[add] https://crrev.com/8841bb3d396c14c9d3b910e5e76cb6bea41edf15/chromeos-base/gdix_hid_firmware_update/Manifest
[add] https://crrev.com/8841bb3d396c14c9d3b910e5e76cb6bea41edf15/chromeos-base/gdix_hid_firmware_update/gdix_hid_firmware_update-1.4.4.ebuild

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/255d99705df48a28bcc784b247b432f916422684

commit 255d99705df48a28bcc784b247b432f916422684
Author: Charles Wang <charles.goodix@gmail.com>
Date: Mon Apr 02 06:03:18 2018

Add goodix input device FW updater support

CQ-DEPEND=CL:948663
BUG=chromium:815399
TEST=Tested this policy on retrofitted Yoga 7

Change-Id: Ieb65c07a3d897fb53aa2170293b05e19d75a4c9f
Reviewed-on: https://chromium-review.googlesource.com/948582
Commit-Ready: Charles Wang <charles.goodix@gmail.com>
Tested-by: Charles Wang <charles.goodix@gmail.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>

[modify] https://crrev.com/255d99705df48a28bcc784b247b432f916422684/chromeos-base/touch_updater/touch_updater-9999.ebuild

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/touch_updater/+/40b339a4288aa9f60ffe63e63ce8a8ef50142ba4

commit 40b339a4288aa9f60ffe63e63ce8a8ef50142ba4
Author: Charles Wang <charles.goodix@gmail.com>
Date: Mon Apr 02 06:03:19 2018

Add Goodix touchscreen FW updater script

This CL adds touchscreen firmware updater script for Goodix touch
controller. This script read active firmware information form
/dev/hidrawX and compares it will the firmware on disk, if the product
id is equal and firmware version not equal than it will do firmware
update or roll back otherwise print the firmware info and exit.

CQ-DEPEND=CL:948582
BUG=chromium:815399
TEST=Tested on retrofitted device including a Goodix touchscreen with
i2c-hid driver.

Change-Id: I02af2208df36e51b93e207111e23814a1656f8f9
Reviewed-on: https://chromium-review.googlesource.com/948663
Commit-Ready: Charles Wang <charles.goodix@gmail.com>
Tested-by: Charles Wang <charles.goodix@gmail.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/40b339a4288aa9f60ffe63e63ce8a8ef50142ba4/scripts/chromeos-touch-update.sh
[add] https://crrev.com/40b339a4288aa9f60ffe63e63ce8a8ef50142ba4/scripts/chromeos-goodix-touch-firmware-update.sh
[add] https://crrev.com/40b339a4288aa9f60ffe63e63ce8a8ef50142ba4/policies/amd64/gdixupdate.query.policy
[add] https://crrev.com/40b339a4288aa9f60ffe63e63ce8a8ef50142ba4/policies/amd64/gdixupdate.update.policy

About run the update scripts with non-root user:
Fisrt you should do `chmod` and `chown` to give the user proper access to the
following files.
 - /dev/hidrawX   //This node is used for read/write data form IC.
 - gdixupdate.query.policy //seccomp policy file for query firmware version info
 - gdixupdate.update.policy  //seccomp policy file for do firmware update
 - <product_id>_<firmware_version>.bin   // firmware binary file

Second run the script under minijail:
 # minijail0 -u <user> -S gdixupdate.<query/update>.policy <update command>
 If you run minijail with -u option,you must add this two system call to the
seccomp policy file `setresuid: 1` and `setgroups: 1`, there are used by minijail when change users and groups.
 
 Or you may just run the minijail with non-root user, and if so, you will need add -U -m opthions, just like this.
 $ minijail0 -U -m gdixupdate.<query/update>.policy <update command>

Please note the difference between '#' and '$' in the command line. '#' represent root user and '$' for non-root user.

Comment 6 by vapier@chromium.org, Apr 26 2018

for more details on sandboxing, check out this doc:
  https://chromium.googlesource.com/chromiumos/docs/+/master/sandboxing.md

the current updater uses seccomp nicely:
  https://chromium-review.googlesource.com/948663
Project Member

Comment 7 by bugdroid1@chromium.org, May 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/eclass-overlay/+/957f992fc9b90765f74d3312664a9ac2de980596

commit 957f992fc9b90765f74d3312664a9ac2de980596
Author: Charles Wang <charles.goodix@gmail.com>
Date: Fri May 04 07:13:54 2018

Add goodixfwupdate user/group to accounts database

This user/group is responsible for Goodix touch controllers
firmware update.

BUG=chromium:815399
TEST=Tested on a retrofitted Yoga 710

Change-Id: Ib2cd7220cbc95351c4c851087929f5ad1589ff02
Reviewed-on: https://chromium-review.googlesource.com/1034172
Commit-Ready: Charles Wang <charles.goodix@gmail.com>
Tested-by: Charles Wang <charles.goodix@gmail.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>

[add] https://crrev.com/957f992fc9b90765f74d3312664a9ac2de980596/profiles/base/accounts/user/goodixfwupdate
[add] https://crrev.com/957f992fc9b90765f74d3312664a9ac2de980596/profiles/base/accounts/group/goodixfwupdate

Project Member

Comment 8 by bugdroid1@chromium.org, May 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/touch_updater/+/a4eca6b5591a14c9a5e5c2c371daffe18f190cc0

commit a4eca6b5591a14c9a5e5c2c371daffe18f190cc0
Author: Charles Wang <charles.goodix@gmail.com>
Date: Thu May 10 09:27:08 2018

Run the updater with dedicated user/group

Let the firmware updater run with user and group 'goodixfwupdate'
to reduce safety risks. And before run the jail use chown/chmod
give access to necessary device nodes.

BUG=chromium:815399
TEST=Tested with retrofitted Yoga 710.
CQ-DEPEND=CL:1034172

Change-Id: Iaaeb6830571f83bc0f56ec6419b259b88fa407bc
Reviewed-on: https://chromium-review.googlesource.com/1034041
Commit-Ready: Charles Wang <charles.goodix@gmail.com>
Tested-by: Charles Wang <charles.goodix@gmail.com>
Reviewed-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>

[modify] https://crrev.com/a4eca6b5591a14c9a5e5c2c371daffe18f190cc0/scripts/chromeos-goodix-touch-firmware-update.sh
[modify] https://crrev.com/a4eca6b5591a14c9a5e5c2c371daffe18f190cc0/policies/amd64/gdixupdate.query.policy
[modify] https://crrev.com/a4eca6b5591a14c9a5e5c2c371daffe18f190cc0/policies/amd64/gdixupdate.update.policy

Add support for Goodix Touchpad device.

Sign in to add a comment