Gentoo:安装Stage3:修订间差异
imported>Soleverlee |
imported>Soleverlee |
||
(未显示同一用户的2个中间版本) | |||
第51行: | 第51行: | ||
=配置USE= | =配置USE= | ||
USE这玩意又多又乱,完全不知道该怎么选了.... | USE这玩意又多又乱,完全不知道该怎么选了.... | ||
< | <source lang="lua"> | ||
USE="-gtk -gnome | # detailed example. | ||
</ | CFLAGS="-march=native -O2 -pipe" | ||
CXXFLAGS="${CFLAGS}" | |||
MAKEOPTS="-j5" | |||
# WARNING: Changing your CHOST is not something that should be done lightly. | |||
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. | |||
CHOST="x86_64-pc-linux-gnu" | |||
# These are the USE and USE_EXPAND flags that were used for | |||
# buidling in addition to what is provided by the profile. | |||
USE="bindist X -gtk -gnome -qt3support -ldap" | |||
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" | |||
PORTDIR="/usr/portage" | |||
DISTDIR="${PORTDIR}/distfiles" | |||
PKGDIR="${PORTDIR}/packages" | |||
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/" | |||
</source> | |||
<source lang="bash"> | |||
echo "Asia/Shanghai" > /etc/timezone | |||
emerge --config sys-libs/timezone-data | |||
nano -w /etc/locale.gen | |||
locale-gen | |||
eselect locale list | |||
#zh_CN.UTF8 | |||
env-update && source /etc/profile && export PS1="(chroot) $PS1" | |||
</source> | |||
[[Category:Linux/Unix]] | [[Category:Linux/Unix]] |
2016年12月16日 (五) 04:36的最新版本
安装文件系统
cd /mnt/gentoo
wget http://mirrors.sohu.com/gentoo/releases/amd64/autobuilds/current-stage3-amd64/stage3-amd64-20161208.tar.bz2
wget http://mirrors.sohu.com/gentoo/releases/amd64/autobuilds/20161208/stage3-amd64-20161208.tar.bz2.DIGESTS
sha512sum stage*.tar.bz2
tar xvjpf stage3-*.tar.bz2 --xattrs
确保你使用了同样的参数 (xvjpf 即使用--xattrs)。 x表示解开(Extract),v表示详细信息(Verbose)可以用来查看解压缩时发生了什么(可选参数), j 表示使用bzip2解压缩,thep 表示保留权限(Preserve permissions),还有f 表示我们要解开一个文件,而不是标准输入。最后,--xattrs的是包括存储在归档以及扩展属性。
编译选项
/mnt/gentoo/etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe" CXXFLAGS="${CFLAGS}" MAKEOPTS="-j5"
MAKEOPTS:A good choice is the number of CPUs (or CPU cores) in the system plus one, but this guideline isn't always perfect.
笔者认为,少设点,稳定点,慢点无所谓,i7-4700MQ我觉得设个5就差不多了
mirror选择
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
这里选择163的http和厦门大学的rsync源。
挂载文件系统
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
#--make-rslave操作是稍后安装systemd支持时所需要的。
chroot到新系统
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
更新portage树
emerge-webrsync
eselect profile list
eselect profile set 6
# default/linux/amd64/13.0/desktop/kde
配置USE
USE这玩意又多又乱,完全不知道该怎么选了....
# detailed example.
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE and USE_EXPAND flags that were used for
# buidling in addition to what is provided by the profile.
USE="bindist X -gtk -gnome -qt3support -ldap"
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/"
echo "Asia/Shanghai" > /etc/timezone
emerge --config sys-libs/timezone-data
nano -w /etc/locale.gen
locale-gen
eselect locale list
#zh_CN.UTF8
env-update && source /etc/profile && export PS1="(chroot) $PS1"