-
Notifications
You must be signed in to change notification settings - Fork 0
/
manual_installation.sh
executable file
·55 lines (48 loc) · 1.94 KB
/
manual_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
#!/bin/bash
# Installation based on https://wiki.archlinux.org/title/Installation_guide
# 1. Pre-installation
download_and_verify_iso() {
echo "****************************************"
echo "*** 1.1 Aquire an installation image ***"
echo "****************************************"
curl -s -o arch_checksums.html https://archlinux.org/download/#checksums
ARCH_RELEASE=$(cat arch_checksums.html | grep -oP 'Current Release:.*?\K[0-9.]+')
ISO_CHECKSUM=$(cat arch_checksums.html | grep -oP 'SHA256:.*?\K([0-9a-fA-F]{64})')
ISO_FILENAME="archlinux-${ARCH_RELEASE}-x86_64.iso"
ISO_DL_PATH="https://ftp.lysator.liu.se/pub/archlinux/iso/${ARCH_RELEASE}/${ISO_FILENAME}"
rm arch_checksums.html
wget -q -c --show-progress -O "$ISO_FILENAME" "$ISO_DL_PATH"
echo "Download complete..."
echo ""
echo "****************************"
echo "*** 1.2 Verify signature ***"
echo "****************************"
DOWNLOADED_ISO_CHECKSUM=$(sha256sum "${ISO_FILENAME}" | awk '{print $1}')
echo "Wanted SHA256 Checksum: $ISO_CHECKSUM"
echo "Actual SHA256 Checksum: $DOWNLOADED_ISO_CHECKSUM"
[ "$ISO_CHECKSUM" != "$DOWNLOADED_ISO_CHECKSUM" ] && \
{ echo "Checksum error on downloaded ISO. Rerun the script..."; exit 1; }
echo "Checksum is OK..."
}
write_iso() {
echo ""
echo "******************************************"
echo "*** 1.3 Prepare an installation medium ***"
echo "******************************************"
echo "Partitions:"
sudo parted -l | grep "Disk /"
echo ""
echo "Run the following command with the correct value for 'of='"
echo ""
echo "sudo dd if=${ISO_FILENAME} of=/dev/sdX bs=4M status=progress && sync"
}
main() {
echo "**********************************************"
echo "* Arch Linux Installation - Pre-installation *"
echo "**********************************************"
echo ""
download_and_verify_iso
write_iso
exit
}
main