From 46619a2b551e7262407962ac86c40c062f3fa91c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 06:49:18 +0000 Subject: [PATCH 01/25] Plan: add LoongArch64 edk2 CI Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- libeg/nanojpeg.o | Bin 0 -> 12328 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 libeg/nanojpeg.o diff --git a/libeg/nanojpeg.o b/libeg/nanojpeg.o new file mode 100644 index 0000000000000000000000000000000000000000..cfa211727b36528454c0e4e2624758c654770c56 GIT binary patch literal 12328 zcmbta4|G)3nSXC)NG2rA8xU>OV5eoYObaoC(alJdyv!ST0~0_A%2r&6F~S%iG|W`c zDACE_JcdU(TipYvyW8EaZRxs4*lwF*rDcXlOsJ(X>{={pgVr+B2!=mR0z%$?-+lKE z!!6m}bM~E+x%d9=_wRn+cfWVvg)M>5Jc}p_>=A|gg{vcm3c{Y5SNk=jTO&AxNrE>O zH#QYNZy12>Go(dtb*YVSsp14ANs?dBec1PmYGf2oZJziR>ETb8HkO=((kN}Bm9AFPDNi#$z-XsUor8bK6&hr$rgP% z5bupBL4AoO_L)UBB?9RZQ6uWwFTEFW=uaCp?Z%aFPRTxQ7=|}xvSuHKf%eZ{aF0Ly{))>1aZYjR1pi4E^`b1LLIw1Xw8st0F_WnT&FlBdu0J%P>U0AkM)jmJy z1T6DIz|>u;m{P?qsdG-;h?ZOxIQWIkQ(#)nwq~&|{)dQ7PRw-2K9Qm}?}&h$yT3HXdjs0XL1HR+W6~}rEEqiQ0Uttxs-kqh`bJk!dp{Vfb_-F*K|!zx8Keqo zHg_;N)vd<+BR9P+v?Jed6>U`2UhV^V=U*MP2E3<(u{Z5%?6AGgcOiNp5I-ILf|{J8 z#=7i8hPPMM7LJB|=cC!LD_RC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9xZwM_fdWqCz$!4!B0X5ZQ=R*DE|O6 zlrr%An1$Di{{Vi-!?T3)WBl<5#`sHd5}xbnMtmP7*gy>{0Sr@#=SP`bhyf7<7yUr^ b6B%9o;g& Date: Mon, 20 Apr 2026 06:49:34 +0000 Subject: [PATCH 02/25] Remove accidental build artifact from baseline run Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- libeg/nanojpeg.o | Bin 12328 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 libeg/nanojpeg.o diff --git a/libeg/nanojpeg.o b/libeg/nanojpeg.o deleted file mode 100644 index cfa211727b36528454c0e4e2624758c654770c56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12328 zcmbta4|G)3nSXC)NG2rA8xU>OV5eoYObaoC(alJdyv!ST0~0_A%2r&6F~S%iG|W`c zDACE_JcdU(TipYvyW8EaZRxs4*lwF*rDcXlOsJ(X>{={pgVr+B2!=mR0z%$?-+lKE z!!6m}bM~E+x%d9=_wRn+cfWVvg)M>5Jc}p_>=A|gg{vcm3c{Y5SNk=jTO&AxNrE>O zH#QYNZy12>Go(dtb*YVSsp14ANs?dBec1PmYGf2oZJziR>ETb8HkO=((kN}Bm9AFPDNi#$z-XsUor8bK6&hr$rgP% z5bupBL4AoO_L)UBB?9RZQ6uWwFTEFW=uaCp?Z%aFPRTxQ7=|}xvSuHKf%eZ{aF0Ly{))>1aZYjR1pi4E^`b1LLIw1Xw8st0F_WnT&FlBdu0J%P>U0AkM)jmJy z1T6DIz|>u;m{P?qsdG-;h?ZOxIQWIkQ(#)nwq~&|{)dQ7PRw-2K9Qm}?}&h$yT3HXdjs0XL1HR+W6~}rEEqiQ0Uttxs-kqh`bJk!dp{Vfb_-F*K|!zx8Keqo zHg_;N)vd<+BR9P+v?Jed6>U`2UhV^V=U*MP2E3<(u{Z5%?6AG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Y-xZxr5>~P3f#4Ous4Dy{5zKp9!-lljpCY{3_2Ydf9xZwM_fdWqCz$!4!B0X5ZQ=R*DE|O6 zlrr%An1$Di{{Vi-!?T3)WBl<5#`sHd5}xbnMtmP7*gy>{0Sr@#=SP`bhyf7<7yUr^ b6B%9o;g& Date: Mon, 20 Apr 2026 06:56:00 +0000 Subject: [PATCH 03/25] Add LoongArch64 edk2 CI workflow and initial compatibility fixes Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 79 ++++++++++++++++++++++++++ Makefile | 6 +- filesystems/btrfs.inf | 8 +-- filesystems/ext2.inf | 8 +-- filesystems/ext4.inf | 8 +-- filesystems/hfs.inf | 8 +-- filesystems/iso9660.inf | 8 +-- filesystems/ntfs.inf | 8 +-- filesystems/reiserfs.inf | 8 +-- gptsync.inf | 8 +-- refind.inf | 12 ++-- 11 files changed, 112 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/loongarch64-edk2.yml diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml new file mode 100644 index 0000000..6ea9458 --- /dev/null +++ b/.github/workflows/loongarch64-edk2.yml @@ -0,0 +1,79 @@ +name: LoongArch64 EDK2 Build + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build-loongarch64-edk2: + runs-on: ubuntu-latest + env: + EDK2BASE: ${{ github.workspace }}/edk2 + ARCH: loongarch64 + EDK2_TARGET: RELEASE + EDK2_TOOLCHAIN: GCC5 + + steps: + - name: Checkout rEFInd + uses: actions/checkout@v4 + + - name: Checkout EDK2 stable202602 + uses: actions/checkout@v4 + with: + repository: tianocore/edk2 + ref: edk2-stable202602 + path: edk2 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + iasl \ + nasm \ + python3 \ + python3-pip \ + uuid-dev + + - name: Install EDK2 Python dependencies + run: pip3 install -r edk2/pip-requirements.txt + + - name: Download LoongArch64 cross-toolchain + run: | + curl -L --fail \ + -o /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz \ + https://github.com/loong64/cross-tools/releases/latest/download/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz + mkdir -p "$RUNNER_TEMP/x-tools" + tar -xf /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz -C "$RUNNER_TEMP/x-tools" + echo "GCC5_LOONGARCH64_PREFIX=$RUNNER_TEMP/x-tools/loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-" >> "$GITHUB_ENV" + + - name: Prepare EDK2 BaseTools + run: | + git -C edk2 submodule update --init \ + BaseTools/Source/C/BrotliCompress/brotli \ + CryptoPkg/Library/MbedTlsLib/mbedtls \ + CryptoPkg/Library/OpensslLib/openssl \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \ + MdeModulePkg/Universal/RegularExpressionDxe/oniguruma \ + MdePkg/Library/BaseFdtLib/libfdt \ + MdePkg/Library/MipiSysTLib/mipisyst + make -C edk2/BaseTools -j"$(nproc)" + + - name: Build rEFInd for LoongArch64 (EDK2) + run: | + make EDK2BASE="$EDK2BASE" \ + ARCH="$ARCH" \ + EDK2_TARGET="$EDK2_TARGET" \ + EDK2_TOOLCHAIN="$EDK2_TOOLCHAIN" \ + edk2 fs_edk2 + + - name: Upload LoongArch64 EFI artifacts + uses: actions/upload-artifact@v4 + with: + name: refind-loongarch64-edk2 + if-no-files-found: error + path: | + refind/refind_loongarch64.efi + gptsync/gptsync_loongarch64.efi + drivers_loongarch64/*.efi diff --git a/Makefile b/Makefile index 8ebc622..03a621f 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,9 @@ export EDK2BASE=/usr/local/edk2-vUDK2018 # NOTE: Below is overridden for "tiano" targets -include $(EDK2BASE)/Conf/target.txt THISDIR=$(shell pwd) -EDK2_BUILDLOC=$(EDK2BASE)/Build/Refind/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH) +EDK2_TARGET ?= RELEASE +EDK2_TOOLCHAIN ?= GCC5 +EDK2_BUILDLOC=$(EDK2BASE)/Build/Refind/$(EDK2_TARGET)_$(EDK2_TOOLCHAIN)/$(UC_ARCH) EDK2_PROGRAM_BASENAMES=refind gptsync EDK2_PROGRAMS=$(EDK2_PROGRAM_BASENAMES:=.efi) EDK2_DRIVER_BASENAMES=btrfs ext4 ext2 hfs iso9660 reiserfs @@ -184,7 +186,7 @@ endif build_edk2: $(EDK2BASE)/RefindPkg cd $(EDK2BASE) && \ . ./edksetup.sh BaseTools && \ - build -a $(UC_ARCH) -p RefindPkg/RefindPkg.dsc + build -a $(UC_ARCH) -b $(EDK2_TARGET) -t $(EDK2_TOOLCHAIN) -p RefindPkg/RefindPkg.dsc mkdir -p ./drivers_$(FILENAME_CODE) $(EDK2BASE)/RefindPkg: diff --git a/filesystems/btrfs.inf b/filesystems/btrfs.inf index 00a2c54..6fa0d99 100644 --- a/filesystems/btrfs.inf +++ b/filesystems/btrfs.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/ext2.inf b/filesystems/ext2.inf index 2df2dbd..fed0d89 100644 --- a/filesystems/ext2.inf +++ b/filesystems/ext2.inf @@ -33,11 +33,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/ext4.inf b/filesystems/ext4.inf index 6e445dd..7733a24 100644 --- a/filesystems/ext4.inf +++ b/filesystems/ext4.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/hfs.inf b/filesystems/hfs.inf index 31bc526..e578d3a 100644 --- a/filesystems/hfs.inf +++ b/filesystems/hfs.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/iso9660.inf b/filesystems/iso9660.inf index 9bcf98b..fa33f70 100644 --- a/filesystems/iso9660.inf +++ b/filesystems/iso9660.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/ntfs.inf b/filesystems/ntfs.inf index b008e10..61211a7 100644 --- a/filesystems/ntfs.inf +++ b/filesystems/ntfs.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/filesystems/reiserfs.inf b/filesystems/reiserfs.inf index b2c6dfa..b897b23 100644 --- a/filesystems/reiserfs.inf +++ b/filesystems/reiserfs.inf @@ -34,11 +34,9 @@ fsw_lib.c fsw_efi_lib.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/gptsync.inf b/gptsync.inf index 382ac97..5e187b8 100644 --- a/gptsync.inf +++ b/gptsync.inf @@ -31,11 +31,9 @@ gptsync/os_efi.c gptsync/showpart.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] BaseLib diff --git a/refind.inf b/refind.inf index 7bb6a36..404d37a 100644 --- a/refind.inf +++ b/refind.inf @@ -67,13 +67,11 @@ libeg/screen.c libeg/text.c -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec -# Uncomment the below when compiling with OS X -# StdLib/StdLib.dec +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec +# Uncomment the below when compiling with OS X +# StdLib/StdLib.dec [Packages.XCODE] StdLib/StdLib.dec From 0fcd4d3d16015a19dd60631b006cfe4ddbdcfdcf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 06:59:17 +0000 Subject: [PATCH 04/25] Adapt plan to use QEMU+Docker loong64 CI environment Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- RefindPkg.dsc | 13 ++++--------- filesystems/btrfs.inf | 16 +++++++--------- filesystems/ext2.inf | 16 +++++++--------- filesystems/ext4.inf | 16 +++++++--------- filesystems/hfs.inf | 16 +++++++--------- filesystems/iso9660.inf | 16 +++++++--------- filesystems/ntfs.inf | 16 +++++++--------- filesystems/reiserfs.inf | 16 +++++++--------- gptsync.inf | 21 ++++++++------------- refind.inf | 24 +++++++++--------------- 10 files changed, 70 insertions(+), 100 deletions(-) diff --git a/RefindPkg.dsc b/RefindPkg.dsc index 5a7f857..0d7c46e 100644 --- a/RefindPkg.dsc +++ b/RefindPkg.dsc @@ -18,6 +18,7 @@ SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf @@ -43,11 +44,6 @@ # UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf - NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf - UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf - TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf - DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf @@ -70,13 +66,12 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - BaseStackCheckLib|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf - + StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf [LibraryClasses.AARCH64] - CompilerIntrinsicsLib|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + CompilerIntrinsicsLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf [LibraryClasses.LOONGARCH64] - CompilerIntrinsicsLib|LoongArchPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + CompilerIntrinsicsLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf [Components] RefindPkg/refind.inf diff --git a/filesystems/btrfs.inf b/filesystems/btrfs.inf index 6fa0d99..959bfe8 100644 --- a/filesystems/btrfs.inf +++ b/filesystems/btrfs.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/ext2.inf b/filesystems/ext2.inf index fed0d89..f71fbb0 100644 --- a/filesystems/ext2.inf +++ b/filesystems/ext2.inf @@ -43,15 +43,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/ext4.inf b/filesystems/ext4.inf index 7733a24..5784196 100644 --- a/filesystems/ext4.inf +++ b/filesystems/ext4.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/hfs.inf b/filesystems/hfs.inf index e578d3a..59876f0 100644 --- a/filesystems/hfs.inf +++ b/filesystems/hfs.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/iso9660.inf b/filesystems/iso9660.inf index fa33f70..39365da 100644 --- a/filesystems/iso9660.inf +++ b/filesystems/iso9660.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/ntfs.inf b/filesystems/ntfs.inf index 61211a7..6802cb2 100644 --- a/filesystems/ntfs.inf +++ b/filesystems/ntfs.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/filesystems/reiserfs.inf b/filesystems/reiserfs.inf index b897b23..981e970 100644 --- a/filesystems/reiserfs.inf +++ b/filesystems/reiserfs.inf @@ -44,15 +44,13 @@ DxeServicesTableLib MemoryAllocationLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] diff --git a/gptsync.inf b/gptsync.inf index 5e187b8..f83d079 100644 --- a/gptsync.inf +++ b/gptsync.inf @@ -43,15 +43,13 @@ UefiLib UefiApplicationEntryPoint -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] gEfiAcpiTableGuid @@ -121,10 +119,7 @@ gEfiLoadFileProtocolGuid gEfiHiiPackageListProtocolGuid -[FeaturePcd] - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport - -[Pcd] +[Pcd] [BuildOptions.IA32] diff --git a/refind.inf b/refind.inf index 404d37a..677aade 100644 --- a/refind.inf +++ b/refind.inf @@ -92,15 +92,13 @@ IoLib PerformanceLib -[LibraryClasses.AARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 - CompilerIntrinsicsLib - -[LibraryClasses.LOONGARCH64] - BaseStackCheckLib -# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 - CompilerIntrinsicsLib +[LibraryClasses.AARCH64] +# Comment out CompilerIntrinsicsLib when compiling for AARCH64 using UDK2014 + CompilerIntrinsicsLib + +[LibraryClasses.LOONGARCH64] +# Comment out CompilerIntrinsicsLib when compiling for LOONGARCH64 using UDK2014 + CompilerIntrinsicsLib [Guids] gEfiAcpiTableGuid @@ -128,8 +126,7 @@ gEfiSimpleTextInProtocolGuid # ALWAYS_CONSUMED gEfiSimpleTextInputExProtocolGuid # ALWAYS_CONSUMED gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED - gEfiUnicodeCollationProtocolGuid # ALWAYS_CONSUMED - gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED + gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED gEfiAcpiS3SaveProtocolGuid # PROTOCOL CONSUMES gEfiBlockIoProtocolGuid # PROTOCOL CONSUMES @@ -170,10 +167,7 @@ gEfiLoadFileProtocolGuid gEfiHiiPackageListProtocolGuid -[FeaturePcd] - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport - -[Pcd] +[Pcd] [BuildOptions.IA32] From 0ce633be67989be41d739e76c7be8f59cb783087 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 07:12:39 +0000 Subject: [PATCH 05/25] Fix LoongArch64 edk2-stable202602 build and update CI workflow Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 25 ++++++++++++++++++++---- EfiLib/DevicePath.c | 10 +++++----- EfiLib/Platform.h | 5 +---- EfiLib/legacy.c | 2 +- Make.common | 8 ++++++++ Makefile | 10 ++++++++++ RefindPkg.dsc | 2 ++ gptsync.inf | 11 +---------- include/tiano_includes.h | 12 ++---------- mok/simple_file.c | 11 +++++++---- refind.inf | 27 ++++++++++++-------------- refind/apple.c | 2 +- refind/config.c | 2 +- refind/install.c | 4 ++-- refind/lib.c | 5 ----- refind/line_edit.c | 2 +- refind/mystrings.c | 16 ++++++++++----- refind/scan.c | 10 +++++++++- 18 files changed, 95 insertions(+), 69 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 6ea9458..b8bc087 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -25,6 +25,22 @@ jobs: ref: edk2-stable202602 path: edk2 + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Verify simulated native loong64 container + uses: maus007/docker-run-action-fork@5ddaad0f7eedd03f64e412b1931852bd3031b273 + with: + image: linuxdeepin/deepin:crimson-loong64 + options: --cpus=2 --platform linux/loong64 --privileged -v ${{ github.workspace }}:/work + run: | + cd /work + uname -m + test -f Makefile + - name: Install build dependencies run: | sudo apt-get update @@ -42,10 +58,11 @@ jobs: - name: Download LoongArch64 cross-toolchain run: | curl -L --fail \ - -o /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz \ - https://github.com/loong64/cross-tools/releases/latest/download/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz + -o /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-latest.tar.xz \ + https://github.com/loong64/cross-tools/releases/latest/download/x86_64-cross-tools-loongarch64-unknown-linux-gnu-latest.tar.xz mkdir -p "$RUNNER_TEMP/x-tools" - tar -xf /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-stable.tar.xz -C "$RUNNER_TEMP/x-tools" + tar -xf /tmp/x86_64-cross-tools-loongarch64-unknown-linux-gnu-latest.tar.xz -C "$RUNNER_TEMP/x-tools" + echo "LOONGARCH64_TOOLCHAIN_BIN=$RUNNER_TEMP/x-tools/loongarch64-unknown-linux-gnu/bin" >> "$GITHUB_ENV" echo "GCC5_LOONGARCH64_PREFIX=$RUNNER_TEMP/x-tools/loongarch64-unknown-linux-gnu/bin/loongarch64-unknown-linux-gnu-" >> "$GITHUB_ENV" - name: Prepare EDK2 BaseTools @@ -62,6 +79,7 @@ jobs: - name: Build rEFInd for LoongArch64 (EDK2) run: | + export PATH="$LOONGARCH64_TOOLCHAIN_BIN:$PATH" make EDK2BASE="$EDK2BASE" \ ARCH="$ARCH" \ EDK2_TARGET="$EDK2_TARGET" \ @@ -75,5 +93,4 @@ jobs: if-no-files-found: error path: | refind/refind_loongarch64.efi - gptsync/gptsync_loongarch64.efi drivers_loongarch64/*.efi diff --git a/EfiLib/DevicePath.c b/EfiLib/DevicePath.c index 023ea3f..1db43fc 100644 --- a/EfiLib/DevicePath.c +++ b/EfiLib/DevicePath.c @@ -65,11 +65,11 @@ MyCatPrint ( ASSERT (Str->Str != NULL); } - Str->Maxlen = MAX_CHAR * sizeof (UINT16); - if (StringSize < Str->Maxlen) { - StrCat (Str->Str, AppendStr); - Str->Len = StringSize - sizeof (UINT16); - } + Str->Maxlen = MAX_CHAR * sizeof (UINT16); + if (StringSize < Str->Maxlen) { + StrCatS (Str->Str, StringSize / sizeof (CHAR16), AppendStr); + Str->Len = StringSize - sizeof (UINT16); + } FreePool (AppendStr); return Str->Str; diff --git a/EfiLib/Platform.h b/EfiLib/Platform.h index 6b479aa..820f374 100644 --- a/EfiLib/Platform.h +++ b/EfiLib/Platform.h @@ -40,16 +40,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#include +#include #include #include #include -#include -#include #include -#include #include #include #include diff --git a/EfiLib/legacy.c b/EfiLib/legacy.c index 4ee6229..981ee54 100644 --- a/EfiLib/legacy.c +++ b/EfiLib/legacy.c @@ -392,7 +392,7 @@ BdsCreateLegacyBootOption ( // // Create new BBS device path node with description string // - UnicodeStrToAsciiStr (BootDesc, HelpString); + UnicodeStrToAsciiStrS (BootDesc, HelpString, sizeof (HelpString)); StringLen = AsciiStrLen (HelpString); NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen); diff --git a/Make.common b/Make.common index c3cfba2..89a4141 100644 --- a/Make.common +++ b/Make.common @@ -60,6 +60,14 @@ ifeq ($(ARCH),aarch64) AR = $(prefix)aarch64-linux-gnu-ar RANLIB = $(prefix)aarch64-linux-gnu-ranlib OBJCOPY = $(prefix)aarch64-linux-gnu-objcopy +else ifeq ($(ARCH),loongarch64) + LOONGARCH64_CROSS_PREFIX ?= loongarch64-unknown-linux-gnu- + CC = $(LOONGARCH64_CROSS_PREFIX)gcc + AS = $(LOONGARCH64_CROSS_PREFIX)as + LD = $(LOONGARCH64_CROSS_PREFIX)ld + AR = $(LOONGARCH64_CROSS_PREFIX)ar + RANLIB = $(LOONGARCH64_CROSS_PREFIX)ranlib + OBJCOPY = $(LOONGARCH64_CROSS_PREFIX)objcopy else CC = $(prefix)gcc AS = $(prefix)as diff --git a/Makefile b/Makefile index 03a621f..a342e5a 100644 --- a/Makefile +++ b/Makefile @@ -153,20 +153,30 @@ fs_tiano: # than my own custom Makefiles (except this top-level one) edk2: build_edk2 cp $(EDK2_BUILDLOC)/refind.efi ./refind/refind_$(FILENAME_CODE).efi +ifneq ($(ARCH),loongarch64) cp $(EDK2_BUILDLOC)/gptsync.efi ./gptsync/gptsync_$(FILENAME_CODE).efi +endif ifneq ($(OMIT_SBAT), 1) $(OBJCOPY) --set-section-alignment '.sbat=512' --add-section .sbat=$(REFIND_SBAT_CSV) \ --adjust-section-vma .sbat+10000000 ./refind/refind_$(FILENAME_CODE).efi +ifneq ($(ARCH),loongarch64) $(OBJCOPY) --set-section-alignment '.sbat=512' --add-section .sbat=$(REFIND_SBAT_CSV) \ --adjust-section-vma .sbat+10000000 ./gptsync/gptsync_$(FILENAME_CODE).efi endif +endif all_edk2: build_edk2 fs_edk2 cp $(EDK2_BUILDLOC)/refind.efi ./refind/refind_$(FILENAME_CODE).efi +ifneq ($(ARCH),loongarch64) cp $(EDK2_BUILDLOC)/gptsync.efi ./gptsync/gptsync_$(FILENAME_CODE).efi +endif gptsync_edk2: build_edk2 +ifeq ($(ARCH),loongarch64) + @echo "Skipping gptsync build output for LoongArch64" +else cp $(EDK2_BUILDLOC)/gptsync.efi ./gptsync/gptsync_$(FILENAME_CODE).efi +endif fs_edk2: build_edk2 ifeq ($(OMIT_SBAT), 1) diff --git a/RefindPkg.dsc b/RefindPkg.dsc index 0d7c46e..8f0575a 100644 --- a/RefindPkg.dsc +++ b/RefindPkg.dsc @@ -75,7 +75,9 @@ [Components] RefindPkg/refind.inf +!if $(ARCH) != LOONGARCH64 RefindPkg/gptsync.inf +!endif RefindPkg/filesystems/ext2.inf RefindPkg/filesystems/ext4.inf RefindPkg/filesystems/btrfs.inf diff --git a/gptsync.inf b/gptsync.inf index f83d079..24b25cd 100644 --- a/gptsync.inf +++ b/gptsync.inf @@ -77,10 +77,8 @@ gEfiSimpleTextInProtocolGuid # ALWAYS_CONSUMED gEfiSimpleTextInputExProtocolGuid # ALWAYS_CONSUMED gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED - gEfiUnicodeCollationProtocolGuid # ALWAYS_CONSUMED - gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED + gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED - gEfiAcpiS3SaveProtocolGuid # PROTOCOL CONSUMES gEfiBlockIoProtocolGuid # PROTOCOL CONSUMES gEfiCpuArchProtocolGuid # PROTOCOL CONSUMES gEfiDebugPortProtocolGuid # PROTOCOL CONSUMES @@ -90,14 +88,10 @@ gEfiFirmwareVolume2ProtocolGuid # PROTOCOL CONSUMES gEfiGraphicsOutputProtocolGuid # PROTOCOL SOMETIMES_CONSUMES gEfiHiiFontProtocolGuid # PROTOCOL CONSUMES - gEfiLegacy8259ProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiLoadedImageProtocolGuid # PROTOCOL CONSUMES - gEfiOEMBadgingProtocolGuid # PROTOCOL CONSUMES gEfiPciIoProtocolGuid # PROTOCOL CONSUMES gEfiScsiIoProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiSimpleNetworkProtocolGuid # PROTOCOL CONSUMES - gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES gEfiAbsolutePointerProtocolGuid gEfiAcpiTableProtocolGuid @@ -105,15 +99,12 @@ gEfiEdidDiscoveredProtocolGuid gEfiHiiDatabaseProtocolGuid gEfiHiiImageProtocolGuid - gEfiHiiProtocolGuid gEfiSimplePointerProtocolGuid gEfiSmbiosProtocolGuid gEfiSecurityArchProtocolGuid gEfiScsiIoProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiExtScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiLegacyBiosProtocolGuid # PROTOCOL TO_START gEfiLoadFile2ProtocolGuid gEfiLoadFileProtocolGuid diff --git a/include/tiano_includes.h b/include/tiano_includes.h index a723c91..0b3c948 100644 --- a/include/tiano_includes.h +++ b/include/tiano_includes.h @@ -19,14 +19,12 @@ #include #include #include -#include // Protocol Includes #include #include #include #include #include -#include #include #include #include @@ -36,16 +34,13 @@ #include #include #include -#include #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -54,17 +49,14 @@ #include #include #include -#include -#include +#include #include #include -#include // Guid Includes #include #include #include -#include #include #include #include @@ -148,4 +140,4 @@ EfiReallocatePool ( #define PoolPrint(...) CatSPrint(NULL, __VA_ARGS__) -#endif \ No newline at end of file +#endif diff --git a/mok/simple_file.c b/mok/simple_file.c index 37a163f..1e0094f 100644 --- a/mok/simple_file.c +++ b/mok/simple_file.c @@ -70,10 +70,13 @@ generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16 pathlen = StrLen(devpathstr); } + UINTN path_name_len; + if (name[0] != '\\') pathlen++; - *PathName = AllocatePool((pathlen + 1 + StrLen(name))*sizeof(CHAR16)); + path_name_len = pathlen + 1 + StrLen(name); + *PathName = AllocatePool(path_name_len * sizeof(CHAR16)); if (!*PathName) { Print(L"Failed to allocate path buffer\n"); @@ -81,11 +84,11 @@ generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16 goto error; } - StrCpy(*PathName, devpathstr); + StrCpyS(*PathName, path_name_len, devpathstr); if (name[0] != '\\') - StrCat(*PathName, L"\\"); - StrCat(*PathName, name); + StrCatS(*PathName, path_name_len, L"\\"); + StrCatS(*PathName, path_name_len, name); *path = FileDevicePath(li->DeviceHandle, *PathName); diff --git a/refind.inf b/refind.inf index 677aade..9847547 100644 --- a/refind.inf +++ b/refind.inf @@ -29,11 +29,10 @@ EfiLib/GenericBdsLib.h EfiLib/BmLib.c EfiLib/DevicePath.c #included into GenericBdsLib - EfiLib/BdsConnect.c #included into GenericBdsLib - EfiLib/BdsHelper.c - EfiLib/BdsTianoCore.c - EfiLib/legacy.c - gzip/decompress_inflate.c + EfiLib/BdsConnect.c #included into GenericBdsLib + EfiLib/BdsHelper.c + EfiLib/BdsTianoCore.c + gzip/decompress_inflate.c mok/mok.c mok/guid.c mok/security_policy.c @@ -64,8 +63,14 @@ libeg/lodepng_xtra.c libeg/nanojpeg.c libeg/nanojpeg_xtra.c - libeg/screen.c - libeg/text.c + libeg/screen.c + libeg/text.c + +[Sources.IA32] + EfiLib/legacy.c + +[Sources.X64] + EfiLib/legacy.c [Packages] MdePkg/MdePkg.dec @@ -128,7 +133,6 @@ gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED - gEfiAcpiS3SaveProtocolGuid # PROTOCOL CONSUMES gEfiBlockIoProtocolGuid # PROTOCOL CONSUMES gEfiCpuArchProtocolGuid # PROTOCOL CONSUMES gEfiDebugPortProtocolGuid # PROTOCOL CONSUMES @@ -138,14 +142,10 @@ gEfiFirmwareVolume2ProtocolGuid # PROTOCOL CONSUMES gEfiGraphicsOutputProtocolGuid # PROTOCOL SOMETIMES_CONSUMES gEfiHiiFontProtocolGuid # PROTOCOL CONSUMES - gEfiLegacy8259ProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiLoadedImageProtocolGuid # PROTOCOL CONSUMES - gEfiOEMBadgingProtocolGuid # PROTOCOL CONSUMES gEfiPciIoProtocolGuid # PROTOCOL CONSUMES gEfiScsiIoProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiSimpleNetworkProtocolGuid # PROTOCOL CONSUMES - gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES gEfiAbsolutePointerProtocolGuid gEfiAcpiTableProtocolGuid @@ -153,15 +153,12 @@ gEfiEdidDiscoveredProtocolGuid gEfiHiiDatabaseProtocolGuid gEfiHiiImageProtocolGuid - gEfiHiiProtocolGuid gEfiSimplePointerProtocolGuid gEfiSmbiosProtocolGuid gEfiSecurityArchProtocolGuid gEfiScsiIoProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES gEfiExtScsiPassThruProtocolGuid ## PROTOCOL SOMETIMES_CONSUMES - gEfiLegacyBiosProtocolGuid # PROTOCOL TO_START gEfiLoadFile2ProtocolGuid gEfiLoadFileProtocolGuid diff --git a/refind/apple.c b/refind/apple.c index b7562e0..f7f6416 100644 --- a/refind/apple.c +++ b/refind/apple.c @@ -162,8 +162,8 @@ EFI_STATUS SetAppleOSInfo() { if (AppleOSVersion) { LOG(2, LOG_LINE_NORMAL, L"Setting Apple OS information to '%s'", AppleOSVersion); AppleOSVersion8 = AllocateZeroPool((StrLen(AppleOSVersion) + 1) * sizeof(CHAR8)); - UnicodeStrToAsciiStr(AppleOSVersion, AppleOSVersion8); if (AppleOSVersion8) { + UnicodeStrToAsciiStrS(AppleOSVersion, AppleOSVersion8, StrLen(AppleOSVersion) + 1); Status = refit_call1_wrapper (SetOs->SetOsVersion, AppleOSVersion8); if (!EFI_ERROR(Status)) Status = EFI_SUCCESS; diff --git a/refind/config.c b/refind/config.c index e5e0b3a..4c6fb0e 100644 --- a/refind/config.c +++ b/refind/config.c @@ -256,7 +256,7 @@ static BOOLEAN KeepReading(IN OUT CHAR16 *p, IN OUT BOOLEAN *IsQuoted) { if (p[1] == L'"') { Temp = StrDuplicate(&p[1]); if (Temp != NULL) { - StrCpy(p, Temp); + StrCpyS(p, StrLen(Temp) + 1, Temp); MyFreePool(Temp); } MoreToRead = TRUE; diff --git a/refind/install.c b/refind/install.c index c6995cc..54acfb4 100644 --- a/refind/install.c +++ b/refind/install.c @@ -184,7 +184,7 @@ static EFI_STATUS RenameFile(IN EFI_FILE_PROTOCOL *BaseDir, CHAR16 *OldName, CHA if (NewInfo != NULL) { MyCopyMem(NewInfo, Buffer, sizeof(EFI_FILE_INFO)); NewInfo->FileName[0] = 0; - StrCat(NewInfo->FileName, NewName); + StrCpyS(NewInfo->FileName, StrLen(NewName) + 1, NewName); // Note: The below call is where Tow-Boot can error out. Status = refit_call4_wrapper(BaseDir->SetInfo, FilePtr, @@ -605,7 +605,7 @@ static EFI_STATUS ConstructBootEntry(EFI_HANDLE *TargetVolume, Working += sizeof (UINT32); *(UINT16 *)Working = DevPathSize; Working += sizeof (UINT16); - StrCpy((CHAR16 *)Working, Label); + StrCpyS((CHAR16 *)Working, StrLen(Label) + 1, Label); Working += StrSize(Label); MyCopyMem(Working, DevicePath, DevPathSize); // If support for arguments is required in the future, uncomment diff --git a/refind/lib.c b/refind/lib.c index 5d27526..27d61ba 100644 --- a/refind/lib.c +++ b/refind/lib.c @@ -1543,11 +1543,6 @@ InitializeUnicodeCollationProtocol (VOID) // Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID **) &mUnicodeCollation); - if (EFI_ERROR(Status)) { - Status = gBS->LocateProtocol(&gEfiUnicodeCollationProtocolGuid, - NULL, (VOID **) &mUnicodeCollation); - - } return Status; } diff --git a/refind/line_edit.c b/refind/line_edit.c index 59d9b9a..7ba72ae 100644 --- a/refind/line_edit.c +++ b/refind/line_edit.c @@ -68,7 +68,7 @@ BOOLEAN line_edit(CHAR16 *line_in, CHAR16 **line_out, UINTN x_max) { line_in = L""; size = StrLen(line_in) + 1024; line = AllocatePool(size * sizeof(CHAR16)); - StrCpy(line, line_in); + StrCpyS(line, size, line_in); len = StrLen(line); print = AllocatePool(x_max * sizeof(CHAR16)); diff --git a/refind/mystrings.c b/refind/mystrings.c index 84dd678..bbf21ab 100644 --- a/refind/mystrings.c +++ b/refind/mystrings.c @@ -144,20 +144,21 @@ VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar) { Length2 = StrLen(Second); NewString = AllocatePool(sizeof(CHAR16) * (Length1 + Length2 + 2)); if (NewString != NULL) { + UINTN NewStringSize = Length1 + Length2 + 2; if ((*First != NULL) && (Length1 == 0)) { MyFreePool(*First); *First = NULL; } NewString[0] = L'\0'; if (*First != NULL) { - StrCat(NewString, *First); + StrCatS(NewString, NewStringSize, *First); if (AddChar) { NewString[Length1] = AddChar; NewString[Length1 + 1] = '\0'; } // if (AddChar) } // if (*First != NULL) if (Second != NULL) - StrCat(NewString, Second); + StrCatS(NewString, NewStringSize, Second); MyFreePool(*First); *First = NewString; } else { @@ -216,7 +217,7 @@ BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit) { } else { TempString = StrDuplicate(&SubString[i]); if (TempString != NULL) { - StrCpy(&SubString[1], TempString); + StrCpyS(&SubString[1], StrLen(TempString) + 1, TempString); MyFreePool(TempString); HasChanged = TRUE; } else { @@ -349,7 +350,12 @@ BOOLEAN DeleteItemFromCsvList(CHAR16 *ToDelete, CHAR16 *List) { Found[0] = L'\0'; } // if/else } else { // Found is NOT final element - StrCpy(Found, &Comma[1]); + UINTN i = 0; + while (Comma[1 + i] != L'\0') { + Found[i] = Comma[1 + i]; + i++; + } + Found[i] = L'\0'; } // if/else return TRUE; } else { @@ -416,7 +422,7 @@ BOOLEAN ReplaceSubstring(IN OUT CHAR16 **MainString, IN CHAR16 *SearchString, IN FoundSearchString[-1] = L'\0'; ReplString = SearchString; } // if - StrCpy(NewString, *MainString); + StrCpyS(NewString, StrLen(*MainString) + 1, *MainString); MergeStrings(&NewString, ReplString, L'\0'); MergeStrings(&NewString, EndString, L'\0'); MyFreePool(MainString); diff --git a/refind/scan.c b/refind/scan.c index 47fa3f6..21fd8ce 100644 --- a/refind/scan.c +++ b/refind/scan.c @@ -68,6 +68,12 @@ #include "driver_support.h" #include "launch_efi.h" #include "launch_legacy.h" + +#ifndef BBS_HARDDISK +#define BBS_HARDDISK 0x02 +#define BBS_CDROM 0x03 +#define BBS_USB 0x05 +#endif #include "linux.h" #include "log.h" #include "scan.h" @@ -360,7 +366,7 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume, IN BOOLEAN } // safe mode allowed // check for Apple hardware diagnostics - StrCpy(DiagsFileName, L"System\\Library\\CoreServices\\.diagnostics\\diags.efi"); + StrCpyS(DiagsFileName, 256, L"System\\Library\\CoreServices\\.diagnostics\\diags.efi"); if (FileExists(Volume->RootDir, DiagsFileName) && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HWTEST)) { SubEntry = InitializeLoaderEntry(Entry); if (SubEntry != NULL) { @@ -1347,8 +1353,10 @@ VOID ScanForBootloaders(BOOLEAN ShowMessage) { // If UEFI & scanning for legacy loaders & deep legacy scan, update NVRAM boot manager list if ((GlobalConfig.LegacyType == LEGACY_TYPE_UEFI) && ScanForLegacy && GlobalConfig.DeepLegacyScan) { +#ifndef EFILOONGARCH64 BdsDeleteAllInvalidLegacyBootOptions(); BdsAddNonExistingLegacyBootOptions(); +#endif } // if // We temporarily modify GlobalConfig.DontScanFiles and GlobalConfig.DontScanVolumes From 1b39223a65d62237cb6b44095c96435705572887 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 07:14:51 +0000 Subject: [PATCH 06/25] Harden workflow permissions and address validation feedback Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 14 ++++++-------- refind/apple.c | 6 ++++-- refind/mystrings.c | 7 +------ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index b8bc087..0eabfcb 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -5,6 +5,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: build-loongarch64-edk2: runs-on: ubuntu-latest @@ -32,14 +35,9 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Verify simulated native loong64 container - uses: maus007/docker-run-action-fork@5ddaad0f7eedd03f64e412b1931852bd3031b273 - with: - image: linuxdeepin/deepin:crimson-loong64 - options: --cpus=2 --platform linux/loong64 --privileged -v ${{ github.workspace }}:/work - run: | - cd /work - uname -m - test -f Makefile + run: | + docker run --rm --platform linux/loong64 --privileged -v "$GITHUB_WORKSPACE:/work" linuxdeepin/deepin:crimson-loong64 \ + sh -lc 'cd /work && uname -m && test -f Makefile' - name: Install build dependencies run: | diff --git a/refind/apple.c b/refind/apple.c index f7f6416..ab9f811 100644 --- a/refind/apple.c +++ b/refind/apple.c @@ -143,6 +143,7 @@ typedef struct EfiAppleSetOsInterface { EFI_STATUS SetAppleOSInfo() { CHAR16 *AppleOSVersion = NULL; CHAR8 *AppleOSVersion8 = NULL; + UINTN AppleOSVersion8Len = 0; EFI_STATUS Status; EFI_GUID apple_set_os_guid = EFI_APPLE_SET_OS_PROTOCOL_GUID; EfiAppleSetOsInterface *SetOs = NULL; @@ -161,9 +162,10 @@ EFI_STATUS SetAppleOSInfo() { MergeStrings(&AppleOSVersion, GlobalConfig.SpoofOSXVersion, ' '); if (AppleOSVersion) { LOG(2, LOG_LINE_NORMAL, L"Setting Apple OS information to '%s'", AppleOSVersion); - AppleOSVersion8 = AllocateZeroPool((StrLen(AppleOSVersion) + 1) * sizeof(CHAR8)); + AppleOSVersion8Len = StrLen(AppleOSVersion) + 1; + AppleOSVersion8 = AllocateZeroPool(AppleOSVersion8Len * sizeof(CHAR8)); if (AppleOSVersion8) { - UnicodeStrToAsciiStrS(AppleOSVersion, AppleOSVersion8, StrLen(AppleOSVersion) + 1); + UnicodeStrToAsciiStrS(AppleOSVersion, AppleOSVersion8, AppleOSVersion8Len); Status = refit_call1_wrapper (SetOs->SetOsVersion, AppleOSVersion8); if (!EFI_ERROR(Status)) Status = EFI_SUCCESS; diff --git a/refind/mystrings.c b/refind/mystrings.c index bbf21ab..384f013 100644 --- a/refind/mystrings.c +++ b/refind/mystrings.c @@ -350,12 +350,7 @@ BOOLEAN DeleteItemFromCsvList(CHAR16 *ToDelete, CHAR16 *List) { Found[0] = L'\0'; } // if/else } else { // Found is NOT final element - UINTN i = 0; - while (Comma[1 + i] != L'\0') { - Found[i] = Comma[1 + i]; - i++; - } - Found[i] = L'\0'; + StrCpyS(Found, StrLen(&Comma[1]) + 1, &Comma[1]); } // if/else return TRUE; } else { From 267508424ce9f6b75d28dde8eef16a4e3287a9a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 07:17:09 +0000 Subject: [PATCH 07/25] Clean duplicate include and clarify legacy source scope Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- include/tiano_includes.h | 1 - refind.inf | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tiano_includes.h b/include/tiano_includes.h index 0b3c948..229dab0 100644 --- a/include/tiano_includes.h +++ b/include/tiano_includes.h @@ -49,7 +49,6 @@ #include #include #include -#include #include #include diff --git a/refind.inf b/refind.inf index 9847547..90480db 100644 --- a/refind.inf +++ b/refind.inf @@ -67,9 +67,11 @@ libeg/text.c [Sources.IA32] + # Legacy BIOS support code is only built on x86 targets. EfiLib/legacy.c [Sources.X64] + # Legacy BIOS support code is only built on x86 targets. EfiLib/legacy.c [Packages] From 31884014281d2a07d6a944583e32ac82f8998851 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 07:19:42 +0000 Subject: [PATCH 08/25] Refine string handling fixes and loongarch compatibility cleanup Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/856f13ec-c642-4ec7-98b3-ddc6e5416322 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- EfiLib/DevicePath.c | 2 +- refind/config.c | 2 +- refind/install.c | 4 ++-- refind/mystrings.c | 11 ++++++++--- refind/scan.c | 3 ++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/EfiLib/DevicePath.c b/EfiLib/DevicePath.c index 1db43fc..8e4b70f 100644 --- a/EfiLib/DevicePath.c +++ b/EfiLib/DevicePath.c @@ -67,7 +67,7 @@ MyCatPrint ( Str->Maxlen = MAX_CHAR * sizeof (UINT16); if (StringSize < Str->Maxlen) { - StrCatS (Str->Str, StringSize / sizeof (CHAR16), AppendStr); + CopyMem(&(Str->Str[StrLen(Str->Str)]), AppendStr, StrSize(AppendStr)); Str->Len = StringSize - sizeof (UINT16); } diff --git a/refind/config.c b/refind/config.c index 4c6fb0e..44bd270 100644 --- a/refind/config.c +++ b/refind/config.c @@ -256,7 +256,7 @@ static BOOLEAN KeepReading(IN OUT CHAR16 *p, IN OUT BOOLEAN *IsQuoted) { if (p[1] == L'"') { Temp = StrDuplicate(&p[1]); if (Temp != NULL) { - StrCpyS(p, StrLen(Temp) + 1, Temp); + MyCopyMem(p, Temp, StrSize(Temp)); MyFreePool(Temp); } MoreToRead = TRUE; diff --git a/refind/install.c b/refind/install.c index 54acfb4..e9f48ce 100644 --- a/refind/install.c +++ b/refind/install.c @@ -184,7 +184,7 @@ static EFI_STATUS RenameFile(IN EFI_FILE_PROTOCOL *BaseDir, CHAR16 *OldName, CHA if (NewInfo != NULL) { MyCopyMem(NewInfo, Buffer, sizeof(EFI_FILE_INFO)); NewInfo->FileName[0] = 0; - StrCpyS(NewInfo->FileName, StrLen(NewName) + 1, NewName); + MyCopyMem(NewInfo->FileName, NewName, StrSize(NewName)); // Note: The below call is where Tow-Boot can error out. Status = refit_call4_wrapper(BaseDir->SetInfo, FilePtr, @@ -605,7 +605,7 @@ static EFI_STATUS ConstructBootEntry(EFI_HANDLE *TargetVolume, Working += sizeof (UINT32); *(UINT16 *)Working = DevPathSize; Working += sizeof (UINT16); - StrCpyS((CHAR16 *)Working, StrLen(Label) + 1, Label); + MyCopyMem(Working, Label, StrSize(Label)); Working += StrSize(Label); MyCopyMem(Working, DevicePath, DevPathSize); // If support for arguments is required in the future, uncomment diff --git a/refind/mystrings.c b/refind/mystrings.c index 384f013..2e29011 100644 --- a/refind/mystrings.c +++ b/refind/mystrings.c @@ -217,7 +217,7 @@ BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit) { } else { TempString = StrDuplicate(&SubString[i]); if (TempString != NULL) { - StrCpyS(&SubString[1], StrLen(TempString) + 1, TempString); + MyCopyMem(&SubString[1], TempString, StrSize(TempString)); MyFreePool(TempString); HasChanged = TRUE; } else { @@ -350,7 +350,12 @@ BOOLEAN DeleteItemFromCsvList(CHAR16 *ToDelete, CHAR16 *List) { Found[0] = L'\0'; } // if/else } else { // Found is NOT final element - StrCpyS(Found, StrLen(&Comma[1]) + 1, &Comma[1]); + UINTN i = 0; + while (Comma[1 + i] != L'\0') { + Found[i] = Comma[1 + i]; + i++; + } + Found[i] = L'\0'; } // if/else return TRUE; } else { @@ -417,7 +422,7 @@ BOOLEAN ReplaceSubstring(IN OUT CHAR16 **MainString, IN CHAR16 *SearchString, IN FoundSearchString[-1] = L'\0'; ReplString = SearchString; } // if - StrCpyS(NewString, StrLen(*MainString) + 1, *MainString); + MyCopyMem(NewString, *MainString, StrSize(*MainString)); MergeStrings(&NewString, ReplString, L'\0'); MergeStrings(&NewString, EndString, L'\0'); MyFreePool(MainString); diff --git a/refind/scan.c b/refind/scan.c index 21fd8ce..7fbcb4d 100644 --- a/refind/scan.c +++ b/refind/scan.c @@ -366,7 +366,8 @@ VOID GenerateSubScreen(LOADER_ENTRY *Entry, IN REFIT_VOLUME *Volume, IN BOOLEAN } // safe mode allowed // check for Apple hardware diagnostics - StrCpyS(DiagsFileName, 256, L"System\\Library\\CoreServices\\.diagnostics\\diags.efi"); + StrCpyS(DiagsFileName, sizeof (DiagsFileName) / sizeof (DiagsFileName[0]), + L"System\\Library\\CoreServices\\.diagnostics\\diags.efi"); if (FileExists(Volume->RootDir, DiagsFileName) && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_HWTEST)) { SubEntry = InitializeLoaderEntry(Entry); if (SubEntry != NULL) { From ae9939a3a6affe72a3a0f1a994b98c0676ec6b31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 10:34:25 +0000 Subject: [PATCH 09/25] Simplify loongarch CI and add loong64 deb package artifact build Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/4a308622-19e3-4256-bfdd-50ae22aa177a Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 49 +++++++++++++++++--------- debian/control | 2 +- debian/rules | 5 +++ 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 0eabfcb..8f93b6d 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -27,6 +27,7 @@ jobs: repository: tianocore/edk2 ref: edk2-stable202602 path: edk2 + submodules: recursive - name: Setup QEMU uses: docker/setup-qemu-action@v3 @@ -34,11 +35,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Verify simulated native loong64 container - run: | - docker run --rm --platform linux/loong64 --privileged -v "$GITHUB_WORKSPACE:/work" linuxdeepin/deepin:crimson-loong64 \ - sh -lc 'cd /work && uname -m && test -f Makefile' - - name: Install build dependencies run: | sudo apt-get update @@ -49,9 +45,7 @@ jobs: python3 \ python3-pip \ uuid-dev - - - name: Install EDK2 Python dependencies - run: pip3 install -r edk2/pip-requirements.txt + pip3 install -r edk2/pip-requirements.txt - name: Download LoongArch64 cross-toolchain run: | @@ -65,16 +59,32 @@ jobs: - name: Prepare EDK2 BaseTools run: | - git -C edk2 submodule update --init \ - BaseTools/Source/C/BrotliCompress/brotli \ - CryptoPkg/Library/MbedTlsLib/mbedtls \ - CryptoPkg/Library/OpensslLib/openssl \ - MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \ - MdeModulePkg/Universal/RegularExpressionDxe/oniguruma \ - MdePkg/Library/BaseFdtLib/libfdt \ - MdePkg/Library/MipiSysTLib/mipisyst make -C edk2/BaseTools -j"$(nproc)" + - name: Build loong64 Debian package in container + run: | + mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" + docker run --rm --platform linux/loong64 --privileged \ + -v "$GITHUB_WORKSPACE:/work" linuxdeepin/deepin:crimson-loong64 \ + sh -lc ' + set -e + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y \ + build-essential \ + debhelper \ + devscripts \ + dpkg-dev \ + fakeroot \ + gnu-efi \ + mtools \ + gettext + cp -a /work /tmp/refind-loong64 + cd /tmp/refind-loong64 + dpkg-buildpackage -us -uc -b + cp -a /tmp/*.deb /tmp/*.changes /tmp/*.buildinfo /work/artifacts/deb-loong64/ + ' + - name: Build rEFInd for LoongArch64 (EDK2) run: | export PATH="$LOONGARCH64_TOOLCHAIN_BIN:$PATH" @@ -92,3 +102,10 @@ jobs: path: | refind/refind_loongarch64.efi drivers_loongarch64/*.efi + + - name: Upload loong64 Debian package + uses: actions/upload-artifact@v4 + with: + name: refind-loong64-deb + if-no-files-found: error + path: artifacts/deb-loong64/* diff --git a/debian/control b/debian/control index 889bbd9..004f29e 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Browser: https://salsa.debian.org/debian/refind Vcs-Git: https://salsa.debian.org/debian/refind.git Package: refind -Architecture: amd64 arm64 i386 +Architecture: amd64 arm64 i386 loong64 Depends: debconf, efibootmgr, gawk, gdisk, mokutil, openssl, ${misc:Depends} Recommends: python3, sbsigntool Description: boot manager for EFI-based computers diff --git a/debian/rules b/debian/rules index d55b30d..8a40081 100755 --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,10 @@ else ifeq (arm64, $(DEB_HOST_ARCH_CPU)) ARCH = aarch64 EFI_ARCH := aa64 +else +ifeq (loong64, $(DEB_HOST_ARCH_CPU)) + ARCH = loongarch64 + EFI_ARCH := loongarch64 else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) @@ -21,6 +25,7 @@ else endif endif endif +endif %: dh $@ From 00582e639d95c42c0ee0c8207ba7bfe12e835e2a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 10:35:28 +0000 Subject: [PATCH 10/25] Harden deb artifact collection in loong64 CI step Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/4a308622-19e3-4256-bfdd-50ae22aa177a Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 8f93b6d..51e4a42 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -82,7 +82,9 @@ jobs: cp -a /work /tmp/refind-loong64 cd /tmp/refind-loong64 dpkg-buildpackage -us -uc -b - cp -a /tmp/*.deb /tmp/*.changes /tmp/*.buildinfo /work/artifacts/deb-loong64/ + artifacts="$(find /tmp -maxdepth 1 -type f \( -name "*.deb" -o -name "*.changes" -o -name "*.buildinfo" \))" + [ -n "$artifacts" ] || { echo "No Debian artifacts found"; exit 1; } + cp -a $artifacts /work/artifacts/deb-loong64/ ' - name: Build rEFInd for LoongArch64 (EDK2) @@ -107,5 +109,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: refind-loong64-deb - if-no-files-found: error path: artifacts/deb-loong64/* + if-no-files-found: error From d696b5713351c5ad314aaba618e15c59fffbcf5b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 10:59:41 +0000 Subject: [PATCH 11/25] Fix loong64 Debian build to use native compiler prefix Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/f6b3166d-cfd3-4fe2-8972-3a3959103663 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- debian/rules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 8a40081..0cab14b 100755 --- a/debian/rules +++ b/debian/rules @@ -18,6 +18,7 @@ else ifeq (loong64, $(DEB_HOST_ARCH_CPU)) ARCH = loongarch64 EFI_ARCH := loongarch64 + LOONGARCH64_CROSS_PREFIX := else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) @@ -35,8 +36,8 @@ override_dh_auto_clean: rm -rf drivers_*/ override_dh_auto_build: - dh_auto_build -- gnuefi 'ARCH=$(ARCH)' - dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' + dh_auto_build -- gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' + dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' override_dh_auto_install: # "make install" actually runs "efi-install" for the current system, so let's not do that :) From 3132c8b4a3fa7525e47317175c5a754a935e235c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:20:11 +0000 Subject: [PATCH 12/25] Fix legacy warning and switch loong64 deb build to cross packaging Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 43 +++++++++----------------- EfiLib/legacy.c | 4 +++ debian/rules | 4 +++ 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 51e4a42..5cd2de7 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -29,18 +29,21 @@ jobs: path: edk2 submodules: recursive - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y \ build-essential \ + binutils-loongarch64-linux-gnu \ + gcc-loongarch64-linux-gnu \ + debhelper \ + devscripts \ + dpkg-dev \ + fakeroot \ + gettext \ + gnu-efi \ iasl \ + mtools \ nasm \ python3 \ python3-pip \ @@ -61,31 +64,13 @@ jobs: run: | make -C edk2/BaseTools -j"$(nproc)" - - name: Build loong64 Debian package in container + - name: Build loong64 Debian package run: | mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" - docker run --rm --platform linux/loong64 --privileged \ - -v "$GITHUB_WORKSPACE:/work" linuxdeepin/deepin:crimson-loong64 \ - sh -lc ' - set -e - export DEBIAN_FRONTEND=noninteractive - apt-get update - apt-get install -y \ - build-essential \ - debhelper \ - devscripts \ - dpkg-dev \ - fakeroot \ - gnu-efi \ - mtools \ - gettext - cp -a /work /tmp/refind-loong64 - cd /tmp/refind-loong64 - dpkg-buildpackage -us -uc -b - artifacts="$(find /tmp -maxdepth 1 -type f \( -name "*.deb" -o -name "*.changes" -o -name "*.buildinfo" \))" - [ -n "$artifacts" ] || { echo "No Debian artifacts found"; exit 1; } - cp -a $artifacts /work/artifacts/deb-loong64/ - ' + dpkg-buildpackage -us -uc -b -a loong64 + artifacts="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f \( -name "refind_*_loong64.deb" -o -name "refind_*_*.changes" -o -name "refind_*_*.buildinfo" \))" + [ -n "$artifacts" ] || { echo "No Debian artifacts found"; exit 1; } + cp -a $artifacts "$GITHUB_WORKSPACE/artifacts/deb-loong64/" - name: Build rEFInd for LoongArch64 (EDK2) run: | diff --git a/EfiLib/legacy.c b/EfiLib/legacy.c index 981ee54..e024ea7 100644 --- a/EfiLib/legacy.c +++ b/EfiLib/legacy.c @@ -392,7 +392,11 @@ BdsCreateLegacyBootOption ( // // Create new BBS device path node with description string // +#ifdef __MAKEWITH_GNUEFI + UnicodeStrToAsciiStr (BootDesc, HelpString); +#else UnicodeStrToAsciiStrS (BootDesc, HelpString, sizeof (HelpString)); +#endif StringLen = AsciiStrLen (HelpString); NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen); diff --git a/debian/rules b/debian/rules index 0cab14b..ef16c03 100755 --- a/debian/rules +++ b/debian/rules @@ -18,7 +18,11 @@ else ifeq (loong64, $(DEB_HOST_ARCH_CPU)) ARCH = loongarch64 EFI_ARCH := loongarch64 +ifeq (loong64, $(DEB_BUILD_ARCH_CPU)) LOONGARCH64_CROSS_PREFIX := +else + LOONGARCH64_CROSS_PREFIX := loongarch64-linux-gnu- +endif else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) From b720096adae31d528d63922e335106eeec735527 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:21:29 +0000 Subject: [PATCH 13/25] Use EDK2-only loong64 Debian build and drop gnu-efi in CI Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 1 - debian/rules | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 5cd2de7..e8f863c 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -41,7 +41,6 @@ jobs: dpkg-dev \ fakeroot \ gettext \ - gnu-efi \ iasl \ mtools \ nasm \ diff --git a/debian/rules b/debian/rules index ef16c03..14aa4b3 100755 --- a/debian/rules +++ b/debian/rules @@ -18,11 +18,6 @@ else ifeq (loong64, $(DEB_HOST_ARCH_CPU)) ARCH = loongarch64 EFI_ARCH := loongarch64 -ifeq (loong64, $(DEB_BUILD_ARCH_CPU)) - LOONGARCH64_CROSS_PREFIX := -else - LOONGARCH64_CROSS_PREFIX := loongarch64-linux-gnu- -endif else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) @@ -40,16 +35,23 @@ override_dh_auto_clean: rm -rf drivers_*/ override_dh_auto_build: +ifeq (loong64, $(DEB_HOST_ARCH_CPU)) + dh_auto_build -- edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' + dh_auto_build -- fs_edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' +else dh_auto_build -- gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' +endif override_dh_auto_install: # "make install" actually runs "efi-install" for the current system, so let's not do that :) override_dh_install: dh_install +ifneq (loong64, $(DEB_HOST_ARCH_CPU)) mkdir -p debian/refind/usr/share/refind/refind/tools_$(EFI_ARCH) cp gptsync/gptsync_$(EFI_ARCH).efi debian/refind/usr/share/refind/refind/tools_$(EFI_ARCH)/ +endif override_dh_installchangelogs: dh_installchangelogs NEWS.txt From 16d3714c0f3c150184b482b9090cf99e87399219 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:23:02 +0000 Subject: [PATCH 14/25] Clean up debian rules after EDK2 loong64 switch Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 14aa4b3..115b23f 100755 --- a/debian/rules +++ b/debian/rules @@ -39,8 +39,8 @@ ifeq (loong64, $(DEB_HOST_ARCH_CPU)) dh_auto_build -- edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' dh_auto_build -- fs_edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' else - dh_auto_build -- gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' - dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' 'LOONGARCH64_CROSS_PREFIX=$(LOONGARCH64_CROSS_PREFIX)' + dh_auto_build -- gnuefi 'ARCH=$(ARCH)' + dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' endif override_dh_auto_install: From 0c905cee747238c191b10fa9ec4333f16646f867 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:24:33 +0000 Subject: [PATCH 15/25] Validate loong64 deb structure and tighten artifact matching Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 7 ++++++- debian/rules | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index e8f863c..c9bb48b 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -67,7 +67,12 @@ jobs: run: | mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" dpkg-buildpackage -us -uc -b -a loong64 - artifacts="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f \( -name "refind_*_loong64.deb" -o -name "refind_*_*.changes" -o -name "refind_*_*.buildinfo" \))" + deb_file="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f -name "refind_*_loong64.deb" | head -n1)" + [ -n "$deb_file" ] || { echo "No loong64 Debian package found"; exit 1; } + dpkg-deb -c "$deb_file" | grep -q './etc/refind.d/keys/' || { echo "Missing keys directory in deb"; exit 1; } + dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/refind_loongarch64.efi' || { echo "Missing refind_loongarch64.efi in deb"; exit 1; } + dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/drivers_loongarch64/' || { echo "Missing drivers_loongarch64 in deb"; exit 1; } + artifacts="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f \( -name "refind_*_loong64.deb" -o -name "refind_*_loong64.changes" -o -name "refind_*_loong64.buildinfo" \))" [ -n "$artifacts" ] || { echo "No Debian artifacts found"; exit 1; } cp -a $artifacts "$GITHUB_WORKSPACE/artifacts/deb-loong64/" diff --git a/debian/rules b/debian/rules index 115b23f..03f15ee 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f export DH_VERBOSE := 1 +EDK2BASE ?= $(CURDIR)/edk2 include /usr/share/dpkg/architecture.mk ifeq (amd64, $(DEB_HOST_ARCH_CPU)) @@ -36,8 +37,8 @@ override_dh_auto_clean: override_dh_auto_build: ifeq (loong64, $(DEB_HOST_ARCH_CPU)) - dh_auto_build -- edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' - dh_auto_build -- fs_edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(CURDIR)/edk2' + dh_auto_build -- edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(EDK2BASE)' + dh_auto_build -- fs_edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(EDK2BASE)' else dh_auto_build -- gnuefi 'ARCH=$(ARCH)' dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' From 51a51937aea2812986b9e7564e7422dc36bce6a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:26:18 +0000 Subject: [PATCH 16/25] Harden loong64 deb artifact selection and scope EDK2BASE Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 13 ++++++++----- debian/rules | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index c9bb48b..780bd8d 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -67,14 +67,17 @@ jobs: run: | mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" dpkg-buildpackage -us -uc -b -a loong64 - deb_file="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f -name "refind_*_loong64.deb" | head -n1)" - [ -n "$deb_file" ] || { echo "No loong64 Debian package found"; exit 1; } + mapfile -t deb_files < <(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f -name "refind_*_loong64.deb") + [ "${#deb_files[@]}" -eq 1 ] || { echo "Expected exactly one loong64 deb artifact, found ${#deb_files[@]}"; printf '%s\n' "${deb_files[@]}"; exit 1; } + deb_file="${deb_files[0]}" + changes_file="${deb_file%.deb}.changes" + buildinfo_file="${deb_file%.deb}.buildinfo" + [ -f "$changes_file" ] || { echo "Missing changes artifact: $changes_file"; exit 1; } + [ -f "$buildinfo_file" ] || { echo "Missing buildinfo artifact: $buildinfo_file"; exit 1; } dpkg-deb -c "$deb_file" | grep -q './etc/refind.d/keys/' || { echo "Missing keys directory in deb"; exit 1; } dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/refind_loongarch64.efi' || { echo "Missing refind_loongarch64.efi in deb"; exit 1; } dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/drivers_loongarch64/' || { echo "Missing drivers_loongarch64 in deb"; exit 1; } - artifacts="$(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f \( -name "refind_*_loong64.deb" -o -name "refind_*_loong64.changes" -o -name "refind_*_loong64.buildinfo" \))" - [ -n "$artifacts" ] || { echo "No Debian artifacts found"; exit 1; } - cp -a $artifacts "$GITHUB_WORKSPACE/artifacts/deb-loong64/" + cp -a "$deb_file" "$changes_file" "$buildinfo_file" "$GITHUB_WORKSPACE/artifacts/deb-loong64/" - name: Build rEFInd for LoongArch64 (EDK2) run: | diff --git a/debian/rules b/debian/rules index 03f15ee..09901d9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,6 @@ #!/usr/bin/make -f export DH_VERBOSE := 1 -EDK2BASE ?= $(CURDIR)/edk2 include /usr/share/dpkg/architecture.mk ifeq (amd64, $(DEB_HOST_ARCH_CPU)) @@ -19,6 +18,7 @@ else ifeq (loong64, $(DEB_HOST_ARCH_CPU)) ARCH = loongarch64 EFI_ARCH := loongarch64 + EDK2BASE ?= $(CURDIR)/edk2 else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) From ad34fd62619e1a06fe0be3d892572934819d1446 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:27:25 +0000 Subject: [PATCH 17/25] Make loong64 artifact detection deterministic in CI Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 8 +++++--- debian/rules | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 780bd8d..33a614f 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -66,6 +66,7 @@ jobs: - name: Build loong64 Debian package run: | mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" + rm -f "$GITHUB_WORKSPACE"/../refind_*_loong64.deb "$GITHUB_WORKSPACE"/../refind_*_loong64.changes "$GITHUB_WORKSPACE"/../refind_*_loong64.buildinfo dpkg-buildpackage -us -uc -b -a loong64 mapfile -t deb_files < <(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f -name "refind_*_loong64.deb") [ "${#deb_files[@]}" -eq 1 ] || { echo "Expected exactly one loong64 deb artifact, found ${#deb_files[@]}"; printf '%s\n' "${deb_files[@]}"; exit 1; } @@ -74,9 +75,10 @@ jobs: buildinfo_file="${deb_file%.deb}.buildinfo" [ -f "$changes_file" ] || { echo "Missing changes artifact: $changes_file"; exit 1; } [ -f "$buildinfo_file" ] || { echo "Missing buildinfo artifact: $buildinfo_file"; exit 1; } - dpkg-deb -c "$deb_file" | grep -q './etc/refind.d/keys/' || { echo "Missing keys directory in deb"; exit 1; } - dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/refind_loongarch64.efi' || { echo "Missing refind_loongarch64.efi in deb"; exit 1; } - dpkg-deb -c "$deb_file" | grep -q 'usr/share/refind/refind/drivers_loongarch64/' || { echo "Missing drivers_loongarch64 in deb"; exit 1; } + deb_listing="$(dpkg-deb -c "$deb_file")" + grep -q './etc/refind.d/keys/' <<< "$deb_listing" || { echo "Missing keys directory in deb"; exit 1; } + grep -q 'usr/share/refind/refind/refind_loongarch64.efi' <<< "$deb_listing" || { echo "Missing refind_loongarch64.efi in deb"; exit 1; } + grep -q 'usr/share/refind/refind/drivers_loongarch64/' <<< "$deb_listing" || { echo "Missing drivers_loongarch64 in deb"; exit 1; } cp -a "$deb_file" "$changes_file" "$buildinfo_file" "$GITHUB_WORKSPACE/artifacts/deb-loong64/" - name: Build rEFInd for LoongArch64 (EDK2) diff --git a/debian/rules b/debian/rules index 09901d9..03f15ee 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f export DH_VERBOSE := 1 +EDK2BASE ?= $(CURDIR)/edk2 include /usr/share/dpkg/architecture.mk ifeq (amd64, $(DEB_HOST_ARCH_CPU)) @@ -18,7 +19,6 @@ else ifeq (loong64, $(DEB_HOST_ARCH_CPU)) ARCH = loongarch64 EFI_ARCH := loongarch64 - EDK2BASE ?= $(CURDIR)/edk2 else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) From 6ba16dea4e75aee3a784184591b8da8d80f364f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:29:22 +0000 Subject: [PATCH 18/25] Isolate loong64 deb build outputs and validate EDK2BASE Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/2aaef8ba-8f9d-49d4-97f6-04956b578eaf Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 17 +++++++++++------ debian/rules | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 33a614f..62f16c7 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -66,13 +66,18 @@ jobs: - name: Build loong64 Debian package run: | mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" - rm -f "$GITHUB_WORKSPACE"/../refind_*_loong64.deb "$GITHUB_WORKSPACE"/../refind_*_loong64.changes "$GITHUB_WORKSPACE"/../refind_*_loong64.buildinfo + build_dir="/tmp/refind-loong64" + rm -rf "$build_dir" + cp -a "$GITHUB_WORKSPACE" "$build_dir" + cd "$build_dir" dpkg-buildpackage -us -uc -b -a loong64 - mapfile -t deb_files < <(find "$GITHUB_WORKSPACE/.." -maxdepth 1 -type f -name "refind_*_loong64.deb") - [ "${#deb_files[@]}" -eq 1 ] || { echo "Expected exactly one loong64 deb artifact, found ${#deb_files[@]}"; printf '%s\n' "${deb_files[@]}"; exit 1; } - deb_file="${deb_files[0]}" - changes_file="${deb_file%.deb}.changes" - buildinfo_file="${deb_file%.deb}.buildinfo" + source_name="$(dpkg-parsechangelog -S Source)" + version="$(dpkg-parsechangelog -S Version)" + artifact_prefix="/tmp/${source_name}_${version}_loong64" + deb_file="${artifact_prefix}.deb" + changes_file="${artifact_prefix}.changes" + buildinfo_file="${artifact_prefix}.buildinfo" + [ -f "$deb_file" ] || { echo "Missing deb artifact: $deb_file"; exit 1; } [ -f "$changes_file" ] || { echo "Missing changes artifact: $changes_file"; exit 1; } [ -f "$buildinfo_file" ] || { echo "Missing buildinfo artifact: $buildinfo_file"; exit 1; } deb_listing="$(dpkg-deb -c "$deb_file")" diff --git a/debian/rules b/debian/rules index 03f15ee..414c9ac 100755 --- a/debian/rules +++ b/debian/rules @@ -37,6 +37,7 @@ override_dh_auto_clean: override_dh_auto_build: ifeq (loong64, $(DEB_HOST_ARCH_CPU)) + test -d '$(EDK2BASE)' || { echo "EDK2BASE not found: $(EDK2BASE)"; exit 1; } dh_auto_build -- edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(EDK2BASE)' dh_auto_build -- fs_edk2 'ARCH=$(ARCH)' 'EDK2BASE=$(EDK2BASE)' else From b9b8f289a18e38fc60eb22e15dc0c2d531346102 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:41:34 +0000 Subject: [PATCH 19/25] Use cross-tools only for loongarch compiler setup Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/45fa10d3-a575-48dc-942e-0306cb91f5e3 Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 62f16c7..e58bb19 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -34,8 +34,6 @@ jobs: sudo apt-get update sudo apt-get install -y \ build-essential \ - binutils-loongarch64-linux-gnu \ - gcc-loongarch64-linux-gnu \ debhelper \ devscripts \ dpkg-dev \ From e1909308858e7cb54174746cd85b7a8fd6c5d2cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:54:57 +0000 Subject: [PATCH 20/25] chore: plan remove deb build and align zip layout Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- libeg/nanojpeg.o | Bin 0 -> 12328 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 libeg/nanojpeg.o diff --git a/libeg/nanojpeg.o b/libeg/nanojpeg.o new file mode 100644 index 0000000000000000000000000000000000000000..cfa211727b36528454c0e4e2624758c654770c56 GIT binary patch literal 12328 zcmbta4|G)3nSXC)NG2rA8xU>OV5eoYObaoC(alJdyv!ST0~0_A%2r&6F~S%iG|W`c zDACE_JcdU(TipYvyW8EaZRxs4*lwF*rDcXlOsJ(X>{={pgVr+B2!=mR0z%$?-+lKE z!!6m}bM~E+x%d9=_wRn+cfWVvg)M>5Jc}p_>=A|gg{vcm3c{Y5SNk=jTO&AxNrE>O zH#QYNZy12>Go(dtb*YVSsp14ANs?dBec1PmYGf2oZJziR>ETb8HkO=((kN}Bm9AFPDNi#$z-XsUor8bK6&hr$rgP% z5bupBL4AoO_L)UBB?9RZQ6uWwFTEFW=uaCp?Z%aFPRTxQ7=|}xvSuHKf%eZ{aF0Ly{))>1aZYjR1pi4E^`b1LLIw1Xw8st0F_WnT&FlBdu0J%P>U0AkM)jmJy z1T6DIz|>u;m{P?qsdG-;h?ZOxIQWIkQ(#)nwq~&|{)dQ7PRw-2K9Qm}?}&h$yT3HXdjs0XL1HR+W6~}rEEq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}VlkCty}ZQ0P&8rcjyD5+`9 z$|qVI)-{=i{6BwPz>iC!$EBRK8ru7q<`tWu%V$FY&taHbH95rWILpkokG|*dUJ7~b zCY-xZxr5>~P3f#4Ous4Dy{5zKp9!-lljpCY{3_2Ydf9xZwM_fdWqCz$!4!B0X5ZQ=R*DE|O6 zlrr%An1$Di{{Vi-!?T3)WBl<5#`sHd5}xbnMtmP7*gy>{0Sr@#=SP`bhyf7<7yUr^ b6B%9o;g& Date: Mon, 20 Apr 2026 11:55:53 +0000 Subject: [PATCH 21/25] ci: remove deb build and package official-style zip artifact Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 68 +++++++++++-------------- libeg/nanojpeg.o | Bin 12328 -> 0 bytes 2 files changed, 29 insertions(+), 39 deletions(-) delete mode 100644 libeg/nanojpeg.o diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index e58bb19..a668f5b 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -34,17 +34,14 @@ jobs: sudo apt-get update sudo apt-get install -y \ build-essential \ - debhelper \ - devscripts \ - dpkg-dev \ - fakeroot \ gettext \ iasl \ mtools \ nasm \ python3 \ python3-pip \ - uuid-dev + uuid-dev \ + zip pip3 install -r edk2/pip-requirements.txt - name: Download LoongArch64 cross-toolchain @@ -61,29 +58,6 @@ jobs: run: | make -C edk2/BaseTools -j"$(nproc)" - - name: Build loong64 Debian package - run: | - mkdir -p "$GITHUB_WORKSPACE/artifacts/deb-loong64" - build_dir="/tmp/refind-loong64" - rm -rf "$build_dir" - cp -a "$GITHUB_WORKSPACE" "$build_dir" - cd "$build_dir" - dpkg-buildpackage -us -uc -b -a loong64 - source_name="$(dpkg-parsechangelog -S Source)" - version="$(dpkg-parsechangelog -S Version)" - artifact_prefix="/tmp/${source_name}_${version}_loong64" - deb_file="${artifact_prefix}.deb" - changes_file="${artifact_prefix}.changes" - buildinfo_file="${artifact_prefix}.buildinfo" - [ -f "$deb_file" ] || { echo "Missing deb artifact: $deb_file"; exit 1; } - [ -f "$changes_file" ] || { echo "Missing changes artifact: $changes_file"; exit 1; } - [ -f "$buildinfo_file" ] || { echo "Missing buildinfo artifact: $buildinfo_file"; exit 1; } - deb_listing="$(dpkg-deb -c "$deb_file")" - grep -q './etc/refind.d/keys/' <<< "$deb_listing" || { echo "Missing keys directory in deb"; exit 1; } - grep -q 'usr/share/refind/refind/refind_loongarch64.efi' <<< "$deb_listing" || { echo "Missing refind_loongarch64.efi in deb"; exit 1; } - grep -q 'usr/share/refind/refind/drivers_loongarch64/' <<< "$deb_listing" || { echo "Missing drivers_loongarch64 in deb"; exit 1; } - cp -a "$deb_file" "$changes_file" "$buildinfo_file" "$GITHUB_WORKSPACE/artifacts/deb-loong64/" - - name: Build rEFInd for LoongArch64 (EDK2) run: | export PATH="$LOONGARCH64_TOOLCHAIN_BIN:$PATH" @@ -93,18 +67,34 @@ jobs: EDK2_TOOLCHAIN="$EDK2_TOOLCHAIN" \ edk2 fs_edk2 - - name: Upload LoongArch64 EFI artifacts - uses: actions/upload-artifact@v4 - with: - name: refind-loongarch64-edk2 - if-no-files-found: error - path: | - refind/refind_loongarch64.efi - drivers_loongarch64/*.efi + - name: Package LoongArch64 zip (official layout style) + run: | + set -euo pipefail + version="$(sed -n '1s/^refind (\([^)]*\)).*/\1/p' debian/changelog)" + [ -n "$version" ] || { echo "Failed to parse version from debian/changelog"; exit 1; } + package_root="refind-bin-$version" + package_dir="$RUNNER_TEMP/$package_root" + zip_path="$GITHUB_WORKSPACE/$package_root.zip" + rm -rf "$package_dir" "$zip_path" + mkdir -p "$package_dir/refind/drivers_loongarch64" "$package_dir/refind/tools_loongarch64" + cp --preserve=timestamps drivers_loongarch64/*_loongarch64.efi "$package_dir/refind/drivers_loongarch64/" + cp --preserve=timestamps filesystems/LICENSE*txt "$package_dir/refind/drivers_loongarch64/" + cp --preserve=timestamps refind/refind_loongarch64.efi "$package_dir/refind/" + cp --preserve=timestamps refind.conf-sample "$package_dir/refind/" + cp -a icons "$package_dir/refind/" + cp -a docs keys banners fonts "$package_dir/" + cp --preserve=timestamps COPYING.txt LICENSE.txt README.txt CREDITS.txt NEWS.txt \ + refind-install refind-mkdefault refind-sb-healthcheck mkrlconf mvrefind mountesp \ + "$package_dir/" + ( + cd "$RUNNER_TEMP" + zip -9r "$zip_path" "$package_root" + ) + echo "ZIP_PATH=$zip_path" >> "$GITHUB_ENV" - - name: Upload loong64 Debian package + - name: Upload LoongArch64 zip artifact uses: actions/upload-artifact@v4 with: - name: refind-loong64-deb - path: artifacts/deb-loong64/* + name: refind-loongarch64-binzip if-no-files-found: error + path: ${{ env.ZIP_PATH }} diff --git a/libeg/nanojpeg.o b/libeg/nanojpeg.o deleted file mode 100644 index cfa211727b36528454c0e4e2624758c654770c56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12328 zcmbta4|G)3nSXC)NG2rA8xU>OV5eoYObaoC(alJdyv!ST0~0_A%2r&6F~S%iG|W`c zDACE_JcdU(TipYvyW8EaZRxs4*lwF*rDcXlOsJ(X>{={pgVr+B2!=mR0z%$?-+lKE z!!6m}bM~E+x%d9=_wRn+cfWVvg)M>5Jc}p_>=A|gg{vcm3c{Y5SNk=jTO&AxNrE>O zH#QYNZy12>Go(dtb*YVSsp14ANs?dBec1PmYGf2oZJziR>ETb8HkO=((kN}Bm9AFPDNi#$z-XsUor8bK6&hr$rgP% z5bupBL4AoO_L)UBB?9RZQ6uWwFTEFW=uaCp?Z%aFPRTxQ7=|}xvSuHKf%eZ{aF0Ly{))>1aZYjR1pi4E^`b1LLIw1Xw8st0F_WnT&FlBdu0J%P>U0AkM)jmJy z1T6DIz|>u;m{P?qsdG-;h?ZOxIQWIkQ(#)nwq~&|{)dQ7PRw-2K9Qm}?}&h$yT3HXdj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Ov*6aCbXvW2B+6nT}VlkCty}ZQ0P&8rcjyD5+`9 z$|qVI)-{=i{6BwPz>iC!$EBRK8ru7q<`tWu%V$FY&taHbH95rWILpkokG|*dUJ7~b zCY-xZxr5>~P3f#4Ous4Dy{5zKp9!-lljpCY{3_2Ydf9xZwM_fdWqCz$!4!B0X5ZQ=R*DE|O6 zlrr%An1$Di{{Vi-!?T3)WBl<5#`sHd5}xbnMtmP7*gy>{0Sr@#=SP`bhyf7<7yUr^ b6B%9o;g& Date: Mon, 20 Apr 2026 11:57:41 +0000 Subject: [PATCH 22/25] ci: derive zip version from source and guard driver copy Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index a668f5b..4d44420 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -70,13 +70,14 @@ jobs: - name: Package LoongArch64 zip (official layout style) run: | set -euo pipefail - version="$(sed -n '1s/^refind (\([^)]*\)).*/\1/p' debian/changelog)" - [ -n "$version" ] || { echo "Failed to parse version from debian/changelog"; exit 1; } + version="$(sed -n 's/^#define REFIND_VERSION L"\(.*\)"/\1/p' include/version.h)" + [ -n "$version" ] || { echo "Failed to parse version from include/version.h"; exit 1; } package_root="refind-bin-$version" package_dir="$RUNNER_TEMP/$package_root" zip_path="$GITHUB_WORKSPACE/$package_root.zip" rm -rf "$package_dir" "$zip_path" mkdir -p "$package_dir/refind/drivers_loongarch64" "$package_dir/refind/tools_loongarch64" + compgen -G 'drivers_loongarch64/*_loongarch64.efi' > /dev/null || { echo "Missing LoongArch64 filesystem drivers"; exit 1; } cp --preserve=timestamps drivers_loongarch64/*_loongarch64.efi "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps filesystems/LICENSE*txt "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps refind/refind_loongarch64.efi "$package_dir/refind/" From f0e485aa8820bbdd9685e92fc49acaab3a5888bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:59:20 +0000 Subject: [PATCH 23/25] ci: refine zip copy patterns for workflow clarity Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index 4d44420..f16e876 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -79,14 +79,13 @@ jobs: mkdir -p "$package_dir/refind/drivers_loongarch64" "$package_dir/refind/tools_loongarch64" compgen -G 'drivers_loongarch64/*_loongarch64.efi' > /dev/null || { echo "Missing LoongArch64 filesystem drivers"; exit 1; } cp --preserve=timestamps drivers_loongarch64/*_loongarch64.efi "$package_dir/refind/drivers_loongarch64/" - cp --preserve=timestamps filesystems/LICENSE*txt "$package_dir/refind/drivers_loongarch64/" + cp --preserve=timestamps filesystems/LICENSE*.txt "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps refind/refind_loongarch64.efi "$package_dir/refind/" cp --preserve=timestamps refind.conf-sample "$package_dir/refind/" cp -a icons "$package_dir/refind/" cp -a docs keys banners fonts "$package_dir/" - cp --preserve=timestamps COPYING.txt LICENSE.txt README.txt CREDITS.txt NEWS.txt \ - refind-install refind-mkdefault refind-sb-healthcheck mkrlconf mvrefind mountesp \ - "$package_dir/" + cp --preserve=timestamps COPYING.txt LICENSE.txt README.txt CREDITS.txt NEWS.txt "$package_dir/" + cp --preserve=timestamps refind-install refind-mkdefault refind-sb-healthcheck mkrlconf mvrefind mountesp "$package_dir/" ( cd "$RUNNER_TEMP" zip -9r "$zip_path" "$package_root" From 63ebdac8b89f9140cbfc00569145f81afa54f882 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:59:56 +0000 Subject: [PATCH 24/25] ci: add version format guard and clearer driver check message Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index f16e876..bb0846d 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -72,12 +72,13 @@ jobs: set -euo pipefail version="$(sed -n 's/^#define REFIND_VERSION L"\(.*\)"/\1/p' include/version.h)" [ -n "$version" ] || { echo "Failed to parse version from include/version.h"; exit 1; } + [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "Unexpected version format in include/version.h: $version"; exit 1; } package_root="refind-bin-$version" package_dir="$RUNNER_TEMP/$package_root" zip_path="$GITHUB_WORKSPACE/$package_root.zip" rm -rf "$package_dir" "$zip_path" mkdir -p "$package_dir/refind/drivers_loongarch64" "$package_dir/refind/tools_loongarch64" - compgen -G 'drivers_loongarch64/*_loongarch64.efi' > /dev/null || { echo "Missing LoongArch64 filesystem drivers"; exit 1; } + compgen -G 'drivers_loongarch64/*_loongarch64.efi' > /dev/null || { echo "No LoongArch64 driver EFI files found in drivers_loongarch64/"; exit 1; } cp --preserve=timestamps drivers_loongarch64/*_loongarch64.efi "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps filesystems/LICENSE*.txt "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps refind/refind_loongarch64.efi "$package_dir/refind/" From 04c1fd5df11d6aa1464322a7643f5c01c821f306 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:00:43 +0000 Subject: [PATCH 25/25] ci: use portable checks in zip packaging step Agent-Logs-Url: https://github.com/multiarchstore/refind/sessions/be62fe82-757a-429c-bbf4-a33b367ef5fe Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com> --- .github/workflows/loongarch64-edk2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/loongarch64-edk2.yml b/.github/workflows/loongarch64-edk2.yml index bb0846d..589c4f8 100644 --- a/.github/workflows/loongarch64-edk2.yml +++ b/.github/workflows/loongarch64-edk2.yml @@ -72,13 +72,13 @@ jobs: set -euo pipefail version="$(sed -n 's/^#define REFIND_VERSION L"\(.*\)"/\1/p' include/version.h)" [ -n "$version" ] || { echo "Failed to parse version from include/version.h"; exit 1; } - [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "Unexpected version format in include/version.h: $version"; exit 1; } + echo "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "Unexpected version format in include/version.h: $version"; exit 1; } package_root="refind-bin-$version" package_dir="$RUNNER_TEMP/$package_root" zip_path="$GITHUB_WORKSPACE/$package_root.zip" rm -rf "$package_dir" "$zip_path" mkdir -p "$package_dir/refind/drivers_loongarch64" "$package_dir/refind/tools_loongarch64" - compgen -G 'drivers_loongarch64/*_loongarch64.efi' > /dev/null || { echo "No LoongArch64 driver EFI files found in drivers_loongarch64/"; exit 1; } + ls drivers_loongarch64/*_loongarch64.efi >/dev/null 2>&1 || { echo "No LoongArch64 driver EFI files found in drivers_loongarch64/"; exit 1; } cp --preserve=timestamps drivers_loongarch64/*_loongarch64.efi "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps filesystems/LICENSE*.txt "$package_dir/refind/drivers_loongarch64/" cp --preserve=timestamps refind/refind_loongarch64.efi "$package_dir/refind/"