背景故事-很久以前,一家供应商给了我们带有Linux 4.4.49的buildroot 2017.08.2。我们从未更新过Ubuntu14.x构建机器。从Ubuntu20和更新的GCC开始,对旧的软件包和内核造成了严重破坏。
我试着跳到最长的LTS 5.15内核,但太多的硬件特定补丁失败了,我在学习&记住。我在2021.11.1中花了一些精力构建了4.4.49内核,但作为更新内核的一种方式,警告/错误比我想做的有根据的猜测要多。
我选择4.19.231作为"足够近但足够近"。我不明白为什么下面的大块没能修补Makefile。
Applying 0001-add-am33x-firmware.patch using patch:
patching file firmware/am335x-bone-scale-data.bin
patching file firmware/am335x-evm-scale-data.bin
patching file firmware/am335x-pm-firmware.bin
patching file firmware/am335x-pm-firmware.elf
patching file firmware/am43x-evm-scale-data.bin
patching file firmware/.gitignore
Applying 0002-add-8250-serial-tx-hooks.patch using patch:
patching file drivers/tty/serial/8250/8250_port.c
Hunk #1 succeeded at 1516 with fuzz 1 (offset 236 lines).
Hunk #2 succeeded at 1590 with fuzz 2 (offset 296 lines).
Hunk #3 succeeded at 1649 with fuzz 2 (offset 329 lines).
Hunk #4 succeeded at 3377 (offset 439 lines).
Applying 0003-add-tty-tx-en-driver.patch using patch:
**patching file drivers/misc/Makefile
Hunk #1 FAILED at 53.**
1 out of 1 hunk FAILED -- saving rejects to file drivers/misc/Makefile.rej
patching file drivers/misc/Kconfig
Hunk #1 succeeded at 513 with fuzz 2 (offset -12 lines).
patching file drivers/misc/tty_tx_en.c
make[1]: *** [package/pkg-generic.mk:251: /home/dobleadmin/Buildroot2021/buildroot-2021.11.1/output/build/linux-4.19.231/.stamp_patched] Error 1
make: *** [Makefile:84: _all] Error 2
The Makefile section:
obj-$(CONFIG_GENWQE) += genwqe/
obj-$(CONFIG_ECHO) += echo/
obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
obj-$(CONFIG_CXL_BASE) += cxl/
obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
The patch hunk:
Index: linux-custom/drivers/misc/Makefile
===================================================================
--- linux-custom.orig/drivers/misc/Makefile
+++ linux-custom/drivers/misc/Makefile @@ -52,3 +52,4 @@ obj-$(CONFIG_GENWQE) += genwqe/
obj-$(CONFIG_ECHO) += echo/
obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
obj-$(CONFIG_CXL_BASE) += cxl/
+obj-$(CONFIG_TTY_TX_EN) += tty_tx_en.o
您的补丁无法应用:在4.4中,它被应用在文件的末尾,在包含CONFIG_CXL_BASE
的行之后。这一行不再是v4.19中的最后一行。然而,考虑到更改,更新补丁应该是微不足道的。