Retracing crashes from Ubuntu 24.04 (noble) can fail with (test case
`test_retrace_system_sandbox_gdb_sandbox`):
```
ERROR: [Errno 2] No such file or directory: '/tmp/apport_sandbox_8s5bjkjo/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2'
```
Let `subprocess.run` find the correct path to `ld-linux-x86-64.so.2` by
letting it search through all library paths.
Add system tests for apport-retrace: One set of tests for retracing the
same release and one set of tests for retracing crashes of a different
release (in this case jammy).
whoopsie-upload-all: exit with 0 if whoopsie is disabled
`apport-autoreport.service` fails if auto-reporting is disabled:
```
$ systemctl status apport-autoreport.service
× apport-autoreport.service - Process error reports when automatic reporting is enabled
Loaded: loaded (/usr/lib/systemd/system/apport-autoreport.service; static)
Active: failed (Result: exit-code) since Thu 2024-06-13 21:55:08 CEST; 1h 9min ago
TriggeredBy: ● apport-autoreport.timer
● apport-autoreport.path
Process: 1059564 ExecStart=/usr/share/apport/whoopsie-upload-all --timeout 20 (code=exited, status=1/FAILURE)
Main PID: 1059564 (code=exited, status=1/FAILURE)
CPU: 86ms
Jun 13 21:55:08 host systemd[1]: Starting apport-autoreport.service - Process error reports when automatic reporting is enabled...
Jun 13 21:55:08 host whoopsie-upload-all[1059564]: ERROR: whoopsie.path is not enabled
Jun 13 21:55:08 host systemd[1]: apport-autoreport.service: Main process exited, code=exited, status=1/FAILURE
Jun 13 21:55:08 host systemd[1]: apport-autoreport.service: Failed with result 'exit-code'.
Jun 13 21:55:08 host systemd[1]: Failed to start apport-autoreport.service - Process error reports when automatic reporting is enabled.
```
Change the log message to info level and exit with 0 in that case.
In case `/var/crash` exists, let `apport --start` not modify the
permission of the directory. Otherwise the permission might be changed
to an unwanted mode (see discussion in the linked bug).
Create `/var/crash` with mode 3777 instead of 1777 to have the `setgid`
permission set. The `setgid` permission causes crash files created in
`/var/crash` to inherit its group ownership.
The subiquity package hook relies on parsing the version information out
of one of the log files. The contents of this file are only available if
the permission elevation prompt works. Change to conditionally update
the version only if the log contents were retrieve successfully.
Change the get_revision logic to accept the contents of the log
instead of reading it directly. This way we don't have to do a
permissions prompt just to get the revision information.