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 2025-01-11 15:33:20 +02:00
parent 51affb7e97
commit 057686379c
2 changed files with 4 additions and 8 deletions

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 \

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