pmos-xiaomi-angelican/catch-kernel-trouble.sh
MeexReay 2faf800056 catch_kernel_trouble - add hint about recovery mode
catch_kernel_trouble - move log to /tmp right after pulling
2025-05-17 03:40:27 +03:00

33 lines
583 B
Bash
Executable File

#!/bin/sh
NUM_LINES=100
if [ $# -ge 1 ]; then
NUM_LINES="$1"
fi
./extract-paths.sh
pmbootstrap chroot adb pull /proc/last_kmsg /home/pmos
if ! mv $PMWORK/chroot_native/home/pmos/last_kmsg /tmp/full-kernel-trouble
then
echo "1. Enter to the recovery mode"
echo "2. Run this script"
echo "3. Connect the phone to usb cable"
exit 1
fi
tail -n $NUM_LINES /tmp/full-kernel-trouble > kernel-trouble
echo
echo "Last $NUM_LINES log lines"
echo
cat kernel-trouble
echo
echo "Saved to \"$PWD/kernel-trouble\""
echo "Full log was saved to \"/tmp/full-kernel-trouble\""
echo