google / cro3 Goto Github PK
View Code? Open in Web Editor NEWAbstraction Layer of ChromiumOS development
Home Page: https://google.github.io/cro3/
License: BSD 3-Clause "New" or "Revised" License
Abstraction Layer of ChromiumOS development
Home Page: https://google.github.io/cro3/
License: BSD 3-Clause "New" or "Revised" License
When the --dut arg contains greater than or equal to 2 commas and has no brackets, we can assume that the address is a raw ipv6 address.
e.g. 2401:fa00:480:ee08:fae4:3bff:fe5b:1796 -> [2401:fa00:480:ee08:fae4:3bff:fe5b:1796]
Impl --skip-mirror-sync or --do-mirror-sync for lium sync
lium dut list --remove gets a DUT but it's not completed by bash-completion script.
Right now we can push an android prebuilt but not locally built, we should add this by adding a flag or subcommand
For some reasons, I had depot_tools modified (which I do not know where it came from).
This caused lium to crash on sync
.
Adding some printfs revealed that the variable repos
in repo_sync()
was empty. (Thanks @cynthia !)
So we should not do the following without checking that
let repos = repos[1..=repos.len() - 2].to_owned();
update chroot can fail with:
00:38:43.861: ERROR: Missing upgrade hook for version 222.
Chroot is too new. Consider running:
cros_sdk --replace
Detect the message and run cros_sdk --replace
automatically to fix the issue automatically
This will add some type safety here. A Display method can be added to convert to string easily.
Assignees: brandonpollack23
Labels:
It would be convenient if lium can boot into the other set of partition.
The proposal of this feature would be:
This is based on my own rustfmt.toml I usually use. I tend to set these for the following reasons:
imports_granularity = "Crate" # this combines a bunch of lines at the top, but it doesnt match google style so I removed it
tab_spaces = 2 # param lists and chained calls tend to be longer and more common in rust, I think this increases readability
fn_params_layout = "Tall" # this is way easier to read than non tall
format_strings = true
use_try_shorthand = true # replace any ugly try! macros with the pretty ?
wrap_comments = true
max_width = 100 # If we can do it in Java, we can do it in Rust
We can run a unit test with cros_run_unit_tests
which can seemlessly execute the unit test on a package.
lium sync --repo /work/chromiumos --version R106-15050.0.0 --force
Syncing /work/chromiumos to R106-15050.0.0 forcibly ...
Error: /work/chromiumos is not a cros directory nor an empty directory.
lium dut monitor
doesn't work because of connection (portforwarding) failure. (ssh_stdout was None
)
DUT Forward Addr IP Addr
Failed to reconnect: ssh_stdout was None
krane_HA1584S2 Reconnecting...
Since lium covers so many features and hard to sort the command/subcommand, it is helpful if it has an AI suggested or supported interactive mode. In this mode, user can ask lium how to do something in natural language.
$ lium bard
> what DUTs I have?
(lium): here are your DUTs
lazor_ABCDEFG ...
kaisa_ABCD123 ...
> I want to flash the latest test image on my lazor DUT.
(lium): I do flash the latest (R123-45678.0.0) test image on lazor_ABCDEFG
...
> Oh, I want to update the firmware on that DUT
(lium): I update the firmware on lazor_ABCDEFG
...
Right now, the default output for servo list
is JSON.
It would be nice if we didn't need to rely on arcane methods to massage the output into something usable. For example, here is how you get a list of the usb devices so that it can be processed by a shell script:
lium servo list | jq -r '.[] | map(.serial + ": " + .usb_sysfs_path)[]' \
| awk '{print $2 " " $1;}' | sort | tr -d ':'
Given that this is a CLI first, it'd make sense to make the default output pipe-processing friendly, and make JSON output an opt-in (as that would be more likely something that would be machine-processed).
As a user of lium, I want more structured logs so that I can filter by desired verbosity and it can integrate more effectively into the rest of the infra I'm used to.
the rust blessed tracing crate is the trait to go with here. Then we can pick a logger of our choice. env_logger and simple logger are pretty popular.
Currently, cargo run -- --help
outputs the following. We should do better.
Usage: lium <command> [<args>]
yet another wrapper for CrOS developers. For more information, see: https://chromium.googlesource.com/chromiumos/platform/dev-util/+/refs/heads/main/contrib/lium/ . For Googlers, see go/lium and go/lium-bug
Options:
--help display usage information
Commands:
arc DUT controller
build build a package
cl CL (Change List) helpers
chroot cros_sdk wrapper
config DUT controller
deploy cros deploy wrapper
dut DUT controller
flash Flash CrOS images
packages Tast test wrapper
servo DUT controller
setup DUT controller
sync smart repo sync wrapper
tast Tast test wrapper
version display version info
// TODO create an enum to represent board that can be converted to string (adds
Not showing progress on lium sync is not user friendly. display some progress to make it clear that it is not stuck but it is in progress...
Add --ab_update
option to the kernel package deploy.
libchrome is a core library of the ChromeOS, and it is frequently updated incompatible way. Thus the user deploy a different version of libchrome, the DUT can be easily bricked.
If lium deploy finds libchrome in the packages list, it can warn user that something like "This can brick the DUT, do you really want to deploy libchrome? [Yes/No]"
And it also recommend user to sync the DUT's image version to the local cros-sdk version.
As an internal lium user I want to be be able to create vms both locally and on acloud so that I can connect to a virtual dut that I created form within lium alone so that I can have a virtualized development workflow from within lium.
Add a feature to list known board (once it is used, it is registered) and complete it on the command line.
Maybe lium dut info
will also be able to add its board name to this boad list. But mostly, the name passed to the --board
option will be added if the command succeeded.
Currently, javascript files are generated on the developer side and checked in. This can make the code review confusing and against the best practices. Let's add GitHub actions to generate *.js files on the deployment of GitHub pages.
sometimes it fails to get macaddr (seems to be a timing issue). it should be fixed to improve reliability. also, if the macaddr is not set, it should report that.
We can query the synced version by portageq-${board} envvar PORTAGE_BINHOST.
This is good for synced up the DUT with currently checked out cros-sdk.
Tast test will accept -var
option to control test (e.g. mute the sound), so lium tast run
would be better to take an option string.
Add CODEOWNERS file for assigning reviewers automatically.
https://docs.github.com/ja/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
Given there is a script to get tast CI result, we can implement a wrapper to query the latest result and integrate it with other commands. e.g.
lium tast result --last-success --test ${TEST} --model ${MODEL}
b/271811998
default_ipv6_prefix will take any value - and happily generates non-compliant IPv6 addresses.
A common mistake is for users to put in prefixes like:
"default_ipv6_prefix": "aabb:ccdd:1122:3344"
When the expectation is
"default_ipv6_prefix": "aabb:ccdd:1122:3344:"
emphasis on the last colon. There should be some handling for problematic input like this.
(Let's set aside the minor quirk that the address that comes out of the example is probably non-compliant too.)
lium should be able to provide a list of packages which is available for build and deploy. Then we can avoid a tragedy of type miss of - and _!
When working with a stack of commits, I often have to format individual ones by doing git rebase -i, selecting the commit with bad formatting, running clang-format.py, git commit --amend for each commit with bad formatting.
It'd be nice to have lium format that just iterates over every commit in git rebase -i, runs clang-format.py, and git commit --amend the changes.
FYI: one-liner to apply cros format for every commit
git rebase --keep-base --exec 'git diff-tree --no-commit-id --name-only HEAD -r --relative . | xargs -I {} -- cros format {} && git commit --amend -a --no-edit'
make a wrapper for this:
# (in chroot)
sudo emerge -1 hdctools
sudo flashrom -p raiden_debug_spi:target=AP,serial=0780A02E-8C65B668 -r -i GBB:/tmp/gbb.bin
sudo futility gbb -s --flags=0x40b9 /tmp/gbb.bin /tmp/gbb2.bin
sudo flashrom -p raiden_debug_spi:target=AP,serial=0780A02E-8C65B668 -w -i GBB:/tmp/gbb2.bin --noverify-all
If we pass the packages list as positional argument, we can make it completable.
Let me explain more details.
The bash-completion is implemented by passing all available values to compgen and compgen filters the list using current argument as a prefix.
For example, if a command will get AAA BB BBC and CCC as an option, and if user inputs
command A[tab]
then, the completion script pass AAA BB BBC CCC to compgen. And compgen filters the list and returns only AAA.
If an option also takes AAA BB BBC CCC, same things happens.
But if the option takes a list of those, things become more complex. For example,
command --option "AAA BB[tab]
In this case, the completion script must pass a list of AAA AAA, AAA BB, AAA BBC and AAA CCC. And if
command --option "AAA BB [tab]
(there is a space separator after BB), then AAA BB AAA, AAA BB BB, AAA BB BBC and AAA BB CCC have to be passed. So it has to handle the space separators in the string in bash script. Also, if user add more options, the candidate list becomes longer.
But if we change don't use --option but just pass it as positional argument, we don't care about that.
command AAA BB [tab]
in any case, the completion script can pass AAA BB BBC CCC to compgen.
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.conf have enough info to determine an image to recover from a model name (first part of hwid), which is a best publicly available way.
to make it easy to use lium, without preparing Rust toolchain...
https://google.github.io/lium/servo_power_monitor/
Expected behavior: when a JSON file is dropped, the tool tip on the chart should disappear
Actual behavior: The tool tip was still visible
After we setup github actions we should move lium_update functionality for googlers into lium
While reviewing the PR on add --ab_update #46, I noticed cros-workon start
is called for the packages to be deployed. Is this necessary? I feel if we do things like cros-workon
behind the scene, that might be a source of confusion.
lium servo show --servo ${SERVO_SERIAL}
lium servo show --json --servo ${SERVO_SERIAL}
lium dut list --add
requires serial number to add a device to the local DUT list. But some devices don't have the serial number.
Use some hash (e.g. from IPv6 addr) number if the device has no serial number. (But warn user that this device name is local one)
Currently lium flash
uses "eve" for lookup the real version. But when user specify a board, it should use that board name for looking up real version. Certain boards may not have a specific version built.
This combination doesn't work
$ lium build --full --board arm64-generic
...
$ lium flash --board generic-arm64 --usb --use-local-image --version latest
Error message is something like,
ERROR: Locating image "xBuddy://local/generic-arm64/latest/test" failed. The path might not be valid or the image might not exist.
ERROR: To get the latest remote image, please run:
cros flash --board=None usb:// remote/latest
ERROR: cros flash failed before completing.
ERROR: Cannot locate image xBuddy://local/generic-arm64/latest/test: No builds found for generic-arm64. Did you run `cros build-image --board generic-arm64`?
ERROR: (Re-run with --debug for more details.)
lium build --full
may not build image?
alias configured in ssh_config should be honored when used in lium as network host name.
Low-level operations like reboot can be done via servo as well and we should support doing such kind of tasks via servo as well for making recovery easy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.