验证内核文件的架构

验证内核文件的架构

笔记: 我是不是对当前正在运行的内核感兴趣,但我要启动的内核位于文件系统中的文件中。

我要启动一个新内核。我已经准备好grub.conf并运行了sudo update-grub。我几乎确信我已经安装了正确的内核:

$ apt-cache show linux-image-generic-lts-trusty
Package: linux-image-generic-lts-trusty
Priority: optional
Section: metapackages
Installed-Size: 28
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Source: linux-meta
Version: 3.13.0.32.38
Depends: linux-image-generic
Filename: pool/main/l/linux-meta/linux-image-generic-lts-trusty_3.13.0.32.38_amd64.deb
Size: 1778
MD5sum: b8e5f06fb937b0132cb2fec4f996fdbf
SHA1: cad821aedf442987d9de0eb16b93f9fdc761fc2f
SHA256: 2a1a1f0073ca6864b985445bb0b012e5becc4cd44836ff5ab52cb84e221015f1
Description-en: Generic Linux kernel image
 Transistional package for upgrades from 12.04 to 14.04 (Precise to Trusty)
Description-md5: 8a39d8556ef2a2dfbe5697d557d7c36a
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y

Package: linux-image-generic-lts-trusty
Priority: optional
Section: metapackages
Installed-Size: 27
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Source: linux-meta
Version: 3.13.0.24.28
Depends: linux-image-generic
Filename: pool/main/l/linux-meta/linux-image-generic-lts-trusty_3.13.0.24.28_amd64.deb
Size: 1782
MD5sum: 5cf768492732982e3bde545f519196dc
SHA1: fdc5d833ca0f93ae5d1b1dbdb818285d5338fde4
SHA256: f11eb79a49640d161d9e7cdade80a9fad2f7b50880bf28097eaca30a8c0a8fbb
Description-en: Generic Linux kernel image
 Transistional package for upgrades from 12.04 to 14.04 (Precise to Trusty)
Description-md5: 8a39d8556ef2a2dfbe5697d557d7c36a
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y

因此内核是 64 位的 ( amd64)。然后我将安装它:

$ sudo apt-get install linux-image-generic-lts-trusty

让我们检查一下安装了什么:

$ apt-cache depends linux-image-generic-lts-trusty 
linux-image-generic-lts-trusty
  Depends: linux-image-generic
  Conflicts: linux-image-generic-lts-trusty:i386

$ apt-cache depends linux-image-generic
linux-image-generic
  Depends: linux-image-3.13.0-32-generic
  Depends: linux-image-extra-3.13.0-32-generic
  Depends: linux-firmware
  Conflicts: linux-image-generic:i386

$ dpkg -L linux-image-3.13.0-32-generic 
...
/boot/abi-3.13.0-32-generic
/boot/vmlinuz-3.13.0-32-generic
/boot/config-3.13.0-32-generic
/boot/System.map-3.13.0-32-generic

我不喜欢这样-32。那是 32 位吗?可能不是,但是:

$ ls -l /boot/bzImage-* /boot/vmlinuz-*
-rw-r--r-- 1 root root 7694800 Mar 18 16:48 /boot/bzImage-3.10.23-xxxx-std-ipv6-64
-rw------- 1 root root 5798112 Jul 15 06:29 /boot/vmlinuz-3.13.0-32-generic

我拥有的另一个内核有一个非常明显的-64,而我将要尝试的内核有一个-32-generic。也许这并不意味着什么,但我想确保/boot/vmlinuz-3.13.0-32-generic是 64 位。我该如何验证?

相关内容