57744b984e
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>
25 lines
1.2 KiB
Text
25 lines
1.2 KiB
Text
pkgname=postmarketos-mkinitfs-hook-debug-shell
|
|
pkgver=0.6.0
|
|
pkgrel=0
|
|
pkgdesc="Root shell in the initramfs (security hole, for debugging only)"
|
|
url="https://postmarketos.org"
|
|
depends="postmarketos-mkinitfs devicepkg-utils fbdebug evtest linuxconsoletools reboot-mode libinput libinput-tools"
|
|
source="20-debug-shell.sh 20-debug-shell.files setup_usb_storage.sh"
|
|
arch="noarch"
|
|
license="GPL2"
|
|
options="!check"
|
|
|
|
package() {
|
|
install -Dm644 "$srcdir"/20-debug-shell.sh \
|
|
"$pkgdir"/usr/share/mkinitfs/hooks/20-debug-shell.sh
|
|
install -Dm644 "$srcdir"/20-debug-shell.files \
|
|
"$pkgdir"/usr/share/mkinitfs/files/20-debug-shell.files
|
|
install -Dm755 "$srcdir"/setup_usb_storage.sh \
|
|
"$pkgdir"/usr/libexec/postmarketos-mkinitfs/setup_usb_storage.sh
|
|
}
|
|
|
|
sha512sums="
|
|
add95b3fa64b804fd386298406fbc55489e3e122d70f40e45627a450d299e148a346a4a147c2b28e0110ecef14e9e0b62ac75a0bd2d39295c2407ebb5e93708c 20-debug-shell.sh
|
|
a739bc47d905d189edb26d9ebfd062023720fefdaab27207471c16d53a9c12ea8b81092a1047d8f2300e42ba500bdf6c5a3343aca55aab5bf8e84d68eb5680ab 20-debug-shell.files
|
|
75d485c2e9f352cfd717b7a92753a9dfc4a72526a44bcbb784eacb4ef9011072b3ffa1c42a317c0940598cc076fb6c61676c440e5b188378b19ca08d882c1338 setup_usb_storage.sh
|
|
"
|