[Build failure] How to fix usbip compilation in 17.01

Hi all,

I am following the Tutorial for R7800 to build a firmware for my R7500v2. Instead of "git checkout tags/v17.01.2", I used the branch 17.01 by "git checkout lede-17.01".

The make fails with the following log.

Applying ./patches-2.0/100-musl-compat.patch using plaintext: 
patching file src/usbipd.c
Hunk #1 FAILED at 453.
1 out of 1 hunk FAILED -- saving rejects to file src/usbipd.c.rej
Patch failed!  Please fix ./patches-2.0/100-musl-compat.patch!
Makefile:107: recipe for target '/home/ggrn/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl-1.1.16_eabi/linux-ipq806x/usbip-2.0/.prepared_b295d1b65ee4b3b5b25b8c458736ea3768b329da9893e34099c7d8ad5cb9c940' failed
make[3]: *** [/home/ggrn/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl-1.1.16_eabi/linux-ipq806x/usbip-2.0/.prepared_b295d1b65ee4b3b5b25b8c458736ea3768b329da9893e34099c7d8ad5cb9c940] Error 1
make[3]: Leaving directory '/home/ggrn/openwrt/feeds/packages/net/usbip'
package/Makefile:105: recipe for target 'package/feeds/packages/usbip/compile' failed
make[2]: *** [package/feeds/packages/usbip/compile] Error 2
make[2]: Leaving directory '/home/ggrn/openwrt'
package/Makefile:101: recipe for target '/home/ggrn/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl-1.1.16_eabi/stamp/.package_compile' failed
make[1]: *** [/home/ggrn/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl-1.1.16_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/ggrn/openwrt'
/home/ggrn/openwrt/include/toplevel.mk:205: recipe for target 'world' failed
make: *** [world] Error 2

I wonder how can this error happens, and how to fix it?

Thank you.

The reason is that the corresponding patch has been implemented upstream at the Linux kernel source repo in March, so the recent kernel bumps here have invalidated the old patch..

Kernel 4.4 that 17.01 uses:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/tools/usb/usbip?h=linux-4.4.y&id=6638091f1b1623db8b2338ef5a5f26d9ec870444

(and the same for kernel 4.9 that some targets use in master https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/tools/usb/usbip?h=linux-4.9.y&id=c485b111e69c76a39d5535c0d53050635f0e3314 )

Simple fix is to delete net/usbip/patches-2.0/100-musl-compat.patch in the packages feed . From your buildroot: feeds/packages/net/usbip/patches-2.0/100-musl-compat.patch