quickemu/actions/dietpi

57 lines
1.6 KiB
Plaintext

# Template file for 'dietpi'
OSNAME=dietpi
PRETTY="DietPi"
BASEDOF="Debian"
DESCRIPTION="Highly optimised minimal Debian OS"
HOMEPAGE="https://dietpi.com"
CREDENTIALS='-'
function releases_() {
echo bios uefi
}
function editions_() {
echo bookworm bookworm-installer bullseye bullseye-installer
}
function get_() {
local HASH=""
local ISO=""
local URL="https://dietpi.com/downloads/images"
if [ "${RELEASE}" == 'bios' ]; then
case ${EDITION} in
bookworm )
local ISO="DietPi_NativePC-BIOS-x86_64-Bookworm.7z";;
bullseye )
local ISO="DietPi_NativePC-BIOS-x86_64-Bullseye.7z";;
'bookworm-installer' )
local ISO="DietPi_NativePC-BIOS-x86_64-Bookworm_Installer.7z";;
'bullseye-installer' )
local ISO="DietPi_NativePC-BIOS-x86_64-Bullseye_Installer.7z";;
esac
elif [ "${RELEASE}" == 'uefi' ]; then
case ${EDITION} in
'bookworm-installer' )
local ISO="DietPi_NativePC-UEFI-x86_64-Bookworm_Installer.7z";;
'bullseye-installer' )
local ISO="DietPi_NativePC-UEFI-x86_64-Bullseye_Installer.7z";;
esac
fi
HASH=$(wget -q -O- "${URL}/SHASUMS.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function distro_specific() {
if [[ "${ISO}" =~ ".7z" ]]; then
7zip x -o${VM_PATH} ${VM_PATH}/${ISO}
ISO=$(ls ${VM_PATH} | grep -i '.iso')
fi
}
function specific_tweaks() {
if [[ "${RELEASE}" == 'bios' ]]; then
echo "boot=\"legacy\"" >> "${CONF_FILE}"
fi
}