- 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
##############################################################
# Arch Linux install script
# @author sqram http://sqr.am
# Assumes you use a whole disk for OS, no partitions.
# If you want to use partitions such as /boot /home /var,
# create them manually. mount them manually, and don't use this.
# This will use /dev/sda and /dev/sda1. always.
# This is how i always set up my system, so it caters to me.
# change it according to your own needs if you want
##############################################################
echo -e "what is the \e[1;36mUSER\e[0m to create besides root? "
read arch_user
echo -e "what is your \e[1;36mHOST\e[0m name (user@hostname)? "
read arch_hostname
echo -e "what is the 3 letter \e[1;36mDEVICE\e[0m to install on? (usually sda)? "
read arch_device
# making it sda1
boot_partition=1
os_partition=2
# Partition
echo -e '\e[1;33mPartitioning...\e[0m'
echo '---------------------------------'
parted /dev/$arch_device mklabel gpt
parted /dev/$arch_device mkpart P1 fat32 1MiB 512MiB
parted /dev/$arch_device mkpart P2 ext2 512MiB 100%
parted /dev/$arch_device set $boot_partition boot on
echo
# Format partitions created
echo -e '\e[1;33mFormatting...\e[0m'
echo '---------------------------------'
mkdir /mnt/boot
mkfs.ext4 /dev/$arch_device$os_partition
mkfs.fat -F32 /dev/$arch_device$boot_partition
mount /dev/$arch_device$os_partition /mnt
mount /dev/$arch_device$boot_partition /mnt/boot
echo
# Install the base system with some other packages
echo -e '\e[1;33mPacstrapping...\e[0m'
echo '---------------------------------'
pacstrap /mnt base base-devel grub-bios dialog wpa_supplicant wireless_tools netctl zsh
echo
# Generate fstab so you can boot
echo -e '\e[1;33mGenerating fstab...\e[0m'
echo '---------------------------------'
genfstab -U /mnt >> /mnt/etc/fstab
echo
curl https://storage.googleapis.com/www.sqr.am/sqram-install2.sh -o /mnt/sqram-install2.sh
arch-chroot /mnt /usr/bin/zsh sqram-install2.sh $arch_user $arch_hostname
## NOTE
# unfortunatelly, because this script is broken into two parts
# the variables here are lost in the installation script pt2.
# try to find a way to use a single script only. the issue is that
# when you call arch-chroot, you're in a new shell and this
# script halts -- or -- pass these variables as arguments to
# sqram-install2.sh (currently doing this)