2023-07-16 20:55:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Einfache Version #
|
|
|
|
####################
|
|
|
|
|
2023-07-16 22:24:29 +00:00
|
|
|
# processor micricode: amd-ucode|intel-ucode
|
2023-07-16 20:55:29 +00:00
|
|
|
MICROCODE="amd-ucode"
|
2023-07-16 22:24:29 +00:00
|
|
|
# kernel: linux|linux-lts|linux-zen
|
2023-07-16 20:55:29 +00:00
|
|
|
KERNEL="linux"
|
|
|
|
# hostname: arch
|
|
|
|
HOSTNAME_NEW="arch"
|
|
|
|
# rootpassword: testen
|
|
|
|
ROOTPASSWORD="testen"
|
|
|
|
# username: eichehome
|
|
|
|
USERNAME="eichehome"
|
|
|
|
# userpassword: testen
|
|
|
|
USERPASSWORD="testen"
|
2023-07-16 22:24:29 +00:00
|
|
|
# graphics card: amd|intel|nvidia
|
2023-07-16 20:55:29 +00:00
|
|
|
GRAPHICS_CARD="amd"
|
|
|
|
# timezone: Europe/Berlin
|
|
|
|
TIMEZONE="Europe/Berlin"
|
|
|
|
# language: de_DE.UTF-8
|
|
|
|
LANG="de_DE.UTF-8"
|
|
|
|
|
|
|
|
# Drive: /dev/vda
|
|
|
|
DRIVE="/dev/vda"
|
|
|
|
# disklayout: ESP (512MiB), Root (100% - 512MiB)
|
|
|
|
|
|
|
|
###########################
|
|
|
|
|
|
|
|
#Discoverable Partitions Specification
|
|
|
|
sgdisk -og "${DRIVE}"
|
|
|
|
sgdisk -n 0:0:+512M -t 0:C12A7328-F81F-11D2-BA4B-00A0C93EC93B -c 0:efi "${DRIVE}"
|
|
|
|
#sgdisk -n 0:0:+512M -t 0:ef00 -c 0:ESP "${DRIVE}"
|
|
|
|
sgdisk -n 0:0:0 -t 0:4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 -c 0:root "${DRIVE}"
|
|
|
|
|
|
|
|
mkfs.vfat -n EFI -F 32 /dev/vda1
|
|
|
|
mkfs.ext4 -L root /dev/vda2
|
|
|
|
|
|
|
|
mount /dev/vda2 /mnt
|
2023-07-16 21:13:09 +00:00
|
|
|
mkdir -p /mnt/boot
|
|
|
|
mount /dev/vda1 /mnt/boot
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
#ln -sf /run/systemd/resolve/stub-resolv.conf /mnt/etc/resolv.conf # tmpfiles.d macht das
|
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
pacstrap -i /mnt base linux-firmware vim git "${KERNEL}" "${MICROCODE}" #dracut
|
2023-07-16 21:52:11 +00:00
|
|
|
#arch-chroot /mnt
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
# ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime -> L /etc/localtime - - - - "/usr/share/zoneinfo/${TIMEZONE}"
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt hwclock --systohc
|
|
|
|
arch-chroot /mnt rm -rf /mnt/etc/localtime
|
|
|
|
arch-chroot /mnt ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /mnt/etc/localtime
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/#\(Color\)/\1/' /mnt/etc/pacman.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
# Umbruch notwendug
|
|
|
|
sed -i 's/#\(ParallelDownloads\s=\s5\)/\1\
|
2023-07-16 22:01:36 +00:00
|
|
|
ILoveCandy/' /mnt/etc/pacman.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i "s/#\(${LANG}\)/\1/" /mnt/etc/locale.gen
|
|
|
|
arch-chroot /mnt locale-gen
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
echo "LANG=${LANG}" > /mnt/etc/locale.conf
|
|
|
|
echo "KEYMAP=${KEYMAP}" > /mnt/etc/vconsole.conf
|
|
|
|
echo "${HOSTNAME_NEW}" > /mnt/etc/hostname
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/hosts << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
127.0.0.1 localhost
|
|
|
|
::1 localhost
|
|
|
|
127.0.1.1 ${HOSTNAME_NEW}.localedomain ${HOSTNAME_NEW}
|
|
|
|
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
|
2023-07-16 22:04:52 +00:00
|
|
|
arch-chroot /mnt chpasswd <<< "root:${ROOTPASSWORD}"
|
|
|
|
#echo root:"${ROOTPASSWORD}" | chpasswd
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
pacstrap -i /mnt base-devel "${KERNEL}-header"
|
|
|
|
pacstrap -i /mnt opendoas firewalld iptables-nft openssh bash-completion man-db man-pages reflector xdg-user-dirs
|
2023-07-16 20:55:29 +00:00
|
|
|
#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
|
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
pacstrap -i /mnt efibootmgr mtools dosfstools
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
|
|
|
|
pacstrap -i /mnt xf86-video-amdgpu
|
|
|
|
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
|
|
|
|
pacstrap -i /mnt nvidia nvidia-utils nvidia-settings
|
2023-07-16 20:55:29 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# GNOME installieren
|
2023-07-16 22:42:49 +00:00
|
|
|
pacstrap -i /mnt gnome gnome-extra gdm 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
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
#################################################################
|
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/#\(CHARACTER_SET:\).*/\1utf-8/' /mnt/etc/lynx.cfg
|
2023-07-16 22:43:39 +00:00
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/xdg/reflector/reflector.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
--save /etc/pacman.d/mirrorlist
|
|
|
|
--country Germany
|
|
|
|
--protocol https
|
|
|
|
--latest 5
|
|
|
|
EOF
|
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/doas.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
permit :wheel
|
|
|
|
permit persist eichehome as root
|
|
|
|
EOF
|
|
|
|
#echo "permit :wheel" > /etc/doas.conf
|
|
|
|
#echo "permit persist eichehome as root" >> /etc/doas.conf
|
|
|
|
#echo "" >> /etc/doas.conf
|
2023-07-16 22:43:39 +00:00
|
|
|
arch-chroot /mnt doas -C /etc/doas.conf && echo "config ok" || echo "config error"
|
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/systemd/resolved.conf.d/disable-multicastDNS.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
[Resolve]
|
|
|
|
MulticastDNS=no
|
|
|
|
EOF
|
2023-07-16 22:43:39 +00:00
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt systemctl enable systemd-resolved
|
|
|
|
arch-chroot /mnt systemctl enable systemd-timesyncd
|
|
|
|
arch-chroot /mnt systemctl enable reflector.timer
|
|
|
|
arch-chroot /mnt systemctl enable firewalld
|
|
|
|
arch-chroot /mnt systemctl enable fstrim.timer
|
|
|
|
arch-chroot /mnt systemctl enable gdm
|
|
|
|
arch-chroot /mnt systemctl enable avahi-daemon
|
|
|
|
arch-chroot /mnt systemctl enable bluetooth
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(amdgpu)/' /mnt/etc/mkinitcpio.conf #AMD
|
2023-07-16 22:28:08 +00:00
|
|
|
elif [[ "${GRAPHICS_CARD}" == "intel" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(i915)/' /mnt/etc/mkinitcpio.conf #Intel
|
2023-07-16 22:28:08 +00:00
|
|
|
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(nvidia)/' /mnt/etc/mkinitcpio.conf #Nvidia
|
2023-07-16 20:55:29 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/^HOOKS=(.*)/HOOKS=(base systemd keyboard plymouth autodetect sd-vconsole modconf kms block filesystems fsck)/' /mnt/etc/mkinitcpio.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt mkinitcpio -p "${KERNEL}"
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt bootctl install
|
|
|
|
cat > /mnt/boot/loader/loader.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
timeout 5
|
|
|
|
console-mode max
|
|
|
|
editor yes
|
|
|
|
default *
|
|
|
|
EOF
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/boot/loader/entries/arch.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
title Arch Linux
|
|
|
|
version 0.1
|
|
|
|
linux /vmlinuz-${KERNEL}
|
|
|
|
initrd /${MICROCODE}.img
|
|
|
|
initrd /initramfs-${KERNEL}.img
|
|
|
|
options quiet rw
|
|
|
|
EOF
|
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt useradd -mG wheel "${USERNAME}"
|
|
|
|
arch-chroot /mnt chpasswd <<< "${USERNAME}:${USERPASSWORD}"
|
|
|
|
#echo "${USERNAME}:${USERPASSWORD}" | chpasswd
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:44:52 +00:00
|
|
|
umount -R /mnt
|
|
|
|
|
2023-07-16 22:28:45 +00:00
|
|
|
exit 0
|