嘗試安裝 Click Modular Router 並需要 /usr/src/linux 作為核心模組安裝

嘗試安裝 Click Modular Router 並需要 /usr/src/linux 作為核心模組安裝

我正在嘗試安裝點擊模組化路由器作為 Linux 核心模組。

我運行了命令

sudo ./configure --enable-linuxmodule

我收到以下錯誤

Can't find /usr/src/linux, so I can't compile the linuxmodule driver! (You may need the --with-linux=DIR option.)

然後我運行了以下命令

sudo ./configure --enable-linuxmodule --with-linux=/usr/src/linux-headers-3.2.0-55-generic-pae

我收到以下錯誤

Can't find Linux System.map file in /usr/src/linux-headers-3.2.0-55-generic-pae. (You may need the --with-linux=DIR and/or --with-linux-map=MAP options.)

我需要以這樣的方式進行設置,以便可以將其放入自動部署腳本中。我該怎麼做呢?

答案1

你需要做這樣的事情:

$: LINUX_VERSION=`uname -r` ./configure --with-linux=/usr/src/linux-headers-$LINUX_VERSION --with-linux-map=/boot/System.map-$LINUX_VERSION

如果需要其他部件,如果它們用於版本化部件,您可能需要以相同的方式傳遞它們的選項。

自動化部署的最佳解決方案是將其打包為 debian 軟體包,並隨其安裝,dkms以便在系統中安裝新核心時自動重建核心模組。您可以查看該virtualbox-dkms包以及其他類似的-dkms命名包,以了解如何執行此操作。

相關內容