With so many online tutorials or resources, what else do you write? The main reason is that the technology update is too fast, there are a lot of things have been changing, so I write out the latest, which will surely make your installation successful~
Download Image
Generally, I use domestic image sources. Whether it’s CentOS, Ubuntu or Gentoo, the image in China is faster than that in foreign countries
The code is as follows:
mirrors.163.com/gentoo/
#I use x86
http://mirrors.163.com/gentoo/releases/x86/current-iso/
#Need to download, for example, the latest version of the country, this address http://mirrors.163.com/gentoo/releases/x86/current-iso/
The code is as follows:
stage3-i486-20140318. tar.bz2 </p>
My general installation habit is like this, I put stage3-i486-20140318 tar.bz2 And portage- latest.tar.bz2 The package is added to the image install-x86-minimum-20140318.iso to save the trouble of later installation. For example, I use UltraISO to compress those two packages into the image, as shown in the following figure
Then you can write to the USB flash disk, boot up and load the livecd. Then we start the installation
start-up
Boot appears in the startup interface: you can press enter directly, or enter the hardware options corresponding to your startup. See the most underground appendix
configure network
The code is as follows:
The code is as follows:
>Route add default gw 192.168.1.1 gateway
>echo “nameserver 192.168.1.1”>>/etc/ resolv.conf #Configure DNS
>ping www.baidu.com #The test network is not working
Start SSH
The code is as follows:
Passwd root # enter your account number and password, then you can use SSH to log in remotely. Of course, you don’t need a computer at all
partition
The code is as follows:
The code is as follows:
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default P): P # select primary partition
Partition number (1-4, default 1): # enter
Using default value 1
First sector (2048-16777215, default 2048): Enter
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-16777215, default 16777215): +200M #200M boot
Partition 1 of type Linux and of size 200 MiB is set
The last and last input W are saved
The code is as follows:
The partition table has been altered!</p>
<p>Calling ioctl() to re-read partition table.
Syncing disks.
According to the above method, you can partition by yourself. My partition is 200m boot 7g / 512M swap
format partition
The code is as follows:
mkfs.ext4 /dev/sda2
Mkswap / dev / sda3 # format swap
Swap / dev / sda3 ᦇ mount swap
Mount partition
The code is as follows:
mkdir /mnt/gentoo/boot
Mount / dev / sda1 / MNT / Gentoo / boot
Install stage tarball
The code is as follows:
Date 032714382014
Because before we put stage3-i686-20140304 tar.bz2 And portage-20140310 tar.bz2 It’s compressed into the image, so we don’t need to download it
The code is as follows:
cp *. tar.bz2 /MNT / Gentoo? Copy two files to / MNT / Gentoo</p>
tar xvjpf stage3-*. tar.bz2 #Decompress stage3</p>
According to the official documents make.conf In / MNT / Gentoo / etc/ make.conf But I am in / MNT / Gentoo / etc / portage/ make.conf Please pay attention to your position
#The single core configuration is as follows to limit the number of parallel compilers
The code is as follows:
Chroot
mirrorselect -i -o >> /mnt/gentoo/etc/portage/ make.conf #This one in the back is my own make.conf I choose 163, and then enter</p>
Mounting / proc and / dev file systems
The code is as follows:
Entering a new system environment
The code is as follows:
env-update
source /etc/profile
Update portage tree
The code is as follows:
eselect profile list
Configure time zone
The code is as follows:
CP / usr / share / zoneinfo / Asia / Shanghai / etc / Localtime
Install kernel
The code is as follows:
LS – L / usr / SRC / Linux # view kernel connections
Manual configuration
The code is as follows:
make menuconfig
Note: I am a 32-bit system. So the * in front of 64 bit kernel must be removed
To configure, press ↓ to enter the file system. Because I use ext4, I select ext4 debugging support
Then tab select Save enter, then OK, exit enter, and then exit
Compile kernel
The code is as follows:
Install kernel
The code is as follows:
cp arch/x86/boot/bzImage /boot/kernel-3.12.13-gentoo
Configuration system
Configuration file system
The code is as follows:
/dev/sda2 / ext4 noatime 0 1
/dev/sda3 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0</p>
<p>
Modify host name
The code is as follows:
configure network
The code is as follows:
routes_ enp0s3=( “default via 192.168.1.1” )</p>
Configure root password
The code is as follows:
Install system tools
The code is as follows:
rc-update add syslog-ng default
Emerge vixie Cron # cron Daemons
rc-update add vixie-cron default
Emergency sys apps / mlocate # install file index locate. Remember to update DB to create a new library after restart
Configure bootloader
Install grub
The code is as follows:
Configure grub
After I install emergency grub, I install Grub2. If it is Grub2, the configuration is as follows
The code is as follows:
/usr/sbin/grub2-mkconfig -o /boot/grub/ grub.cfg #Build configuration
Restart installation complete
The code is as follows:
Reboot # restart
The code is as follows:
Service sshd start
Appendix start items
acpi=on
Load the support for ACPI, start acpid background program at the same time of starting the CD. This option is only required if your system needs ACPI to work properly. This option is not required to enable hyper threading support.
acpi=off
Close ACPI completely. This is useful on older systems and is a necessary option to use advanced power management (APM). This will also turn off hyper threading support for your processor.
console=X
This option can set the serial port access of the CD. The first option is device, usually ttys0 on X86, which can be followed by other options and separated by commas. The default options are 9600,8, N, 1.
dmraid=X
This option is used to pass parameters to the device mapper RAID subsystem. Arguments passed must be enclosed in quotation marks.
doapm
This option loads advanced power management (APM) driver support. This requires you to use the ACPI = off option at the same time.
dopcmcia
This option loads support for PCMCIA and CardBus hardware, and also enables cardmgr of PCMCIA card to run when the CD starts. This option is only required when booting from a PCMCIA / CardBus device.
doscsi
This option loads support for most SCSI controllers. This option is also needed when most USB devices start up, because USB devices use the SCSI subsystem in the kernel.
sda=stroke
This option allows you to partition the entire hard disk, even if your BIOS can’t handle large hard disks. This option is only used on machines that use the old BIOS. When using, replace SDA with the device that needs this option.
ide=nodma
This option forces DMA in the kernel to be turned off. Some IDE and CDROM drivers need this option. If your system has trouble reading the IDE interface CD-ROM, you can try this option. This option also turns off the default setting for hdparm.
noapic
This option turns off the advanced programmable interrupt controllers that exist on some new motherboards. It can cause problems on some old hardware.
nodetect
This option will turn off all automatic detection of the CD, including device detection and DHCP detection. This is useful when debugging a problem disc or driver.
nodhcp
This option will disable DHCP probing on the detected network card. This is useful for networks with only static addresses.
nodmraid
Support for device mapped raid is turned off, such as the controller for on-board ide / SATA raid.
nofirewire
This option turns off FireWire module loading. This option is only required if your FireWire hardware causes problems with CD startup.
nogpm
This option turns off GPM console mouse support.
nohotplug
This option turns off the loading of hot plug and cold plug startup scripts at startup. This option is useful when debugging failed discs and drives.
nokeymap
This option prevents keyboard layout selection.
nolapic
This option turns off the local APIC on the single processor core.
nosata
This option turns off loading of serial ATA (SATA) modules. This option is useful when there is a problem with your system’s SATA subsystem.
nosmp
This option turns off the SMP function in a kernel that supports SMP (symmetric multiprocessing). This option is used to debug SMP related issues on specific drivers and motherboards.
nosound
This option turns off sound support and volume settings. This option is useful on systems where voice support is problematic.
nousb
This option turns off automatic loading of USB module. This option is useful when debugging USB problems.
slowusb
This option adds some extra pauses during startup, mainly for some slow USB CDROMs, such as IBM BladeCenter.