Commit graph

22 commits

Author SHA1 Message Date
Caleb Connolly
dd28314ba2
postmarketos-initramfs: debug-shell 3.0 (MR 5000)
This incorprates the debug-shell functionality directly into the
initramfs, so it's no longer necessary to build and boot a custom
initramfs in order to debug your device.

Additionally, the behaviour of the debug-shell is entirely reworked, It
now creates an ACM serial gadget which can be accessed via any normal
terminal emulator (picocom, minicom, etc; or PuTTY on windows). Rather
than just invoking sh, the debug-shell now creates a respawning getty on
both the new virtual console and the active console (this will either be
the UART console or tty0/1).

It is necessary to spawn these shells via getty since the logging rework
means we can no longer assume that stdin/out/err reference a TTY.

In addition to the above, it is now possible to trigger a log dump by
holding volume up during boot. This can be useful for helping users
debug their devices if the issue doesn't result in a failure that can be
detected in the initramfs.

With these changes, the console-shell and debug-shell hook packages are
reduced to only adding the additional tools/features. console-shell is
still required for fbkeyboard, and debug-shell for the setup_usb_storage
tool.

Co-Developed-by: Clayton Craft <craftyguy@postmarketos.org>
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-18 12:35:05 -07:00
mae
25ad7892a1
main/postmarketos-mkinitfs-hook-debug-shell: Cleanup debug-shell telnet server (MR 5191)
Moved the cleanup code from initramfs
2024-06-04 20:46:50 +02:00
Caleb Connolly
57744b984e
postmarketos-initramfs: export logs on boot failure (MR 4646)
Currently, when postmarketOS fails to boot up, retrieving any
information necessary to root cause the issue is non-trivial, requiring
building a custom initramfs with debug-shell enabled and then manually
copying out data.

Let's improve the situation by exporting logs automatically on boot
failure. This is safer than just exposing a root shell but still
provides a whole lot of useful info that should make duplicating and
triaging issues much easier for developers.

This commit implements the functionality and includes some generally
useful data. We then generate a README and expose files for each command/log
as well as an archive that can be easily attached to a GitLab issue.

To help with triaging, also record the version of the postmarketos-initramfs
package and hash the init.sh and init_functions.sh files.

For testing purposes, you can trigger the log recovery mode on-time by
creating an empty file named ".pmos_export_logs" in the /boot partition.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2024-01-05 17:29:45 +00:00
Ion Agorria
1258df73d7
postmarketos-mkinitfs-hook-debug-shell: Add setup_usb_storage.sh (MR 4450) 2023-11-19 10:27:41 -08:00
Caleb Connolly
16bf9c9700
main/postmarketos-mkinitfs-hook-debug-shell: fixes (MR 4204)
Some change (I think some tools switching from the coreutils to busybox
versions?) subtly broke debug-shell behaviour. Try to fix it.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
[ci:skip-build]: already built successfully in CI
2023-09-08 17:15:05 +02:00
Luca Weiss
8cbd19f79d
main/postmarketos-mkinitfs-hook-debug-shell: fix launching telnet (MR 4350)
With the recent changes in commit 80fff9242, there's no longer an $IP
variable we can use. Use the same code as in init_functions.sh to get
the potentially customized IP address to use for telnet.
2023-08-27 19:19:28 +02:00
Luca Weiss
81fbe5a74e
main/postmarketos-mkinitfs-hook-debug-shell: add telnetd to initramfs files (MR 4237)
Since we've now finally removed telnetd from the main initramfs but we
still need telnetd for the debug-shell, add it to the files for that
hook.

Also make sure the list of files is sorted.
2023-07-08 19:06:33 +02:00
Luca Weiss
3b5e3cb66a
main/postmarketos-mkinitfs-hook-debug-shell: show Loading splash once done (MR 4212)
Since the original "Loading..." splash is being shown before the hooks
is being run, we should go back to the "Loading..." splash once we're
done in the hook.
2023-07-01 19:43:01 +02:00
Newbyte
0c043b055d
main/postmarketos-mkinitfs-hook-debug-shell: use source_deviceinfo from devicepkg-utils (MR 4129) 2023-06-03 17:44:25 +02:00
Pablo Correa Gómez
e192346cb4
main/postmarketos-mkinitfs-hook-debug-shell: use source_deviceinfo (MR 4037) 2023-04-26 18:13:52 +02:00
Clayton Craft
6778e7b10b
postmarketos-mkinitfs-hook-debug-shell: support new mkintifs paths (MR 3895) 2023-03-08 21:30:29 -08:00
Caleb Connolly
f54600e966 main/postmarketos-mkinitfs-hook-*: use pbsplash (MR 2878) 2023-02-18 01:40:28 +00:00
Johannes Marbach
bfb933dec1
main/postmarketos-mkinitfs-hook-debug-shell: add libinput utils (MR 3169)
This adds the libinput program to allow to debug libinput device handling.

[ci:skip-build] already built successfully in CI
2022-05-31 08:36:05 -07:00
Clayton Craft
6078e51757
main/postmarketos-mkinitfs-hook-debug: start unudhcpd (MR 2834)
this was missed when support for unudhcpd was merged earlier
2022-01-09 10:35:51 +01:00
Alexey Minnekhanov
81c47a0912
postmarketos-mkinitfs-hook-debug-shell: add debugfs mount (MR 2655)
Very helpful and useful for debugging issues.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
2021-11-06 19:05:45 +03:00
Alexey Min
b11e1f0e38
main/postmarketos-mkinitfs-hook-debug-shell: mount pstore (!921) 2020-02-04 11:19:41 +03:00
Daniele Debernardi
f5ef288dce
postmarketos-mkinitfs-hook-debug-shell: add reboot-mode (!492) 2019-07-13 14:05:00 +02:00
Daniele Debernardi
88abc21167
debug-shell: Skip fbsplash properly (!124)
The show_splash function called by the 20-debug-shell.sh script already
skips fbsplash when the device is configured to not use the framebuffer.
But the variable was not defined in the script. This is solved by
including the /etc/deviceinfo file.

Follow-up to !108, where this change got lost in the rebase.
2019-01-03 09:03:37 +01:00
Oliver Smith
a31244d28a Remove github.com references
* Travis and Coveralls badges
* aports: instead of <https://github.com/postmarketOS>, use
  <https://postmarketos.org>
* References to full URLs to issues and pull requests replaced with
  a hash and the number
* grsec check: simplify error message, remove link to github issue
  (nobody is using that anymore anyway)
2018-06-30 09:00:48 +02:00
Daniele Debernardi
5f6afd3b39 Add additional files into initramfs when debug-shell is installed (#1358) 2018-03-26 18:12:58 +00:00
Daniele Debernardi
7cb729cbe3 Include fbdebug tool in debug-shell hook (#1266) 2018-02-26 20:32:01 +00:00
drebrez
0c63ff041c Feature debug-shell (#1028)
* Changed usb-shell behavior, it wait for some user action before continue booting
* Rename usb-shell to debug-shell and changed port to 23
* Add `20-debug-shell.sh` script to static code analysis
* Enable eth0 interface in initramfs (qemu)
* Add additional script to run a shell in order to be able to kill it from a telnet session
2017-12-23 19:22:28 +00:00