系统启动相关

liaocj 2024-11-20 11:16:32
Categories: Tags:

ubuntu 启动设置项

apt-get install grub-customizer
grep menuentry /boot/grub/grub.cfg | grep -E --color=auto '^menuentry' | cut -d "'" -f2
grub-set-default "Ubuntu, with Linux 5.4.0-45-generic"

centos 启动设置项

sudo dnf --showduplicates list kernel
grubby --info=ALL
grubby --default-kernel
sudo grubby --set-default /boot/vmlinuz-4.18.0-305.3.1.el8.x86_64

替换repolist

cat << EOF | tee /etc/yum.repos.d/CentOS-Vault.repo
[base]
name=CentOS-8 - Base
baseurl=https://vault.centos.org/8.4.2105/BaseOS/\$basearch/os/
gpgcheck=1
enabled=1

[appstream]
name=CentOS-8 - AppStream
baseurl=https://vault.centos.org/8.4.2105/AppStream/\$basearch/os/
gpgcheck=1
enabled=1
EOF

查看支持的repolist

dnf repolist all

设置内核启动参数

grubby --update-kernel=/boot/vmlinuz-4.18.0-394.el8.x86_64 --args="intel_iommu=on iommu=pt"

安装内核开发头文件

sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

切换centos 8 stream

sudo dnf install centos-release-stream -y
sudo dnf swap centos-{linux,stream}-repos -y
sudo dnf clean all
sudo dnf makecache
sudo dnf distro-sync -y
sudo dnf update -y
sudo dnf install kernel-core -y

tty*命名

grub.cfg

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="ubuntu linux"
GRUB_DEFAULT=saved
GRUB_TIMEOUT_STYLE=menu
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial"
GRUB_CMDLINE_LINUX="crashkernel=auto root=UUID=93b2546e-2a13-41e1-b0db-69b88b5544
881 console=ttyS0 intel_iommu=on iommu=pt pci=realloc pci=assign-busses pciehp.pp
ciehp_force=1 pci=pcie_bus_perf nokaslr no_hash_pointers"
GRUB_DISABLE_RECOVERY=true
GRUB_ENABLE_BLSCFG=true
GRUB_DISABLE_OS_PROBER=false

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"