Update README.md and HACK to match markdown.lint style

This commit is contained in:
Kate Hsuan 2025-01-07 14:24:23 +08:00
parent 9c3b678d7f
commit 2b371cc290
2 changed files with 38 additions and 43 deletions

17
HACKING
View file

@ -1,5 +1,4 @@
SCM
===
## SCM
- anonymous checkouts
@ -48,12 +47,12 @@ SCM
http://www.kernel.org/pub/software/scm/git/docs/
Committing code
===
## Committing code
- Commit messages should be of the form (the five lines between the
lines starting with ===)
```
=== begin example commit ===
short explanation of the commit
@ -61,7 +60,7 @@ Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too brief.
=== end example commit ===
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
@ -77,8 +76,7 @@ tracker reference if applicable) and so forth. Be concise but not too brief.
- When committing code on behalf of others use the --author option, e.g.
git commit -a --author "Joe Coder <joe@coder.org>"
Coding Style
===
## Coding Style
- Please follow the coding style already used.
@ -92,8 +90,7 @@ Coding Style
data). Avoiding heuristics is also important for security reasons;
if it looks funny, ignore it (or exit, or disconnect).
Testing
===
## Testing
Under Linux, with the umockdev package installed, you can run "make check"
in the root build directory to run an automated test suite.

64
README
View file

@ -1,50 +1,48 @@
===============
UPower
===============
# UPower
Requirements:
glib-2.0 >= 2.66.0
gio-2.0 >= 2.16.1
gudev-1.0 >= 235 (Linux)
libimobiledevice-1.0 >= 0.9.7 (optional)
polkit-gobject-1 >= 124
```
glib-2.0 >= 2.66.0
gio-2.0 >= 2.16.1
gudev-1.0 >= 235 (Linux)
libimobiledevice-1.0 >= 0.9.7 (optional)
polkit-gobject-1 >= 124
```
UPower is an abstraction for enumerating power devices,
listening to device events and querying history and statistics.
Any application or service on the system can access the
org.freedesktop.UPower service via the system message bus.
Debugging
---------
## Debugging
When doing bug reports, the following information can be useful:
* `grep . /sys/class/power_supply/*/*`:
This includes the current kernel view of all power supplies in the
system. It is always a good idea to include this information.
* `udevadm info -e`:
This shows the hardware configuration and is relevant when e.g. the
type of an external device is misdetected.
* `upower -d`:
Shows upower's view of the state
* `upower --monitor-detail`:
Dumps device information every time that a change happens. This helps
with debugging dynamic issues.
* `udevadm monitor`:
Dumps the udev/kernel reported hardware changes (and addition/removal).
This is helpful when debugging dynamic issues, in particular if it is
not clear whether the issue is coming from the kernel or upower.
- `grep . /sys/class/power_supply/*/*`:
This includes the current kernel view of all power supplies in the
system. It is always a good idea to include this information.
- `udevadm info -e`:
This shows the hardware configuration and is relevant when e.g. the
type of an external device is misdetected.
- `upower -d`:
Shows upower's view of the state
- `upower --monitor-detail`:
Dumps device information every time that a change happens. This helps
with debugging dynamic issues.
- `udevadm monitor`:
Dumps the udev/kernel reported hardware changes (and addition/removal).
This is helpful when debugging dynamic issues, in particular if it is
not clear whether the issue is coming from the kernel or upower.
In addition, it can also be useful to run upower in debug mode and post the
logs. There are two ways of doing so:
* Run upower daemon manually, you can do so using:
`sudo /usr/libexec/upowerd -rd`
* Modify the systemd service and restart. This is best done by:
1. `sudo systemctl edit upower.service`
2. Adding the two lines:
- Run upower daemon manually, you can do so using:
`sudo /usr/libexec/upowerd -rd`
- Modify the systemd service and restart. This is best done by:
1. `sudo systemctl edit upower.service`
2. Adding the two lines:
```
[Service]
Environment=G_MESSAGES_DEBUG=all
```
3. `sudo systemctl restart upower.service`
4. Grab logs using `journalctl -u upower.service` or similar
3. `sudo systemctl restart upower.service`
4. Grab logs using `journalctl -u upower.service` or similar