Open studeo14 opened 4 years ago
Just added a script to apply the patches in question. It can also handle applying a generic patch set in case new patches are needed in the future. I updated the README to reflect this.
When using your branch:
quantomworks@DESKTOP-6VDCHBC:~/usbip-wsl2-instructions$ sudo bash scripts/apply_patches.sh
Found patches: ./patches/usbip-network-fix-unaligned-member-access.patch ./patches/usbip-strncpy-stringop-truncation.patch
Applying patch: ./patches/usbip-network-fix-unaligned-member-access.patch
patch -d /usr/src/4.19.104-microsoft-standard -p1 < ./patches/usbip-network-fix-unaligned-member-access.patch
patching file tools/usb/usbip/src/usbip_network.c
Hunk #1 succeeded at 62 (offset 12 lines).
patching file tools/usb/usbip/src/usbip_network.h
Applying patch: ./patches/usbip-strncpy-stringop-truncation.patch
patch -d /usr/src/4.19.104-microsoft-standard -p1 < ./patches/usbip-strncpy-stringop-truncation.patch
patching file tools/usb/usbip/libsrc/usbip_common.c
Hunk #1 FAILED at 226.
1 out of 1 hunk FAILED -- saving rejects to file tools/usb/usbip/libsrc/usbip_common.c.rej
patching file tools/usb/usbip/libsrc/usbip_device_driver.c
Hunk #1 FAILED at 103.
Hunk #2 FAILED at 122.
2 out of 2 hunks FAILED -- saving rejects to file tools/usb/usbip/libsrc/usbip_device_driver.c.rej
For some kernel versions USB/IP may require a patch in order to compile. These are fixed in current kernel versions, but some may not have the patches in their version.
Added information for these patches: stringop-trunctation in usbip_device_driver.c, and address-of-packed-member in usbip_network.c