This commit is contained in:
Valeria Fadeeva 2023-12-22 01:01:07 +05:00
parent f0706ac28d
commit 11c0b6041b
1 changed files with 33 additions and 2 deletions

View File

@ -62,6 +62,18 @@ if ! [[ -d "${REFIND_DIR}" ]]; then
fi
echo "Found rEFInd in ${REFIND_DIR}"
EFI_BOOT_DIR=$(find "$ESP" -type d -iname boot)
if ! [[ -d "${EFI_BOOT_DIR}" ]]; then
EFI_BOOT_DIR=$(find "$ESP" -type d -iname Boot)
if ! [[ -d "${EFI_BOOT_DIR}" ]]; then
EFI_BOOT_DIR=$(find "$ESP" -type d -iname BOOT)
if ! [[ -d "${EFI_BOOT_DIR}" ]]; then
mkdir -p "$(dirname ${REFIND_DIR})/boot"
EFI_BOOT_DIR="$(dirname ${REFIND_DIR})/boot"
fi
fi
fi
if [ -z "${ESP}" ]; then
exit 1
@ -147,12 +159,31 @@ if [ -d "$KERNEL_DIR" ]; then
cat "$manual_end_conf" >> "$manual_conf"
cp -vf "$manual_conf" "${ESP}/EFI/refind/manual.conf"
cp -vf "$manual_conf" "${REFIND_DIR}/manual.conf"
if [ -d "${ESP}/EFI/boot" ]; then
cp -vf "$manual_conf" "${ESP}/EFI/boot/manual.conf"
cp -vf "$manual_conf" "${EFI_BOOT_DIR}/manual.conf"
fi
rm -f "$manual_conf"
rm -f "$manual_end_conf"
REFIND_CONF_PATH="${REFIND_DIR}/refind.conf"
RESULT=$(grep "theme" $REFIND_CONF_PATH)
if [[ "$?" = "0" ]]; then
CURRENT_THEME=$(echo $RESULT | cut -d"/" -f2)
if [[ "$?" = "0" ]]; then
sed -e "s/$CURRENT_THEME/$theme/g" -i $REFIND_CONF_PATH
fi
else
if [[ -z "$(tail -n 1 -c 1 $REFIND_CONF_PATH)" ]];then
echo "include themes/$theme/theme.conf" >> $REFIND_CONF_PATH
else
echo -e "\ninclude themes/$theme/theme.conf" >> $REFIND_CONF_PATH
fi
fi
cp -vf "${REFIND_DIR}/refind.conf" "${EFI_BOOT_DIR}/refind.conf"
fi