Stop compressing the .img, and prepare to drop .tar as the update package.

This commit is contained in:
fewtarius 2022-03-30 19:14:07 -04:00
parent 2fae13d6e8
commit 1e5668f857
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
3 changed files with 18 additions and 16 deletions

View file

@ -70,15 +70,24 @@ then
exit 0
fi
echo -e "\nFetching: ${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar" >/dev/console
curl -Lo "${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar" "${GIT_REPO}/releases/download/${LATEST_RELEASE_TAG}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar" 2>/dev/console
echo -e "Fetching: ${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar.sha256" >/dev/console
curl -Lo "${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar.sha256" "${GIT_REPO}/releases/download/${LATEST_RELEASE_TAG}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar.sha256" 2>/dev/console
# Continue to use the .tar extension for a while
# and cut over for all updates after this date.
if [ "${LATEST_RELEASE_TAG}" -lt "20220409" ]
then
EXTENSION="tar"
else
EXTENSION="img"
fi
echo -e "\nFetching: ${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION}" >/dev/console
curl -Lo "${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION}" "${GIT_REPO}/releases/download/${LATEST_RELEASE_TAG}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar" 2>/dev/console
echo -e "Fetching: ${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION}.sha256" >/dev/console
curl -Lo "${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION}.sha256" "${GIT_REPO}/releases/download/${LATEST_RELEASE_TAG}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar.sha256" 2>/dev/console
echo -e "\nVerifying download, please wait..." >/dev/console
# Verify
MYSUM=$(sha256sum ${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar | awk '{print $1}')
DLSUM=$(cat ${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.tar.sha256 | awk '{print $1}')
MYSUM=$(sha256sum ${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION} | awk '{print $1}')
DLSUM=$(cat ${UPDATE_PATH}/${OS_NAME}-${HW_DEVICE}.${HW_ARCH}-${LATEST_RELEASE_TAG}.${EXTENSION}.sha256 | awk '{print $1}')
if [ ! "${MYSUM}" == "${DLSUM}" ]
then

View file

@ -427,15 +427,12 @@ set_consolefont() {
progress "Set console font"
if [ -e /dev/fb0 ]; then
hres="$(fbset 2>/dev/null | awk '/geometry/ { print $2 }')"
if [ "${hres}" -lt "640" ]
if [ "${hres}" -lt "1152" ]
then
setfont -C /dev/tty0 ter-v14n.psf
elif [ "${hres}" -ge "1152" ]
then
setfont -C /dev/tty0 ter-v32n.psf
elif [ "${hres}" -ge "640" ]
then
setfont -C /dev/tty0 ter-v20n.psf
fi
fi
}

View file

@ -315,17 +315,13 @@ if [ "${PROJECT}" = "Generic" ]; then
[ -n "${SUDO_USER}" ] && chown "${SUDO_USER}:" "${DISK_BASENAME}.ova"
fi
# gzip
echo "image: compressing..."
pigz --best --force "${DISK}"
# set owner
if [ -n "${SUDO_USER}" ]; then
chown "${SUDO_USER}:" "${DISK}.gz"
chown "${SUDO_USER}:" "${DISK}"
fi
# create sha256 checksum of image
( cd "${TARGET_IMG}"
sha256sum $(basename "${DISK}").gz > $(basename "${DISK}").gz.sha256
sha256sum $(basename "${DISK}") > $(basename "${DISK}").sha256
)
# cleanup