Skip to content

Instantly share code, notes, and snippets.

@erikbye
Created May 6, 2020 11:10
Show Gist options
  • Save erikbye/cdc92360107aa48495cb8401cd6a6681 to your computer and use it in GitHub Desktop.
Save erikbye/cdc92360107aa48495cb8401cd6a6681 to your computer and use it in GitHub Desktop.
arch
# disable PC speaker
rmmod pcspkr
loadkeys no
# check if UEFI or BIOS
ls /sys/firmware/efi/efivars
echo "If output above displays files you're using UEFI, if directory does not exist you're using BIOS."
ip link
echo "Use wifi-menu if you need to setup wifi for internet connectivity."
timedatectl set-ntp true
# ** PARTITIONING **
# partition requirements for UEFI:
# - one partition for the root directory, /
# - one EFI system partition
# we will also create a Linux swap partition
# sda1 1GB EFI System
# sda2 2GB Linux Swap
# sda3 Linux filesystem
# show disk info
fdisk -:
echo "Use cfdisk to partition your disk now, then reboot, and run commands below after:"
echo "mkfs.ext4 /dev/sda:"
echo "mkswap /dev/sda2"
echo "swapon /dev/sda2"
echo "mount sda3 at /mnt and sda1 at /mnt/efi"
echo "no need to mount swap partition."
# Install essential packages
pacstrap /mnt base base-devel linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab # try -I instead of -U
cat /mnt/etc/fstab
echo "You can pacman to install additional packages, after chrooting."
# ** CHROOT **
arch-chroot /mnt
# timezone
ln -sf /usr/share/zoneinfo/Europe/Oslo /etc/localtime
hwclock --systohc
# locale
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "KEYMAP=no" > /etc/vconsole.conf
# hostname
echo "manhattan" > /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 manhattan.localdomain manhattan" >> /etc/hosts
# common packages
pacman -S man-db man-pages texinfo vim iw networkmanager iputils xorg \
xorg-server xorg-apps xorg-xinit openssh iproute2 dhcpcd emacs tmux \
firefox zsh zsh-completions i3-wm plasma-meta plasma-wayland-session \
kde-applications-meta qemu libvirt virt-manager ebtables iptables \
dnsmasq ttf-fira-code ttf-hack ttf-anonymous-pro adobe-source-code-pro-fonts \
sddm intel-ucode screenfetch neofetch \
--noconfirm
# run screenfetch on terminal start
echo 'screenfetch -c "8;1,7;1"' >> ~/.bashrc
virsh net-start default
virsh auto-start default
# my emacs config
git clone https://github.com/erikbye/deadmacs ~/.emacs.d/
# set root password
passwd
# boot loader
pacman -S grub efibootmgr --noconfirm
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable dhcpcd
systemctl enable sddm
# exit chroot
exit
umount -R /mnt
reboot
# network configuration
ip link
ip link set <interface> up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment