xyrjkq
deepin
2014-05-16 00:10 这个是我在网上看到LINUX内核启动参数资料。可是我实在搞不定,不知道把(intel_iommu=on)这段加在/boot/grub/grub.cfg 文件的什么位置才可以启动IOMMU内核。
修改Linux内核启动参数
分类: Linux内核 2012-03-27 22:22 3520人阅读 评论(0) 收藏 举报
linux内核ubuntulinuxsearchextos
内核启动参数一般保存在 /boot/grub/menu.lst (对应"kernel"开头的行) 或者 /boot/grub/grub.cfg (对应linux开头的行)文件中, 系统启动时由grub引导并传递给内核.
以下是/boot/grub/menu.lst文件中的示例片段:
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/1 rhgb vga=791
initrd /boot/initrd-2.6.18-1.2798.fc6.img
以下是/boot/grub/grub.cfg文件中的示例片段:
menuentry 'Ubuntu, with Linux 2.6.32.56+drm33.22' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9
linux /boot/vmlinuz-2.6.32.56+drm33.22 root=UUID=03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9 ro vga=791 quiet splash
initrd /boot/initrd.img-2.6.32.56+drm33.22
}
可直接修改该文件(需要root权限), 但要注意备份原有内核启动项, 以避免出错而导致系统无法引导.
对于在内核源码目录下使用"make modules_install && make install"命令新安装的内核, 也可通过update-grub命令更新该文件以增加新内核的启动引导项.
update-grub命令无法满足更细致的内核参数修改需求, 所以如果要增加一些特别内核引导参数, 只能手动修改/boot/grub/menu.lst 或 /boot/grub/grub.cfg文件.
修改Linux内核启动参数
分类: Linux内核 2012-03-27 22:22 3520人阅读 评论(0) 收藏 举报
linux内核ubuntulinuxsearchextos
内核启动参数一般保存在 /boot/grub/menu.lst (对应"kernel"开头的行) 或者 /boot/grub/grub.cfg (对应linux开头的行)文件中, 系统启动时由grub引导并传递给内核.
以下是/boot/grub/menu.lst文件中的示例片段:
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/1 rhgb vga=791
initrd /boot/initrd-2.6.18-1.2798.fc6.img
以下是/boot/grub/grub.cfg文件中的示例片段:
menuentry 'Ubuntu, with Linux 2.6.32.56+drm33.22' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9
linux /boot/vmlinuz-2.6.32.56+drm33.22 root=UUID=03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9 ro vga=791 quiet splash
initrd /boot/initrd.img-2.6.32.56+drm33.22
}
可直接修改该文件(需要root权限), 但要注意备份原有内核启动项, 以避免出错而导致系统无法引导.
对于在内核源码目录下使用"make modules_install && make install"命令新安装的内核, 也可通过update-grub命令更新该文件以增加新内核的启动引导项.
update-grub命令无法满足更细致的内核参数修改需求, 所以如果要增加一些特别内核引导参数, 只能手动修改/boot/grub/menu.lst 或 /boot/grub/grub.cfg文件.
Reply Like 0 View the author
电脑系统使用版本:Deepin_2013.1_zh-hans_i386.iso
以下为我的/boot/grub/grub.cfg文件全部数据:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root b3851994-3f7b-43e5-8b04-78e54a1f5336
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=zh_CN
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'LinuxDeepin GNU/Linux' --class linuxdeepin --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b3851994-3f7b-43e5-8b04-78e54a1f5336' {
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 b3851994-3f7b-43e5-8b04-78e54a1f5336
fi
linux /boot/vmlinuz-3.8.0-34-generic root=UUID=b3851994-3f7b-43e5-8b04-78e54a1f5336 ro locale=zh_CN quiet splash $vt_handoff
initrd /boot/initrd.img-3.8.0-34-generic
}
submenu 'Advanced options for LinuxDeepin GNU/Linux' $menuentry_id_option 'gnulinux-advanced-b3851994-3f7b-43e5-8b04-78e54a1f5336' {
menuentry 'LinuxDeepin GNU/Linux,Linux 3.8.0-34-generic' --class linuxdeepin --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-34-generic-advanced-b3851994-3f7b-43e5-8b04-78e54a1f5336' {
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 b3851994-3f7b-43e5-8b04-78e54a1f5336
fi
echo '载入 Linux 3.8.0-34-generic ...'
linux /boot/vmlinuz-3.8.0-34-generic root=UUID=b3851994-3f7b-43e5-8b04-78e54a1f5336 ro locale=zh_CN quiet splash $vt_handoff
echo '载入初始化内存盘...'
initrd /boot/initrd.img-3.8.0-34-generic
}
menuentry 'LinuxDeepin GNU/Linux,Linux 3.8.0-34-generic (恢复模式)' --class linuxdeepin --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-34-generic-recovery-b3851994-3f7b-43e5-8b04-78e54a1f5336' {
recordfail
load_video
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 b3851994-3f7b-43e5-8b04-78e54a1f5336
fi
echo '载入 Linux 3.8.0-34-generic ...'
linux /boot/vmlinuz-3.8.0-34-generic root=UUID=b3851994-3f7b-43e5-8b04-78e54a1f5336 ro single nomodeset locale=zh_CN
echo '载入初始化内存盘...'
initrd /boot/initrd.img-3.8.0-34-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###