multi-tzx2sfs script
Posted: Tue Aug 25, 2020 9:42 am
I only discovered today that there is a rightclick menu option to convert a .tzx install package to sfs. I had developed a small script which did similar but it also downloads the packages and then creates one big sfs. So it is easy to create a Music or Art sfs with all your favourite packages. Also there are two types of post install package 1) install/doinst.sh and 2) /var/log/setup/setup.<package name>: ... the former is implemented the latter is not implemented here. It seemed to me that the /install/doinst.sh is a relative script, and works within the created directory file structure. I'm trying to improve the script in case there are any obvious incompatibilities.
but here it is
but here it is
Code: Select all
#!/bin/sh
# by stemsee, copyright (C) 2020
[[ -z "$1" ]]||[[ -z "$2" ]] && timeout 7 echo "usage: multi-tzx2sfs 'package package' '/path/dirname' 'sfs compression'
multi-tzx2sfs \"python perl rust\" '/mnt/sda1/progs' 'xz'" && exit
add="$1"
dir="$2"
comp="$3"
[ -z "$comp" ] && comp="xz"
[[ -z "$1" ]]||[[ -z "$2" ]] && exit
[ ! -d "$dir" ] && mkdir -p "$dir"/tmp/sfs/install || echo "$dir exists" && xdg-open "$dir" && echo "press return to continue" && read dummy
slapt-get --clean
slapt-get -y -i --allow-unauthenticated --retry=3 --download-only --ignore-dep $add &
wait $!
[ $? -eq 1 ] && exit
ls /var/slapt-get/* | while read line; do [[ "$line" != package_data ]] && engrampa "$line" --extract-to="$dir" &>/dev/null
mv -f "$dir"/install/doinst.sh "$dir"/ && chmod 755 "$dir"/doinst.sh && exec "$dir"/doinst.sh && rm -f "$dir"/doinst.sh
cat "$dir"/install/slack-desc >> "$dir"/tmp/sfs/install/slack-desc
cat "$dir"/install/slack-required >> "$dir"/tmp/sfs/install/slack-required
cat "$dir"/install/slack-desc | awk '{$1=""; print $0}' >> "$dir"/tmp/sfs/msg
rm -rf "$dir"/install
done
sort --unique -o "$dir"/tmp/sfs/install/slack-required "$dir"/tmp/sfs/install/slack-required
mksquashfs "$dir" "$dir".sfs -comp "$comp"