Commit Graph

52 Commits

Author SHA1 Message Date
Ewout ter Hoeven
55390d273f Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00
Shane Smiskol
b745a14ff7 version.py: make function names more clear (#23216)
* rename a few version functions

* and is_prebuilt

* and some formatting 😊
2021-12-14 12:15:13 +01:00
Adeeb Shihadeh
c6d3306dbe updated: handle execptions while setting params 2021-12-10 22:49:32 -08:00
Adeeb Shihadeh
b79eaca18d updated: move update alerts out of thermald (#23028)
* updated: move update alerts out of thermald

* cleanup last update time

* set on startup
2021-12-04 22:15:55 -08:00
Mayfield
1aebe6ff6e ui: render markdown in release notes (#22754)
* convert release notes from markdown to html

* fall back to previous behavior if utf8 decoding or markdown parsing throws

* make simple markdown parser to avoid needing a library

* add unit test

* move markdown parser to common. add unit test

use `markdown-it-py` instead of `markdown` dependency for test comparison since it's already in Pipfile.lock

* test (almost) all release notes and add some extra html encoding

* update lock

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-04 16:12:39 +01:00
Adeeb Shihadeh
9ca16560e2 updated: add a few missing type hints 2021-10-25 15:58:26 -07:00
Adeeb Shihadeh
ed70c5aaf5 updated: add persistent param for build date (#22237) 2021-09-14 20:24:41 -07:00
Adeeb Shihadeh
b3705ede5e Unify neos/agnos updaters (#22109)
* start moving neos updater

* downloading

* ui

* move recovery

* resuming

* add verification

* fix up launch

* test

* update updater

* fix mypy

* fake updater

* review suggestions

* more tests

* abc

* update bin

* raise

Co-authored-by: Comma Device <device@comma.ai>
2021-09-10 17:03:54 -07:00
Adeeb Shihadeh
d4b4204233 updated: move final git reset before finalizing update (#22168) 2021-09-08 10:47:38 -07:00
Adeeb Shihadeh
da1aa27046 updated: log successful update swap (#22144) 2021-09-06 13:48:19 -07:00
Adeeb Shihadeh
3a7444250c fix crash due to permissions when clearing update staging dir (#21790) 2021-07-29 19:50:34 -07:00
Adeeb Shihadeh
a44072753d updated: clear overlay on exception (#21489) 2021-07-05 19:27:06 -07:00
Willem Melching
7c6bf89e04 tici: flash bootloader partitions from manifest (#21399)
* move swapping to python

* only create downloader if needed

* typo

* number

* add sanity check

* boot full check to test

* manifest is required argument

* implement full hash check

* off by one

* new manifest

* only write tag for system

* bump splash

* review comments part 1

* trigger update

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
2021-06-30 14:20:58 +02:00
Adeeb Shihadeh
49d96f0acc fixup release build (#21430)
* fixup release3 build

* works on pc

* install release3

* push dashcam

* only import on tici

Co-authored-by: Comma Device <device@comma.ai>
2021-06-28 14:30:44 -07:00
Willem Melching
715dbd4882 Revert "tici: always run updated (#21249)"
This reverts commit 4dfdf0e51d.
2021-06-14 12:38:33 +02:00
Adeeb Shihadeh
4dfdf0e51d tici: always run updated (#21249) 2021-06-12 22:23:39 -07:00
Adeeb Shihadeh
967489bdaa Revert "updated: fix surfacing exceptions and errors (#20754)"
This reverts commit 3c9e46d8a2.
2021-05-27 14:35:52 -07:00
Adeeb Shihadeh
3c9e46d8a2 updated: fix surfacing exceptions and errors (#20754)
* updated: fix surfacing exceptions and errors

* can't rely on that

* unused

* ugh pylint

* try this

* this makes pylint happy

Co-authored-by: Comma Device <device@comma.ai>
2021-04-26 20:58:21 -07:00
Willem Melching
ae094042ad add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
2021-04-07 15:36:37 +02:00
Adeeb Shihadeh
bcb6879199 updated: log git diff on overlay init (#20476)
* updated: log git diff on overlay init

* add git diff param

* params
2021-03-25 16:16:12 -07:00
Adeeb Shihadeh
6e101fd691 offroad alert for agnos update (#20270) 2021-03-07 15:37:09 -08:00
Adeeb Shihadeh
07ab081a42 oneplus cleanup (#20200)
* start cleanup

* cleanup camerad

* remove unused

* little more

Co-authored-by: Comma Device <device@comma.ai>
2021-03-01 17:14:03 -08:00
Adeeb Shihadeh
cfb0390183 move agnos manifest to selfdrive/hardware (#19889) 2021-01-30 18:31:28 -08:00
Adeeb Shihadeh
09ee2a8c51 fix updated bug that allows for mismatch openpilot/agnos (#19943) 2021-01-27 15:39:14 -08:00
Adeeb Shihadeh
b276881fcd agnos updater (#2600)
* agnos updater

* add manifest

* fix path

* get manifest from overlay

* update manifest

* remove merge markers

* add streaming decompressor

* dont need read all

* Unsparsify

* Fix output filename

* Optimization

* cleanup

* Small cleanup

* Read manifest from merged overlay

* Write hash at end of partition

* Sync before writing hash

* Write bytes in file

* add manifest with image sizes

* Fix manifest path

* File was closed already

* Format string

* Put raw hash

* Read hashes in launch script

* update launch script

* should be agnos version

* fix slot

* Make sure we clear the hash

* Verify partition size

* move updated

* Standalone flasher

* Don't rely on ordering

* Get path

* Debug log

* Download agnos

* Info is enough

* update manifest

* Remove f

* Check downloader return code

* Exit on wrong manifest

* Fix typos

* Set pythonpath before hardware init

* move agnos into hardware folder

* remove comments

* Fix abstractmethod

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-12-18 13:17:12 +01:00
Adeeb Shihadeh
40a4bd9fc7 disable updater for oneplus EONs 2020-12-17 12:20:07 -08:00
Adeeb Shihadeh
8674b023ba HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
2020-12-16 21:30:23 -08:00
Adeeb Shihadeh
238ac19ba9 remove fsck logging in updated 2020-12-14 10:51:03 -08:00
Adeeb Shihadeh
6a151dcd9c oneplus deprecation (#2748)
* oneplus deprecation

* lowercase

* too long

* no udpates
2020-12-12 12:51:12 -08:00
Adeeb Shihadeh
38ded9b1e7 Tici updated (#2126)
* run updated on tici

* do this for now

* two didn't like empty string

* fix permissions
2020-10-02 16:36:20 -07:00
Adeeb Shihadeh
2a2cfd6bb5 updated: remove old overlay init file 2020-09-29 21:26:27 -07:00
Adeeb Shihadeh
3f40a9ee75 updated: log git corruption (#2242)
* log git corruption

* better cloudlog
2020-09-29 12:08:55 -07:00
Adeeb Shihadeh
722a440eb6 Improved updater robustness (#2046)
* git ping

* cleanup overlay init

* separate update available check from fetch

* cleanup setting params

* only fetch neos update on android

* move that

* type hints

* lightweight update check with git ls-remote

* git fetch dry run

* cleanup
2020-09-22 12:09:41 -07:00
Greg Hogan
1e6c7c94e4 fix pylint errors 2020-09-03 18:46:13 -07:00
Adeeb Shihadeh
21a1792f89 remove dead code in updated 2020-08-17 16:21:55 -07:00
Adeeb Shihadeh
cb5a2996e7 NEOS background updater (#1892) 2020-08-12 11:39:21 -07:00
Adeeb Shihadeh
60e2267f02 fix linter 2020-08-11 20:37:51 -07:00
Adeeb Shihadeh
8e63f06540 Alert when updated consistently fails (#2013)
* alert when update fails more than 10 times

* bring over offroad alert refactor from other branch

* and we have tests

* use it in snapshot

* bump apk

* don't show exceptions on release branches

* only write when changed

* why does delete use so much cpu

* clean that up

* little more
2020-08-11 16:23:57 -07:00
Adeeb Shihadeh
fe18a014c7 Updater tests (#1974)
* refactor exit handling

* test update

* more reliable?

* better

* init git in CI

* testy tester

* CI should work

* test overlay reinit

* only one

* still need to fix loop test

* more patience

* more patience in CI

* no ping in CI

* this is cleaner

* need to run these in jenkins

* clean up

* run in jenkins

* fix test file path

* it's a git repo now

* no commit

* reinit

* remove duplicate

* why not git

* la

* git status

* pythonpath

* fix

* no CI fro now

* check overlay consistent

* more tests

* make more changes in the update commit

* sample

* no k
2020-08-06 21:49:05 -07:00
Adeeb Shihadeh
a115366ddd Improve update reliability and responsiveness (#1986)
* handle orphaned git lock

* trigger update after going offroad

* git ping
2020-08-06 12:49:11 -07:00
Adeeb Shihadeh
f61dcb6e12 Cleanup updated (#1981)
* remove dead code from updated

* no short

* simpler

* simplify that

* move that into the class

* little more
2020-08-05 13:29:03 -07:00
Adeeb Shihadeh
88c67e7e9f improve updated responsiveness (#1973) 2020-08-04 13:48:19 -07:00
Adeeb Shihadeh
62a94eb0cd fix blocking sleep in updated (#1860) 2020-07-12 01:46:18 -07:00
Jason Young
c43df81214 Make updated more resilient (#1853)
* Add sleep at updated startup

* Mitigate symlink-related FS damage
2020-07-10 07:41:26 -04:00
George Hotz
cb495bb8c9 Add an SSH param to disable updates (#1807)
* disable updates with optional param

* dont create the alert

* Revert "dont create the alert"

This reverts commit 7179a6c8b4b4656e0b203b5a590b33d3388aa9c9.

* keep alert, but allow engagement

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-07-01 14:26:35 -07:00
Adeeb
367155168a Update Flake8 config (#1624)
* update flake8 checks

* add E502

* no whitespace warnings

* fix violations

* no W391

Co-authored-by: Jason Young <jason@comma.ai>
2020-06-03 16:13:34 -07:00
Willem Melching
843a64c72f Make pylint more strict (#1626)
* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
2020-06-02 16:29:32 -07:00
Willem Melching
0418da517a updater read git config first (#1376) 2020-04-16 11:55:16 -07:00
Andy
54f34abdb3 Replace usages of datetime.now() with datetime.utcnow() (#1267) 2020-03-26 19:49:58 -07:00
Adeeb
e8cb6ea06a Abstract common events + event cleanup (#1129)
* too many if

* unused

* whitespace

* key

* sefldrive/car/*

* no more gctx

* lower

* start abstracting common events

* all cars

* start small

* all cars

* reverse gear

* wrongCarMode

* wrongGear

* espDisabled

* steerUnvailable

* make linter happy

* c isn't used

* fix esp_disabled in VW

* update ref

* more red

* more cleanup

* fix subaru

* update ref
2020-02-20 16:22:25 -08:00