Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors Disk model: DataTraveler 2.0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA Device Start End Sectors Size Type /dev/sda1 2048 526335 524288 256M EFI System /dev/sda2 526336 2623487 2097152 1G Linux swap /dev/sda3 2623488 19400703 16777216 8G Linux filesystem /dev/sda4 19400704 60549086 41148383 19.6G Linux filesystem
创建一个gpt分区列表
1 2 3
Command (m forhelp):g
Created a new GPT disklabel (GUID: 87EA4497-2722-DF43-A954-368E46AE5C5F).
如果当前存在其他的分区,可以选择将分区删除
1 2 3
Command (m forhelp):d
Partition number (1-4): 1
创建一个efi分区,大小建议256MB
1 2 3 4 5 6 7
Command (m forhelp):n
Partition number (1-128, default 1): 1 First sector (2048-60549086, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549086, default 60549086): +256M Created a new partition 1 of type'Linux filesystem' and of size 256 MiB.
1 2 3 4 5
Command (m forhelp):t
Selected partition 1 Partition type (type L to list all types): 1 Changed type of partition 'Linux filesystem' to 'EFI System'.
创建一个swap分区
1 2 3 4 5 6 7
Command (m forhelp):n
Partition number (2-128, default 2): First sector (526336-60549086, default 526336): Last sector, +/-sectors or +/-size{K,M,G,T,P} (526336-60549086, default 60549086): +4G Created a new partition 2 of type'Linux filesystem' and of size 4 GiB.
1 2 3 4 5 6
Command (m forhelp):t
Partition number (1,2, default 2): 2 Partition type (type L to list all types): 19 Changed type of partition 'Linux filesystem' to 'Linux swap'.
创建主分区
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Command (m forhelp):p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors Disk model: DataTraveler 2.0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 87EA4497-2722-DF43-A954-368E46AE5C5F Device Start End Sectors Size Type /dev/sda1 2048 526335 524288 256M EFI System /dev/sda2 526336 8914943 8388608 4G Linux swap /dev/sda3 8914944 60549086 51634143 24.6G Linux filesystem
# These settings were set by the catalyst build script that automatically # built this stage. # Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. COMMON_FLAGS="-march=native -O3 -pipe -fstack-protector-strong"#设置编译参数(-march=native可以根据cpu指令集进行优化,-O3优化级别) CFLAGS="${COMMON_FLAGS}"#C编译参数 CXXFLAGS="${COMMON_FLAGS}"#C++编译参数 FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" ACCEPT_KEYWORDS="amd64"#可接受的软件包等级(稳定与不稳定)(这里为全局keyworkds,若想为特定软件包指定特定的Keyworkds(可以在/etc/protage/portage.accpet_keywords ACCEPT_LICENSE="*"#可接受的软件包许可证 MAKEOPTS="-j8 -l7.2"#根据cpu核心数来配置(一般配置为cpu核心数+1),如果机器配置不够尽量将线程数调低一些,方式内存爆.
PORTDIR="/var/db/repos/gentoo"#软件包的ebuild文件存储目录 DISTDIR="/var/cache/distfiles" PKGDIR="/var/cache/binpkgs"#软件包的存储目录 #设置软件包缓存目录 PORTAGE_TMPDIR="/tmp"#portage的编译目录 #设置portage构建软件包目录(如果内存较大,建议设置在内存里面) # This sets the language of build output to English. # Please keep this setting intact when reporting bugs. LC_MESSAGES=C GENTOO_MIRRORS="${USTC}"#配置Gentoo镜像源(软件镜像源) #全局USE USE="-X -qt5 "
Available targets for the LANG variable: [1] C [2] C.utf8 [3] en_US [4] en_US.iso88591 [5] en_US.utf8 [6] de_DE [7] de_DE.iso88591 [8] de_DE.iso885915 [9] de_DE.utf8 [10] POSIX [ ] (free form)
#设置locale root #eselect locale set 9
配置主机名
1
hostnamectl set-hostname Gentoo
配置hosts文件
1 2 3 4 5 6 7
/etc/hosts # This defines the current system and must be set 127.0.0.1 tux.homenetwork tux localhost # Optional definition of extra systems on the network 192.168.0.5 jenny.homenetwork jenny 192.168.0.6 benny.homenetwork benny