這幾天我一直在嘗試讓 ZFS-on-Linux 在 Debian 7 上工作,但該模組不想編譯:
# dpkg-reconfigure zfs-dkms
------------------------------
Deleting module version: 0.6.3
completely from the DKMS tree.
------------------------------
Done.
Loading new zfs-0.6.3 DKMS files...
Building only for 2.6.32-openvz-042stab090.5-amd64
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
當然,標頭和來源已安裝:
# uname -r
2.6.32-openvz-042stab090.5-amd64
# dpkg -l | grep 2.6.32-openvz-042stab090.5-amd64
ii linux-headers-2.6.32-openvz-042stab090.5-amd64 1 amd64 Header files related to Linux kernel, specifically,
ii linux-image-2.6.32-openvz-042stab090.5-amd64 1 amd64 Linux kernel binary image for version 2.6.32-openvz-042stab090.5-amd64
ii linux-source-2.6.32-openvz-042stab090.5-amd64 1 all Linux kernel source for version 2.6.32-openvz-042stab090.5-amd64
#
所以我正在手動嘗試。還沒有:
# dkms build zfs/0.6.3 -k `uname -r` --kernelsourcedir=/usr/src/linux-source-2.6.32-openvz-042stab090.5-amd64
Error! Your kernel headers for kernel 2.6.32-openvz-042stab090.5-amd64 cannot be found.
Please install the linux-headers-2.6.32-openvz-042stab090.5-amd64 package,
or use the --kernelsourcedir option to tell DKMS where it's located
ls /usr/src/linux-source-2.6.32-openvz-042stab090.5-amd64 | wc -l
90
它包含所有內容(arch、區塊、配置、debian,...)。搞什麼?
答案1
經過長時間的偵錯會話後,我發現 /lib/modules/2.6.32-openvz-042stab090.5-amd64 中到 /usr/src 和 /usr/include 的建置和來源連結遺失。
手動添加它們並且有效。
每個人都很高興我可以在 Linux 中工作,在那裡我至少可以查看原始程式碼並進行調試...