Linux kernel(核心程式)如何上patch(補丁)

如何編譯(Compile) Linux的核心(Kernel)文中說明了如何編譯Linux的核心,但Linux kernel會一直更新,每次更新要重抓一次全部也行,只抓patch再補丁也行,後者好處是patch檔案小,且不必全部程式只要編譯更新的檔案,時間差很多。

如何上patch(補丁)呢,很簡單,先加–dry-run參數,試試有沒有錯誤,例如 kernel 4.8 升到 4.8.1
$ xz -dc patch-4.8.1.xz | patch -p1 --dry-run
checking file Makefile
checking file arch/arm64/kernel/debug-monitors.c
checking file drivers/staging/fbtft/fbtft-core.c
checking file drivers/usb/class/usbtmc.c
checking file drivers/usb/misc/legousbtower.c
checking file drivers/usb/serial/cp210x.c
checking file drivers/usb/usbip/vudc_rx.c
checking file include//swap.h
checking file sound/pci/hda/patch_conexant.c
checking file sound/pci/hda/patch_realtek.c

沒有錯誤的話,去掉–dry-run,正式跑一次,
$ xz -dc patch-4.8.1.xz | patch -p1
patching file Makefile
patching file arch/arm64/kernel/debug-monitors.c
patching file drivers/staging/fbtft/fbtft-core.c
patching file drivers/usb/class/usbtmc.c
patching file drivers/usb/misc/legousbtower.c
patching file drivers/usb/serial/cp210x.c
patching file drivers/usb/usbip/vudc_rx.c
patching file include/linux/swap.h
patching file sound/pci/hda/patch_conexant.c
patching file sound/pci/hda/patch_realtek.c

完了就可以繼續接 make 步驟了。

(Visited 86 times, 1 visits today)
相關文章:

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *