Last active
December 2, 2024 02:02
-
-
Save rickhull/fea66e9689d2f0b310034fb48bb88d53 to your computer and use it in GitHub Desktop.
Arch Install
This file contains hidden or 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
#!/bin/bash | |
set -e | |
HOSTNAME="dummy" | |
IFACE="eth0" | |
LANG="en_US.UTF-8" | |
TIMEZONE="America/New_York" | |
# Hostname | |
echo $HOSTNAME > /etc/hostname | |
hostnamectl set-hostname $HOSTNAME | |
# Hosts | |
cat <<EOF > /etc/hosts | |
127.0.0.1 localhost | |
127.0.1.1 $HOSTNAME | |
::1 localhost | |
EOF | |
# Time | |
ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime | |
hwclock --systohc | |
# Locale | |
echo $LANG UTF-8 > /etc/locale.gen | |
locale-gen | |
cat <<EOF > /etc/locale.conf | |
LANG=$LANG | |
LC_ALL=$LANG | |
EOF | |
# Network | |
cat <<EOF > /etc/systemd/network/$IFACE.network | |
[Match] | |
Name=$IFACE | |
[Network] | |
DHCP=yes | |
EOF | |
# Enable services | |
systemctl enable systemd-networkd | |
systemctl enable systemd-resolved | |
systemctl enable sshd | |
# Boot loader | |
bootctl install | |
cat <<EOF > /boot/loader/loader.conf | |
default arch.conf | |
timeout 3 | |
console-mode max | |
editor no | |
EOF | |
cat <<EOF > /boot/loader/entries/arch.conf | |
title Arch Linux | |
linux /vmlinuz-linux | |
initrd /initramfs-linux.img | |
options root=/dev/sda2 rw | |
EOF | |
passwd |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
# remove any LVM VGs, PVs, LVs | |
# Assuming /dev/sda with GPT for Gen2 Hyper-V | |
sgdisk -Z /dev/sda # zap existing partitions | |
sgdisk -n 1:0:+512M -t 1:ef00 /dev/sda # EFI | |
sgdisk -n 2:0:0 -t 2:8300 /dev/sda # Root | |
# Format | |
mkfs.fat -F32 /dev/sda1 | |
mkfs.ext4 /dev/sda2 | |
# Mount | |
mount /dev/sda2 /mnt | |
mkdir -p /mnt/boot | |
mount /dev/sda1 /mnt/boot | |
# Base install with our chosen packages | |
# consider intel-ucode or amd-ucode here too | |
pacstrap -K /mnt base linux linux-firmware \ | |
sudo openssh \ | |
emacs-nox git \ | |
man-db man-pages | |
# Generate fstab | |
genfstab -U /mnt >> /mnt/etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment