Update install.sh
This commit is contained in:
parent
31cc977a64
commit
1423b82aa4
46
install.sh
46
install.sh
|
@ -75,9 +75,9 @@ else
|
||||||
echo
|
echo
|
||||||
echo "You have entered different passwords. Try again.."
|
echo "You have entered different passwords. Try again.."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
echo
|
||||||
|
|
||||||
# Setting hostname.
|
# Setting hostname.
|
||||||
echo "Before installing the system, please enter a hostname:"
|
echo "Before installing the system, please enter a hostname:"
|
||||||
|
@ -86,7 +86,7 @@ read host
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Setting root password.
|
# Setting root password.
|
||||||
echo "Please enter a password for the root account:"
|
echo "Choose a password for the root account:"
|
||||||
while [ -z "$pwr" ]; do
|
while [ -z "$pwr" ]; do
|
||||||
echo "Please enter a password: "
|
echo "Please enter a password: "
|
||||||
read -s pwfr
|
read -s pwfr
|
||||||
|
@ -100,9 +100,9 @@ else
|
||||||
echo
|
echo
|
||||||
echo "You have entered different passwords. Try again.."
|
echo "You have entered different passwords. Try again.."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
echo
|
||||||
|
|
||||||
# Setting username
|
# Setting username
|
||||||
echo "And please enter a username:"
|
echo "And please enter a username:"
|
||||||
|
@ -110,7 +110,7 @@ read user
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Setting user password.
|
# Setting user password.
|
||||||
echo "Also please enter a password for your user:"
|
echo "Also please choose a password for your user:"
|
||||||
while [ -z "$pwu" ]; do
|
while [ -z "$pwu" ]; do
|
||||||
echo "Please enter a password: "
|
echo "Please enter a password: "
|
||||||
read -s pwfr
|
read -s pwfr
|
||||||
|
@ -160,20 +160,20 @@ lsblk | grep "$dev"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Get new variable.
|
# Get new variable.
|
||||||
main=$(dev)2
|
main=${dev}2
|
||||||
|
|
||||||
# Encrypting partition.
|
# Encrypting partition.
|
||||||
echo "Encrypting system partition. This might take a while."
|
echo "Encrypting system partition. This might take a while."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo -en "&pwcr\n$pwcr" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$main &&
|
echo -en "$pwcr\n$pwcr" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$main &&
|
||||||
echo "Partition successfully encrypted."
|
echo "Partition successfully encrypted."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Opening encrypted partition and mounting at /dev/mapper/lvm.
|
# Opening encrypted partition and mounting at /dev/mapper/lvm.
|
||||||
echo "Decrypting.. This also might take a while."
|
echo "Decrypting.. This also might take a while."
|
||||||
echo
|
echo
|
||||||
echo -en "&pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main lvm &&
|
echo -en "$pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main lvm &&
|
||||||
echo "Partition successfully opened."
|
echo "Partition successfully opened."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ echo
|
||||||
echo "Creating the filesystem."
|
echo "Creating the filesystem."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
boot=$(dev)1
|
boot=${dev}1
|
||||||
|
|
||||||
mkfs.fat -F 32 -n UEFI /dev/$boot &&
|
mkfs.fat -F 32 -n UEFI /dev/$boot &&
|
||||||
echo "Filesystem for boot successfully created."
|
echo "Filesystem for boot successfully created."
|
||||||
|
@ -259,8 +259,6 @@ genfstab -Up /mnt > /mnt/etc/fstab &&
|
||||||
echo "Installed fstab."
|
echo "Installed fstab."
|
||||||
|
|
||||||
# Setting hostname.
|
# Setting hostname.
|
||||||
echo "Please enter a hostname:"
|
|
||||||
read host &&
|
|
||||||
echo $host > /mnt/etc/hostname
|
echo $host > /mnt/etc/hostname
|
||||||
echo "Hostname set."
|
echo "Hostname set."
|
||||||
|
|
||||||
|
@ -300,41 +298,28 @@ arch-chroot /mnt systemctl enable NetworkManager sddm &&
|
||||||
echo
|
echo
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|
||||||
|
# Set root password
|
||||||
echo "Setting root password:"
|
echo "Setting root password:"
|
||||||
echo -en "&pwrt\n$pwrt" | arch-chroot /mnt passwd
|
echo -en "$pwrt\n$pwrt" | arch-chroot /mnt passwd
|
||||||
|
|
||||||
|
# Install bootloader.
|
||||||
arch-chroot /mnt bootctl install
|
arch-chroot /mnt bootctl install
|
||||||
|
|
||||||
|
# Set bootloader entry.
|
||||||
cat << EOF > /mnt/boot/loader/entries/arch.conf
|
cat << EOF > /mnt/boot/loader/entries/arch.conf
|
||||||
# The title of your systemd-boot entry.
|
|
||||||
title Arch Linux
|
title Arch Linux
|
||||||
|
|
||||||
# Change only when using different kernel, e. g. /vmlinuz-linux-zen.
|
|
||||||
linux /vmlinuz-linux-zen
|
linux /vmlinuz-linux-zen
|
||||||
|
|
||||||
# Uncomment if you have installed the respective Microcode.
|
|
||||||
#initrd /amd-ucode.img
|
#initrd /amd-ucode.img
|
||||||
#initrd /intel-ucode.img
|
#initrd /intel-ucode.img
|
||||||
|
|
||||||
# Change only when using different kernel, e. g. /vmlinuz-linux-zen.
|
|
||||||
initrd /initramfs-linux-zen.img
|
initrd /initramfs-linux-zen.img
|
||||||
|
|
||||||
# Change to the correct device like /dev/sda2.
|
|
||||||
options cryptdevice=/dev/$main:lvm:allow-discards
|
options cryptdevice=/dev/$main:lvm:allow-discards
|
||||||
|
|
||||||
# Change to correct LVM device.
|
|
||||||
options root=/dev/mapper/main-root rw
|
options root=/dev/mapper/main-root rw
|
||||||
|
|
||||||
# Localization options.
|
|
||||||
options lang=de locale=de_DE.UTF-8
|
options lang=de locale=de_DE.UTF-8
|
||||||
|
|
||||||
# Default init is systemd.
|
|
||||||
options init=/usr/lib/systemd/systemd
|
options init=/usr/lib/systemd/systemd
|
||||||
|
|
||||||
# Prints only kernel errors and above on boot.
|
|
||||||
#options loglevel=3
|
#options loglevel=3
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Set bootloader fallback entry.
|
||||||
cat << EOF > /mnt/boot/loader/entries/arch-fallback.conf
|
cat << EOF > /mnt/boot/loader/entries/arch-fallback.conf
|
||||||
title Arch Linux Fallback
|
title Arch Linux Fallback
|
||||||
linux /vmlinuz-linux
|
linux /vmlinuz-linux
|
||||||
|
@ -345,13 +330,16 @@ options lang=de locale=de_DE.UTF-8
|
||||||
options init=/usr/lib/systemd/systemd
|
options init=/usr/lib/systemd/systemd
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Set bootloader.
|
||||||
echo "timeout 1" >> /mnt/boot/loader/loader.conf
|
echo "timeout 1" >> /mnt/boot/loader/loader.conf
|
||||||
echo "default arch.conf" >> /mnt/boot/loader/loader.conf
|
echo "default arch.conf" >> /mnt/boot/loader/loader.conf
|
||||||
|
|
||||||
|
# Set X locale.
|
||||||
arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys
|
arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys
|
||||||
|
|
||||||
|
# Set username, password and group.
|
||||||
arch-chroot /mnt useradd -m $user &&
|
arch-chroot /mnt useradd -m $user &&
|
||||||
echo -en "&pwur\n$pwur" | arch-chroot /mnt passwd $user &&
|
echo -en "$pwur\n$pwur" | arch-chroot /mnt passwd $user &&
|
||||||
arch-chroot /mnt gpasswd -a $user wheel
|
arch-chroot /mnt gpasswd -a $user wheel
|
||||||
|
|
||||||
cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf
|
cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf
|
||||||
|
|
Loading…
Reference in New Issue