From 5aefa2213915a28e5d0048848815e62926cc28d9 Mon Sep 17 00:00:00 2001 From: Shinjitsu Ni Ikiru Date: Fri, 7 Jul 2023 14:44:39 -0600 Subject: [PATCH] fix --- debian.sh | 102 +++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/debian.sh b/debian.sh index 20dd861..8b64dff 100755 --- a/debian.sh +++ b/debian.sh @@ -34,43 +34,20 @@ WIRELESS_INTERFACE='wlan0' DISK_PASSWORD='123456' COMPRESSION='compress=zlib:5' AUTO_DECRYPT='True' -FLATPAKS+=(org.kde.kapman net.sourceforge.ExtremeTuxRacer com.github.bjaraujo.Bombermaaan org.supertuxproject.SuperTux net.supertuxkart.SuperTuxKart net.sourceforge.chromium-bsu io.jor.mightymike com.eduke32.EDuke32 com.zandronum.Zandronum net.openra.OpenRA) +FLATPAKS+=(io.exodus.Exodus com.nextcloud.desktopclient.nextcloud com.tutanota.Tutanota) #Packages -PACKAGES=" iptables-persistent resolvconf wireguard wireguard-tools nmap libsecret-tools libglu1-mesa preload flatpak powertop acpi cockpit cockpit-podman packagekit cockpit-packagekit cockpit-storaged " -BASE_PACKAGES=" inotify-tools debootstrap cups apt-transport-https samba samba-common nfs-common nfs-kernel-server linux-cpupower locales zram-tools acpid podman ghostscript cifs-utils ntp vim-airline rsync screen base udev git network-manager cryptsetup network-manager-openvpn ntp screen docbook-xsl alsa-utils sysstat fuse3 build-essential unzip bash-completion parted dosfstools wget curl " -SHARED_DESKTOP_APPS=" kwin-addons kde-standard konsole dolphin kde-spectacle print-manager digikam krita nextcloud-desktop handbrake calligra " -#REMOVED=" cockpit-pcp " +BASE_PACKAGES=" linux-image-amd64 grub-efi efibootmgr plymouth plymouth-themes btrfs-progs cryptsetup-initramfs linux-headers-amd64 firmware-iwlwifi firmware-linux firmware-linux-nonfree podman-compose podman-toolbox cockpit cockpit-podman packagekit cockpit-packagekit cockpit-storaged shfmt aardvark-dns power-profiles-daemon iptables-persistent resolvconf wireguard wireguard-tools nmap libsecret-tools libglu1-mesa preload flatpak powertop acpi btop inotify-tools debootstrap cups apt-transport-https samba samba-common nfs-common nfs-kernel-server linux-cpupower locales zram-tools acpid podman ghostscript cifs-utils ntp vim-airline rsync screen base udev git network-manager cryptsetup network-manager-openvpn ntp screen docbook-xsl alsa-utils sysstat fuse3 build-essential unzip bash-completion parted dosfstools wget curl " +SHARED_DESKTOP_APPS=" handbrake calligra yt-dlp plasma-discover-backend-flatpak kwin-addons kde-standard konsole dolphin kde-spectacle print-manager " #TROUBLESOME_PACKAGES - packages here that may not be available for your Debian release -TROUBLESOME_PACKAGES=" aardvark-dns shfmt podman-compose btop podman-toolbox yt-dlp power-profiles-daemon " +#TROUBLESOME_PACKAGES=" " VIRTUALIZATION=" virt-manager qemu-system libvirt-daemon-system ovmf cockpit-machines" -PACKAGES=$BASE_PACKAGES$PACKAGES$SHARED_DESKTOP_APPS -#PACKAGES=$BASE_PACKAGES -TAR_EXCLUDES="--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/flatpak --exclude=/var/lib/postgresql --exclude=/var/lib/containers" - -installBrowser() { - #Brave - curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list - apt update - apt install brave-browser -y - - #Vivaldi - #curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | tee /usr/share/#keyrings/vivaldi.gpg > /dev/null - #echo deb [arch=amd64,armhf signed-by=/usr/share/keyrings/vivaldi.gpg] https://repo.vivaldi.com/archive/#deb/ stable main | tee /etc/apt/sources.list.d/vivaldi.list - #apt update - #apt install vivaldi-stable -y -} - -installElement() { - wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | tee /etc/apt/sources.list.d/element-io.list - apt update - apt install -y element-desktop -} +PACKAGES=$BASE_PACKAGES$SHARED_DESKTOP_APPS +TAR_EXCLUDES="--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" installVPN() { cd /tmp + rm -f *.deb wget --content-disposition https://mullvad.net/download/app/deb/latest apt install -y /tmp/*.deb systemctl enable --now mullvad-daemon @@ -177,11 +154,11 @@ os-restore() { } systemMounts() { - mount -o rbind /dev $TARGET/dev - mount -o rbind /dev/pts $TARGET/dev/pts - mount -o rbind /proc $TARGET/proc - mount -o rbind /sys $TARGET/sys - mount -t efivarfs none $TARGET/sys/firmware/efi/efivars + mount -o rbind /dev $TARGET/dev + mount -o rbind /dev/pts $TARGET/dev/pts + mount -o rbind /proc $TARGET/proc + mount -o rbind /sys $TARGET/sys + mount -t efivarfs none $TARGET/sys/firmware/efi/efivars } decryptBoot() { @@ -212,14 +189,14 @@ configure-repository() { if [ "$DEBIAN_RELEASE" == "testing" ]; then echo "deb https://deb.debian.org/debian $DEBIAN_RELEASE main contrib non-free non-free-firmware" >$TARGET/etc/apt/sources.list chroot $TARGET /usr/bin/apt update - chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt install -y $PACKAGES" + chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt install -y $PACKAGES " else echo "deb https://deb.debian.org/debian $DEBIAN_RELEASE main contrib non-free non-free-firmware" >$TARGET/etc/apt/sources.list echo "deb https://deb.debian.org/debian-security $DEBIAN_RELEASE-security main" >>$TARGET/etc/apt/sources.list echo "deb https://deb.debian.org/debian $DEBIAN_RELEASE-updates main " >>$TARGET/etc/apt/sources.list echo "deb https://deb.debian.org/debian $DEBIAN_RELEASE-backports main" >>$TARGET/etc/apt/sources.list chroot $TARGET /usr/bin/apt update - chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt install -y $PACKAGES" + chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt install -y $PACKAGES " chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt dist-upgrade -y -t $DEBIAN_RELEASE-backports" chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt install -y $TROUBLESOME_PACKAGES" chroot $TARGET /usr/bin/bash -c "export DEBIAN_FRONTEND=noninteractive;/usr/bin/apt auto-remove -y" @@ -230,13 +207,13 @@ configure-repository() { make-image() { umount $TARGET - mount -t tmpfs tmpfs -o size=11G,dev,exec $TARGET + mount -t tmpfs tmpfs -o size=15G,dev,exec $TARGET debootstrap --arch amd64 $DEBIAN_RELEASE $TARGET https://deb.debian.org/debian configure-repository locale custom_service_files + rm -rf $TARGET/var/lib/flatpak cp -f debian.sh $TARGET/usr/bin/ - echo 'bash /usr/bin/debian.sh kernel-packages' >>$TARGET/setup.sh echo "bash /usr/bin/debian.sh bootloader $1 $ROOT_NAME $ROOT_MAPPER_NAME" >>$TARGET/setup.sh echo 'bash /usr/bin/debian.sh grub-snapshots' >>$TARGET/setup.sh echo 'bash /usr/bin/debian.sh desktop' >>$TARGET/setup.sh @@ -248,9 +225,10 @@ make-image() { echo -e "ALGO=zstd\nPERCENT=60" | tee -a $TARGET/etc/default/zramswap cd $TARGET echo "[Creating new OS image to $1/$ROOT_NAME.tgz]" - time tar cpzf $1/$ROOT_NAME.tgz $TAR_EXCLUDES . + time tar cpzf $1/$ROOT_NAME.tgz --exclude=proc/* . cd $1 - umount $TARGET + du -h $1/$ROOT_NAME.tgz | tail -1 + unmount } install() { @@ -275,7 +253,7 @@ install() { } desktop() { - SERVICES+=(mullvad-daemon pmcd pmie pmlogger pmproxy exim4 cockpit.socket apparmor nfs-server smbd rpbind rpcbind.socket avahi-daemon bluetooth) + SERVICES+=(mullvad-daemon pmcd pmie pmlogger pmproxy exim4 cockpit.socket apparmor nfs-server smbd rpbind rpcbind.socket avahi-daemon bluetooth) for i in "${SERVICES[@]}"; do systemctl disable --now $i done @@ -283,8 +261,9 @@ desktop() { apt -y purge apparmor apt remove unattended-upgrades firefox-esr chromium chromium-common chromium-sandbox epiphany-browser epiphany-browser-data -y installBrowser - installVPN installElement + installCodium + installVPN apt autoremove -y } @@ -303,10 +282,11 @@ remove-snapshots() { } flatpaks() { - flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + echo;echo "Installing Flatpaks......";echo + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo for i in "${FLATPAKS[@]}"; do echo $i - flatpak install $i -y + flatpak install --system $i -y done } @@ -319,10 +299,6 @@ grub-snapshots() { systemctl enable --now grub-btrfsd.service } -kernel-packages() { - /usr/bin/apt install --reinstall -y linux-image-amd64 grub-efi efibootmgr plymouth plymouth-themes btrfs-progs cryptsetup-initramfs linux-image-amd64 linux-headers-amd64 firmware-iwlwifi firmware-linux firmware-linux-nonfree -} - bootloader() { if [ -z "$1" ]; then echo @@ -349,11 +325,10 @@ bootloader() { function setup_script() { cp -f debian.sh $TARGET/usr/bin/ - echo 'bash /usr/bin/debian.sh kernel-packages' >>$TARGET/setup.sh #sed -i 's/most/dep/i' $TARGET/etc/initramfs-tools/initramfs.conf echo "bash /usr/bin/debian.sh bootloader $1 $ROOT_NAME $ROOT_MAPPER_NAME" >>$TARGET/setup.sh echo 'bash /usr/bin/debian.sh grub-snapshots' >>$TARGET/setup.sh - echo 'bash /usr/bin/debian.sh accounts' >>$TARGET/setup.sh + echo 'bash /usr/bin/debian.sh accounts' >>$TARGET/setup.sh echo 'bash /usr/bin/debian.sh desktop' >>$TARGET/setup.sh echo 'bash /usr/bin/debian.sh btrfs-tweaks' >>$TARGET/setup.sh @@ -377,6 +352,28 @@ btrfs_filesytem() { mount -o $COMPRESSION,subvol=@$ROOT_NAME /dev/mapper/$ROOT_MAPPER_NAME $TARGET } +installCodium(){ + curl -fSsL https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | tee /usr/share/keyrings/vscodium.gpg >/dev/null + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/vscodium.gpg] https://download.vscodium.com/debs vscodium main" | tee /etc/apt/sources.list.d/vscodium.list + apt update + apt install codium -y +} + +installBrowser() { + #Brave + curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list + apt update + apt install brave-browser -y +} + +installElement() { + wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | tee /etc/apt/sources.list.d/element-io.list + apt update + apt install -y element-desktop +} + mounts() { echo echo "Mounting......." @@ -444,7 +441,6 @@ fstab() { echo "/dev/mapper/$ROOT_MAPPER_NAME /var/lib/libvirt btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@libvirt 0 1" >>$TARGET/etc/fstab echo "tmpfs /var/log tmpfs defaults,dev,exec 0 0" >>$TARGET/etc/fstab echo "tmpfs /tmp tmpfs defaults 0 0" >>$TARGET/etc/fstab - #echo "tmpfs /var/tmp tmpfs defaults 0 0" >>$TARGET/etc/fstab echo "tmpfs /home/${USER}/.cache tmpfs rw,user,exec 0 0" >>$TARGET/etc/fstab echo "tmpfs /home/${USER}/Downloads tmpfs rw,user,exec 0 0" >>$TARGET/etc/fstab echo "/dev/mapper/$ROOT_MAPPER_NAME /home btrfs noatime,nodiratime,autodefrag,$COMPRESSION,subvol=@home 0 1" >>$TARGET/etc/fstab @@ -643,8 +639,6 @@ if [ "$1" = "desktop" ]; then desktop elif [ "$1" = "tar" ]; then create-os-snapshots "null" "$3" "$2" -elif [ "$1" = "kernel-packages" ]; then - kernel-packages elif [ "$1" = "upgrade-system" ]; then upgrade-system elif [ "$1" = "wifi" ]; then