【问题标题】:How do I compile and install an addition kernel on a Debian System如何在 Debian 系统上编译和安装附加内核
【发布时间】:2014-11-18 09:17:46
【问题描述】:
我必须为我的 Debian 发行版安装旧内核版本,以检查驱动程序是否有版本问题。该驱动程序仅在最高 2.6 的内核版本中受支持和测试。我的 Debian 有一个 3.2 内核。由于硬件工作不正常,我联系了支持人员,并告诉我尝试使用较旧的内核版本,但由于此测试,我不想重新安装整个系统。我知道可以在启动菜单中选择不同的内核版本,但是如何在其中添加内核呢?
获取较旧的内核版本并进行编译不是问题,但是如何将新的“旧”内核添加到启动菜单以及在不杀死实际内核的情况下我必须在哪里存储此内核
【问题讨论】:
标签:
linux
linux-kernel
debian
【解决方案1】:
内核映像必须位于您的 /boot 目录中,并且 grub 引导加载程序配置文件位于 /boot/grub/grub.cfg 中
如果你打开grub.cfg你可以看到grub菜单的设置(当你打开你的电脑时它是启动菜单)。它必须看起来像这样(我的 grub.cfg):
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os
$menuentry_id_option 'gnulinux-simple-79b185ec-dcb5-4f70-9ea9-6cee082cc626' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 79b185ec-dcb5-4f70-9ea9-6cee082cc626
else
search --no-floppy --fs-uuid --set=root 79b185ec-dcb5-4f70-9ea9-6cee082cc626
fi
linux /boot/vmlinuz-3.18.0-rc4+ root=UUID=79b185ec-dcb5-4f70-9ea9-6cee082cc626 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.18.0-rc4+
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-79b185ec-dcb5-4f70-9ea9-6cee082cc626' {
menuentry 'Ubuntu, with Linux 3.18.0-rc4+' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.18.0-rc4+-advanced-79b185ec-dcb5-4f70-9ea9-6cee082cc626' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 79b185ec-dcb5-4f70-9ea9-6cee082cc626
else
search --no-floppy --fs-uuid --set=root 79b185ec-dcb5-4f70-9ea9-6cee082cc626
fi
echo 'Loading Linux 3.18.0-rc4+ ...'
linux /boot/vmlinuz-3.18.0-rc4+ root=UUID=79b185ec-dcb5-4f70-9ea9-6cee082cc626 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.18.0-rc4+
}
# other submenes
....
....
....
#
}
您可以在此处查看菜单条目和子菜单,因此您可以添加另一个菜单/子菜单项,其中包含内核路径、initrd 路径等的设置...