-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInstallation.sh
56 lines (44 loc) · 1.76 KB
/
Installation.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
echo "Installation"
# Set the hostname
read -p "Set hostname: " hostName
echo $hostName > /etc/hostname
# Set the root password
echo "Set root password:"
passwd
# Set timezone (or use tzselect)
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
# Set locales and generate them
echo "LANG="en_US.UTF8 > /etc/locale.conf
echo "LANGUAGE=fen_US" >> /etc/locale.conf
echo "KEYMAP=us" > /etc/vconsole.conf
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "en_US ISO-8859-1" >> /etc/locale.gen
locale-gen
# Fix pacman: Signature is unknown trust
rm -Rf /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
# Configure mkinitcpio
sed -i '/^HOOKS=/s/block/block keymap encrypt/' /etc/mkinitcpio.conf
# Create a new initial RAM disk
mkinitcpio -p linux
# Install microcode for Intel processors
pacman -Syyu --noconfirm
pacman -S --noconfirm intel-ucode
# Install and configure the Bootloader
bootctl install
ROOT="$(find -L /dev/disk/by-partuuid -samefile /dev/sdb3 | cut -d/ -f5)"
echo "title Arch Linux" > /boot/loader/entries/arch.conf
echo "linux /vmlinuz-linux" >> /boot/loader/entries/arch.conf
echo "initrd /intel-ucode.img" >> /boot/loader/entries/arch.conf
echo "initrd /initramfs-linux.img" >> /boot/loader/entries/arch.conf
echo "options cryptdevice=PARTUUID=$ROOT:root root=/dev/mapper/root quite rw" >> /boot/loader/entries/arch.conf
echo "default arch" > /boot/loader/loader.conf
echo "editor 0" >> /boot/loader/loader.conf
cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-lts.conf
sed -i '/title/s/$/ LTS/' /boot/loader/entries/arch-lts.conf
sed -i '/vmlinuz/s/$/-lts/' /boot/loader/entries/arch-lts.conf
sed -i '/initramfs/s/linux/linux-lts/' /boot/loader/entries/arch-lts.conf
# Run Post-Installation.sh
/arch-setup/Post-Installation.sh