quickemu/actions/easyos

44 lines
1.6 KiB
Plaintext

# Template file for 'easyos'
OSNAME="easyos"
PRETTY="EasyOS"
BASEDOF="-"
HOMEPAGE="https://easyos.org"
DESCRIPTION="Experimental distribution designed from scratch to support containers"
CREDENTIALS="-"
IMAGE_TYPE="img"
function releases_() {
local ALL_RELEASES=""
local YEAR=""
# get the latest 2 years of releases so that when we hit next year we still have the latest 2 years
TWO_YEARS=$(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/ | grep -o -E '[[:digit:]]{4}/' | sort -nr | tr -d / | head -n 2 )
for YEAR in ${TWO_YEARS} ; do
ALL_RELEASES="${ALL_RELEASES} $(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/ | grep -o -E '[[:digit:]]+(\.[[:digit:]])+/' | tr -d / | sort -nr)"
done
echo ${ALL_RELEASES}
}
function get_() {
local HASH=""
local URL=""
local ISO=""
local YEAR=""
ISO="easy-${RELEASE}-amd64.img"
TWO_YEARS=$(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/ | grep -o -E '[[:digit:]]{4}/' | sort -nr | tr -d / | head -n 2 )
for YEAR in ${TWO_YEARS} ; do
if web_check "https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/${RELEASE}/" ; then
URL="https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/${RELEASE}"
HASH=$(web_pipe "${URL}/md5.sum.txt" | cut -d' ' -f1)
break
fi
done
echo "${URL}/${ISO} ${HASH}"
}
function distro_specific() {
if [[ ${ISO} = *".img"* ]]; then
${QEMU_IMG} convert -f raw -O qcow2 "${VM_PATH}/${ISO}" "${VM_PATH}/disk.qcow2"
ISO="${ISO/.img/}"
fi
}