Update pika-refind-theme/debian/pika-refind-theme.postinst

This commit is contained in:
Ward Nakchbandi (CosmicFusion) 2024-11-27 20:18:01 +01:00
parent b991aad020
commit c260e528a2

View File

@ -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