mirror of https://github.com/ventoy/Ventoy.git
Improve EDK2 build process script for simplicity and reliability
- Update script to remove the existing EDK2 directory and unzip the new one, ensuring a clean start for the build process. - Add a check to exit the script if changing to the EDK2 directory fails, enhancing the robustness of the script. - Introduce a function `build_edk2` to streamline the building of EDK2 for different architectures (i386-efi, arm64-efi, and x86_64-efi). This function takes the architecture as an argument and executes the corresponding build command. - Replace repetitive build commands with calls to `build_edk2` function, reducing redundancy and improving the readability of the script.
This commit is contained in:
parent
757cacf274
commit
6efc93ab42
|
@ -1,21 +1,25 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Remove old EDK2 directory and unzip new one
|
||||||
rm -rf edk2-edk2-stable201911
|
rm -rf edk2-edk2-stable201911
|
||||||
|
|
||||||
unzip edk2-edk2-stable201911.zip > /dev/null
|
unzip edk2-edk2-stable201911.zip > /dev/null
|
||||||
|
|
||||||
|
# Copy modified EDK2 files
|
||||||
/bin/cp -a ./edk2_mod/edk2-edk2-stable201911 ./
|
/bin/cp -a ./edk2_mod/edk2-edk2-stable201911 ./
|
||||||
|
|
||||||
cd edk2-edk2-stable201911
|
# Build BaseTools
|
||||||
|
cd edk2-edk2-stable201911 || exit 1
|
||||||
make -j 4 -C BaseTools/
|
make -j 4 -C BaseTools/
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo '======== build EDK2 for i386-efi ==============='
|
# Function to build EDK2 for different architectures
|
||||||
sh ./build.sh ia32 || exit 1
|
build_edk2() {
|
||||||
|
local arch=$1
|
||||||
echo '======== build EDK2 for arm64-efi ==============='
|
echo "======== build EDK2 for $arch-efi ==============="
|
||||||
sh ./build.sh aa64 || exit 1
|
sh ./build.sh "$arch" || exit 1
|
||||||
|
}
|
||||||
echo '======== build EDK2 for x86_64-efi ==============='
|
|
||||||
sh ./build.sh || exit 1
|
|
||||||
|
|
||||||
|
# Build for different architectures
|
||||||
|
build_edk2 "ia32"
|
||||||
|
build_edk2 "aa64"
|
||||||
|
build_edk2 "" # default to x86_64
|
||||||
|
|
Loading…
Reference in New Issue