Gentoo Linux 安装(五)配置系统

来源:互联网 发布:淘宝申请售后要钱不 编辑:程序博客网 时间:2024/04/29 07:41
Optional: Get PCMCIA working
PCMCIA users should now install the sys-apps/pcmciautils package.
root #emerge --ask sys-apps/pcmciautils
System information

root #nano -w /etc/fstab
In the remainder of the text, we use the default /dev/sd* block device files as partition. Users can also opt to use the symbolic links in the /dev/disk/by-id/ or/dev/disk/by-uuid/ locations. These names are not likely to change, whereas the default block device files naming depends on a number of factors (such as how and in what order the disks are attached to the system). However, unless someone intends to fiddle with the disk ordering, one can continue with the default block device files safely.
Let us take a look at how to write down the options for the /boot/ partition. This is just an example, and should be modified according to the partitioning decisions made earlier in the installation. In our amd64 partitioning example, /boot/ is usually the /dev/sda2 partition, with ext2 as filesystem. It needs to be checked during boot, so we would write down:


FILE /etc/fstabA full /etc/fstab example
/dev/sda2 /boot ext2 defaults,noatime 0 2/dev/sda3 none swap sw 0 0/dev/sda4 / ext4 noatime 0 1 /dev/cdrom /mnt/cdrom auto noauto,user 0 0


Networking information
Host and domain information
One of the choices the user has to make is name his/her PC. This seems to be quite easy, but lots of users are having difficulties finding the appropriate name for their Linux PC. To speed things up, know that the decision is not final - it can be changed afterwards. In the examples below, the hostname tux is used within the domainhomenetwork.
root #nano -w /etc/conf.d/hostname
# Set the hostname variable to the selected host namehostname="tux"
Second, if a domain name is needed, set it in /etc/conf.d/net. This is only necessary if the ISP or network administrator says so, or if the network has a DNS server but not a DHCP server. Don't worry about DNS or domain names if the system uses DHCP for dynamic IP address allocation and network configuration.


Configuring the network
During the Gentoo Linux installation, networking was already configured. However, that was for the installation CD itself and not for the installed environment. Right now, the network configuration is made for the installed Gentoo Linux system.
 Note
More detailed information about networking, including advanced topics like bonding, bridging, 802.1Q VLANs or wireless networking is covered in the Gentoo Network Configuration section.
All networking information is gathered in /etc/conf.d/net. It uses a straightforward yet perhaps not intuitive syntax. But don't fear, everything is explained below. A fully commented example that covers many different configurations is available in /usr/share/doc/netifrc-*/net.example.bz2.
First install net-misc/netifrc:
root #emerge --ask --noreplace net-misc/netifrc

Automatically start networking at boot
To have the network interfaces activated at boot, they need to be added to the default runlevel.
root #cd /etc/init.d
root #ln -s net.lo net.eth0
root #rc-update add net.eth0 default

The hosts file
Next inform Linux about the network environment. This is defined in /etc/hosts and helps in resolving host names to IP addresses for hosts that aren't resolved by the nameserver.
root #nano -w /etc/hosts


System information
Root password
Set the root password using the passwd command.
root #passwd
The root Linux account is an all-powerful account, so pick a strong password. Later an additional regular user account will be created for daily operations.
Init and boot configuration
Gentoo (at least when using OpenRC) uses /etc/rc.conf to configure the services, startup, and shutdown of a system. Open up /etc/rc.conf and enjoy all the comments in the file. Review the settings and change where needed.
root #nano -w /etc/rc.conf
Next, open /etc/conf.d/keymaps to handle keyboard configuration. Edit it to configure and select the right keyboard.
root #nano -w /etc/conf.d/keymaps
Take special care with the keymap variable. If the wrong keymap is selected, then weird results will come up when typing on the keyboard.
Finally, edit /etc/conf.d/hwclock to set the clock options. Edit it according to personal preference.
root #nano -w /etc/conf.d/hwclock
If the hardware clock is not using UTC, then it is necessary to set clock="local" in the file. Otherwise the system might show clock skew behavior.

0 0
原创粉丝点击