From dccea3891b03a767c638ce626c6398b8459289fd Mon Sep 17 00:00:00 2001 From: zenobit Date: Mon, 3 Mar 2025 12:44:32 +0100 Subject: [PATCH] Fix dietpi and make it dynamic --- actions/dietpi | 28 +++------------------------- public/dietpi | 29 ++++------------------------- 2 files changed, 7 insertions(+), 50 deletions(-) diff --git a/actions/dietpi b/actions/dietpi index 0f60d8a..576e4c5 100644 --- a/actions/dietpi +++ b/actions/dietpi @@ -11,7 +11,7 @@ function releases_() { } function editions_() { - echo bookworm bookworm-installer bullseye bullseye-installer + echo $(web_pipe "https://dietpi.com/downloads/images/" | grep '\.iso"' | cut -d'"' -f2 | grep '_VM-UEFI' | cut -d'-' -f4 | cut -d'_' -f1) } function get_() { @@ -19,38 +19,16 @@ function get_() { 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 + local ISO="DietPi_VM-x86_64-${EDITION}_Installer.iso" 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 + local ISO="DietPi_VM-UEFI-x86_64-${EDITION}_Installer.iso" 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 } - diff --git a/public/dietpi b/public/dietpi index cefc9a7..d305d4b 100644 --- a/public/dietpi +++ b/public/dietpi @@ -8,14 +8,14 @@ CREDENTIALS="-" RELEASES="uefi bios" -EDITIONS="bullseye-installer bullseye bookworm-installer bookworm" +EDITIONS="Trixie Bullseye Bookworm" function releases_() { echo bios uefi } function editions_() { - echo bookworm bookworm-installer bullseye bullseye-installer + echo $(web_pipe "https://dietpi.com/downloads/images/" | grep '\.iso"' | cut -d'"' -f2 | grep '_VM-UEFI' | cut -d'-' -f4 | cut -d'_' -f1) } function get_() { @@ -23,35 +23,14 @@ function get_() { 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 + local ISO="DietPi_VM-x86_64-${EDITION}_Installer.iso" 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 + local ISO="DietPi_VM-UEFI-x86_64-${EDITION}_Installer.iso" 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}"