From e47d6a28c74937ccce12e8dda34e275375765a44 Mon Sep 17 00:00:00 2001 From: lurk Date: Sat, 21 Sep 2024 11:36:31 -0700 Subject: [PATCH] mega update --- make.conf | 25 +++++++++++++++++++++++++ package.use | 9 +++++++++ stage3.sh | 50 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 make.conf create mode 100644 package.use diff --git a/make.conf b/make.conf new file mode 100644 index 0000000..fab76de --- /dev/null +++ b/make.conf @@ -0,0 +1,25 @@ +COMMON_FLAGS="-march=native -O2 -pipe" +CFLAGS="${COMMON_FLAGS}" +CXXFLAGS="${COMMON_FLAGS}" +FCFLAGS="${COMMON_FLAGS}" +FFLAGS="${COMMON_FLAGS}" +LDFLAGS="-Wl,-O2 -Wl,--as-needed" +RUSTFLAGS="-C debuginfo=0 -C codegen-units=1 -C target-cpu=native -C opt-level=3" +ACCEPT_LICENSE="*" +PORTAGE_SCHEDULING_POLICY="idle" + +PYTHON_TARGETS="python3_11" +PYTHON_SINGLE_TARGET="python3_11" +LUA_TARGETS="lua5-4" +LUA_SINGLE_TARGET="lua5-4" + +EMERGE_DEFAULT_OPTS="--jobs=16 --load-average=16 --keep-going --verbose --quiet-build --with-bdeps=y --complete-graph=y --deep --ask" +FEATURES="candy fixlafiles unmerge-orphans noman nodoc noinfo notitles parallel-install parallel-fetch clean-logs" +# NOTE: This stage was built with the bindist USE flag enabled + +# This sets the language of build output to English. +# Please keep this setting intact when reporting bugs. +LC_MESSAGES=C.utf8 +VIDEO_CARDS="nvidia" + +USE="native-symlinks lto pgo jit xs orc threads asm openmp system-* clang pipewire X dbus dist-kernel -wayland" diff --git a/package.use b/package.use new file mode 100644 index 0000000..ff8427e --- /dev/null +++ b/package.use @@ -0,0 +1,9 @@ +sys-kernel/installkernel grub dracut +net-wireless/wpa_supplicant dbus +sys-kernel/gentoo-kernel savedconfig +media-video/pipewire sound-server pipewire-alsa ffmpeg dbus extra +sys-auth/pambase elogind +x11-base/xorg-server xvfb +media-libs/libvpx postproc +x11-terms/st savedconfig +sys-libs/zlib minizip diff --git a/stage3.sh b/stage3.sh index 79ab9f3..11d36dc 100644 --- a/stage3.sh +++ b/stage3.sh @@ -21,17 +21,13 @@ done tar xpvf stage3-*.tar.xz --xattrs-include="*.*" --numeric-owner rm stage3-*.tar.xz +# set USE flags for later +rm -rf /mnt/gentoo/etc/package.use +touch /mnt/gentoo/etc/package.use +cat package.use > /mnt/gentoo/etc/package.use + # configure portage (COMMON/USE) -PROMPT_PORTAGE=$(prompt_accept "Configure /etc/portage/make.conf COMMON/USE/MAKE/etc flags") -if [[ "$PROMPT_PORTAGE" == "y" ]]; then - nano -w ./etc/portage/make.conf - NANO_RUNNING="true" - while [[ $NANO_RUNNING == "true" ]]; do - log_msg INFO "Waiting for user to quit nano ..." - NANO_RUNNING=$(ps -aux | (grep -o '[n]ano') || true) - sleep 5s - done -fi +cat make.conf > /mnt/gentoo/etc/make.conf # make sure DNS works after chroot cp --dereference /etc/resolv.conf /mnt/gentoo/etc/ @@ -60,22 +56,36 @@ export PS1="(chroot) ${PS1}" log_msg INFO "synchronize gentoo ebuild repo" >> /var/log/installer.log emerge --ask n --sync +# set some makeopts and default opts +# WARNING: THE DEFAULT USES ALL THE THREADS IN THE SYSTEM! +# IF YOU DO NOT WANT THIS PLEASE CHANGE IT TO WHAT GENTOO RECOMMENDS +# https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage#MAKEOPTS +emerge --ask n cpuid2cpuflags +cpuid2cpuflags | sed 's/:\s/="/; s/$/"/' >> /etc/portage/make.conf +echo "EMERGE_DEFAULT_OPTS=\"--jobs=$(nproc) --load-average=$(nproc) --keep-going --verbose --quiet-build --with-bdeps=y --complete-graph=y --deep --ask\"" >> /etc/portage/make.conf +echo "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"" >> /etc/portage/make.conf + +# install custom compiler for firefox +mkdir -p /etc/portage/env +curl -L https://gist.githubusercontent.com/emrakyz/23bf6fe9c30aa0b1eb88021889750ace/raw/832a0160ac0d0383c4f600da5cf8af4290019ff6/compiler-firefox -o /etc/portage/env/compiler-firefox +echo "www-client/firefox compiler-firefox" > /etc/portage/package.env + # TODO: select profile log_msg INFO "update @world set (@system and @selected)" >> /var/log/installer.log emerge --ask n --update --deep --newuse @world +emerge --ask n @preserved-rebuild +emerge --ask n --depclean log_msg INFO "configure licenses" >> /var/log/installer.log echo "ACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf log_msg INFO "configure timezone (glibc)" >> /var/log/installer.log echo ${CFG_TIMEZONE} > /etc/timezone -emerge --ask n sys-libs/timezone-data +emerge --ask n --config sys-libs/timezone-data log_msg INFO "configure locales (glibc)" >> /var/log/installer.log -echo "fi_FI.UTF-8 UTF-8" >> /etc/locale.gen -echo "fi_FI ISO-8859-1" >> /etc/locale.gen -echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen @@ -86,6 +96,18 @@ env-update && source /etc/profile && export PS1="(chroot) ${PS1}" # firmware install # +log_msg INFO "installing microcode and firmware" >> /var/log/installer.log +emerge --ask n intel-microcode +SIGNATURE=$(iucode_tool -S 2>&1 | grep -o "0.*$") +sed -i "s/MICROCODE_SIGNATURES=\"-S\"/MICROCODE_SIGNATURES=\"-s $SIGNATURE\"/" /etc/portage/make.conf +emerge --ask n intel-microcode +USE="-compress-xz" emerge --ask n linux-firmware +emerge --oneshot --ask n pciutils +GPU_CODE=$(lspci | grep -i 'vga\|3d\|2d' | awk -F'[[]' '{print $1}' | awk '{print $NF}' | tr '[:upper:]' '[:lower:]') +sed -i "/^nvidia\/\($GPU_CODE\)/!d" /etc/portage/savedconfig/sys-kernel/linux-firmware-* +USE="-harfbuzz" emerge --oneshot --ask n freetype +emerge --oneshot --ask n freetype + # # kernel install #