Gentoo安装详解(三)-- 配置系统
配置系统
文件系统fstab
- 创建/etc/fstab
/dev/sda1 /boot vfat defaults,noatime 0 2
/dev/sda2 none swap sw 0 0
/dev/sda3 / ext4 noatime 0 1
/dev/cdrom /mnt/cdrom auto noauto,user 0 0
- Filesystem labels and UUIDs
blkid
网络信息
- Host name, Domainname, etc
nano -w /etc/conf.d/hostname
- Configuring Network
nano -w /etc/conf.d/net
- Automatically start networking at boot
cd /etc/init.d
root #ln -s net.lo net.eth0
root #rc-update add net.eth0 default
系统信息
- Gentoo uses /etc/rc.conf to configure the services, startup, and shutdown of your system.
nano -w /etc/rc.conf
- Root Password
passwd
root允许弱口令: enforce=none
vim /etc/security/passwdqc.conf
min=disabled,24,11,8,7
max=72
passphrase=3
match=4
similar=deny
random=47
enforce=none
retry=3
- Gentoo uses /etc/conf.d/hwclock to set clock options.
nano -w /etc/conf.d/hwclock
安装系统工具
- System Logger
emerge syslog-ng
rc-update add syslog-ng default
- 可选:File Indexing
emerge mlocate
- 可选:Remote Access
rc-update add sshd default
- 可选:DHCP Client
emerge dhcpcd
配置启动项
Using GRUB2
- BIOS
emerge --ask --verbose sys-boot/grub
grub-install /dev/sda
- UEFI
echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf
emerge --ask sys-boot/grub
grub-install --target=x86_64-efi --efi-directory=/boot
Optionally, install theos-prober utility (provided through the sys-boot/os-prober package) to have GRUB2 probe for other operating systems when running thegrub2-mkconfig command. In most instances, this will enable GRUB2 to automatically detect other operating systems (Windows 7, Windows 8.1, etc.).
Generating GRUB2 configuration:
grub-mkconfig -o /boot/grub/grub.cfg
可选:Using GRUB Legacy
emerge sys-boot/grub:0
编辑配置文件
nano -w /boot/grub/grub.conf
Example grub.conf
# 默认选择哪个列表来引导。0表示第一个, 1表示第二个,以此类推。
default 0
# 引导默认列表前等待多少秒
timeout 30
# 使用漂亮、“臃肿”的spalsh图像来增加一点趣味:)
# 如果您没有安装显卡,请将这行注释掉
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux 3.10.10
# 内核镜像(或者操作系统)所在分区
root (hd0,0)
kernel /boot/kernel-3.10.10-gentoo root=/dev/sda2
title Gentoo Linux 3.10.10 (rescue)
# 内核镜像(或者操作系统)所在分区
root (hd0,0)
kernel /boot/kernel-3.10.10-gentoo root=/dev/sda2 init=/bin/bb
# 接下来的四行只有在您与Windows系统进行双启动的情况下才需要。
# 本例中,windows系统位于/dev/sda6。
title Windows XP
rootnoverify (hd0,5)
makeactive
chainloader +1
#win7下注释掉makeactive
Setting up GRUB Legacy using grub-install:
Creating /etc/mtab:
grep -v rootfs /proc/mounts > /etc/mtab
Install GRUB Legacy:
grub-install --no-floppy /dev/sda
重启系统
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/boot,/proc,}
reboot
✎﹏键落惊风雨,码成泣鬼神~~
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)