Gentoo/studio:修订间差异

来自OSSmedia
无编辑摘要
无编辑摘要
第52行: 第52行:
EOF
EOF


</pre>
=== cpu config ===
<pre>
# CPU
# CPU
echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags
echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags
# seems useless
</pre>
=== bin host config ===
 
<pre>
# seems useless, but save your time
tee -a /etc/portage/binrepos.conf/bfsu.conf <<EOF
tee -a /etc/portage/binrepos.conf/bfsu.conf <<EOF
[binhost]
[binhost]
第60行: 第68行:
sync-uri = https://mirrors.bfsu.edu.cn/gentoo/releases/amd64/binpackages/23.0/x86-64/
sync-uri = https://mirrors.bfsu.edu.cn/gentoo/releases/amd64/binpackages/23.0/x86-64/
EOF
EOF
 
</pre>
 
=== USE config ===
<pre>
tee -a /etc/portage/package.use/01studio <<EOF
tee -a /etc/portage/package.use/01studio <<EOF
# kernel
# kernel
第79行: 第88行:
touch /etc/portage/package.use/zz-autoconfig
touch /etc/portage/package.use/zz-autoconfig
</pre>
</pre>
=== bfsu repo ===
=== bfsu gentoo repo mirror ===
<pre>
<pre>
mkdir /etc/portage/repos.conf
mkdir /etc/portage/repos.conf

2025年1月11日 (六) 14:29的版本

自制脚本

请在挂载磁盘后运行(默认位置 /mnt/gentoo)

stage file and chroot

download

# URL of the Gentoo mirror
MIRROR_URL="https://mirrors.bfsu.edu.cn/"

# Fetch the latest signed file
SIGNED_FILE=$(curl -s "${MIRROR_URL}gentoo/releases/amd64/autobuilds/current-stage3-amd64-desktop-systemd/latest-stage3-amd64-desktop-systemd.txt")

# Extract the stage file name
STAGE_FILE=$(echo "$SIGNED_FILE" | grep -oP '^stage3-[^ ]+\.tar\.xz')

# Download the stage file
if [ -n "$STAGE_FILE" ]; then
    DOWNLOAD_URL="${MIRROR_URL}gentoo/releases/amd64/autobuilds/current-stage3-amd64-desktop-systemd/${STAGE_FILE}"
    echo "Downloading ${STAGE_FILE}..."
    curl -O "$DOWNLOAD_URL"
    echo "Download complete."
else
    echo "Stage file not found."
    exit 1
fi

extranct and chroot

tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner -C /mnt/gentoo

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

root passwd

just do this first please, in case

passwd

portage config

do check make.conf after run this

# add config to make.conf
echo 'RUSTFLAGS="${RUSTFLAGS} -C target-cpu=native"' >> /etc/portage/make.conf
sed -i '/^COMMON_FLAGS=/ s/"$/ -march=native"/' /etc/portage/make.conf
tee -a /etc/portage/make.conf <<EOF

GRUB_PLATFORMS="emu efi-32 efi-64 pc"
USE="X fcitx5 tkip kcm cjk"
ACCEPT_LICENSE="* -@EULA"
VIDEO_CARDS="nvidia amdgpu radeon radeonsi intel mesa"
FEATURES="getbinpkg"
L10N="zh-CN jp en-US"
EOF

cpu config

# CPU
echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags

bin host config

# seems useless, but save your time
tee -a /etc/portage/binrepos.conf/bfsu.conf <<EOF
[binhost]
priority = 9999
sync-uri = https://mirrors.bfsu.edu.cn/gentoo/releases/amd64/binpackages/23.0/x86-64/
EOF

USE config

tee -a /etc/portage/package.use/01studio <<EOF
# kernel
sys-kernel/installkernel dracut grub
# kde
kde-plasma/plasma-meta networkmanager kwallet display-manager sddm wacom systemd sdk rdp plymouth oxygen-theme gtk grub discover bluetooth smart
kde-plasma/kde-apps-meta admin education games graphics multimedia network pim sdk utils
# latex
app-text/texlive X cjk context extra games graphics humanities luatex metapost music pdfannotextractor png pstricks publishers science tex4ht texi2html truetype xetex xml
# im
# app-i18n/fcitx 
app-i18n/mozc fcitx5
# audio
media-video/pipewire systemd jack-sdk pipewire-alsa sound-server
EOF

touch /etc/portage/package.use/zz-autoconfig

bfsu gentoo repo mirror

mkdir /etc/portage/repos.conf
cp /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.conf
sed -i 's|rsync://rsync.gentoo.org/gentoo-portage|rsync://mirrors.bfsu.edu.cn/gentoo-portage|' /etc/portage/repos.conf/gentoo.conf

enable testing flag(optional)

# ~AMD64
tee -a /etc/portage/package.accept_keywords/01studio <<EOF
# testing 
*/* ~amd64
EOF

update and installation

unmask-write, install, enable and reboot

emerge --sync
#eselect profile list | grep plasma
#eselect profile set 
emerge --ask --verbose --update --deep --changed-use @world
emerge --autounmask-write mirrorselect bash-completion net-misc/networkmanager \
app-portage/cpuid2cpuflags sudo glances app-misc/screen \
sys-kernel/installkernel sys-kernel/linux-firmware sys-kernel/gentoo-kernel \
plasma-meta kde-apps-meta \
firefox chromium \
app-editors/kile app-text/texlive \
pipewire libpulse plasma-pa wireplumber

cd /etc/portage/package.use
etc-update --automode -5

emerge mirrorselect bash-completion net-misc/networkmanager \
app-portage/cpuid2cpuflags sudo glances app-misc/screen \
sys-kernel/installkernel sys-kernel/linux-firmware sys-kernel/gentoo-kernel 

grub-install --efi-directoy=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl enable bluetooth
systemctl enable NetwrokManager

setting up some scripts

curl -fsSL "ossmedia.cn/set-ac.sh?raw" | bash
curl -fsSL "ossmedia.cn/set-proxy.sh?raw" | bash

system config before reboot

systemd-machine-id-setup
systemd-firstboot --prompt
systemctl preset-all --preset-mode=enable-only

install packaged after the reboot

package install

emerge plasma-meta kde-apps-meta \
firefox chromium media-fonts/noto-cjk \
app-editors/kile app-text/kbibtex app-text/texlive \
fcitx mozc fcitx-configtool fcitx-chinese-addons \
pipewire libpulse plasma-pa wireplumber genlop eix

enable sddm

systemctl enable ssdm

enable cjk fonts

sudo eselect fontconfig enable 70-noto-cjk.conf

pipewire

sudo usermod -aG pipewire $USER
mkdir ~/.config/pipewire
cp /usr/share/pipewire/pipewire.conf ~/.config/pipewire/
systemctl --user disable --now pulseaudio.socket pulseaudio.service
systemctl --user enable --now pipewire.socket pipewire-pulse.socket wireplumber.service
systemctl --user enable --now pipewire.service

如果在安装时使用gtk2或gtk3 USE标记,<module>(下面的示例中)应是fcitx,否则应是xim。 文件 ~/.xprofile

export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=<module>
export GTK_IM_MODULE=<module>

add gentoo-zh

sudo emerge eselect-repository sudo eselect repository enable gentoo-zh