Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patch section for USB/IP #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

studeo14
Copy link

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

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
@@ -131,6 +131,27 @@ Build USBIP tools:
/usr/src/4.19.43-microsoft-standard/tools/usb/usbip$ sudo make install -j 12
```

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the commit. Q: Is this compiler message occurring because of an upgrade to GCC v8? Any ideas on why it did not occur before?

Copy link
Author

@studeo14 studeo14 Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for replying! First of all, my kernel version is 4.19.104 on Ubuntu 20 with gcc 9.3.0. The USB/IP Makefiles seem to be settings the -Werror flag, so all of these small warnings will make the build fail. These errors are new features in gcc 9 so that could be why they haven't shown up before. I updated the README to reflect that as well.

The need for the patches has been updated to reflect why they are now showing up.
Copy link

@dkozel dkozel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely helpful and necessary and merging it as is would be an improvement. Even better would be to include the patch files in this repo and include wget and patch commands for applying the patches. While that may seem a bit excessive given we're compiling a kernel, the rest of the instructions are so straightforward and detailed that very little programming knowledge is needed to follow them.

README.md Outdated Show resolved Hide resolved
Cleaned up code

Updated README to recommend using the apply_patches script

Updated README with example usages

Typo
@studeo14
Copy link
Author

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.

@sfxworks
Copy link

sfxworks commented Aug 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants