Last active
July 8, 2020 14:23
-
-
Save yevshev/2fad8fd517d17c5231f885ceca6e9617 to your computer and use it in GitHub Desktop.
arch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update system clock | |
timedatectl set-ntp true | |
timedatectl set-timezone America/Chicago | |
# Partition | |
printf "n\n1\n4096\n+512M\nef00\nw\ny\n" | gdisk /dev/nvme0n1 | |
printf "n\n2\n\n\n8300\nw\ny\n" | gdisk /dev/nvme0n1 | |
# format | |
yes | mkfs.fat -F32 /dev/nvme0n1p1 | |
yes | mkfs.f2fs /dev/nvme0n1p2 | |
# mount | |
mount /dev/nvme0n1p2 /mnt/ | |
mkdir /mnt/boot | |
mount /dev/nvme0n1p1 /mnt/boot | |
# Install base | |
yes '' | pacstrap /mnt base linux linux-firmware dhcpcd amd-ucode mesa | |
# Generate fstab | |
genfstab -U /mnt >> /mnt/etc/fstab | |
### Chroot | |
arch-chroot /mnt <<EOF | |
# time | |
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime | |
hwclock --systohc | |
# locale | |
echo LANG=en_US.UTF-8 > /etc/locale.conf | |
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen | |
locale-gen | |
# network | |
echo arch > /etc/hostname | |
systemctl enable dhcpcd | |
# bootloader | |
bootctl --path=/boot install | |
mkdir -p /boot/loader/ | |
touch /boot/loader/loader.conf | |
tee -a /boot/loader/loader.conf << END | |
default arch | |
timeout 1 | |
editor 0 | |
END | |
# entries | |
touch /boot/loader/entries/arch.conf | |
tee -a /boot/loader/entries/arch.conf << END | |
title ArchLinux | |
linux /vmlinuz-linux | |
initrd /amd-ucode.img | |
initrd /initramfs-linux-lts.img | |
options root=/dev/nvme0n1p2 rw | |
END | |
# pacman hook | |
mkdir -p /etc/pacman.d/hooks/ | |
touch /etc/pacman.d/hooks/systemd-boot.hook | |
tee -a /etc/pacman.d/hooks/systemd-boot.hook << END | |
[Trigger] | |
Type = Package | |
Operation = Upgrade | |
Target = systemd | |
[Action] | |
Description = Updating systemd-boot | |
When = PostTransaction | |
Exec = /usr/bin/bootctl update | |
END | |
# initramfs | |
mkinitcpio -P | |
EOF | |
umount -R /mnt | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment