From 033792516b65159bdf033c9a22bc5c12c44f45f8 Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Sat, 3 Aug 2024 03:31:45 +0200 Subject: [PATCH 1/2] Use whiptail by default The default mode being suitable for the installer (not showing download progress) is not good for using frzr via terminal: use whiptail GUI by default --- __frzr-deploy | 8 ++++---- test/test-deploy.sh | 1 + test/test-install.sh | 1 + test/test-removal.sh | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index d25652b..d467e13 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -337,7 +337,7 @@ frzr_deploy() { if [ $FRZR_STEAM_PROGRESS -eq 1 ]; then curl --http1.1 -# -L -o "${IMG_FILE}" -C - "${IMG_URL}" 2>&1 | stdbuf -oL tr '\r' '\n' | grep --line-buffered -oP '[0-9]*+(?=.[0-9])' | clean_progress 91 % - elif [ -z ${SHOW_UI} ]; then + elif [ "${SHOW_UI}" = "0" ]; then # This will need to be put under a new variable if it passes testing because we want to have different # logic depending if there is a Modern UI, legecy UI support, or if it is ran via CLI TASK_MSG="Downloading Image" @@ -412,7 +412,7 @@ frzr_deploy() { fi # Use BTRFS receive to install the image - if [ -z ${SHOW_UI} ]; then + if [ "${SHOW_UI}" = "0" ]; then TASK_MSG="Installing image ${NAME}" send_data else @@ -572,7 +572,7 @@ frzr_deploy() { RUNNING=false - if [ -z ${SHOW_UI} ]; then + if [ "${SHOW_UI}" = "0" ]; then echo "Deployment is successful: reboot to boot into ${NAME}" else whiptail --msgbox "Deployment is successful: reboot to boot into ${NAME}" 8 48 @@ -585,7 +585,7 @@ frzr_deploy() { send_data RUNNING=false - if [ -z ${SHOW_UI} ]; then + if [ "${SHOW_UI}" = "0" ]; then echo "Deployment failed: ${TASK_ERROR_MSG}" else whiptail --msgbox "Deployment failed: ${TASK_ERROR_MSG}" 8 48 diff --git a/test/test-deploy.sh b/test/test-deploy.sh index 3e53edc..10692f2 100755 --- a/test/test-deploy.sh +++ b/test/test-deploy.sh @@ -76,6 +76,7 @@ if btrfs send $MOUNT_POINT/archlinux | xz -e -9 --memory=95% -T0 > $TARGET_FILEN export SWAP_GIB=0 bash /workdir/frzr bootstrap + export SHOW_UI="0" export SKIP_UEFI_CHECK="yes" export MOUNT_PATH="/tmp/frzr_root" export EFI_MOUNT_PATH="/tmp/frzr_root/efi" diff --git a/test/test-install.sh b/test/test-install.sh index ab61e39..170e29a 100755 --- a/test/test-install.sh +++ b/test/test-install.sh @@ -33,6 +33,7 @@ export DISK="$MOUNTED_DEVICE" export SWAP_GIB=0 bash /workdir/frzr bootstrap +export SHOW_UI="0" export SKIP_UEFI_CHECK="yes" export MOUNT_PATH="/tmp/frzr_root" export EFI_MOUNT_PATH="/tmp/frzr_root/efi" diff --git a/test/test-removal.sh b/test/test-removal.sh index 34bd4dd..c06b8c2 100755 --- a/test/test-removal.sh +++ b/test/test-removal.sh @@ -33,6 +33,7 @@ export DISK="$MOUNTED_DEVICE" export SWAP_GIB=0 bash /workdir/frzr bootstrap +export SHOW_UI="0" export SKIP_UEFI_CHECK="yes" export MOUNT_PATH="/tmp/frzr_root" export EFI_MOUNT_PATH="/tmp/frzr_root/efi" From 707b00c35a4c2fe51a3e1dcb46352a58c1b74e9d Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Tue, 13 Aug 2024 18:35:27 +0200 Subject: [PATCH 2/2] Use curl by default - introduce FRZR_INSTALLER to flag for the presence of the GUI installer - use curl by default if frzr deploy is used by CLI --- __frzr | 1 + __frzr-deploy | 4 +++- __frzr-envars | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/__frzr b/__frzr index f900666..c6a52ed 100644 --- a/__frzr +++ b/__frzr @@ -21,6 +21,7 @@ frzr_status() { "Local Install": "$LOCAL_INSTALL", "Repair Install": "$REPAIR_INSTALL", "Show UI": "$SHOW_UI", + "GUI Installer": "$FRZR_INSTALLER", "EFI Path": "$EFI_MOUNT_PATH", "Mount Path": "$MOUNT_PATH", "SUBVOL": "$SUBVOL", diff --git a/__frzr-deploy b/__frzr-deploy index d467e13..73a69ee 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -337,7 +337,7 @@ frzr_deploy() { if [ $FRZR_STEAM_PROGRESS -eq 1 ]; then curl --http1.1 -# -L -o "${IMG_FILE}" -C - "${IMG_URL}" 2>&1 | stdbuf -oL tr '\r' '\n' | grep --line-buffered -oP '[0-9]*+(?=.[0-9])' | clean_progress 91 % - elif [ "${SHOW_UI}" = "0" ]; then + elif [ "${SHOW_UI}" = "0" ] && [ "${FRZR_INSTALLER}" = "1" ]; then # This will need to be put under a new variable if it passes testing because we want to have different # logic depending if there is a Modern UI, legecy UI support, or if it is ran via CLI TASK_MSG="Downloading Image" @@ -354,6 +354,8 @@ frzr_deploy() { fi; sleep 1; done + elif [ "${SHOW_UI}" = "0" ]; then + curl --http1.1 -L -o "${IMG_FILE}" -C - "${IMG_URL}" else TASK_MSG="Using Whiptail to show download progress" send_data diff --git a/__frzr-envars b/__frzr-envars index 7a6e36b..b3c51b5 100644 --- a/__frzr-envars +++ b/__frzr-envars @@ -28,6 +28,10 @@ if [ -z "$EFI_MOUNT_PATH" ]; then EFI_MOUNT_PATH="${MOUNT_PATH}/efi" # EFI mount path fi +if [ -z "$FRZR_INSTALLER" ]; then + FRZR_INSTALLER="0" +fi + SUBVOL="" DEPLOY_PATH="" # ${MOUNT_PATH}/deployments FRZR_CHECK_UPDATE=0