-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase-install.sh
executable file
·117 lines (74 loc) · 5.6 KB
/
base-install.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
##############################################################################
# Copyright (C) 2024 Antonio Manuel Hernández De León
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
##############################################################################
#Usage: ./base-install.sh |& tee base-install.log
username=""
hostname=""
efi_partition_name=""
no_confirmation="--noconfirm"
if [[ $username == "" || $hostname == "" || $efi_partition_name == "" ]]; then
echo "Initialize the required data first"
exit
fi
#Clock and time zone
echo -e "------------------------------Clock, time zone and languages------------------------------"
ln -sf /usr/share/zoneinfo/Europe/Dublin /etc/localtime #Configure the time zone
hwclock --systohc #Set the Hardware clock from the System Clock
timedatectl set-local-rtc 1 --adjust-system-clock #To avoid time issues when changing to Windows
sed -i -e 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen #Enable sudo privilege to the wheel group
locale-gen #Generate the locales
echo "LANG=en_US.UTF-8" > /etc/locale.conf #Specify which language will be used by default
echo "KEYMAP=es" > /etc/vconsole.conf #Specify the keyboard layout
#Hostname
echo -e "\n------------------------------Hostname------------------------------"
echo $hostname > /etc/hostname #Specify the hostname
echo -e "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 $hostname" >> /etc/hosts #Configure local host name resolution to some programs
#Network
echo -e "\n------------------------------Network------------------------------"
systemctl enable NetworkManager #Enable NetworkManager service
#Users
echo -e "\n------------------------------Users------------------------------"
echo "Type the root password"
passwd #Set the root password
useradd -m -G wheel $username #Create a non-root user
echo "Type the $username password"
passwd $username #Set the password of the non-root user
sed -i -e "s/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/g" /etc/sudoers #Enable sudo privilege to the wheel group
#Base software 1
echo -e "\n------------------------------Base software 1------------------------------"
pacman -Syy
pacman -S intel-ucode $no_confirmation #Install Intel microcode
pacman -S grub efibootmgr os-prober $no_confirmation #Install grub bootloader
#Bootloader
echo -e "\n------------------------------Bootloader------------------------------"
mkdir /boot/efi && mount /dev/$efi_partition_name /boot/efi #Create an EFI directory and mount the EFI partition
grub-install --target=x86_64-efi --bootloader-id=arch_linux #Install grub in the newly mounted EFI partition
sed -i -e 's/#GRUB_DISABLE_OS_PROBER/GRUB_DISABLE_OS_PROBER/g' /etc/default/grub #Enable OS prober
sed -i -e 's/#GRUB_DISABLE_SUBMENU/GRUB_DISABLE_SUBMENU/g' /etc/default/grub #Disable grub submenu
sed -i -e 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub #Set GRUB_TIMEOUT=0
grub-mkconfig -o /boot/grub/grub.cfg #Generate grub configuration file
#Base software 2
echo -e "\n------------------------------Base software 2------------------------------"
pacman -S xorg-server $no_confirmation #Install Xorg
pacman -S xf86-video-intel nvidia nvidia-utils $no_confirmation #Install Intel and Nvidia graphics drivers
pacman -S plasma plasma-workspace $no_confirmation #Install plasma desktop environment
#Display manager
echo -e "\n------------------------------Display manager------------------------------"
systemctl enable sddm #Enable the plasma display manager
#Upgrade
echo -e "\n------------------------------Upgrade------------------------------"
pacman -Syu $no_confirmation