
我接到一個任務,必須在不做任何修改的情況下重新編譯 64 位元內核,並將新內核設定為 grub 中的預設內核。我在帶有 kernel 的 Ubuntu 14.04.2 64 位元系統上執行此操作3.16.0-60-generic
。
apt-get source linux-image-$(uname -r)
sudo apt-get build-dep linux-image-$(uname -r)
cd linux-lts-utopic-3.16.0/
cp /boot/config-3.16.0-60-generic .config
make
make modules
make modules_install
sudo make install
我可以啟動進入內核,除了內核版本 ( uname -r
) 之外的所有內容都顯示為3.16.7-ckt22
.如果我從原始碼編譯內核,版本會如何變化3.16.0-60
?
編輯:我沒有遵循完整的說明https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel因為它們會用新的核心映像覆蓋目前的核心映像。我想要一個帶有修改後綴的圖像,例如 -3.16.0-60-recompiled 或類似的東西,並與 grub 中的原始圖像一起顯示。
答案1
簡而言之,核心版本沒有因您的編譯而改變,而是為官方 Ubuntu 版本而改變。下面更長的答案。
官方 Ubuntu 核心有特殊的版本號。您可以查看版本號映射這裡,您的特定行複製如下:
3.16.0-60.80~14.04.1 Ubuntu-lts-3.16.0-60.80_14.04.1 3.16.7-ckt22
看這裡有關命名約定的解釋,也複製如下:
What does a specific Ubuntu kernel version number mean?
The official version of an Ubuntu kernel tells you a number of things,
including the base upstream version, the current Ubuntu ABI identifier
and the kernel flavour. (See How can we determine the version of the
running kernel? to find your current version number.)
Given a version like 2.6.35-6.9-generic this can be broken into four
parts as below:
<base kernel version>-<ABI number>.<upload number>-<flavour>
The base kernel version represents the mainline version on which the
Ubuntu kernel is based. The ABI number represents significant changes
in the kernel Application Binary Interface. The upload number is a
monotonically increasing counter for each upload of this base version.
The flavour indicates which kernel configuration variant this is (See
What is a Kernel Flavour?).