-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3850 from MilhouseVH/le92_kodi_pastekodi
kodi: add pastekodi script [backport]
- Loading branch information
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-License-Identifier: GPL-2.0 | ||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) | ||
|
||
cat_data() { | ||
echo "========== ${1} ==========" | ||
cat | ||
} | ||
|
||
cat_file() { | ||
if [ -f "${1}" ]; then | ||
cat "${1}" | cat_data "${2:-${1}}" | ||
fi | ||
} | ||
|
||
source /etc/os-release | ||
SYSTEM_ARCH="${LIBREELEC_ARCH#*.}" | ||
|
||
# If running in SAFE mode, send FAILED logs | ||
if [ "$(cat "/storage/.config/boot.status" 2>/dev/null)" = "SAFE" ]; then | ||
KODI_ROOT="/storage/.kodi.FAILED/temp" | ||
else | ||
KODI_ROOT="/storage/.kodi/temp" | ||
fi | ||
|
||
if [ "$(basename $0)" = "pastekodi" ]; then | ||
LOG_TYPE="System" | ||
LOG_FILE="${KODI_ROOT}/kodi.log" | ||
else | ||
LOG_TYPE="Crash" | ||
LOG_FILE="${KODI_ROOT}/kodi_crash.log" | ||
fi | ||
|
||
( | ||
echo "${LOG_TYPE} log output for: $(lsb_release)" | ||
|
||
if [ "${SYSTEM_ARCH}" = "x86_64" ]; then | ||
if [ -f "/sys/firmware/efi" ]; then | ||
echo "Firmware Boot Mode: EFI" | ||
else | ||
echo "Firmware Boot Mode: BIOS" | ||
fi | ||
fi | ||
if [ "${LIBREELEC_PROJECT}" = "RPi" ]; then | ||
echo "RPi Hardware Revision: $(vcgencmd otp_dump | grep 30: | cut -d: -f2)" | ||
fi | ||
|
||
cat_file "${LOG_FILE}" | ||
|
||
journalctl -a | cat_data "journalctl -a" | ||
|
||
if [ "${LIBREELEC_PROJECT}" = "RPi" ]; then | ||
bootloader_version="$(vcgencmd bootloader_version)" | ||
if ! echo "${bootloader_version}" | grep -q "Command not registered"; then | ||
echo "${bootloader_version}" | cat_data "Bootloader version" | ||
fi | ||
fi | ||
|
||
cat_file "/flash/config.txt" # RPi | ||
cat_file "/flash/distroconfig.txt" # RPi | ||
cat_file "/flash/cmdline.txt" # RPi | ||
|
||
cat_file "/flash/syslinux.cfg" # x86 BIOS | ||
cat_file "/flash/EFI/BOOT/syslinux.cfg" # x86 EFI | ||
cat_file "/flash/extlinux.conf" # x86 legacy | ||
|
||
cat_file "/flash/extlinux/extlinux.conf" # u-boot | ||
|
||
cat_file "${KODI_ROOT}/.smb/smb.conf" | ||
cat_file "${KODI_ROOT}/.smb/user.conf" | ||
cat_file "/run/samba/smb.conf" | ||
) | /usr/bin/pastebinit 2>/dev/null |