aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Guégan <loic.guegan@mailbox.org>2024-07-05 18:51:57 +0200
committerLoïc Guégan <loic.guegan@mailbox.org>2024-07-05 18:51:57 +0200
commitc7e01eded2d755c8590a6f2c0336b145f0043306 (patch)
tree210c6388c90ace4635b20913687ff1e77ec317a9
parent6c4aa11c72553ab5c2b16ea87ee186f31c7e65f3 (diff)
Minor changes
-rw-r--r--README.md24
-rwxr-xr-xsysdump.sh21
2 files changed, 29 insertions, 16 deletions
diff --git a/README.md b/README.md
index f34ddd7..50f85c6 100644
--- a/README.md
+++ b/README.md
@@ -17,18 +17,18 @@ To explore a dump (require `jq`), see help as follow:
# Useful entries
Important note: Depending on the system, some entries may not be available.
-| Entry | Description |
-|--------------------------|------------------------------------------------------------------|
-| compgen | List all available commands in current shell |
-| ping | Check if ping succeed (internet is available) |
-| boot_folder | Recursive listing of /boot/ |
-| root_folder | Content of / |
-| home_folder | Content of $HOME |
-| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
-| /proc/cmdline | See kernel parameters |
-| /boot/config-$(uname -r) | Get kernel config |
-| users | List logged users |
-| declare | Get all shell defined variables, functions etc |
+| Entry | Description |
+|-------------------------|------------------------------------------------------------------|
+| compgen | List all available commands in current shell |
+| ping | Check if ping succeed (internet is available) |
+| boot_folder | Recursive listing of /boot/ |
+| root_folder | Content of / |
+| home_folder | Content of $HOME |
+| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
+| /proc/cmdline | See kernel parameters |
+| kernel_config | Get kernel config |
+| users | List logged users |
+| declare | Get all shell defined variables, functions etc |
# Notes
- Some commands require root permissions. If `sysdump.sh` is not run
diff --git a/sysdump.sh b/sysdump.sh
index 9aa886e..f0f625f 100755
--- a/sysdump.sh
+++ b/sysdump.sh
@@ -59,7 +59,7 @@ sysdump() {
dump "/etc/hosts" safecat /etc/hosts
dump "/etc/bash.bashrc" safecat /etc/bash.bashrc
dump "/etc/timezone" safecat /etc/timezone
- dump "/boot/config-$(uname -r)" safecat /boot/config-$(uname -r)
+ dump "kernel_config" safecat /boot/config-$(uname -r)
# safecatroot
dump "/etc/shadow" safecatroot /etc/shadow
dump "/etc/sudoers" safecatroot /etc/sudoers
@@ -198,6 +198,7 @@ then
PING_SUCCESS_COUNT=$(cat "$file"|jq -r '.["ping"]'|base64 -d|grep "packet loss"|cut -d, -f 2|awk '{print $1+0}')
IPADDR=$(cat "$file"|jq -r '.["ipaddr"]'|base64 -d)
INFO_DISKS=$(cat "$file"|jq -r '.["df"]'|base64 -d)
+ KERNEL_CONFIG=$(cat "$file"|jq -r '.["kernel_config"]'|base64 -d)
# Extract infos
INFO_OS_NAME=$(echo "$OS_RELEASE"|grep "^NAME=" | cut -d'"' -f 2)
@@ -216,8 +217,13 @@ then
INFO_MEM_SWAP_FREE=$(echo "$MEM_INFO"|awk '/SwapFree/{print $2/1000" MB"}')
INFO_UPTIME=$(cat "$file"|jq -r '.["uptime"]'|base64 -d|cut -d, -f 1|awk '{$1=$1};1')
INFO_DUMP_DATE=$(cat "$file"|jq -r '.["date"]'|base64 -d) && INFO_DUMP_DATE=$(date -d "@${INFO_DUMP_DATE}")
+ INFO_DUMP_USER=$(cat "$file"|jq -r '.["env"]'|base64 -d|grep "^USER="|cut -d= -f2)
INFO_TIMEZONE=$(cat "$file"|jq -r '.["/etc/timezone"]'|base64 -d)
INFO_KERNEL=$(cat "$file"|jq -r '.["/proc/version"]'|base64 -d|awk '/ version /{print $1" v"$3}')
+ INFO_KERNEL_RAPL=$(echo "$KERNEL_CONFIG"|awk 'BEGIN{DETECTED=0};/^CONFIG_INTEL_RAPL=(y|m)/{DETECTED=1};END{if(DETECTED){print("Supported")}else{print("NA")}}')
+ INFO_KERNEL_KVM=$(echo "$KERNEL_CONFIG"|awk 'BEGIN{DETECTED=0};/^CONFIG_KVM=(y|m)/{DETECTED=1};END{if(DETECTED){print("Supported")}else{print("NA")}}')
+ INFO_KERNEL_I2C=$(echo "$KERNEL_CONFIG"|awk 'BEGIN{DETECTED=0};/^CONFIG_I2C=(y|m)/{DETECTED=1};END{if(DETECTED){print("Supported")}else{print("NA")}}')
+ INFO_KERNEL_SPI=$(echo "$KERNEL_CONFIG"|awk 'BEGIN{DETECTED=0};/^CONFIG_SPI=(y|m)/{DETECTED=1};END{if(DETECTED){print("Supported")}else{print("NA")}}')
# Print Information
echo "====> System <===="
@@ -239,14 +245,21 @@ then
echo "Swap Total: ${INFO_MEM_SWAP_TOTAL}"
echo "Swap Free: ${INFO_MEM_SWAP_FREE}"
echo
+ echo "====> Disk <===="
+ echo "${INFO_DISKS}"
+ echo
+ echo "====> Kernel Config <===="
+ echo "Intel RAPL: ${INFO_KERNEL_RAPL}"
+ echo "KVM: ${INFO_KERNEL_KVM}"
+ echo "I2C: ${INFO_KERNEL_I2C}"
+ echo "SPI: ${INFO_KERNEL_SPI}"
+ echo
echo "====> Other informations <===="
+ echo "Dump User: ${INFO_DUMP_USER}"
echo "Dump Date: ${INFO_DUMP_DATE}"
echo "Timezone: ${INFO_TIMEZONE}"
echo "Network State: ${INFO_OTHER_NETWORK}"
echo "IPv4: ${INFO_INET4}"
echo "IPv6: ${INFO_INET6}"
- echo
- echo "====> Disk <===="
- echo "${INFO_DISKS}"
fi