Refine script for creating Ventoy EFI boot image

- Add a safeguard to exit the script if changing to the ISO directory fails, ensuring robustness in the script execution.
- Format the `mkisofs` command for better readability by breaking it into multiple lines. This enhances the maintainability of the script.
- Simplify the process of replacing the existing compressed EFI boot image in the INSTALL directory by removing the old file first and then copying the new one.
This commit is contained in:
Tobias Svenblad 2023-12-07 20:41:25 +02:00 committed by GitHub
parent 757cacf274
commit 27c957c564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -1,13 +1,20 @@
#!/bin/sh #!/bin/sh
# Remove previous Ventoy EFI boot image
rm -f ventoy_efiboot.img.* rm -f ventoy_efiboot.img.*
cd ISO # Create new ISO in the ISO directory
mkisofs -R -D -sysid VENTOY -V VENTOY -P "longpanda admin@ventoy.net" -p 'https://www.ventoy.net' -o ../ventoy_efiboot.img ./ (
cd .. cd ISO || exit 1
mkisofs -R -D -sysid VENTOY -V VENTOY \
-P "longpanda admin@ventoy.net" \
-p 'https://www.ventoy.net' \
-o ../ventoy_efiboot.img ./
)
# Compress the new EFI boot image
xz --check=crc32 ventoy_efiboot.img xz --check=crc32 ventoy_efiboot.img
# Replace the existing compressed EFI boot image in the INSTALL directory
rm -f ../INSTALL/ventoy/ventoy_efiboot.img.xz rm -f ../INSTALL/ventoy/ventoy_efiboot.img.xz
cp -a ventoy_efiboot.img.xz ../INSTALL/ventoy/ cp -a ventoy_efiboot.img.xz ../INSTALL/ventoy/