gentoo


awesome https://github.com/lcpz/awesome-copycats

install

$ git clone --recursive https://github.com/lcpz/awesome-copycats.git
$ mv -bv awesome-copycats/* ~/.config/awesome && rm -rf awesome-copycats

https://zhuanlan.zhihu.com/p/166652475

https://zhuanlan.zhihu.com/p/122222365

https://www.zhihu.com/topic/19581190/hot

分区:

   ?mkfs.fat -F 32 /dev/nvme0n1p1

    ?    ?mkfs.ext4 /dev/nvme0n1p3

    ?    ?mkswap /dev/nvme0n1p2

    ?    ?swapon /dev/nvme0n1p2

    ?    ?mkdir /mnt/gentoo

    ?    ?mount /dev/nvme0n1p3   /mnt/gentoo

 stage3

    ?    ?tar xpvf stage3-*.*  --xattrs-include='*.*' --numeric-owner

make.conf配置:    ?    ?

nano -w /mnt/gentoo/etc/portage/make.conf

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

COMMON_FLAGS="-march=native -O2 -pipe"

MAKEOPTS="-j12"

EMERGE_DEFAULT_OPTS="--jobs 5 --with-bdeps=y  --keep-going=y"

#$GENTOO_MIRRORS="http://mirror.bit.edu.cn/gentoo/"

GENTOO_MIRRORS="https://mirrors4.tuna.tsinghua.edu.cn/gentoo"

ACCEPT_LICENSE="*"

VIDEO_CARDS="intel i965 "

GRUB_PLATFORMS="efi-64"

L10N="en_US zh_CN en zh"

LINGUAS="en_US zh_CN en zh"

CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

#安装完aria2之后去掉注释,具体参数参考aria2官方文档#FETCHCOMMAND="/usr/bin/aria2c
 -d \${DISTDIR} -o \${FILE} --allow-overwrite=true --max-tries=5 
--max-file-not-found=2 --max-concurrent-downloads=5 --connect-timeout=5 
--timeout=5 --split=5 --min-split-size=2M --lowest-speed-limit=20K 
--max-connection-per-server=9 --uri-selector=feedback 
\${URI}"#RESUMECOMMAND="${FETCHCOMMAND}"

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

mkdir --parents /mnt/gentoo/etc/portage/repos.conf

cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

nano /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

sync-uri = rsync://mirrors4.tuna.tsinghua.edu.cn/gentoo-portage

cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

mount --types proc /proc /mnt/gentoo/proc

mount --rbind /sys /mnt/gentoo/sys

mount --rbind /dev /mnt/gentoo/dev

test -L /dev/shm && rm /dev/shm && mkdir /dev/shm

mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm

chmod 1777 /dev/shm

nano genfstab

chmod +x genfstab

.genfstab -U  /mnt/gentoo  >>   /mnt/gentoo/etc/fstab

chroot /mnt/gentoo /bin/bash

source /etc/profile

?export PS1="(chroot) ${PS1}"

mkdir /boot/EFI

mount /dev/nvme0n1p1  /boot/EFI

emerge-webrsync

emerge --sync

eselect profile list

eselect profile set ..

emerge -uDN @world

emerge --ask --verbose --update --deep --newuse @world

***********

kernel config

*************

https://raw.githubusercontent.com/xanmod/linux/5.11/.config



# 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" MAKEOPTS="-j12" EMERGE_DEFAULT_OPTS="--jobs 8 --with-bdeps=y --keep-going=y" ACCEPT_KEYWORDS="~amd64" ACCEPT_LICENSE="*" VIDEO_CARDS="intel i965 nvidia" ALSA_CARDS="hda_intel" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput synaptics" L10N="en_US zh_CN en zh" LINGUAS="en_US zh_CN en zh" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" # NOTE: This stage was built with the bindist Use flag enabled PORTDIR="/var/db/repos/gentoo" DISTDIR="/var/cache/distfiles" PKGDIR="/var/cache/binpkgs" # This sets the language of build output to English. # Please keep this setting intact when reporting bugs. LC_MESSAGES=C QEMU_SOFTMMU_TARGETS="alpha aarch64 arm i386 mips mips64 mips64el mipsel ppc ppc64 s390x sh4 sh4eb sparc sparc64 x86_64" QEMU_USER_TARGETS="alpha aarch64 arm armeb i386 mips mipsel ppc ppc64 ppc64abi32 s390x sh4 sh4eb sparc sparc32plus sparc64" #GENTOO_MIRRORS="http://mirrors.163.com/gentoo/" #GENTOO_MIRRORS="https://ipv4.mirrors.ustc.edu.cn/gentoo/" #GENTOO_MIRRORS="https://mirrors4.tuna.tsinghua.edu.cn/gentoo" GENTOO_MIRRORS="https://mirrors.bfsu.edu.cn/gentoo" # USE # USE变量是Gentoo最有威力的变量 也是Gentoo吸引我的原因之一 FUCKDE="-gnome -gnome-shell -gnome-keyring -nautilus -kde" # 不打算安装gnome和kde及其相关组件 FUCKSV="-bindist -mdev elogind -dhcpcd -oss -grub -plymouth -systemd -consolekit" # 不使用systemd plymouth consolekit 只使用elogind(旧教程会使用consolekit,事实上elogind是consolekit未来的替代品) SOFTWARE="sudo -icu client git chromium openmp minizip udev blkid efi hwdb smack acpi ccache dbus policykit udisks" # 需要用到的特性 照抄即可 AUDIO="alsa jack pulseaudio" # 对于音频相关软件使用pulseaudio alsa jack特性 NET="network networkmanager connection-sharing wifi http2" # 网络相关 照抄即可 VIDEO="X vulkan layers glamor nvidia gallium" # 图形相关 照抄即可 ELSE="cjk emoji" # 照抄 USE="${FUCKDE} ${FUCKSV} ${SOFTWARE} ${AUDIO} ${NET} ${VIDEO} ${ELSE}" # 定义需要的USE变量 # Ccache FEATURES="parallel-fetch ccache" CCACHE_DIR="/var/cache/ccache" # Aria2 FETCHCOMMAND="/usr/bin/aria2c -d \${DISTDIR} -o \${FILE} --allow-overwrite=true --max-tries=5 --max-file-not-found=2 --max-concurrent-downloads=5 --connect-timeout=5 --timeout=5 --split=5 --min-split-size=2M --lowest-speed-limit=20K -> RESUMECOMMAND="${FETCHCOMMAND}"