Das gesammte Script strukturiert und aufgeräumt.

This commit is contained in:
eichehome 2023-07-18 00:36:03 +02:00
parent 9d51303c1f
commit 245341a927

View file

@ -4,36 +4,87 @@
# Einfache Version #
####################
# processor micricode: amd-ucode|intel-ucode
#--------------------------#
#################
# Einstellungen #
#################
# Microcode für den Prozessor: amd-ucode|intel-ucode
MICROCODE="amd-ucode"
# kernel: linux|linux-lts|linux-zen
# Kernel: linux|linux-lts|linux-zen
KERNEL="linux"
# hostname: arch
# Rechnername: arch
HOSTNAME_NEW="arch"
# rootpassword: testen
# Passwort für den System-Benutzer (root): testen
ROOTPASSWORD="testen"
# username: eichehome
# Name des Benutzers: eichehome
USERNAME="eichehome"
# userpassword: testen
# Passwort für den Benutzer: testen
USERPASSWORD="testen"
# graphics card: amd|intel|nvidia
# Grafikkarte: amd|intel|nvidia
GRAPHICS_CARD="amd"
# timezone: Europe/Berlin
# Zeitzone: Europe/Berlin
TIMEZONE="Europe/Berlin"
# language: de_DE.UTF-8
LANG="de_DE.UTF-8"
# Pakete:
# GNOME Programme
GNOME=(xdg-user-dirs gdm gnome-backgrounds gnome-color-manager gnome-console gnome-control-center gnome-disk-utility gnome-keyring gnome-menus gnome-remote-desktop gnome-session gnome-settings-daemon gnome-shell gnome-system-monitor gnome-tour gnome-user-docs gnome-user-share grilo-plugins gvfs gvfs-afc gvfs-goa gvfs-google gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-smb malcontent nautilus orca rygel sushi xdg-desktop-portal-gnome xdg-user-dirs-gtk yelp seahorse power-profiles-daemon)
# Ander grafische Programme
GRAPHIC_PROGRAMMS=()
# Cli-Anwendungen
CLI=(opendoas git vim lynx openssh bash-completion man-db man-pages reflector efibootmgr mtools dosfstools htop) # texinfo pacman-contrib rsync rebuild-detector
# Schriftarten
FONTS=()
# Codecs
CODECS=()
# Bluetooth
BLUETOOTH=(bluez bluez-utils)
# Office
OFFICE=(libreoffice-fresh-de)
# Audio/Video
AUDIO_VIDEO=(pipewire pipewire-audio pipewire-alsa pipewire-pulse pipewire-jack pipewire-zeroconf pipewire-v4l2 pipewire-docs pipewire-roc helvum wireplumber gstreamer gst-plugin-pipewire gst-libav gst-plugins-good gst-plugins-base)
# Drucken
PRINT=(cups)
# Development
DEV=(base-devel "${KERNEL}-headers")
# Netzwerk
NET=(iptables-nft firewalld inetutils avahi networkmanager networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc modemmanager) #iwd bind(dig,host,nslookup)
# Sontiges
OTHER=(base linux-firmware plymouth mkinitcpio xdg-utils) #dracut
# Grafik
GRAPHIC_DRIVER=()
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
GRAPHIC_DRIVER+=(xf86-video-amdgpu)
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
GRAPHIC_DRIVER+=(nvidia nvidia-utils nvidia-settings)
fi
###################################
pacstrap -i /mnt "${KERNEL}" "${MICROCODE}" "${GNOME[@]}" "${GRAPHIC_PROGRAMMS[@]}" "${CLI[@]}" "${FONTS[@]}" "${CODECS[@]}" "${BLUETOOTH[@]}" "${OFFICE[@]}" "${AUDIO_VIDEO[@]}" "${PRINT[@]}" "${DEV[@]}" "${NET[@]}" "${OTHER[@]}" "${GRAPHIC_DRIVER[@]}" #dracut
#pacman -S dialog
###################################
# Drive: /dev/vda
DRIVE="/dev/vda"
# disklayout: ESP (512MiB), Root (100% - 512MiB)
# disklayout: ESP (512MiB), usr (15GiB), Root (100% - [512MiB + 15GiB])
ESP="512M"
USR="15G"
###########################
#--------------------------#
###############################
# Erstellen der Partitionen #
# und mounten der Partitionen #
###############################
#Discoverable Partitions Specification
sgdisk -og "${DRIVE}"
sgdisk -n 0:0:+512M -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" "${DRIVE}"
sgdisk -n 0:0:+"${ESP}" -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" "${DRIVE}"
#sgdisk -n 0:0:+512M -t 0:ef00 -c 0:ESP "${DRIVE}"
sgdisk -n 0:0:+15G -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"Usr-Partition" "${DRIVE}"
sgdisk -n 0:0:+"${USR}" -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"Usr-Partition" "${DRIVE}"
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"System Root" "${DRIVE}"
@ -46,17 +97,26 @@ mkdir -p /mnt/{boot,usr}
mount /dev/vda1 /mnt/boot
mount /dev/vda2 /mnt/usr
#--------------------------#
#######################
# Pakete installieren #
#######################
pacstrap -i /mnt ""
#--------------------------#
#################################
# Das neue System konfigurieren #
#################################
# Pacman im Live-System konfigurieren
sed -i 's/#\(Color\)/\1/' /etc/pacman.conf
# Umbruch notwendug
sed -i 's/#\(ParallelDownloads\s=\s5\)/\1\
ILoveCandy/' /etc/pacman.conf
#ln -sf /run/systemd/resolve/stub-resolv.conf /mnt/etc/resolv.conf # tmpfiles.d macht das
pacstrap -i /mnt base iptables-nft linux-firmware vim git "${KERNEL}" "${MICROCODE}" #dracut
#arch-chroot /mnt
# ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime -> L /etc/localtime - - - - "/usr/share/zoneinfo/${TIMEZONE}"
arch-chroot /mnt hwclock --systohc
arch-chroot /mnt rm -rf /etc/localtime
@ -82,40 +142,17 @@ EOF
#echo "127.0.0.1 localhost" > /etc/hosts
#echo "::1 localhost" >> /etc/hosts
#echo "127.0.1.1 ${HOSTNAME_NEW}.localedomain ${HOSTNAME_NEW}" >> /etc/hosts
arch-chroot /mnt chpasswd <<< "root:${ROOTPASSWORD}"
#echo root:"${ROOTPASSWORD}" | chpasswd
arch-chroot /mnt useradd -mG wheel "${USERNAME}"
arch-chroot /mnt chpasswd <<< "${USERNAME}:${USERPASSWORD}"
#echo "${USERNAME}:${USERPASSWORD}" | chpasswd
pacstrap -i /mnt base-devel "${KERNEL}-headers"
pacstrap -i /mnt opendoas firewalld openssh bash-completion man-db man-pages reflector xdg-user-dirs lynx
#pacman -S iwd dialog reflector xdg-user-dirs xdg-utils inetutils ldns bash-completion openssh rsync iptables-nft ipset firewalld lynx man-db man-pages texinfo opendoas pacman-contrib rebuild-detector
pacstrap -i /mnt efibootmgr mtools dosfstools
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
pacstrap -i /mnt xf86-video-amdgpu
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
pacstrap -i /mnt nvidia nvidia-utils nvidia-settings
fi
# GNOME installieren
#pacstrap -i /mnt gnome
gnome=("gdm" "gnome-backgrounds" "gnome-color-manager" "gnome-console" "gnome-control-center" "gnome-disk-utility" "gnome-keyring" "gnome-menus" "gnome-remote-desktop" "gnome-session" "gnome-settings-daemon" "gnome-shell" "gnome-system-monitor" "gnome-tour" "gnome-user-docs" "gnome-user-share" "grilo-plugins" "gvfs" "gvfs-afc" "gvfs-goa" "gvfs-google" "gvfs-gphoto2" "gvfs-mtp" "gvfs-nfs" "gvfs-smb" "malcontent" "nautilus" "orca" "rygel" "sushi" "xdg-desktop-portal-gnome" "xdg-user-dirs-gtk" "yelp")
#pacstrap -i /mnt
#pacstrap -i /mnt gnome-extra
gnome+=(seahorse)
#pacstrap -i /mnt seahorse
# Sonstiges
other=("avahi" "bluez" "bluez-utils" "pipewire" "pipewire-audio" "pipewire-alsa" "pipewire-pulse" "pipewire-jack" "pipewire-zeroconf" "pipewire-v4l2" "pipewire-docs" "pipewire-roc" "helvum" "wireplumber" "gstreamer" "gst-plugin-pipewire" "gst-libav" "gst-plugins-good" "gst-plugins-base" "xdg-desktop-portal-gnome" "networkmanager" "modemmanager" "networkmanager-openconnect" "networkmanager-openvpn" "networkmanager-pptp" "networkmanager-vpnc" "power-profiles-daemon" "plymouth" "libreoffice-fresh-de" "htop")
pacstrap -i /mnt "${gnome[@]}" "${other[@]}"
#iwd
#cat > /etc/NetworkManager/conf.d/wifi_backend.conf << EOF
#[device]
#wifi.backend=iwd
#EOF
#################################################################
sed -i 's/#\(CHARACTER_SET:\).*/\1utf-8/' /mnt/etc/lynx.cfg
sleep 2
@ -157,6 +194,12 @@ arch-chroot /mnt systemctl enable gdm
arch-chroot /mnt systemctl enable avahi-daemon
arch-chroot /mnt systemctl enable bluetooth
#--------------------------#
########################################
# Initramfs konfigurieren und erzeugen #
########################################
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
sed -i 's/MODULES=()/MODULES=(amdgpu)/' /mnt/etc/mkinitcpio.conf #AMD
elif [[ "${GRAPHICS_CARD}" == "intel" ]]; then
@ -169,13 +212,21 @@ sed -i 's/^HOOKS=(.*)/HOOKS=(base systemd keyboard plymouth autodetect sd-vconso
arch-chroot /mnt mkinitcpio -p "${KERNEL}"
#--------------------------#
#############################################
# Bootloader installieren und konfigurieren #
#############################################
arch-chroot /mnt bootctl install
cat > /mnt/boot/loader/loader.conf << EOF
timeout 5
console-mode max
editor yes
default *
EOF
cat > /mnt/boot/loader/entries/arch.conf << EOF
title Arch Linux
version 0.1
@ -185,10 +236,6 @@ initrd /initramfs-${KERNEL}.img
options quiet rw
EOF
arch-chroot /mnt useradd -mG wheel "${USERNAME}"
arch-chroot /mnt chpasswd <<< "${USERNAME}:${USERPASSWORD}"
#echo "${USERNAME}:${USERPASSWORD}" | chpasswd
umount -R /mnt
exit 0