Update gentoo.sh

This commit is contained in:
verita84 2023-10-30 15:02:11 +00:00
parent 7f70ec5bef
commit 360f916d66

View File

@ -38,17 +38,15 @@ WIRELESS_INTERFACE='wlan0'
DISK_PASSWORD='123456'
COMPRESSION='compress=zstd:10'
FLATPAKS+=(io.exodus.Exodus us.zoom.Zoom app/com.valvesoftware.Steam/x86_64/stable app/net.lutris.Lutris)
SERVICES+=( cups pulseaudio.service pulseaudio.socket grub-btrfsd sddm NetworkManager dev-zram0.swap)
SERVICES+=(avahi-daemon cups pulseaudio.service pulseaudio.socket grub-btrfsd sddm NetworkManager dev-zram0.swap)
DESKTOP="KDE"
BROWSER="brave"
MAKEOPTS="-j12"
USE_FLAGS="zeroconf dbus daemon pulseaudio X -browser-integration desktop-portal minimal -gtk -gnome qt5 kde dvd alsa gui -wayland device-mapper efiemu themes truetype btrfs seccomp cgroup-hybrid geoclue -webengine boot browser keeshare network opengl"
TMPFS_SIZE="32G"
STAGE3="https://distfiles.gentoo.org/releases/amd64/autobuilds/20231022T164658Z/stage3-amd64-systemd-20231022T164658Z.tar.xz"
#Packages
BASE_PACKAGES=" plasma-meta net-analyzer/nmap x11-apps/xhost app-misc/screen net-im/element-desktop-bin app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-boot/plymouth sys-apps/zram-generator x11-misc/sddm app-eselect/eselect-repository dev-vcs/git sys-boot/refind sys-block/parted sys-boot/grub sys-block/zram-init media-video/vlc app-office/calligra sys-process/btop net-vpn/wireguard-tools sys-apps/flatpak app-editors/vim app-vim/airline app-misc/neofetch net-misc/yt-dlp net-im/telegram-desktop net-misc/nextcloud-client app-containers/crun app-containers/podman app-office/calligra media-gfx/krita net-fs/samba sys-fs/btrfs-progs kde-apps/kdegraphics-meta app-admin/keepassxc net-print/cups "
BASE_PACKAGES=" plasma-meta sys-fs/inotify-tools kde-apps/kate kde-apps/konsole media-gfx/krita dev-util/sh net-analyzer/nmap x11-apps/xhost app-misc/screen net-im/element-desktop-bin app-portage/gentoolkit sys-fs/dosfstools app-admin/sudo sys-apps/systemd sys-boot/plymouth sys-apps/zram-generator x11-misc/sddm app-eselect/eselect-repository dev-vcs/git sys-boot/refind sys-block/parted sys-boot/grub sys-block/zram-init media-video/vlc app-office/calligra sys-process/btop net-vpn/wireguard-tools sys-apps/flatpak app-editors/vim app-vim/airline app-misc/neofetch net-misc/yt-dlp net-im/telegram-desktop net-misc/nextcloud-client app-containers/crun app-containers/podman app-office/calligra media-gfx/krita net-fs/samba sys-fs/btrfs-progs kde-apps/kdegraphics-meta app-admin/keepassxc net-print/cups "
#VIRTUALIZATION=" virt-manager qemu-system libvirt-daemon-system ovmf cockpit-machines"
PACKAGES=""
TAR_EXCLUDES="--exclude=/var/lib/flatpak --exclude=/opt/stable-diffusion-webui --exclude=/.snapshots --exclude=/snapshots --exclude=/var/backups --exclude=/volumes/* --exclude=/mnt/* --exclude=/var/tmp/* --exclude=/tmp/* --exclude=/raid/* --exclude=/root/* --exclude=/var/cache/apt/archives/* --exclude=/proc/* --exclude=/.snapshots/* --exclude=/var/lib/libvirt/* --exclude=/dev/* --exclude=/sys/* --exclude=/home/* --exclude=/var/lib/postgresql --exclude=/var/lib/containers --exclude=/opt/chatgpt "
partitionDetection() {
@ -61,11 +59,11 @@ partitionDetection() {
partitionDetection
auto_login() {
mkdir -p $TARGET/etc/sddm.conf.d
echo "[Autologin]" >$TARGET/etc/sddm.conf.d/autologin
echo "User=$USER" >>$TARGET/etc/sddm.conf.d/autologin
echo "Session=plasma.desktop" >>$TARGET/etc/sddm.conf.d/autologin
echo "Relogin=false" >>$TARGET/etc/sddm.conf.d/autologin
mkdir -p $TARGET/etc/sddm.conf.d
echo "[Autologin]" >$TARGET/etc/sddm.conf.d/autologin
echo "User=$USER" >>$TARGET/etc/sddm.conf.d/autologin
echo "Session=plasma.desktop" >>$TARGET/etc/sddm.conf.d/autologin
echo "Relogin=false" >>$TARGET/etc/sddm.conf.d/autologin
}
hibernate-setup() {
@ -106,16 +104,15 @@ homeBackup() {
os-backup() {
umount $TARGET
echo
echo "[Mounting.....]"
echo
mount -o $COMPRESSION $BTRFS $TARGET
echo
echo "[Mounting.....]"
echo
mount -o $COMPRESSION $BTRFS $TARGET
if [ "$1" = "home" ]; then
homeBackup
fi
create-os-snapshots "$2" "$3"
if [ "$1" = "home" ]; then
homeBackup
fi
create-os-snapshots "$2" "$3"
ls $TARGET/
umount $TARGET
@ -195,25 +192,24 @@ getInstallFiles() {
}
buildGentoo() {
if [ ! -d "$TARGET/var/db/repos/gentoo/x11-misc" ]
then
chroot $TARGET /usr/bin/emerge --sync
fi
if [ ! -d "$TARGET/var/db/repos/gentoo/x11-misc" ]; then
chroot $TARGET /usr/bin/emerge --sync
fi
chroot $TARGET /usr/bin/eselect $(/usr/bin/eselect profile list | grep -i plasma | grep systemd | head -1 | cut -d '[' -f2 | cut -d ']' -f1)
mkdir -p $TARGET/etc/portage/package.license
echo "*/* *" >$TARGET/etc/portage/package.license/license
rm -rf $TARGET/etc/portage/package.accept_keywords
echo "net-im/element-desktop-bin ~amd64" >$TARGET/etc/portage/package.accept_keywords
echo "media-video/vlc ~amd64" >>$TARGET/etc/portage/package.accept_keywords
echo "dev-qt/qtgui ~amd64" >>$TARGET/etc/portage/package.accept_keywords
#echo "net-im/element-desktop-bin ~amd64" >$TARGET/etc/portage/package.accept_keywords
#echo "media-video/vlc ~amd64" >>$TARGET/etc/portage/package.accept_keywords
#echo "dev-qt/qtgui ~amd64" >>$TARGET/etc/portage/package.accept_keywords
chroot $TARGET /usr/bin/emerge --verbose --update --deep --newuse @world --autounmask-write
chroot $TARGET etc-update -q --automode -5
#The line is a workaround per bug https://bugs.gentoo.org/832963
chroot $TARGET /usr/bin/emerge --verbose --update --deep --newuse dev-qt/qtgui
chroot $TARGET /usr/bin/emerge --verbose --update --deep --newuse @world
locale
chroot $TARGET /usr/bin/emerge sys-kernel/gentoo-sources sys-kernel/dracut sys-kernel/genkernel
chroot $TARGET /usr/bin/emerge sys-kernel/gentoo-sources sys-kernel/genkernel
chroot $TARGET eselect kernel set 1
chroot $TARGET genkernel --cachedir=/var/tmp/portage --tmpdir=/var/tmp/portage --install --no-clean all
chroot $TARGET /usr/bin/emerge $BASE_PACKAGES --autounmask-write
@ -270,7 +266,7 @@ bootloader() {
echo "GRUB_TIMEOUT=1" >>/etc/default/grub
echo "GRUB_THEME=/boot/grub/themes/starfield/theme.txt" >>/etc/default/grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo
dracut --hostonly --kver $(ls /lib/modules/) --force
#dracut --hostonly --kver $(ls /lib/modules/) --force
grub-mkconfig -o /boot/grub/grub.cfg
refind-install
fi