General TC > Programming & Scripting - Unofficial
A script to aid in troubleshooting Tinycore installations.
Rich:
The attached script is intended to gather some baseline information about a Tinycore Linux installation. The design goals of the script
were as follows:
1. No dependencies. Use only commands that are part of the base system.
2. Keep the results file generated small so that it can be an attachment in a users post.
3. Format the results file to make it easier to review.
4. Try to stay focused on generic and Tinycore specific data.
5. Optimize for speed where possible.
On my old 800 Mhz, 512 Meg RAM, PATA drives, TC4 system it takes about 50 seconds to complete.
On my Dell E310 2.4Ghz, 3 Gig RAM, SATA drives, TC10 system it takes about 11 seconds to complete.
About 80% of the time is spent on MD5 checks.
The results are saved in a file called TCscanYYMMDDHHMMSS.txt where YYMMDDHHMMSS is a date code.
The format of the file is as follows:
It starts with a time stamp and a Table of Contents listing which sections were created and what they contain
--- Code: ---Sun Jun 7 09:58:50 UTC 2020
Table of Contents
Sect 1 TC version, uname, tcedir, mydata.tgz status, /etc/sysconfig/
Sect 2 tcemirror, repo URL, repo URL reachable, showbootcodes, Some CPU flags
Sect 3 free, /proc/swaps, mounts, disk free
Sect 4 ifconfig, route -n, /etc/resolv.conf
Sect 5 lsmod
Sect 6 .xsession, .profile
Sect 7 bootsync.sh, bootlocal.sh, .filetool.lst, .xfiletool.lst
Sect 8 onboot.lst, ondemand
Sect 9 Missing md5 files, Failed md5 checks, Local/Repo md5 files differ
Sect 10 Orphaned md5 and dep files
Sect 11 find bootloader config file
Sect 12 Some dmesg lines
Sect 13 Some Xorg.0.log lines
Sect 14 /proc/bus/input/devices
--- End code ---
Then each section is listed with the contents in a sort of question/answer format. Text that starts in the first column is the question.
Text that is indented is the answer. The intent behind this is to make it easier to visually scan the file contents. Here's what a section
looks like
--- Code: ---#----------------------------------------------------------------------------------
Sect 1 TC version, uname, tcedir, mydata.tgz status, /etc/sysconfig/
TC version=
10.1
uname=
Linux E310 4.19.10-tinycore #1999 SMP Tue Dec 18 13:36:47 UTC 2018 i686 GNU/Linux
tcedir=
/mnt/sda1/tce
mydata.tgz status=
-rw-rw-r-- 1 tc staff 574K May 16 23:50 /mnt/sda1/tce/mydata.tgz
/etc/sysconfig/=
Xserver Xorg
backup 1
backup_device sda1/tce
cdroms /dev/sr1 /dev/sr0
desktop flwm_topside
icons wbar
keymap KEYMAP=us
language LANG=C
mydata mydata
newmodules
ntpserver pool.ntp.org
tcuser tc
--- End code ---
The attached TCscan200607095849.txt file is what a complete scan looks like.
To try the script just download it and:
--- Code: ---chmod 775 TCscan.sh
./TCscan.sh
--- End code ---
The script echoes its progress to the screen as it runs.
[EDIT]: Updated attached script to version 0.2, Jun 16, 2020. Rich
[EDIT]: Updated attached script to version 0.3, Jun 17, 2020. Rich
[EDIT]: Updated attached script to version 0.4, Jan 10, 2021. Rich
jazzbiker:
Hi, Rich!
Thank You, very interesting and covenient tool, good for learning.
Of course I started it immediately. One remark, it didn't succeed finding my grub2 bootloader.
--- Code: ---#-------------------------------------------------------------------------------
Sect 11 find bootloader config file
No bootloader config files found.
--- End code ---
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on June 07, 2020, 01:32:06 PM --- ... it didn't succeed finding my grub2 bootloader. ...
--- End quote ---
That's quite possible. The script only looks at what is visible. If the partition grub is installed on is not mounted, it is not visible
and will not be found. I have a couple of machines that have grub installed on partition number 1 but boot to Tinycore on a
different partition. The script will not find grub on those machines because the partition doesn't get mounted.
I also limit the search to a maximum of 6 subdirectories deep.
Rudock1:
Hi Rich,
I always enjoy learning from your scripts. As I am studying TCscan I saw a couple things to share back:
Sect 8 my onboot.lst file was not found because it is uniquely named, I don't know if this is a common occurrence
lst=onboot_xorg_jwm_DEBUG64.lst
Sect 10 "Orphaned md5 files" label is showing for the .dep files
That's all, otherwise a few ideas for future:
a listing of the system aliases could be useful
a listing of the env or set command
my bootable USB flash drive bootloaders are
legacy BIOS using syslinux.cfg
UEFI BIOS using rEFId
thanks again for all your great support!
Billy
Rich:
Hi Rudock1
--- Quote from: Rudock1 on June 16, 2020, 02:15:05 PM --- ... I always enjoy learning from your scripts. ...
--- End quote ---
Thank you. It's nice to hear they have some educational value. Hopefully the comments include in the script were helpful too.
--- Quote --- ... As I am studying TCscan I saw a couple things to share back:
Sect 8 my onboot.lst file was not found because it is uniquely named, I don't know if this is a common occurrence
lst=onboot_xorg_jwm_DEBUG64.lst ...
--- End quote ---
The script was primarily aimed at installation issues of newbies. As a result, I tried to focus on default install values. I suppose I
could check for the presence of lst= in /proc/cmdline to see if an alternate name was specified.
--- Quote --- ... Sect 10 "Orphaned md5 files" label is showing for the .dep files ...
--- End quote ---
Seems I forgot to edit a line after copying and pasting. Thanks for bringing it to my attention.
Navigation
[0] Message Index
[#] Next page
Go to full version