-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchinstall
99 lines (76 loc) · 2.81 KB
/
archinstall
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
##Preparation
#sh -c "$(curl -sSL https://johncooknet.github.io/archinstall)"
### Set environment variables
targetdisk="/dev/sda"
rootmnt="/mnt"
locale="en_US.UTF-8"
keymap="us"
timezone="America/New_York"
fontpref="ter-p20b"
hostname="arch-test"
username="osceola"
# For future use: Create SHA512 password hash using any linux os using the command 'mkpasswd -m sha-512'
# Important, must prefix any $ symbols with backslash \ . See sample hash below:
user_password="\$5\$tEV20u.A.3a7znAS\$KiXA2181fwBdkeaIuv8oZtulaMxFvg5bs3ROeduMS97"
# Load keyboard layout (replace de with us, fr, es if needed)
loadkeys "$keymap"
# Increase font size (optional)
setfont "$fontpref"
# Check internet connection
ping -c1 www.archlinux.org
# Check for partitions
lsblk
# Unified Extensible Firmware Interface UEFI with GUID Partition Table (GPT)
# Label disk (sda) as GPT, create 3 partitions (root, swap, boot). uefi requires efi system partition (esp). Spec'd for 32GB virtual disk
wipefs -a -f "$targetdisk"
parted "$targetdisk" -- mklabel gpt
parted "$targetdisk" -- mkpart fat32 1MiB 1025MiB
parted "$targetdisk" -- set 1 esp on
parted "$targetdisk" -- mkpart linux-swap 1025MiB 5121MiB
parted "$targetdisk" -- mkpart ext4 5121MiB 100%
parted "$targetdisk" -- type 3 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
# Reload partition table
sleep 2
partprobe -s "$targetdisk"
sleep 2
# Format partitions
mkfs.fat -F 32 /dev/sda1
mkswap -L swap /dev/sda2
mkfs.ext4 -L archroot -F /dev/sda3
# Mount file system volumes
mount /dev/sda3 /mnt
swapon /dev/sda2
mkdir -p /mnt/{efi,boot,home,.snapshots,var/{cache,log}}
mount /dev/sda1 /mnt/efi
# Install base packages ~2m
pacstrap -K /mnt base linux linux-firmware efibootmgr refind
# Install optional packages for reflector ~1m
# pacstrap -K /mnt base-devel git vim openssh reflector rsync amd-ucode
# Generate fstab --dependant to pacstrap base package
genfstab -U /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
# Chroot to installed sytem
arch-chroot /mnt
# Set hostname
echo archlinux-vm > /etc/hostname
## Install grub bootloader
## pacman -S grub
## grub-install /dev/sda
# Grub installation
#grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB --removable
# Create grub config
#grub-mkconfig -o /boot/grub/grub.cfg
#To add a new boot option using efibootmgr
efibootmgr --create --disk /dev/sda --part 1 --loader '\EFI\refind\refind_x64.efi' --label 'rEFInd Boot Manager' --unicode
# Install gnome desktop environment ~2GB
# pacstrap -K /mnt gnome networkmanager qemu-guest-agent
# Install xfce desktop environment ~1.4GB
# pacstrap -K /mnt xfce4 xfce4-terminal xfce4-goodies sddm kitty firefox nm-connection-editor neofetch mousepad sbctl
# Enable required services
#systemctl enable gdm.service
#systemctl enable NetworkManager.service
# Set root passwd
# passwd
# Shutdown
#exit
#shutdown now