164 lines
14 KiB
Diff
164 lines
14 KiB
Diff
|
|
From b325c0dcbb7ad90448aad6d99752ce08f9c90f5d Mon Sep 17 00:00:00 2001
|
||
|
|
From: Wenlong Zhang <zhangwenlong@loongson.cn>
|
||
|
|
Date: Tue, 26 Nov 2024 10:36:46 +0800
|
||
|
|
Subject: [PATCH] enable efi boot for loongarch64
|
||
|
|
|
||
|
|
---
|
||
|
|
.../loongarch64/livecd/live/loongarch64.tmpl | 4 +-
|
||
|
|
isomaker/iso.sh | 46 +++++++++++++++----
|
||
|
|
2 files changed, 39 insertions(+), 11 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/isomaker/config/loongarch64/livecd/live/loongarch64.tmpl b/isomaker/config/loongarch64/livecd/live/loongarch64.tmpl
|
||
|
|
index daf68c1..b18ffc9 100644
|
||
|
|
--- a/isomaker/config/loongarch64/livecd/live/loongarch64.tmpl
|
||
|
|
+++ b/isomaker/config/loongarch64/livecd/live/loongarch64.tmpl
|
||
|
|
@@ -65,9 +65,11 @@ mkdir ${KERNELDIR}
|
||
|
|
|
||
|
|
%if exists("boot/efi/EFI/*/grubloongarch64.efi"):
|
||
|
|
## make boot.iso
|
||
|
|
-runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||
|
|
+runcmd xorriso as mkisofs -o ${outroot}/images/boot.iso \
|
||
|
|
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
|
||
|
|
-graft-points \
|
||
|
|
+ -efi-boot-part \
|
||
|
|
+ --efi-boot-image \
|
||
|
|
${KERNELDIR}=${outroot}/${KERNELDIR} \
|
||
|
|
${LIVEDIR}=${outroot}/${LIVEDIR} \
|
||
|
|
${efigraft} ${filegraft}
|
||
|
|
diff --git a/isomaker/iso.sh b/isomaker/iso.sh
|
||
|
|
index 9c0cb0f..a70eb15 100755
|
||
|
|
--- a/isomaker/iso.sh
|
||
|
|
+++ b/isomaker/iso.sh
|
||
|
|
@@ -26,9 +26,13 @@ function gen_debug_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DBG_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DBG_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ # Enable EFI boot loongarch64
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DBG_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${DBG_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -43,9 +47,12 @@ function gen_standard_iso()
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
isohybrid -u "${OUTPUT_DIR}/${STANDARD_ISO_NAME}"
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -63,9 +70,12 @@ function gen_edge_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${EDGE_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${EDGE_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${EDGE_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -83,9 +93,12 @@ function gen_desktop_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DESKTOP_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DESKTOP_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${DESKTOP_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -103,9 +116,12 @@ function gen_src_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${SRC_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${SRC_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${SRC_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -125,9 +141,12 @@ function gen_everything_iso()
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
isohybrid -u /result/"${EVE_ISO_NAME}"
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -147,9 +166,12 @@ function gen_everything_debug_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_DEBUG_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_DEBUG_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_DEBUG_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
@@ -169,13 +191,15 @@ function gen_everything_src_iso()
|
||
|
|
if [ "$ARCH" == "x86_64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_SRC_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_SRC_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${EVE_SRC_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ [ $? != 0 ] && return 1
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
-
|
||
|
|
fi
|
||
|
|
implantisomd5 /result/"${EVE_SRC_ISO_NAME}"
|
||
|
|
return 0
|
||
|
|
@@ -187,8 +211,10 @@ function gen_netinst_iso()
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${NETINST_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
isohybrid -u /result/"${NETINST_ISO_NAME}"
|
||
|
|
- elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "loongarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
+ elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "riscv64" ]; then
|
||
|
|
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${NETINST_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
+ elif [ "$ARCH" == "loongarch64" ]; then
|
||
|
|
+ xorriso as mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${NETINST_ISO_NAME}" -efi-boot-part --efi-boot-image -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
|
||
|
|
elif [ "$ARCH" == "ppc64le" ]; then
|
||
|
|
mkisofs -joliet-long -U -J -R -T -o "${OUTPUT_DIR}/${STANDARD_ISO_NAME}" -part -hfs -r -l -sysid "${SYSID_PPC}" -V "${RELEASE_NAME}" -chrp-boot -hfs-bless boot/grub/powerpc-ieee1275 -no-desktop -allow-multidot "${BUILD}"/iso
|
||
|
|
[ $? != 0 ] && return 1
|
||
|
|
--
|
||
|
|
2.43.0
|
||
|
|
|