From 2ced1c61aabd559a94fac6173be7d3ba1c94c55f Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 6 Sep 2019 12:45:28 +0200 Subject: [PATCH] upgpkg: woeusb 3.3.0-2 added fix for cache workaround --- woeusb/.SRCINFO | 7 ++- woeusb/PKGBUILD | 16 ++++-- woeusb/disable_writeback_workaround.patch | 69 +++++++++++++++++++++++ 3 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 woeusb/disable_writeback_workaround.patch diff --git a/woeusb/.SRCINFO b/woeusb/.SRCINFO index b0a1d3f..080e917 100644 --- a/woeusb/.SRCINFO +++ b/woeusb/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = woeusb - pkgdesc = A Linux program to create Windows USB stick installer from a real Windows DVD or an image + pkgdesc = A Linux program to create Windows USB stick installer from a Windows DVD or an image pkgver = 3.3.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/slacka/WoeUSB arch = x86_64 license = GPL3 @@ -12,10 +12,11 @@ pkgbase = woeusb depends = wget depends = ntfs-3g optdepends = gksu - provides = woeusb-git conflicts = woeusb-git source = woeusb-3.3.0.tar.gz::https://github.com/slacka/WoeUSB/archive/v3.3.0.tar.gz + source = disable_writeback_workaround.patch sha256sums = dc0e1a233143a33182339915d043a419c089b8bfb0d3813b17acbff2bdb285bb + sha256sums = f051d9dbf1015596327b91abeea5c9f2404904e40e168f798fb4447e3fa9acb5 pkgname = woeusb diff --git a/woeusb/PKGBUILD b/woeusb/PKGBUILD index cafa8df..51f2a86 100644 --- a/woeusb/PKGBUILD +++ b/woeusb/PKGBUILD @@ -4,20 +4,26 @@ pkgname=woeusb pkgver=3.3.0 -pkgrel=1 -pkgdesc="A Linux program to create Windows USB stick installer from a real Windows DVD or an image" +pkgrel=2 +pkgdesc="A Linux program to create Windows USB stick installer from a Windows DVD or an image" arch=('x86_64') url="https://github.com/slacka/WoeUSB" license=('GPL3') depends=('wxgtk2' 'grub' 'dosfstools' 'parted' 'wget' 'ntfs-3g') optdepends=('gksu') conflicts=('woeusb-git') -provides=('woeusb-git') -source=("$pkgname-$pkgver.tar.gz::https://github.com/slacka/WoeUSB/archive/v$pkgver.tar.gz") -sha256sums=('dc0e1a233143a33182339915d043a419c089b8bfb0d3813b17acbff2bdb285bb') +source=("$pkgname-$pkgver.tar.gz::https://github.com/slacka/WoeUSB/archive/v$pkgver.tar.gz" + "disable_writeback_workaround.patch") +sha256sums=('dc0e1a233143a33182339915d043a419c089b8bfb0d3813b17acbff2bdb285bb' + 'f051d9dbf1015596327b91abeea5c9f2404904e40e168f798fb4447e3fa9acb5') prepare() { cd "WoeUSB-$pkgver" + + # Disable changing kernel cache behaviour, since it fails on newer versions + # See https://github.com/slacka/WoeUSB/issues/267 + patch -Np1 -i "${srcdir}/disable_writeback_workaround.patch" + autoreconf --install ./configure --prefix=/usr } diff --git a/woeusb/disable_writeback_workaround.patch b/woeusb/disable_writeback_workaround.patch new file mode 100644 index 0000000..57e51da --- /dev/null +++ b/woeusb/disable_writeback_workaround.patch @@ -0,0 +1,69 @@ +diff -rupN WoeUSB-3.3.0/src/woeusb WoeUSB-3.3.0-fix/src/woeusb +--- WoeUSB-3.3.0/src/woeusb 2019-03-26 03:34:51.000000000 +0100 ++++ WoeUSB-3.3.0-fix/src/woeusb 2019-08-03 09:10:10.553378730 +0200 +@@ -308,9 +308,6 @@ init(){ + + current_state=copying-filesystem + +- workaround_linux_make_writeback_buffering_not_suck \ +- apply +- + copy_filesystem_files \ + "${source_fs_mountpoint}" \ + "${target_fs_mountpoint}" \ +@@ -1650,41 +1647,6 @@ workaround_support_windows_7_uefi_boot() + > "${efi_boot_directory}/bootx64.efi" + }; declare -fr workaround_support_windows_7_uefi_boot + +-## Currently WoeUSB indirectly causes severely unresponsive system on 64-bit architecture with large primary memory during file copy process due to a flaw of the writeback buffer size handling in Linux kernel, workaround it before it is fixed +-## Refer: +-## - System lagging while copying data · Issue #113 · slacka/WoeUSB +-## - The pernicious USB-stick stall problem [LWN.net] +-workaround_linux_make_writeback_buffering_not_suck(){ +- util_check_function_parameters_quantity 1 "${#}" +- local -r mode="${1}" +- +- local -ir VM_DIRTY_BACKGROUND_BYTES=$((16*1024*1024)) # 16MiB +- local -ir VM_DIRTY_BYTES=$((48*1024*1024)) # 48MiB +- +- case "${mode}" in +- apply) +- echo_with_color \ +- yellow \ +- 'Applying workaround to prevent 64-bit systems with big primary memory from being unresponsive during copying files.' +- echo "${VM_DIRTY_BACKGROUND_BYTES}" > /proc/sys/vm/dirty_background_bytes +- echo "${VM_DIRTY_BYTES}" > /proc/sys/vm/dirty_bytes +- ;; +- reset) +- echo_with_color \ +- yellow \ +- 'Resetting workaround to prevent 64-bit systems with big primary memory from being unresponsive during copying files.' +- echo 0 > /proc/sys/vm/dirty_background_bytes +- echo 0 > /proc/sys/vm/dirty_bytes +- ;; +- *) +- printf_with_color \ +- red \ +- 'Fatal: %s: Unexpected *mode* encountered, please report bug.\n' \ +- "${FUNCNAME[0]}" +- ;; +- esac +-}; declare -fr workaround_linux_make_writeback_buffering_not_suck +- + install_legacy_pc_bootloader_grub(){ + util_check_function_parameters_quantity 3 "${#}" + local -r target_fs_mountpoint="${1}"; shift 1 +@@ -1836,13 +1798,6 @@ trap_exit(){ + off \ + "${global_only_for_gui}" + +- case "${current_state}" in +- copying-filesystem|finished) +- workaround_linux_make_writeback_buffering_not_suck \ +- reset +- ;; +- esac +- + if util_is_parameter_set_and_not_empty \ + source_fs_mountpoint; then + if ! cleanup_mountpoint \