void-packages/srcpkgs/WoeUSB-cli/patches/offline.patch

42 lines
1.6 KiB
Diff

--- WoeUSB-cli-5.2.4.orig/sbin/woeusb
+++ WoeUSB-cli-5.2.4/sbin/woeusb
@@ -16,7 +16,8 @@
# lint: We use indirections and primitive variables, which is false positive of this rule
# shellcheck disable=SC2034
-RUFUS_UEFI_NTFS_VERSION="${RUFUS_UEFI_NTFS_VERSION:-b30e3b387a3ca7a5e2fddebcc2c8f9538a89b868}"
+BUNDLED_RUFUS_VERSION=b30e3b387a3ca7a5e2fddebcc2c8f9538a89b868
+RUFUS_UEFI_NTFS_VERSION="${RUFUS_UEFI_NTFS_VERSION:-${BUNDLED_RUFUS_VERSION}}"
DD_BLOCK_SIZE="${DD_BLOCK_SIZE:-$((4 * 1024 * 1024))}" # 4MiB
# Entry point of the main code
@@ -905,7 +906,6 @@ check_runtime_dependencies(){
rm \
stat \
stty \
- wget \
wimlib-imagex \
wipefs
do
@@ -1360,9 +1360,20 @@ install_uefi_ntfs_support_partition(){
local -r download_directory="${1}"; shift
local -r target_device="${1}"; shift
+ if [ "${rufus_uefi_ntfs_version}" = ${BUNDLED_RUFUS_VERSION} ]; then
+ # Write partition image to partition
+ dd \
+ if="/usr/share/woeusb/uefi-ntfs.img" \
+ of="${uefi_ntfs_partition}"
+ return 0
+ fi
+
if ! wget \
--directory-prefix="${download_directory}" \
"https://cdn.jsdelivr.net/gh/pbatard/rufus@${rufus_uefi_ntfs_version}/res/uefi/uefi-ntfs.img"; then
+ if ! command -v wget >/dev/null; then
+ print_warning 'wget is missing, please install wget!\n'
+ fi
print_warning \
"Unable to download UEFI:NTFS partition image from GitHub, installation skipped. Target device might not be bootable if the UEFI firmware doesn't support NTFS filesystem.\\n"
return 0