Linux

編譯核心但不建構核心模組

  • March 18, 2015

我正在嘗試為我的 Banana pi 編譯一個 linux-sunxi 核心。

使用此連結:http://sunxi.org/Linux_Kernel#Compilation

不幸的是,當我嘗試編譯 uImage 和模組時,我在底部收到以下消息。(步驟make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules:)

 Building modules, stage 2.
 MODPOST 0 modules

有誰知道如何解決這個問題?我確實有一個啟用了可載入模組的配置,例如我啟用了 hid-multitouch。

執行時make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install我得到:

DEPMOD  3.19.0-rc6-45640-g77f18db

根本沒有建構模組..

我遇到了同樣的問題!經過一段時間的Google搜尋,最終發現(在我的情況下)核心建構工具鏈對某些選項非常挑剔,正如在此處env指出的那樣。

在這裡,~/.bashrc我有export GREP_OPTIONS='--color=always',這似乎導致模組腳本生成問題。

因此,將其更改為export GREP_OPTIONS='--color=auto'export GREP_OPTIONS='--color=never' 註銷/登錄解決了問題!

使用時GREP_OPTIONS='--color=always'

$ make clean modules SUBDIRS=drivers/staging/usbip
 CLEAN   drivers/staging/usbip/.tmp_versions
 CLEAN   drivers/staging/usbip/Module.symvers
 LD      drivers/staging/usbip/built-in.o
 CC [M]  drivers/staging/usbip/usbip_common.o
 CC [M]  drivers/staging/usbip/usbip_event.o
 CC [M]  drivers/staging/usbip/stub_dev.o
 CC [M]  drivers/staging/usbip/stub_main.o
 CC [M]  drivers/staging/usbip/stub_rx.o
 CC [M]  drivers/staging/usbip/stub_tx.o
 CC [M]  drivers/staging/usbip/vhci_sysfs.o
 CC [M]  drivers/staging/usbip/vhci_tx.o
 CC [M]  drivers/staging/usbip/vhci_rx.o
 CC [M]  drivers/staging/usbip/vhci_hcd.o
 LD [M]  drivers/staging/usbip/usbip-core.o
 LD [M]  drivers/staging/usbip/vhci-hcd.o
 LD [M]  drivers/staging/usbip/usbip-host.o
 Building modules, stage 2.
 MODPOST 0 modules

更改GREP_OPTIONS='--color=auto'和註銷/登錄:

$ make clean modules SUBDIRS=drivers/staging/usbip
 CLEAN   drivers/staging/usbip/.tmp_versions
 CLEAN   drivers/staging/usbip/Module.symvers
 LD      drivers/staging/usbip/built-in.o
 CC [M]  drivers/staging/usbip/usbip_common.o
 CC [M]  drivers/staging/usbip/usbip_event.o
 CC [M]  drivers/staging/usbip/stub_dev.o
 CC [M]  drivers/staging/usbip/stub_main.o
 CC [M]  drivers/staging/usbip/stub_rx.o
 CC [M]  drivers/staging/usbip/stub_tx.o
 CC [M]  drivers/staging/usbip/vhci_sysfs.o
 CC [M]  drivers/staging/usbip/vhci_tx.o
 CC [M]  drivers/staging/usbip/vhci_rx.o
 CC [M]  drivers/staging/usbip/vhci_hcd.o
 LD [M]  drivers/staging/usbip/usbip-core.o
 LD [M]  drivers/staging/usbip/vhci-hcd.o
 LD [M]  drivers/staging/usbip/usbip-host.o
 Building modules, stage 2.
 MODPOST 3 modules
 CC      drivers/staging/usbip/usbip-core.mod.o
 LD [M]  drivers/staging/usbip/usbip-core.ko
 CC      drivers/staging/usbip/usbip-host.mod.o
 LD [M]  drivers/staging/usbip/usbip-host.ko
 CC      drivers/staging/usbip/vhci-hcd.mod.o
 LD [M]  drivers/staging/usbip/vhci-hcd.ko

瘋狂的!

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