Openwrt

如何解決有關修補的錯誤,hunk failed

  • December 15, 2021

我嘗試添加有關最後一個核心的更新檔,但不知道為什麼不起作用..想法?謝謝

openwrtt$ patch -p1 < kernel.patch
patching file include/kernel-version.mk
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file include/kernel-version.mk.rej
patching file target/linux/bcm27xx/patches-5.10/950-0139-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
patching file target/linux/bcm27xx/patches-5.10/950-0151-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
patching file target/linux/bcm27xx/patches-5.10/950-0249-kbuild-Disable-gcc-plugins.patch
patching file target/linux/bcm27xx/patches-5.10/950-0323-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch
patching file target/linux/bcm27xx/patches-5.10/950-0657-Documentation-devicetree-Add-documentation-for-imx37.patch
patching file target/linux/bcm27xx/patches-5.10/950-0733-usb-xhci-workaround-for-bogus-SET_DEQ_PENDING-endpoi.patch
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- saving rejects to file target/linux/bcm27xx/patches-5.10/950-0733-usb-xhci-workaround-for-bogus-SET_DEQ_PENDING-endpoi.patch.rej
patching file target/linux/generic/backport-5.10/610-v5.13-57-netfilter-flowtable-Set-offload-timeouts-according-t.patch
patching file target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
patching file target/linux/generic/pending-5.10/834-ledtrig-libata.patch
patching file target/linux/oxnas/patches-5.10/999-libata-hacks.patch
patching file target/linux/realtek/patches-5.10/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch

patch命令會告訴您哪些文件已成功修補,哪些未成功修補。例如,

patch -p1 < kernel.patch
patching file include/kernel-version.mk
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file include/kernel-version.mk.rej

在這種情況下,您需要查看拒絕文件include/kernel-version.mk.rej並嘗試確定更新檔無法應用於該文件的原因include/kernel-version.mk-l由於您沒有使用( --ignore-whitespace) 標誌,因此可能很簡單,例如不同的間距。確定問題後,您可能需要手動應用更新檔。

然後對另一個失敗的更新檔重複該過程。

引用自:https://unix.stackexchange.com/questions/681508