release/amd64: cleanup code duplication

Approved by:	imp (mentor)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1571
Closes:		https://github.com/freebsd/freebsd-src/pull/1571
This commit is contained in:
Ahmad Khalifa committed 2025-08-05 04:48:45 +03:00
1 parent 51affb7e97
commit 057686379c
2 files changed
+4 -8

No files matched your search

+2 -4
View File
@@ -62,11 +62,9 @@ fi
# Make an ESP in a file.
espfilename=$(mktemp /tmp/efiboot.XXXXXX)
if [ -f "${BASEBITSDIR}/boot/loader_ia32.efi" ]; then
make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi bootx64 \
${BASEBITSDIR}/boot/loader_ia32.efi bootia32
else
make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi
extra_args="${BASEBITSDIR}/boot/loader_ia32.efi bootia32"
fi
make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi bootx64 ${extra_args}
${MKIMG} -s mbr \
-b ${BASEBITSDIR}/boot/mbr \
+2 -4
View File
@@ -54,11 +54,9 @@ if [ "$1" = "-b" ]; then
# ESP file size in KB.
espsize="2048"
if [ -f "${BASEBITSDIR}/boot/loader_ia32.efi" ]; then
make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootx64 \
${BASEBITSDIR}/boot/loader_ia32.efi bootia32
else
make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi
extra_args="${BASEBITSDIR}/boot/loader_ia32.efi bootia32"
fi
make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootx64 ${extra_args}
bootable="$bootable -o bootimage=i386;${espfilename} -o no-emul-boot -o platformid=efi"
shift