Gentoo installation and configuration process and summary

Source: Internet
Author: User

Some time ago, Gentoo Linux was installed on Vmware and the latest version of Gentoo was used. The installation process was recorded, but it was not sorted into the blog. Today, I will recompile it and share it with you. It was not very familiar with Gentoo soon.

Compared with other Linux distributions, Gentoo does have its advantages. For example, the kernel can be automatically optimized and customized based on source code compilation, and the upgrade is convenient!

For more information about Gentoo releases, see the top 10 most popular Linux releases in the world (figure)

Host environment: win2008 + VMware 7.1

Download the installation package

Download and install the CD and stage3 packages:

Http://www.gentoo.org/main/en/where.xml

I use the x86 Platform:

Http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/

Http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/install-x86-minimal-20100216.iso wget-C

Http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/stage3-i686-20100216.tar.bz2 wget-C

Http://distfiles.gentoo.org/snapshots/portage-20100617.tar.bz2 wget-C

The latest stage3 package is here: http://distfiles.gentoo.org/releases/x86/autobuilds/current-stage3/

Start Installation

Insert the installation CD to the virtual machine. By default, the installation CD is directed to the terminal.

First configure the network, and then all operations can be performed through SSH connections.

Ifconfig eth0 192.168.80.htm (I have automatically assigned this Intranet IP address to the VM .)
Route add default GW 192.168.80.2 (Note: if you cannot access the Internet, you can manually add this gateway address !)
Echo nameserver 8.8.8.8>/etc/resolv. conf
Echo nameserver 8.8.4.4>/etc/resolv. conf

Set the root user password:

Passwd Root

Start the sshd service:

/Etc/init. d/sshd start

Use securecrt or Putty to connect to a virtual machine on Windows.

Disk Partition

Partition first. cfdisk is recommended. Check the partition information first:

Cfdisk/dev/SDA

My Partition Table (I separate/boot partitions),/dev/sda2 is/root partition,/dev/sda3 is swap partition:

Format partition:

Mkfs. ext3/dev/sda1
Mkfs. ext3/dev/sda2
Mkswap/dev/sda3

Activate swap partition:

Swapon/dev/sda3

Write partition information to the fstab configuration file: (Note: Gentoo-Minimal has no vi Editor, only the nano editor .)

Nano-W/etc/fstab

Write the following partition information:

/Dev/sda1/boot ext3 noauto, noatime 1 2
/Dev/sda2/ext3 noatime 0 1
/Dev/sda3 none swap SW 0 0

Decompress stage3 and Portage

Create a basic directory structure:

Mount/dev/sda2/mnt/Gentoo
Mkdir/mnt/Gentoo/boot
Mount/dev/sda1/mnt/Gentoo/boot
CD/mnt/Gentoo

Use winscp or CuteFTP to upload the stage3 package to/mnt/Gentoo, and decompress the package:

(Note: the address of the above tag has not been changed. The actual address is 192.168.80.htm)

Tar jxvf stage3-i686-20100608.tar.bz2
Rm-F stage3-i686-20100608.tar.bz2

Upload the portage package to/mnt/Gentoo/USR and decompress the package:

Tar jxvf portage-20100617.tar.bz2
Rm-F portage-20100617.tar.bz2

Switch System

CD/
Mount-T proc/mnt/Gentoo/proc
Mount-O bind/dev/mnt/Gentoo/dev
CP-L/etc/resolv. CONF/mnt/Gentoo/etc/
Chroot/mnt/Gentoo/bin/bash
Env-Update & source/etc/profile

Host domain name settings

cd /etc
echo "127.0.0.1 gentoo.at.home gentoo localhost" > hosts
sed -i -e ‘s/HOSTNAME.*/HOSTNAME="gentoo"/‘ conf.d/hostname
hostname gentoo

Compile and install the kernel

Lsmod

Find the NIC Driver Module:

Floppy 55736 0
RTC 7960 0
Tg3 103228 0
Libphys 24952 1 tg3
E10000 114636
Fuse 59344 0
JFS 153104 0
Raid10 20648 0

Download the source code and configure the kernel:

Emerge -- sync
Emerge Gentoo-Sources
CD/usr/src/Linux
Make menuconfig
NOTE: If garbled characters are displayed, run: Export lang = zh_CN.UTF-8

Enter/e1000 on the configuration page, search for e1000, and find the driver location:

| Symbol: e1000 [= y]
| Prompt: Intel (r) Pro/1000 Gigabit Ethernet support
| Defined at drivers/NET/kconfig: 2020
| Depends on: netdevices & netdev_1000 & PCI
| Location:
|-> Device Drivers
|-> Network device support (netdevices [= y])
|-> Ethernet (1000 Mbit) (netdev_1000 [= y])

(Be sure to select the NIC driver for the kernel!)

The SCSI adapter used by the VM's hard disk is LSI logic.

You need to add support for fusion MPT base Driver (see dmesg logs ):

Device Drivers->
-Fusion MPT Device Support
<*> Fusion MPT scsihost drivers for Spi
<*> Fusion MPT scsihost drivers for FC
<*> Fusion MPT scsihost drivers for SAS
(128) Maximum number of scatter gather entries (16-128)
<*> Fusion mpt misc device (IOCTL) Driver

You must add this driver. Otherwise, an error similar to the following may occur during system startup:

VFS: Unable to mount root FS via NFS, trying floppy.
VFS: cannot open root device "sda2" or unknown-block (2, 0)
Please append a correct "root =" Boot option; here are the available partitions:
0b00 1048575 sr0 DRIVER: Sr
Kernel panic-not syncing: VFS: Unable to mount root FS on unknown-block (2, 0)

Added support for the ext4 File System:

File Systems->
<*> Second extended FS Support
[*] Ext4 extended attributes
[*] Ext4 POSIX access control lists
[*] Ext4 Security labels
[*] Ext4 debugging support

Start to compile the kernel:

Make-J2
Make modules_install
Cp arch/x86/boot/bzimage/boot/kernel

Install and configure grub

Emerge grub

Grub
> Root (hd0, 0)
> Setup (hd0)
> Quit

Edit the startup configuration file grub. conf:

Nano-W/boot/GRUB/grub. conf

The content of grub. conf is as follows:

Default 0
Timeout 9

Title Gentoo
Root (hd0, 0)
Kernel/boot/kernel root =/dev/sda2

System Configuration

File System mount point:

Nano-W/etc/fstab
/Dev/sda1/boot ext3 noauto, noatime 1 2
/Dev/sda2/ext3 noatime 0 1
/Dev/sda3 none swap SW 0 0

Network settings:

Echo 'config _ eth0 = ("192.168.80.133") '>/etc/CONF. d/Net
Echo 'routes _ eth0 = ("Default via 192.168.80.2") '>/etc/CONF. d/Net

SSH service settings:

RC-update add sshd default

Time zone settings:

CP/usr/share/zoneinfo/Asia/Shanghai/etc/localtime
Nano-W/etc/CONF. d/clock
Timezone = "Asia/Shanghai"

Set the root password:

Passwd Root

Restart to complete installation

Exit
Umount/mnt/Gentoo/dev/mnt/Gentoo/proc/mnt/Gentoo/boot/mnt/Gentoo
Reboot

, Gentoo started successfully:

Supplement: If you want to use the DHCP client to automatically allocate IP addresses, perform the following operations:

emerge dhcpcd
rc-update add dhcpcd default

OK, complete!

Gentoo installation and configuration process and summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.