Skip to content

Commit 04ecc69

Browse files
committed
more infos for debug file
minor shell warnings for rootdevice fix #1034
1 parent 0c0ca39 commit 04ecc69

File tree

5 files changed

+69
-92
lines changed

5 files changed

+69
-92
lines changed

decompressed/base/etc/init.d/rootdevice

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ create_modgui_log() {
8484

8585
save_modgui_log() {
8686
mkdir /overlay/modgui_log
87-
cp -rf $rootdevice_log_file /overlay/modgui_log/rootdevice_log_$(date +"%H-%M_%m-%d-%y")
87+
cp -rf $rootdevice_log_file "/overlay/modgui_log/rootdevice_log_$(date +%H-%M_%m-%d-%y)"
8888
}
8989

9090
sched_remove_modgui_log() {
@@ -238,7 +238,7 @@ install_gui() {
238238

239239
logecho "Start rooting"
240240
if [ ! -f /root/.install_gui ]; then #this check if the placeholder exist
241-
touch /root/.install_gui #this is a placeholder to know if the install process ends correctly (removed by 99_postreq.sh)
241+
touch /root/.install_gui #this is a placeholder to know if the install process ends correctly (removed by 99_postreq.sh)
242242
fi
243243

244244
if [ -d /etc/modgui_scripts ]; then
@@ -355,7 +355,7 @@ check_and_apply_obp() {
355355
kecho "OBP sanity check FAILED but check_obp set to 0... Not acting"
356356
else
357357

358-
if [ $(cat /proc/$PPID/comm) == "upgradegui" ]; then
358+
if [ "$(cat /proc/$PPID/comm)" == "upgradegui" ]; then
359359
logecho "OBP sanity check FAILED but upgrading, postpone planning on next boot..."
360360
kecho "OBP sanity check FAILED but upgrading, postpone planning on next boot..."
361361
uci set modgui.var.reboot_reason_msg="apply OBP planning"
@@ -399,8 +399,8 @@ check_and_apply_obp() {
399399
}
400400

401401
check_full_overlay() {
402-
overlay_percent=$(df /overlay | sed -n 2p | awk {'{print $5}'} | sed 's|%||')
403-
overlay_mtdblock=$(df /overlay | sed -n 2p | awk {'{print $1}'})
402+
overlay_percent=$(df /overlay | sed -n 2p | awk '{print $5}' | sed 's|%||')
403+
overlay_mtdblock=$(df /overlay | sed -n 2p | awk '{print $1}')
404404
bootedbank=$(cat /proc/banktable/booted)
405405
#Reset if rootfs more than 97% full
406406
if [ "$overlay_percent" -gt 96 ]; then

decompressed/gui_file/usr/share/transformer/scripts/generate-debug-file.sh

+58-81
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,8 @@
55

66
######################################################################
77
DATE=$(date +%Y-%m-%d-%H%M)
8-
prod=$(uci get env.var.prod_name)
9-
friend=$(uci get env.var.prod_friendly_name)
10-
isp=$(uci get modgui.var.isp)
11-
version=$(uci get env.var.friendly_sw_version_activebank)
128
guiver=$(grep /etc/init.d/rootdevice -e 'version_gui' | sed 's/version_gui=//')
139
dsl=$(xdslctl --version 2>&1 >/dev/null | grep 'version -' | awk '{print $6}' | sed 's/\..*//')
14-
guihash=$(uci get modgui.gui.gui_hash)
15-
guibranch=$(uci get modgui.gui.update_branch)
16-
guifirst=$(uci get modgui.gui.firstpage)
17-
guirancol=$(uci get modgui.gui.randomcolor)
18-
skin=$(uci get modgui.gui.gui_skin)
19-
aria=$(uci get modgui.app.aria2_webui)
20-
luci=$(uci get modgui.app.luci_webui)
21-
trans=$(uci get modgui.app.transmission_webui)
22-
xupnp=$(uci get modgui.app.xupnp_app)
23-
blk=$(uci get modgui.app.blacklist_app)
24-
telstra=$(uci get modgui.app.telstra_webui)
2510

2611

2712
log() {
@@ -35,89 +20,81 @@ log "Removing directory /tmp/DebugHelper-* to prevent duplicates"
3520
rm -R /tmp/DebugHelper* > /dev/null 2>&1
3621

3722
log "Creating dir"
38-
mkdir /tmp/DebugHelper-$DATE/ > /dev/null 2>&1
39-
cd /tmp/DebugHelper-$DATE/
40-
23+
mkdir "/tmp/DebugHelper-$DATE/" > /dev/null 2>&1
24+
cd "/tmp/DebugHelper-$DATE/"
4125

4226
#################################################################################################################################################################
4327
log "Gathering device info..."
28+
{
29+
echo "___________________________________DEVICE INFO_________________________________________"
30+
echo "Friendly Name: $(uci get env.var.prod_friendly_name)"
31+
echo "Product Name: $(uci get env.var.prod_name)"
32+
echo "Uptime: $(uptime)"
33+
echo "Uname: $(uname -a)"
34+
uci show modgui |grep -v "encrypted_pass"
35+
echo "--------------Free Space--------------"
36+
df -h
37+
echo "--------------Mounts--------------"
38+
mount
39+
echo "--------------NAND--------------"
40+
cat /proc/mtd
41+
echo "--------------LEDS--------------"
42+
ls -lah /sys/class/leds/
43+
echo "--------------Buttons config--------------"
44+
uci show button
45+
echo "--------------pwrctl--------------"
46+
pwrctl show
47+
echo "--------------banktable---------------"
48+
for f in /proc/banktable/*; do
49+
echo -n "$f "
50+
cat "$f"
51+
echo
52+
done
53+
echo "--------------USB---------------"
54+
lsusb
55+
dmesg |grep usb
56+
echo "--------------INTERFACES---------------"
57+
ifconfig
58+
echo "--------------ROUTING---------------"
59+
ip r
60+
}> ./deviceinfo.txt
4461

45-
echo "___________________________________DEVICE INFO_________________________________________" > ./deviceinfo.txt
46-
47-
echo "Product Name: $prod" >> ./deviceinfo.txt
48-
echo "Friendly Name: $friend" >> ./deviceinfo.txt
49-
echo "ISP Name: $isp" >> ./deviceinfo.txt
50-
echo "FW Version: $version" >> ./deviceinfo.txt
51-
echo "DSL Version: $dsl" >> ./deviceinfo.txt
52-
53-
echo "GUI Skin: $skin" >> ./deviceinfo.txt
54-
echo "GUI Version: $guiver" >> ./deviceinfo.txt
55-
echo "GUI Hash: $guihash" >> ./deviceinfo.txt
56-
echo "GUI Branch: $guibranch" >> ./deviceinfo.txt
57-
echo "GUI First Page: $guifirst" >> ./deviceinfo.txt
58-
59-
echo "--------------Free Space--------------" >> ./deviceinfo.txt
60-
df -h >> ./deviceinfo.txt
61-
62-
echo "--------------banktable---------------" >> ./deviceinfo.txt
63-
find /proc/banktable -type f -print -exec cat {} ';' >> ./deviceinfo.txt
64-
65-
echo "-----List of Installed Extensions-----" >> ./deviceinfo.txt
66-
67-
if [ $aria -eq 1 ]
68-
then
69-
echo "Aria Installed" >> ./deviceinfo.txt
70-
fi
71-
72-
if [ $luci -eq 1 ]
73-
then
74-
echo "LuCI Installed" >> ./deviceinfo.txt
75-
fi
76-
77-
if [ $xupnp -eq 1 ]
78-
then
79-
echo "xUPNP Installed" >> ./deviceinfo.txt
80-
fi
81-
82-
if [ $blk -eq 1 ]
83-
then
84-
echo "Blacklist Installed" >> ./deviceinfo.txt
85-
fi
86-
87-
if [ $telstra -eq 1 ]
88-
then
89-
echo "Telstra GUI Installed" >> ./deviceinfo.txt
90-
fi
62+
###########################################################################################################################################################
9163

92-
if [ $trans -eq 1 ]
93-
then
94-
echo "Transmission Installed" >> ./deviceinfo.txt
95-
fi
96-
echo "--------------------------------------" >> ./deviceinfo.txt
64+
log "Scanning for log errors..."
65+
{
66+
echo "__________________________________LOG_________________________________________"
67+
logread |grep daemon.err
68+
}> ./error.log
9769

9870
###########################################################################################################################################################
9971

100-
log "Scanning for log errors..."
101-
echo "__________________________________LOG_________________________________________" > ./error.log
102-
logread |grep daemon.err >> ./error.log
103-
echo " " >> ./error.log
72+
log "XDSL stats..."
73+
{
74+
echo "__________________________________LOG_________________________________________"
75+
logread |grep daemon.err
76+
}> ./error.log
10477

10578
###########################################################################################################################################################
10679

10780
log "Listing processes..."
108-
echo "__________________________________PROCESSES_________________________________________" > ./processes.txt
109-
ps >> ./processes.txt
110-
echo " " >> ./processes.txt
81+
{
82+
echo "__________________________________PROCESSES_________________________________________"
83+
ps
84+
}> ./processes.txt
11185

11286
###########################################################################################################################################################
11387

11488
log "Scanning /etc/config directory..."
115-
echo "__________________________________CONFIG FILE LIST_________________________________________" > ./configlist.txt
116-
ls /etc/config/ >> ./configlist.txt
117-
echo " " >> ./configlist.txt
89+
{
90+
echo "__________________________________CONFIG FILE LIST_________________________________________"
91+
ls -lah /etc/config/
92+
}> ./configlist.txt
11893

11994
###########################################################################################################################################################
12095
log "Tarring File..."
121-
tar -czvf /tmp/DebugHelper$DATE.tar.gz /tmp/DebugHelper-$DATE > /dev/null 2>&1
122-
rm -R /tmp/DebugHelper-$DATE
96+
tar -czvf "/tmp/DebugHelper$DATE.tar.gz" "/tmp/DebugHelper-$DATE" > /dev/null 2>&1
97+
rm -R "/tmp/DebugHelper-$DATE"
12398
log "All Done! Zipped file can be found in /tmp/DebugHelper$DATE.tar.gz"
99+
100+
}

decompressed/gui_file/www/docroot/modals/gateway-modal.lp

+2-2
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,9 @@ ngx.print(ui_helper.createMessages(message_helper.popMessages()))
830830
html[#html + 1] = ui_helper.createAlertBlock(T"Importing failed; Invalid file used: expected file with extension bin. Please use correct file.", importing_wrong_ext_fail)
831831
html[#html + 1] = ui_helper.createAlertBlock(T"Importing failed; Invalid file used: file too large. Please use correct. Please use correct file..", importing_too_big_fail)
832832

833-
html[#html + 1] = ui_helper.createAlertBlock(T"Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advertised to check this if you are downgrading the firmware.", basic)
833+
html[#html + 1] = ui_helper.createAlertBlock(T"Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advised to check this if you are downgrading the firmware.", basic)
834834
html[#html + 1] = ui_helper.createInputCheckbox(T"Remove config file with upgrade","remove_conf_on_upgrade","0",reset_on_upgrade)
835-
html[#html + 1] = ui_helper.createAlertBlock(T"Check this to only root the modem after the firmware is installed.<br/>After this you had to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade", basic)
835+
html[#html + 1] = ui_helper.createAlertBlock(T"Check this to only root the modem after the firmware is installed.<br/>After this you have to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade", basic)
836836
html[#html + 1] = ui_helper.createInputCheckbox(T"Root only modem after upgrade","rootonly_on_upgrade","0",reset_on_upgrade)
837837
html[#html + 1] = '</form><form class="form-horizontal" id="form-upgradefw" method="post" enctype="multipart/form-data">'
838838
html[#html + 1] = '<div class="control-group">'

decompressed/gui_file/www/lang/de-de/webui-core.po

+2-2
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ msgstr "GUI Version %s"
27942794
msgid "GUI Settings & Utility"
27952795
msgstr "GUI Einstellungen & Hilfsfunktionen"
27962796

2797-
msgid "Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advertised to check this if you are downgrading the firmware."
2797+
msgid "Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advised to check this if you are downgrading the firmware."
27982798
msgstr "Kreuzen Sie dies an, um die Konfiguration nach der Firmware-Aktualisierung zu entfernen.<br/>Dies wird root erhalten.<br/>Dies dient dazu, die Firmware auf eine niedrigere Version zu aktualisieren."
27992799

28002800
msgid "Remove config file with upgrade"
@@ -4004,7 +4004,7 @@ msgstr "TIM (Italien)"
40044004
msgid "ISP Autodetect"
40054005
msgstr "Automatische ISP-Erkennung"
40064006

4007-
msgid "Check this to only root the modem after the firmware is installed.<br/>After this you had to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade"
4007+
msgid "Check this to only root the modem after the firmware is installed.<br/>After this you have to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade"
40084008
msgstr "Aktivieren Sie dies, um das Modem nur zu rooten, nachdem die Firmware installiert wurde.<br/>Danach müssen Sie die Oberfläche manuell neu installieren.<br/>Sei müssen damit rechnen, dass die Oberfläche nach der Aktualisierung defekt ist"
40094009

40104010
msgid "Root only modem after upgrade"

decompressed/gui_file/www/lang/it-it/webui-core.po

+2-2
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ msgstr "Versione GUI %s"
27942794
msgid "GUI Settings & Utility"
27952795
msgstr "Opzioni e utility GUI"
27962796

2797-
msgid "Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advertised to check this if you are downgrading the firmware."
2797+
msgid "Check this to remove config after firmware update.<br/>This won't remove root.<br/>It is advised to check this if you are downgrading the firmware."
27982798
msgstr "Selezionando questa opzione verrà azzerata la configurazione dopo l'aggiornamento firmware.<br/>Questo non rimuoverà il root.<br/>Seleziona questa opzione nel caso di downgrade del firmware."
27992799

28002800
msgid "Remove config file with upgrade"
@@ -4004,7 +4004,7 @@ msgstr "TIM (Italia)"
40044004
msgid "ISP Autodetect"
40054005
msgstr "Rilevamento automatico ISP"
40064006

4007-
msgid "Check this to only root the modem after the firmware is installed.<br/>After this you had to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade"
4007+
msgid "Check this to only root the modem after the firmware is installed.<br/>After this you have to reinstall the GUI.<br/>Expect the web interface to be broken after the upgrade"
40084008
msgstr "Spunta questo se vuoi solo fare il root dopo l'installazione del firmware.<br/>Dopo aver fatto ciò devi reinstallare la GUI.<br/>L'interfaccia web verrà danneggiata dopo l'aggiornamento."
40094009

40104010
msgid "Root only modem after upgrade"

0 commit comments

Comments
 (0)