Last week I mentioned the hardware detection BASH script I wrote for refurbishers installing Ubuntu-based distributions on desktops and laptops. I’ve made several changes to the script, including:
- fixing a bug where the script broke on a laptop if a battery wasn’t present
- changing the margins so more information could be included in the future
- the addition of a graphical barcode based on the system’s serial number
It’s worth mentioning that these changes (unfortunately) add quite a few packages to the system. While I’ve only added a few additional programs, one of those programs texlive-extra-utils installs approximately 70 libraries. The texlive-extra-utils is needed for a single tool that isn’t available in other packages, so for now texlive-extra-utils is being included.
Much of the work done is around the inclusion of a graphical barcode based on the system’s serial number. The barcode is created using the following steps:
- dmidecode is used to output the serial number to a text file
- barcode is used to generate a visual EPS file based on the text file contents
- eps2pdf converts the EPS file to a PDF (because there aren’t great tools to crop EPS files)
- pdfcrop then crops the PDF to something that fits nicely in a LaTeX document
During the process several files are created and deleted. I’ve also deleted the specs.log and specs.aux files at the end of the script as they’re really not helpful after the script is done.
If you’ve already followed the instructions in my previous post about hardware.sh to install it, you can update to the newest version by changing to the hardware.sh directory and running git pull:
cd ~/Code/hardware.sh
git pull
See my previous post about installing the script: https://www.chaslinux.com/?p=127