banditelol
10/6/2014 - 12:32 AM

uefisetup.sh

# **************** READ THIS FIRST ******************
#
# This is not a script for you to run. I repeat, do not download and run this!
#
# This is only a guide to show the required steps for successful UEFI + GRUB2 installation
# Many of the choices are examples or assumptions; don't blindly type shit into your machine
# until/unless you at least read the comments around each command
#
# These steps assume you've booted in UEFI mode by preparing your USB stick per these instructions:
# https://wiki.archlinux.org/index.php/UEFI#Archiso
#
# If you're using an actual CD burned from the official Arch ISO, just make sure you've booted it in UEFI mode

# Assuming /dev/sda is the target disk
parted /dev/sda # or gdisk or cgdisk or etc...
# Make a partition of type EF00 (EFI System Partition, or ESP)
# Might want to name it something useful like "efi"
# Make your other partition(s) as you see fit

# Create ESP filesystem
mkfs.vfat -F32 -n efi /dev/sda1 # -F## is not required on most firmwares; FAT12/16 usually work

# In this example, I'm using btrfs
mkfs.btrfs -KL root /dev/sda2

# Mount the needful -- note the btrfs-specific mount options
mount -o ssd,discard,noatime,compress=lzo /dev/sda2 /mnt
mkdir -p /mnt/boot # Or /mnt/boot/efi if you *only* want the grub binary on the ESP
mount -o noatime /dev/sda1 /mnt/boot # See above

# Networking stuff
# ...

# Install as per usual, but snag grub-efi
pacstrap /mnt base base-devel grub-efi-x86_64

# Facestab needfuls
genfstab -pU /mnt >> /mnt/etc/fstab

# Chroot, and gimme some bash plox
arch-chroot /mnt /bin/bash

# Do other installation needfuls
# ...

# Bootloader install
grub-install

# Can check/modify UEFI firmware entries
efibootmgr # -t 0 for timeout, -b xxxx -B xxxx to delete, etc

# Generate grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg

# Exit chroot
exit

# Rebooten Sie!
reboot