From c260e528a2a965a911e71fd4912718186544cf53 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (CosmicFusion)" Date: Wed, 27 Nov 2024 20:18:01 +0100 Subject: [PATCH] Update pika-refind-theme/debian/pika-refind-theme.postinst --- .../debian/pika-refind-theme.postinst | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pika-refind-theme/debian/pika-refind-theme.postinst b/pika-refind-theme/debian/pika-refind-theme.postinst index f98e4e5..ea3a78c 100755 --- a/pika-refind-theme/debian/pika-refind-theme.postinst +++ b/pika-refind-theme/debian/pika-refind-theme.postinst @@ -1,31 +1,37 @@ #! /bin/bash +export EFI_PATH=/boot/efi -if [[ -z $EFI_PATH ]] && [[ -f /efi/EFI/refind/refind.conf ]] +if [[ -f $EFI_PATH/EFI/refind/refind.conf ]] then - export EFI_PATH=/efi + export DO_STANDARD_REFIND_PATH=true +fi + +if [[ -f $EFI_PATH/EFI/BOOT/refind.conf ]] +then + export DO_BOOTX64_REFIND_PATH=true fi -if [[ -z $EFI_PATH ]] && [[ -f /esp/EFI/refind/refind.conf ]] +install_refind_theme() { + REFIND_PATH="$1" + echo "Installing theme to: $REFIND_PATH" + grep -qxF 'include refind-dark/refind-dark.conf' $EFI_PATH/$REFIND_PATH/refind.conf || echo 'include refind-dark/refind-dark.conf' >> $EFI_PATH/$REFIND_PATH/refind.conf + cp -R /usr/share/pika-refind/theme/* $EFI_PATH/$REFIND_PATH +} + +if [[ $DO_STANDARD_REFIND_PATH == true ]] then - export EFI_PATH=/esp +echo "Standard Refind Path Detected" +install_refind_theme "EFI/refind" fi -if [[ -z $EFI_PATH ]] && [[ -f /boot/efi/EFI/refind/refind.conf ]] +if [[ $DO_BOOTX64_REFIND_PATH == true ]] then - export EFI_PATH=/boot/efi +echo "Bootx64 Refind Path Detected" +install_refind_theme "EFI/BOOT" fi -if [[ -z $EFI_PATH ]] && [[ -f /boot/EFI/refind/refind.conf ]] -then - export EFI_PATH=/boot -fi - - -grep -qxF 'include refind-dark/refind-dark.conf' $EFI_PATH/EFI/refind/refind.conf || echo 'include refind-dark/refind-dark.conf' >> $EFI_PATH/EFI/refind/refind.conf -cp -R /usr/share/pika-refind/theme/* $EFI_PATH/EFI/refind - echo "changing up refind_linux.conf" if cat /boot/refind_linux.conf | grep amd_pstate