Remove AI slops: fix parenthetical plural, deduplicate install-grub.sh

This commit is contained in:
2026-04-18 00:57:39 +01:00
parent bed0252d34
commit 44cee12a62
2 changed files with 21 additions and 28 deletions
@@ -72,7 +72,7 @@ impl RepairStats {
} }
if self.orphaned_lfn_entries_removed != 0 { if self.orphaned_lfn_entries_removed != 0 {
parts.push(format!( parts.push(format!(
"{} orphaned LFN entr(ies)", "{} orphaned LFN entries",
self.orphaned_lfn_entries_removed self.orphaned_lfn_entries_removed
)); ));
} }
+20 -27
View File
@@ -24,7 +24,6 @@ ESP_SECTOR_SIZE=512
ESP_OFFSET=$((ESP_LBA * ESP_SECTOR_SIZE)) ESP_OFFSET=$((ESP_LBA * ESP_SECTOR_SIZE))
FAT_TOOL="${SCRIPT_DIR}/fat_tool.py" FAT_TOOL="${SCRIPT_DIR}/fat_tool.py"
ESP="${IMAGE}@${ESP_OFFSET}"
if [ ! -f "${IMAGE}" ]; then if [ ! -f "${IMAGE}" ]; then
echo "ERROR: Image file not found: ${IMAGE}" >&2 echo "ERROR: Image file not found: ${IMAGE}" >&2
@@ -36,33 +35,30 @@ if ! command -v python3 &>/dev/null; then
exit 1 exit 1
fi fi
find_artifact() {
local search_dir="$1"
local pattern="$2"
[ -d "${search_dir}" ] || return 0
for f in $(find "${search_dir}" -path "${pattern}" 2>&1 | grep -v "Permission denied"); do
echo "$f"
return
done
}
GRUB_EFI="" GRUB_EFI=""
GRUB_CFG="" GRUB_CFG=""
# Search in recipe stage directory (cookbook stores output here) GRUB_TARGET="${REPO_ROOT}/local/recipes/core/grub/target"
for f in $(find "${REPO_ROOT}/local/recipes/core/grub/target" -path "*/stage/usr/lib/boot/grub.efi" 2>/dev/null); do GRUB_EFI="$(find_artifact "${GRUB_TARGET}" "*/stage/usr/lib/boot/grub.efi")" || true
GRUB_EFI="${f}" GRUB_CFG="$(find_artifact "${GRUB_TARGET}" "*/stage/usr/lib/boot/grub.cfg")" || true
break
done
for f in $(find "${REPO_ROOT}/local/recipes/core/grub/target" -path "*/stage/usr/lib/boot/grub.cfg" 2>/dev/null); do
GRUB_CFG="${f}"
break
done
# Fallback: search repo extracted packages # Fallback: search repo extracted packages
if [ -z "${GRUB_EFI}" ]; then if [ -z "${GRUB_EFI}" ]; then
for f in $(find "${REPO_ROOT}/repo" -path "*/grub/*/usr/lib/boot/grub.efi" 2>/dev/null); do GRUB_EFI="$(find_artifact "${REPO_ROOT}/repo" "*/grub/*/usr/lib/boot/grub.efi")" || true
GRUB_EFI="${f}"
break
done
fi fi
if [ -z "${GRUB_CFG}" ]; then if [ -z "${GRUB_CFG}" ]; then
for f in $(find "${REPO_ROOT}/repo" -path "*/grub/*/usr/lib/boot/grub.cfg" 2>/dev/null); do GRUB_CFG="$(find_artifact "${REPO_ROOT}/repo" "*/grub/*/usr/lib/boot/grub.cfg")" || true
GRUB_CFG="${f}"
break
done
fi fi
if [ -z "${GRUB_CFG}" ] && [ -f "${REPO_ROOT}/local/recipes/core/grub/grub.cfg" ]; then if [ -z "${GRUB_CFG}" ] && [ -f "${REPO_ROOT}/local/recipes/core/grub/grub.cfg" ]; then
@@ -95,16 +91,13 @@ REDBEAR_EFI=""
for search_path in \ for search_path in \
"${REPO_ROOT}/recipes/core/bootloader/target" \ "${REPO_ROOT}/recipes/core/bootloader/target" \
"${REPO_ROOT}/local/recipes/core/bootloader/target"; do "${REPO_ROOT}/local/recipes/core/bootloader/target"; do
for f in $(find "${search_path}" -path "*/stage/usr/lib/boot/bootloader.efi" 2>/dev/null); do REDBEAR_EFI="$(find_artifact "${search_path}" "*/stage/usr/lib/boot/bootloader.efi")" || true
REDBEAR_EFI="${f}" if [ -n "${REDBEAR_EFI}" ]; then
break 2 break
done fi
done done
if [ -z "${REDBEAR_EFI}" ]; then if [ -z "${REDBEAR_EFI}" ]; then
for f in $(find "${REPO_ROOT}/repo" -path "*/bootloader/*/usr/lib/boot/bootloader.efi" 2>/dev/null); do REDBEAR_EFI="$(find_artifact "${REPO_ROOT}/repo" "*/bootloader/*/usr/lib/boot/bootloader.efi")" || true
REDBEAR_EFI="${f}"
break
done
fi fi
if [ -z "${REDBEAR_EFI}" ]; then if [ -z "${REDBEAR_EFI}" ]; then