Skip to content

Instantly share code, notes, and snippets.

@sxlijin
Last active February 2, 2017 19:11
Show Gist options
  • Save sxlijin/be5611f484aeb67fb3fe226426f9d941 to your computer and use it in GitHub Desktop.
Save sxlijin/be5611f484aeb67fb3fe226426f9d941 to your computer and use it in GitHub Desktop.
Bring up an Arch system from live disk.
#!/bin/bash
set -e
sfdisk /dev/sda <<EOF
/dev/sda1 : start=2048, size=2048, type= 4, bootable
/dev/sda2 : start=4096, type=20
EOF
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt
pacman -Sy --noconfirm archlinux-keyring
pacstrap /mnt base
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt <<EOF
# this line should be customized for the locale
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
hwclock --systohc
sed -i "s/^#\(en_US.UTF-8 UTF-8\)/\1/" /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "arch-box" > /etc/hostname
useradd -m -G wheel -s /bin/bash pockets
passwd pockets
hunter123
hunter123
pacman -Sy --noconfirm grub sudo
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
sudo sed -i "s/^# \(%wheel ALL=(ALL) ALL\)/\1/" /etc/sudoers
exit 0
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment