diff --git a/README.md b/README.md index 4787935..e47414d 100644 --- a/README.md +++ b/README.md @@ -12,32 +12,11 @@ Boot into your Arch ISO & run commands: ```bash # Installer 1 -curl https://git.merlinslair.net/beech/ArchScripts/raw/branch/main/preinstall1.sh -o preinstall1.sh -sh preinstall1.sh - -# Enter Arch root directory -arch-chroot /mnt - -# Set your root password -passwd - -# Create your user account, replace USERNAME with your desired username -useradd -m -g users -G wheel,storage,power -s /bin/bash USERNAME - -# Set the password for your account, replace USERNAME with the user you created -passwd USERNAME - -# Run this & take note of your network adapter name (ex: ens33) -ip link - -# Installer 2 Setup -sudo pacman -S nano curl --noconfirm --needed -curl https://git.merlinslair.net/beech/ArchScripts/raw/branch/main/preinstall2.sh -o preinstall2.sh - -# Edit network adapter name for dhcpcd service in script line 43 -nano preinstall2.sh +curl https://git.merlinslair.net/beech/ArchScripts/raw/branch/main/install1.sh -o install1.sh +sh install1.sh # Installer 2 +curl https://git.merlinslair.net/beech/ArchScripts/raw/branch/main/install2.sh -o install2.sh sh preinstall2.sh # Preparing for first boot (Non-Nvidia GPU or VM) @@ -57,64 +36,16 @@ reboot ### After First Boot ```bash -sudo pacman -S --noconfirm pacman-contrib git -sudo git clone https://git.merlinslair.net/beech/ArchScripts -cd ArchScripts - -# Normal Install -sh setup-gnome.sh # GNOME install -OR -sh setup-kde.sh # KDE install - -reboot - -sh software.sh -``` - -### After First Boot (VM) - -```bash -sudo pacman -S --noconfirm pacman-contrib git +sudo pacman -S --noconfirm pacman-contrib sudo git clone https://git.merlinslair.net/beech/ArchScripts cd ArchScripts +sh install3.sh -# Installed as VM -sh setup-vmgnome.sh # GNOME install (VM) -OR -sh setup-vmkde.sh # KDE install (VM) - -# Audio Fix for VMs -mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ -cd ~/.config/wireplumber/wireplumber.conf.d -nano 50-alsa-config.conf - -# Add the following lines: -monitor.alsa.rules = [ - { - matches = [ - # This matches the value of the 'node.name' property of the node. - { - node.name = "~alsa_output.*" - } - ] - actions = { - # Apply all the desired node specific settings here. - update-props = { - api.alsa.period-size = 1024 - api.alsa.headroom = 8192 - } - } - } -] - -# Reboot Machine reboot - -sh software.sh ``` ### System Description -GNOME or KDE Desktop Enviornment +GNOME or KDE Desktop Environment GDM or SDDM Login Manager diff --git a/VM/50-alsa-config.conf b/VM/50-alsa-config.conf new file mode 100644 index 0000000..45355ba --- /dev/null +++ b/VM/50-alsa-config.conf @@ -0,0 +1,17 @@ +monitor.alsa.rules = [ + { + matches = [ + # This matches the value of the 'node.name' property of the node. + { + node.name = "~alsa_output.*" + } + ] + actions = { + # Apply all the desired node specific settings here. + update-props = { + api.alsa.period-size = 1024 + api.alsa.headroom = 8192 + } + } + } +] diff --git a/setup-vmgnome.sh b/VM/setup-vmgnome.sh similarity index 93% rename from setup-vmgnome.sh rename to VM/setup-vmgnome.sh index b5d2e84..c68ba88 100644 --- a/setup-vmgnome.sh +++ b/VM/setup-vmgnome.sh @@ -69,7 +69,9 @@ sudo systemctl enable gdm.service sudo systemctl enable vmtoolsd.service sudo systemctl enable vmware-vmblock-fuse.service cp /usr/share/pipewire/pipewire.conf /etc/pipewire/ +mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ +cp ~/ArchScripts/VM/50-alsa-config.conf ~/.config/wireplumber/wireplumber.conf.d/50-alsa-config.conf echo -echo "Done! Please Reboot & Run software.sh. View wiki for VM audio fix." +echo "Done! Please Reboot." echo diff --git a/setup-vmkde.sh b/VM/setup-vmkde.sh similarity index 94% rename from setup-vmkde.sh rename to VM/setup-vmkde.sh index 41e34ad..2003bd8 100644 --- a/setup-vmkde.sh +++ b/VM/setup-vmkde.sh @@ -69,6 +69,8 @@ sudo systemctl enable sddm.service sudo systemctl enable vmtoolsd.service sudo systemctl enable vmware-vmblock-fuse.service cp /usr/share/pipewire/pipewire.conf /etc/pipewire/ +mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ +cp ~/ArchScripts/VM/50-alsa-config.conf ~/.config/wireplumber/wireplumber.conf.d/50-alsa-config.conf echo echo "Done! Please Reboot & Run software.sh. View wiki for VM audio fix." diff --git a/setup-gnome.sh b/gnomesetup.sh similarity index 98% rename from setup-gnome.sh rename to gnomesetup.sh index 3715aec..0af1799 100644 --- a/setup-gnome.sh +++ b/gnomesetup.sh @@ -57,6 +57,7 @@ for PKG in "${PKGS[@]}"; do sudo pacman -S "$PKG" --noconfirm --needed done +sudo systemctl disable sddm.service sudo systemctl enable gdm.service echo diff --git a/preinstall1.sh b/install1.sh similarity index 60% rename from preinstall1.sh rename to install1.sh index 0da9a8e..3061299 100644 --- a/preinstall1.sh +++ b/install1.sh @@ -4,52 +4,57 @@ # Change boot, SWAP, and root partition sizes to your needs in lines 15-17 echo "-------------------------------------------------" -echo "Setting up partitions - DRIVE WILL BE WIPED" +echo "Arch Install Script 1 - Drive Setup" echo "-------------------------------------------------" +lsblk +echo "Specify drive name for install (ex. /dev/sda, /dev/nvme0n1). THIS WILL FORMAT & PARTITION THE SPECIFIED DRIVE!" + +read -r -p "Enter the disk: " DISK + +echo -e "\nFormatting disk...\n$HR" + # disk prep -sgdisk -Z /dev/sda # zap all on disk -sgdisk -a 2048 -o /dev/sda # new gpt disk 2048 alignment +sgdisk -Z $DISK # zap all on disk +sgdisk -a 2048 -o $DISK # new gpt disk 2048 alignment # create partitions -sgdisk -n 1:0:1024M /dev/sda # partition 1 (boot) -sgdisk -n 2:0:4G /dev/sda # partition 2 (SWAP - change to desired size) -sgdisk -n 3:0:35G /dev/sda # partition 3 (root - change to desired size) -sgdisk -n 4:0:0 /dev/sda # partition 4 (home, remaining space) +sgdisk -n 1:0:1024M $DISK # partition 1 (boot) +sgdisk -n 2:0:4G $DISK # partition 2 (SWAP - change to desired size) +sgdisk -n 3:0:35G $DISK # partition 3 (root - change to desired size) +sgdisk -n 4:0:0 $DISK # partition 4 (home, remaining space) # set partition types -sgdisk -t 1:ef00 /dev/sda -sgdisk -t 2:8200 /dev/sda -sgdisk -t 3:8300 /dev/sda -sgdisk -t 4:8300 /dev/sda +sgdisk -t 1:ef00 $DISK +sgdisk -t 2:8200 $DISK +sgdisk -t 3:8300 $DISK +sgdisk -t 4:8300 $DISK # label partitions -sgdisk -c 1:"boot" /dev/sda -sgdisk -c 2:"swap" /dev/sda -sgdisk -c 3:"root" /dev/sda -sgdisk -c 4:"home" /dev/sda +sgdisk -c 1:"boot" $DISK +sgdisk -c 2:"swap" $DISK +sgdisk -c 3:"root" $DISK +sgdisk -c 4:"home" $DISK # make filesystems -echo "-------------------------------------------------" -echo "Creating Filesystems" -echo "-------------------------------------------------" +echo -e "\nCreating Filesystems...\n$HR" -mkfs.fat -F32 /dev/sda1 # FAT32 boot partition -mkswap /dev/sda2 # create SWAP -swapon /dev/sda2 # enable SWAP -mkfs.ext4 /dev/sda3 -mkfs.ext4 /dev/sda4 +mkfs.fat -F32 ${DISK}1 # FAT32 boot partition +mkswap ${DISK}2 # create SWAP +swapon ${DISK}2 # enable SWAP +mkfs.ext4 ${DISK}3 +mkfs.ext4 ${DISK}4 # mount partitions echo "-------------------------------------------------" echo "Mounting Partitions" echo "-------------------------------------------------" -mount /dev/sda3 /mnt +mount ${DISK}3 /mnt mkdir /mnt/boot mkdir /mnt/home -mount /dev/sda1 /mnt/boot -mount /dev/sda4 /mnt/home +mount ${DISK}1 /mnt/boot +mount ${DISK}4 /mnt/home # set download mirrors echo "-------------------------------------------------" @@ -77,5 +82,9 @@ echo "-------------------------------------------------" genfstab -U -p /mnt >> /mnt/etc/fstab echo "-------------------------------------------------" -echo "Finished install script 1. Please run [arch-chroot /mnt], create your user and move on to the 2nd installer." +echo "Finished install script 1. Run install2.sh" echo "-------------------------------------------------" + +# chroot +arch-chroot /mnt + diff --git a/preinstall2nvme.sh b/install2.sh similarity index 62% rename from preinstall2nvme.sh rename to install2.sh index d4170c6..b2a36c5 100644 --- a/preinstall2nvme.sh +++ b/install2.sh @@ -1,7 +1,23 @@ #!/usr/bin/env bash -# Create your user account following the README instructions before running this. -# Edit hostname on line 26 if desired +lsblk +echo "Specify drive name that you entered in the first script." + +read -r -p "Enter the disk: " DISK + +echo "Create a root password (not your user password)." + +passwd + +echo "Create a user account." + +read -r -p "Create username: " Username + +useradd -m -g users -G wheel,storage,power -s /bin/bash $Username + +echo "Create a user password (should be different from root)." + +passwd $Username # File edits for user permissions @@ -23,7 +39,11 @@ hwclock --systohc --utc # set hostname - edit archdesk with preferred hostname -echo archdesk > /etc/hostname +echo "Set hostname." + +read -r -p "Enter the hostname: " HOSTNAME + +echo ${HOSTNAME} > /etc/hostname # Enable TRIM @@ -43,19 +63,14 @@ echo "title Arch" > /boot/loader/entries/arch.conf echo "linux /vmlinuz-linux" >> /boot/loader/entries/arch.conf echo "initrd /initramfs-linux.img" >> /boot/loader/entries/arch.conf -echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/nvme0n1p3) rw" >> /boot/loader/entries/arch.conf - -# install dhcpd service - -sudo pacman -S dhcpcd --noconfirm --needed - -sudo systemctl enable dhcpcd@ADAPTER.service # EDIT "ADAPTER" WITH YOUR ADAPTER IN IP LINK +echo "options root=PARTUUID=$(blkid -s PARTUUID -o value ${DISK}3) rw" >> /boot/loader/entries/arch.conf # install NetworkManager sudo pacman -S networkmanager --noconfirm --needed +sudo pacman -S git --noconfirm --needed sudo systemctl enable NetworkManager.service - +sudo systemctl start NetworkManager.service echo "-------------------------------------------------" echo "Arch Linux Installed & Configured. Please [exit] & run [umount -R /mnt] and reboot" diff --git a/install3.sh b/install3.sh new file mode 100644 index 0000000..5d4856e --- /dev/null +++ b/install3.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +chmod +x gnomesetup.sh +chmod +x kdesetup.sh +chmod +x software.sh +chmod +x aur.sh + +install_gnome () { + echo "Setting up GNOME + GDM..." + sh gnomesetup.sh + echo "Gnome installed & GDM enabled on reboot." +} + +install_kde () { + echo "Setting up KDE + SDDM..." + sh kdesetup.sh + echo "KDE installed + SDDM enabled on reboot" +} + +install_software () { + echo "Setting up KDE + SDDM..." + sh software.sh + echo "Software installed." +} + +setup_aur () { + echo "Setting up Yay..." + sh aur.sh + echo "Yay installed." +} + +while true; do + options=("Install GNOME + GDM" "Install KDE + SDDM" "Install Software" "Setup Yay" "Exit") + + echo "Debian Server Setup: " + select opt in "${options[@]}"; do + case $REPLY in + 1) install_gnome; break ;; + 2) install_kde; break ;; + 3) install_software; break ;; + 4) setup_aur; break ;; + 5) break 2 ;; + *) echo "Invalid" >&2 + esac + done +done + +echo "Exiting! Please reboot to enter desktop environment." diff --git a/setup-kde.sh b/kdesetup.sh similarity index 98% rename from setup-kde.sh rename to kdesetup.sh index d0c3c94..efd46b9 100644 --- a/setup-kde.sh +++ b/kdesetup.sh @@ -57,6 +57,7 @@ for PKG in "${PKGS[@]}"; do sudo pacman -S "$PKG" --noconfirm --needed done +sudo systemctl disable gdm.service sudo systemctl enable sddm.service echo diff --git a/nvidia.sh b/nvidia.sh deleted file mode 100644 index 3a18346..0000000 --- a/nvidia.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -echo "-------------------------------------------------" -echo "Installing Nvidia Graphics Drivers" -echo "-------------------------------------------------" - -sudo pacman -S linux-headers --noconfirm -sudo pacman -S nvidia-dkms libglvnd nvidia-utils opencl-nvidia lib32-libglvnd lib32-nvidia-utils lib32-opencl-nvidia nvidia-settings --noconfirm - -sed -i 's/^MODULES=()/MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)/' /etc/mkinitcpio.conf -# sed -i 's/^ rw/ rw nvidia-drm.modeset=1/' /boot/loader/entries/arch.conf - -sudo mkdir /etc/pacman.d/hooks -touch /etc/pacman.d/hooks/nvidia.hook -echo "[Trigger]" > /etc/pacman.d/hooks/nvidia.hook -echo "Operation=Install" >> /etc/pacman.d/hooks/nvidia.hook -echo "Operation=Upgrade" >> /etc/pacman.d/hooks/nvidia.hook -echo "Operation=Remove" >> /etc/pacman.d/hooks/nvidia.hook -echo "Type=Package" >> /etc/pacman.d/hooks/nvidia.hook -echo "Target=nvidia" >> /etc/pacman.d/hooks/nvidia.hook -echo "[Action]" >> /etc/pacman.d/hooks/nvidia.hook -echo "Depends=mkinitcpio" >> /etc/pacman.d/hooks/nvidia.hook -echo "When=PostTransaction" >> /etc/pacman.d/hooks/nvidia.hook -echo "Exec=/usr/bin/mkinitcpio -P" >> /etc/pacman.d/hooks/nvidia.hook - -echo "-------------------------------------------------" -echo "Done. Please edit /boot/loader/entries/arch.conf before exiting" -echo "-------------------------------------------------" \ No newline at end of file diff --git a/preinstall1nvme.sh b/preinstall1nvme.sh deleted file mode 100644 index d8c4bc8..0000000 --- a/preinstall1nvme.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env bash -# This WILL format and partition 1 drive in your system. It is recommended to run the script with only 1 drive installed. -# Selected drive is /dev/nvme0n1, replace sda with specified drive if you have multiple. List drives with 'lsblk' -# Change boot, SWAP, and root partition sizes to your needs in lines 15-17 - -echo "-------------------------------------------------" -echo "Setting up partitions - DRIVE WILL BE WIPED" -echo "-------------------------------------------------" - -# disk prep -sgdisk -Z /dev/nvme0n1 # zap all on disk -sgdisk -a 2048 -o /dev/nvme0n1 # new gpt disk 2048 alignment - -# create partitions -sgdisk -n 1:0:1024M /dev/nvme0n1 # partition 1 (boot) -sgdisk -n 2:0:8G /dev/nvme0n1 # partition 2 (SWAP - change to desired size) -sgdisk -n 3:0:50G /dev/nvme0n1 # partition 3 (root - change to desired size) -sgdisk -n 4:0:0 /dev/nvme0n1 # partition 4 (home, remaining space) - -# set partition types -sgdisk -t 1:ef00 /dev/nvme0n1 -sgdisk -t 2:8200 /dev/nvme0n1 -sgdisk -t 3:8300 /dev/nvme0n1 -sgdisk -t 4:8300 /dev/nvme0n1 - -# label partitions -sgdisk -c 1:"boot" /dev/nvme0n1 -sgdisk -c 2:"swap" /dev/nvme0n1 -sgdisk -c 3:"root" /dev/nvme0n1 -sgdisk -c 4:"home" /dev/nvme0n1 - -# make filesystems -echo "-------------------------------------------------" -echo "Creating Filesystems" -echo "-------------------------------------------------" - -mkfs.fat -F32 /dev/nvme0n1p1 # FAT32 boot partition -mkswap /dev/nvme0n1p2 # create SWAP -swapon /dev/nvme0n1p2 # enable SWAP -mkfs.ext4 /dev/nvme0n1p3 -mkfs.ext4 /dev/nvme0n1p4 - -# mount partitions -echo "-------------------------------------------------" -echo "Mounting Partitions" -echo "-------------------------------------------------" - -mount /dev/nvme0n1p3 /mnt -mkdir /mnt/boot -mkdir /mnt/home -mount /dev/nvme0n1p1 /mnt/boot -mount /dev/nvme0n1p4 /mnt/home - -# set download mirrors -echo "-------------------------------------------------" -echo "Setting Mirrorlist" -echo "-------------------------------------------------" - -cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup # backs up mirrorlist -sudo pacman -Syyy -sudo pacman -S pacman-contrib --noconfirm -rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist - -# install arch -echo "-------------------------------------------------" -echo "Installing to drive" -echo "-------------------------------------------------" - -pacstrap -K /mnt base linux linux-firmware base-devel --noconfirm --needed - -echo "-------------------------------------------------" -echo "Installed - Generating fstab" -echo "-------------------------------------------------" - -# generate fstab - -genfstab -U -p /mnt >> /mnt/etc/fstab - -echo "-------------------------------------------------" -echo "Finished install script 1. Please run [arch-chroot /mnt], create your user and move on to the 2nd installer." -echo "-------------------------------------------------" diff --git a/preinstall2.sh b/preinstall2.sh deleted file mode 100644 index 579d561..0000000 --- a/preinstall2.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -# Create your user account following the README instructions before running this. -# Edit hostname on line 26 if desired - -# File edits for user permissions - -sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers -echo "Defaults rootpw" >> /etc/sudoers - -# generate locales - -sudo pacman -S bash-completion --noconfirm --needed -sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen -locale-gen -echo LANG=en_US.UTF-8 > /etc/locale.conf -export LANG=en_US.UTF-8 - -# set timezone & link HW clock - -ln -s /usr/share/zoneinfo/America/Chicago > /etc/localtime -hwclock --systohc --utc - -# set hostname - edit archdesk with preferred hostname - -echo archdesk > /etc/hostname - -# Enable TRIM - -systemctl enable fstrim.timer - -# mount efivars - -mount -t efivarfs efivarfs /sys/firmware/efi/efivars/ - -# install bootloader - -bootctl install - -touch /boot/loader/entries/arch.conf - -echo "title Arch" > /boot/loader/entries/arch.conf -echo "linux /vmlinuz-linux" >> /boot/loader/entries/arch.conf -echo "initrd /initramfs-linux.img" >> /boot/loader/entries/arch.conf - -echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sda3) rw" >> /boot/loader/entries/arch.conf - -# install dhcpd service - -sudo pacman -S dhcpcd --noconfirm --needed - -sudo systemctl enable dhcpcd@ADAPTER.service # EDIT "ADAPTER" WITH YOUR ADAPTER IN IP LINK - -# install NetworkManager - -sudo pacman -S networkmanager --noconfirm --needed -sudo systemctl enable NetworkManager.service - - -echo "-------------------------------------------------" -echo "Arch Linux Installed & Configured. Please [exit] & run [umount -R /mnt] and reboot" -echo "-------------------------------------------------" \ No newline at end of file