first of all I am not a script guru - but I love google, openwrt and similar pages on how to build scripts.
Here is how I am making the hotfix packages:
The difficulty with this script was to find an automatic way to add files to a tgz file since the version of tar does not allow for ADDING files after creation.
I have 3 files in the tmp folder:
1) make_hotfix.lst = list of files to include in the hotfix
2) make_hotfix.txt = list of changes made to the files listed
3) make_hotfix.sh = actual script to make the tgz file - code listed below.
when I run "sh /tmp/make_hotfix.sh VERSIONA" then it creates three files adding "VERSIONA" to the file names:
1) hotfix-VERSIONA.tgz = the tar ball with all the files in it
2) hotfix-VERSIONA.md5 = the md5sum of the tar ball.
3) hotfix-VERSIONA.txt = copy of make_hotfix.txt
but it will proceed only if the script can find all the files in make_hotfix_list
FILE_LIST='/tmp/make_hotfix.lst' # list of files to tar
FILE_INFO='/tmp/make_hotfix.txt' # list of changes made
FILE_ARCHIVE="/tmp/hotfix$1.tgz" # target output
FILE_ARCHMD5="/tmp/hotfix$1.md5" # MD5SUM of the archive
# Check if all files are present and aborts if a file is not present
if [ ! -r "$FILE_LIST" ]; then
echo "Unable to open $FILE_LIST, aborting"
echo "HOTFIX creation script"
echo "Archive $FILE_ARCHIVE based on files listed in $FILE_LIST"
while IFS= read -r var
if [ ! -r "$var" ]; then
echo "ERROR: file $var was not found, aborting"
done < "$FILE_LIST"
echo "OK - all files found"
echo "Creating archive $FILE_ARCHIVE now"
# remove previous created archive
if [ -r "$FILE_ARCHIVE" ]; then
echo "Deleting previous archive"
date > /.hf_date
tar -czvf $FILE_ARCHIVE -T $FILE_LIST
cp $FILE_INFO "/tmp/hotfix$1.txt"
echo "Calculating MD5SUM of the archive"
md5sum "$FILE_ARCHIVE" > $FILE_ARCHMD5
echo "Done making hotfix patches ......"
make_hotfix.lst is nothing more than a list of files:
I am intentionally NOT including the ITUS hotfix (http://itus.accessinnov.com/Hotfix-160210-td8.html) in this fix.
That particular hotfix also replaces active config files (like network and dhcp) from my Shield. So if I use this script, I risk sharing my own bridge mode setups