-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
95 lines (75 loc) · 2.25 KB
/
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
#!/bin/bash
source ./config.sh
# Pre-installation --------------------------------------------------------------------------------------------------
# Load the right Keymap
echo "Setting the keyboard layout"
loadkeys $KEYMAP
# Verify the boot mode
# If the command shows the directory without error, then the system is booted in UEFI mode
# If the directory does not exist, the system may be booted in BIOS (or CSM) mode
echo "Verifying the boot mode"
echo "If the command shows the directory without error, then the system is booted in UEFI mode"
echo "If the directory does not exist, the system may be booted in BIOS (or CSM) mode"
ls /sys/firmware/efi/efivars
sleep 5
# Connect to the internet
# Not necessary when Ethernet
# TO-DO Wi-Fi
# Update the system clock
echo "Updating the system clock"
timedatectl set-ntp true
# TO-DO -----------------------------------
# Partition the disk /dev/sda
echo "Partitioning the disk /dev/sda"
(
echo g
echo n # Add a new partition
echo 1 # Partition number
echo # First sector (Accept default: 1)
echo +550M
echo t
echo 1
echo n # Add a new partition
echo 2 # Partition number
echo # First sector (Accept default: 1)
echo +4G
echo t
echo 2
echo 19
echo n # Add a new partition
echo 3 # Partition number
echo # First sector (Accept default: 1)
echo
echo w # Write changes
) | fdisk /dev/sda
# TO-DO -----------------------------------
# Format the partitions
echo "Ext4 file system on /dev/sda"
mkfs.ext4 /dev/sda3
echo "Initializing swap"
mkswap /dev/sda2
mkfs.fat -F32 /dev/sda1
# Mounting the file systems
echo "Mounting root volume sda3"
mount /dev/sda3 /mnt
echo "Enabling swap"
swapon /dev/sda2
# Installation ------------------------------------------------------------------------------------------------------
# Select the mirrors
# TO-DO
# Installing essential packages
pacstrap /mnt base linux linux-firmware
# Configure the system ----------------------------------------------------------------------------------------------
# Generating fstab file
echo "Generating fstab file"
genfstab -U /mnt >> /mnt/etc/fstab
# Chroot
echo "Chroot"
cp chroot_script.sh /mnt
cp config.sh /mnt
read -n 1 -s -r -p "Press any key to continue"
arch-chroot /mnt
# After Chroot
rm /mnt/chroot_script.sh
rm /mnt/config.sh
umount -l /mnt