Skip to content

Commit e4a08d9

Browse files
author
Marcus Funch
committed
Merge branch 'feature/58020_debugging-script-get-kernel-info' into 'master'
Debugging scripts: Consistency + gather more kernel info See merge request os2borgerpc/os2borgerpc-scripts!257
2 parents 4e321c1 + c3ab6ec commit e4a08d9

File tree

4 files changed

+65
-47
lines changed

4 files changed

+65
-47
lines changed

common/fejlfinding/gather_hardware_info.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
#! /usr/bin/env sh
22

3-
set -x
4-
53
header() {
64
MSG=$1
7-
printf "\n\n\n%s\n\n\n" "### $MSG ###"
5+
printf "\n\n\n%s\n\n\n" "### $MSG: ###"
86
}
97

108
text() {
119
MSG=$1
12-
printf "\n%s\n" "### $MSG ###"
10+
printf "\n%s\n" "### $MSG: ###"
1311
}
1412

15-
header "Information about the computer model:"
13+
header "Information about the computer model"
1614
dmidecode --type 1
1715

1816
header "Info about devices and drivers"

common/fejlfinding/kiosk_general_debug.sh

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ USER="chrome"
77

88
header() {
99
MSG=$1
10-
printf "\n\n\n%s\n\n\n" "### $MSG ###"
10+
printf "\n\n\n%s\n\n\n" "### $MSG: ###"
1111
}
1212

1313
text() {
1414
MSG=$1
15-
printf "\n%s\n" "### $MSG ###"
15+
printf "\n%s\n" "### $MSG: ###"
1616
}
1717

1818

1919
header "General information from only a basic setup"
2020

21-
text "Information about the computer model:"
21+
text "Information about the computer model"
2222
dmidecode --type 1
2323

2424
text "LAN or Wi-Fi?"
@@ -27,54 +27,64 @@ ip link
2727
text "Files under /usr/share/os2borgerpc/bin"
2828
ls -la /usr/share/os2borgerpc/bin/
2929

30-
text "OS2borgerPC configuration file:"
30+
text "OS2borgerPC configuration file"
3131
cat /etc/os2borgerpc/os2borgerpc.conf
3232

33-
text "OS2borgerPC client version:"
33+
text "OS2borgerPC client version"
3434
pip3 list installed | grep os2borgerpc-client
3535

3636

3737
header "Chromium / Xorg info"
3838

39-
text "Is Chromium running?:"
39+
text "Is Chromium running?"
4040
pgrep --list-full chrome # yes, the binary is called 'chrome'
4141

42-
text "The version of Chromium:"
42+
text "The version of Chromium"
4343
chromium-browser --version
4444

45-
text "Contents of chrome's home directory:"
45+
text "Contents of chrome's home directory"
4646
ls -la /home/$USER/
4747

4848
text "Contents of chrome's .profile-file:"
4949
cat /home/$USER/.profile
5050

51-
text ".xinitrc contents:"
51+
text ".xinitrc contents"
5252
cat /home/$USER/.xinitrc
5353

5454
text "Check files in /tmp/ (this directory contains auth-files and lock-files)"
5555
ls -al /tmp/
5656

57-
header "List assorted device info"
58-
lshw
5957

60-
header "List kernel modules currently loaded (fx. drivers)"
58+
header "Info about kernel, devices and drivers"
59+
60+
text "List currently active kernel version"
61+
uname -a
62+
63+
text "List all installed kernels"
64+
dpkg --get-selections | grep --invert-match deinstall | grep linux-image
65+
66+
text "List kernel modules currently loaded (fx. drivers)"
6167
lsmod
6268

69+
text "List info on connected hardware"
70+
lshw
71+
72+
6373
header "Information about monitors"
6474

65-
text "rotate_screen.sh's permissions:"
75+
text "rotate_screen.sh's permissions"
6676
ls -l /usr/share/os2borgerpc/bin/rotate_screen.sh
6777

68-
text "rotate_screen.sh's contents:"
78+
text "rotate_screen.sh's contents"
6979
cat /usr/share/os2borgerpc/bin/rotate_screen.sh
7080

71-
text "Old rotate_screen.sh's permissions:"
81+
text "Old rotate_screen.sh's permissions"
7282
ls -l /usr/local/bin/rotate_screen.sh
7383

74-
text "Old rotate_screen.sh's contents:"
84+
text "Old rotate_screen.sh's contents"
7585
cat /usr/local/bin/rotate_screen.sh
7686

77-
text "Run xrandr to get info about monitors:"
87+
text "Run xrandr to get info about monitors"
7888
export DISPLAY=:0
7989
export XAUTHORITY=/home/$USER/.Xauthority
8090
xrandr
@@ -90,7 +100,7 @@ cat /usr/share/os2borgerpc/bin/start_chromium.sh
90100

91101
ls -la /usr/share/os2borgerpc/bin/keyboard-button/
92102

93-
text "bspwm_add_button.sh contents:"
103+
text "bspwm_add_button.sh contents"
94104
cat /usr/share/os2borgerpc/bin/keyboard-button/bspwn_add_button.sh
95105

96106

common/fejlfinding/list_programs_services.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
printf "\n\n%s\n\n" "===== LIST INSTALLED PROGRAMS: $0 ====="
44
#apt list --installed
5-
dpkg -l
5+
dpkg -l | grep --invert-match "^rc" # Don't show packages that WERE installed
66

77
printf "\n\n%s\n\n" "===== LIST ALL SERVICES: $0 ====="
88
systemctl list-units

common/fejlfinding/os2borgerpc_general_debug.sh

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ SKELETON=".skjult"
88

99
header() {
1010
MSG=$1
11-
printf "\n\n\n%s\n\n\n" "### $MSG ###"
11+
printf "\n\n\n%s\n\n\n" "### $MSG: ###"
1212
}
1313

1414
text() {
1515
MSG=$1
16-
printf "\n%s\n" "### $MSG ###"
16+
printf "\n%s\n" "### $MSG: ###"
1717
}
1818

1919
# Determine the name of the user desktop directory. This is done via xdg-user-dir,
@@ -25,36 +25,36 @@ export "$(grep LANG= /etc/default/locale | tr -d '"')"
2525
runuser -u $USER xdg-user-dirs-update
2626
DESKTOP=$(basename "$(runuser -u $USER xdg-user-dir DESKTOP)")
2727

28-
header "General info:"
28+
header "General info"
2929

30-
text "Information about the computer model:"
30+
text "Information about the computer model"
3131
dmidecode --type 1
3232

3333
text "LAN or Wi-Fi?"
3434
ip link
3535

36-
text "OS2borgerPC configuration file:"
36+
text "OS2borgerPC configuration file"
3737
cat /etc/os2borgerpc/os2borgerpc.conf
3838

39-
text "OS2borgerPC client version:"
39+
text "OS2borgerPC client version"
4040
pip3 list installed | grep os2borgerpc-client
4141

42-
text "Info on lightdm, the display manager:"
42+
text "Info on lightdm, the display manager"
4343
cat /etc/lightdm/lightdm.conf
4444

45-
text "Info on automatic updates:"
45+
text "Info on automatic updates"
4646
cat /etc/apt/apt.conf.d/90os2borgerpc-automatic-upgrades
4747

48-
text "User cleanup file contents:"
48+
text "User cleanup file contents"
4949
cat /usr/share/os2borgerpc/bin/user-cleanup.bash
5050

5151
text "Check permissions on files in /usr/share/os2borgerpc/bin/"
5252
ls -l /usr/share/os2borgerpc/bin/
5353

54-
text "List programs/files on the desktop:"
54+
text "List programs/files on the desktop"
5555
ls -l /home/$USER/"$DESKTOP"/
5656

57-
text "Verify this matches what's in the user template (after logout):"
57+
text "Verify this matches what's in the user template (after logout)"
5858
ls -l /home/$SKELETON/"$DESKTOP"/
5959

6060
text "Check the contents of /home/$SKELETON/"
@@ -69,7 +69,7 @@ ls -la /home/$SKELETON/.local/
6969
text "List programs in the launcher:"
7070
cat /etc/dconf/db/os2borgerpc.d/02-launcher-favorites
7171

72-
text "Info about the current background image:"
72+
text "Info about the current background image"
7373
cat /etc/dconf/db/os2borgerpc.d/00-background
7474

7575
text "Check the crontab"
@@ -79,26 +79,36 @@ crontab -u $USER -l
7979
text "Check the inactive logout file"
8080
cat /usr/share/os2borgerpc/bin/inactive_logout.sh
8181

82-
header "Info about devices and drivers"
83-
lshw
8482

85-
header "List kernel modules currently loaded (fx. drivers)"
83+
header "Info about kernel, devices and drivers"
84+
85+
text "List currently active kernel version"
86+
uname -a
87+
88+
text "List all installed kernels"
89+
dpkg --get-selections | grep --invert-match deinstall | grep linux-image
90+
91+
text "List kernel modules currently loaded (fx. drivers)"
8692
lsmod
8793

88-
header "Info about printers"
94+
text "List info on connected hardware"
95+
lshw
96+
97+
text "Info about printers"
8998
lpinfo -v
9099

91-
header "Info about scanners"
100+
text "Info about scanners"
92101
scanimage -L
93102

103+
94104
# Firefox related
95105

96106
header "Firefox related info"
97107

98-
text "Firefox version:"
108+
text "Firefox version"
99109
snap list | grep firefox
100110

101-
text "Firefox policies (if any):"
111+
text "Firefox policies (if any)"
102112
cat /etc/firefox/policies/policies.json
103113

104114
### CHROME / CHROMIUM RELATED INFO ###
@@ -124,13 +134,13 @@ DESKTOP_FILE_2="/home/$SKELETON/$DESKTOP/google-chrome.desktop"
124134
DESKTOP_FILE_3="/home/$SKELETON/.config/autostart/chrome.desktop"
125135
DESKTOP_FILE_4="/home/$SKELETON/.local/share/applications/google-chrome.desktop"
126136

127-
text "File at $DESKTOP_FILE_1:"
137+
text "File at $DESKTOP_FILE_1"
128138
cat "$DESKTOP_FILE_1"
129-
text "File at $DESKTOP_FILE_2:"
139+
text "File at $DESKTOP_FILE_2"
130140
cat "$DESKTOP_FILE_2"
131-
text "File at $DESKTOP_FILE_3:"
141+
text "File at $DESKTOP_FILE_3"
132142
cat "$DESKTOP_FILE_3"
133-
text "File at $DESKTOP_FILE_4:"
143+
text "File at $DESKTOP_FILE_4"
134144
cat "$DESKTOP_FILE_4"
135145

136146
# Launch from TTY

0 commit comments

Comments
 (0)