mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2026-12-06 04:43:46 +00:00
134 lines
3.6 KiB
Text
134 lines
3.6 KiB
Text
# Template file for 'slax'
|
|
OSNAME="slax"
|
|
PRETTY="Slax"
|
|
LOGO=""
|
|
ICON="slax.svg"
|
|
ICON_ONLINE=""
|
|
CATEGORY="Lightweight"
|
|
BASEDOF="Debian Slackware"
|
|
DESCRIPTION="Compact, fast, and modern Linux operating system that combines sleek design with modular approach. With the ability to run directly from a USB flash drive without the need for installation, Slax is truly portable and fits easily in your pocket"
|
|
HOMEPAGE="https://www.slax.org"
|
|
CREDENTIALS="-"
|
|
GPG=""
|
|
RSS=""
|
|
DW=""
|
|
MAGNET=""
|
|
MAGNET_PREFERRED=""
|
|
TORRENT=""
|
|
CHAT=""
|
|
SLAX_MIRROR="https://ftp.fi.muni.cz/pub/linux/slax"
|
|
|
|
RELEASES="2026.11 15.0.4 15.0.3 15.0.1 15.0.0 12.2.0 latest"
|
|
EDITIONS="debian slackware"
|
|
EDITIONS_LIST="debian
|
|
slackware"
|
|
QEMU_ARCH="amd64"
|
|
|
|
_release_editions_() {
|
|
case "${1:-}" in
|
|
"amd64|2026.11") echo "debian" ;;
|
|
"amd64|12.2.0") echo "debian" ;;
|
|
"amd64|15.0.4") echo "slackware" ;;
|
|
"amd64|15.0.3") echo "slackware" ;;
|
|
"amd64|15.0.1") echo "slackware" ;;
|
|
"amd64|15.0.0") echo "slackware" ;;
|
|
"amd64|latest") echo "debian slackware" ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
_slax_images_() {
|
|
web_pipe "${SLAX_MIRROR}/" \
|
|
| grep -oE 'href="Slax-[0-9]+(\.x)?/"' \
|
|
| cut -d '"' -f2 | sort -u | while IFS= read -r dir; do
|
|
web_pipe "${SLAX_MIRROR}/${dir}" \
|
|
| grep -oE 'href="slax-[^"/]+\.iso"' \
|
|
| cut -d '"' -f2 | awk -v base="${SLAX_MIRROR}/${dir}" '
|
|
/^slax-64bit-((debian|slackware)-)?[0-9]+(\.[0-9]+)*\.iso$/ {
|
|
version = $0
|
|
sub(/^slax-64bit-/, "", version)
|
|
edition = "slackware"
|
|
if (version ~ /^debian-/ || version ~ /^(9|1[0-3])\./) edition = "debian"
|
|
sub(/^(debian|slackware)-/, "", version)
|
|
sub(/\.iso$/, "", version)
|
|
printf "%s\t%s\t%s%s\n", version, edition, base, $0
|
|
}
|
|
/^slax-[0-9]+(\.[0-9]+)*-64bit(-[0-9]+)?\.iso$/ {
|
|
version = $0
|
|
sub(/^slax-/, "", version)
|
|
sub(/-64bit.*$/, "", version)
|
|
printf "%s\tdebian\t%s%s\n", version, base, $0
|
|
}'
|
|
done
|
|
}
|
|
|
|
releases_() {
|
|
echo latest
|
|
_slax_images_ | cut -f1 | sort -uVr
|
|
}
|
|
|
|
editions_() {
|
|
_slax_images_ | awk -F '\t' -v release="${RELEASE:-latest}" '
|
|
release == "latest" || $1 == release { print $2 }
|
|
' | sort -u
|
|
}
|
|
|
|
arch_() {
|
|
echo amd64
|
|
}
|
|
|
|
get_() {
|
|
case "${ARCH:-amd64}" in amd64|x86_64) ;; *) return 1 ;; esac
|
|
case "${EDITION}" in debian|slackware) ;; *) return 1 ;; esac
|
|
local ENTRY URL ISO HASH SUM_URL HASH_LENGTH
|
|
ENTRY=$(_slax_images_ | awk -F '\t' \
|
|
-v release="${RELEASE:-latest}" -v edition="${EDITION}" '
|
|
$2 == edition && (release == "latest" || $1 == release) {
|
|
printf "%s\t%s\n", $1, $3
|
|
}' | sort -k1,1V -k2,2V | tail -n1)
|
|
[ -n "${ENTRY}" ] || return 1
|
|
URL="${ENTRY#*$'\t'}"
|
|
ISO="${URL##*/}"
|
|
case "${ISO}" in
|
|
slax-[0-9]*-64bit*) SUM_URL="${URL}.sha256sum.txt"; HASH_LENGTH=64 ;;
|
|
*) SUM_URL="${URL%/*}/md5.txt"; HASH_LENGTH=32 ;;
|
|
esac
|
|
HASH=$(web_pipe "${SUM_URL}" | awk -v iso="${ISO}" -v size="${HASH_LENGTH}" '
|
|
{
|
|
file = $2
|
|
sub(/\r$/, "", file)
|
|
sub(/^\*/, "", file)
|
|
if (file == iso && length($1) == size && $1 !~ /[^[:xdigit:]]/) {
|
|
print $1
|
|
exit
|
|
}
|
|
}')
|
|
[ -n "${HASH}" ] || return 1
|
|
echo "${URL} ${HASH}"
|
|
}
|
|
|
|
config_() {
|
|
echo "boot=\"legacy\"" >> "${CONF_FILE}"
|
|
}
|
|
|
|
releases_() {
|
|
# Releases parsed at generation time — no network access needed.
|
|
echo "${RELEASES}"
|
|
}
|
|
editions_() {
|
|
# Editions parsed at generation time — no network access needed.
|
|
local _scoped=""
|
|
if [ -n "${RELEASE:-}" ] && declare -F _release_editions_ >/dev/null; then
|
|
_scoped=$(_release_editions_ "${ARCH:-}|${RELEASE}")
|
|
fi
|
|
if [ -n "${_scoped}" ]; then
|
|
echo "${_scoped}"
|
|
return 0
|
|
fi
|
|
local _per_arch="EDITIONS_${ARCH:-}"
|
|
if [ -n "${!_per_arch:-}" ]; then
|
|
echo "${!_per_arch}"
|
|
return 0
|
|
fi
|
|
echo "${EDITIONS:-}"
|
|
}
|