Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Part 2 of Arch-Setup.sh Arch Linux Setup Script
- # This script, created by James Triantafylos, will install and configure Arch Linux from start to finish.
- # Instructions:
- # - RUN PART 1 OF THIS SCRIPT FIRST
- # - Execute this script with ./Arch-Setup-Part2.sh
- # Requirments:
- # - A wired network connection
- # - A disk over 24GB in size
- # - UEFI boot capability
- # Goto function for BASH
- function goto
- {
- label=$1
- cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
- eval "$cmd"
- exit
- }
- # Setup locales
- echo "Setting up locales..."
- sed -i '/#en_US.UTF-8 UTF-8/c\en_US.UTF-8 UTF-8' /etc/locale.gen
- locale-gen
- echo LANG=en_US.UTF-8 > /etc/locale.conf
- export LANG=en_US.UTF-8
- echo ""
- # Setup timezone and clock
- echo "Setting up timezone and clock..."
- ln -s /usr/share/zoneinfo/Canada/Eastern /etc/localtime
- hwclock --systohc --utc
- echo ""
- # Setup hostname
- echo "Pick your hostname: (Eg. Arch-PC)"
- read HOSTNAME
- echo $HOSTNAME > /etc/hostname
- sed -i '/127.0.0.1/c\127.0.0.1 localhost.localdomain localhost $HOSTNAME' /etc/hosts
- sed -i '/::1/c\::1 localhost.localdomain localhost $HOSTNAME' /etc/hosts
- echo ""
- # Enable network service
- echo "Enabling network service..."
- systemctl enable dhcpcd.service
- echo ""
- # Pick root password
- echo "Choose your root password:"
- echo ""
- passwd
- echo ""
- # Install and setup Gummiboot
- echo "Installing bootloader... (Gummiboot)"
- pacman -S --noconfirm dosfstools efibootmgr
- pacman -S --noconfirm gummiboot
- gummiboot --path=/boot install
- echo ""
- echo "Writing bootloader configuration files..."
- cat > /boot/loader/entries/arch.conf << EOF
- title Arch Linux
- linux /vmlinuz-linux
- initrd /initramfs-linux.img
- options root=/dev/sda2 rw
- EOF
- cat > /boot/loader/loader.conf << EOF
- default arch
- timeout 10
- EOF
- echo ""
- # Installing Wget
- echo "Installing Wget..."
- pacman -S --noconfirm wget
- echo ""
- # Download Part 3 of the setup to the system
- echo "Downloading Part 3 of Arch Linux Setup..."
- wget http://pastebin.com/download.php?i=hREKWvpZ -O /root/Arch-Setup-Part3.sh
- chmod 777 /root/Arch-Setup-Part3.sh
- sed -i -e 's/\r$//' /root/Arch-Setup-Part3.sh
- echo ""
- # Exit chroot environment and reboot system
- echo ""
- echo "###TYPE exit TO EXIT THE CHROOT ENVIRONMNENT###"
- echo "###AFTER EXITING CHROOT TYPE reboot TO REBOOT THE SYSTEM###"
- echo "###REMOVE INSTALLATION MEDIA AFTER REBOOT###"
- echo "###LOGIN TO ROOT USER AFTER REBOOT###"
- echo "###RUN ./Arch-Setup-Part3.sh AFTER REBOOT TO CONTINUE SETUP###"
- echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement