Skip to content

Instantly share code, notes, and snippets.

@sulami
Created March 16, 2015 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sulami/5dc0ca20c6deda1f4c8d to your computer and use it in GitHub Desktop.
Save sulami/5dc0ca20c6deda1f4c8d to your computer and use it in GitHub Desktop.
Arch Installscript
# Arch Install Script
# Confirmed: regular MBR/GPT, LVM MBR, LUKS/LVM MBR, plain LUKS GPT/EFI
# ToDo: RAID, fix GPT+LVM
# vim: ft=sh
(loadkeys de-latin1) # german
(c)fdisk / (c)gdisk # make partitions
# EFI needs a ~200-2000 MB ef00-type fat32 partition as /boot
# regular setup
mkfs.ext4 <partition>
mount <partition> /mnt
# plain luks
cryptsetup -c aes-xts-plain -y -s 512 luksFormat <partition>
cryptsetup luksOpen <partition> <crypt>
mkfs.ext4 /dev/mapper/<crypt>
mount $1 /mnt
mkdir /mnt/boot
mount <partition> /mnt/boot
# lvm
# in case of system-rescue load logical volumes
vgscan
vgchange -ay
mkfs.ext4 <partition> # boot partition
pvcreate <partition>
vgcreate <group> <partition>
lvcreate [-L 10G / -l 100%FREE] -n <name> <group>
mkfs.ext4 /dev/mapper/<group>-<name>
mount !$ /mnt
mkdir /mnt/boot
mount <partition> $! # boot partition
# encrypted lvm
mkfs.ext4 <partition> # boot partition
modprobe dm-crypt
cryptsetup -c aes-xts-plain -y -s 512 luksFormat <partition>
cryptsetup luksOpen <partition> <crypt>
pvcreate /dev/mapper/<crypt>
vgcreate <group> /dev/mapper/<crpyt>
lvcreate [-L 10G / -l 100%FREE] -n <name> <group>
mkfs.ext4 /dev/mapper/<group>-<name>
mount $! /mnt
mkdir /mnt/boot
mount <partition> !$ # boot partition
pacstrap /mnt base (base-devel)
# mount swap(-files)
genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt
pacman -Sy vim
echo hostname > /etc/hostname
# german
echo LANG=de_DE.UTF-8 > /etc/locale.conf
echo LC_COLLATE=C >> !$
echo KEYMAP=de-latin1 > /etc/vconsole.conf
# english
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo LC_COLLATE=C >> !$
echo KEYMAP=us > /etc/vconsole.conf
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
vim /etc/hosts
vim /etc/locale.gen # choose language
locale-gen
vim /etc/modules-load.d/modules.conf # load custom modules
(vim /etc/pacman.conf) # activate multilib
# lvm
vim /etc/mkinitcpio.conf
# MODULES="dm_mod ext4"
# HOOKS="...block lvm2 filesystems..."
# encrypted lvm
vim /etc/mkinitcpio.conf
# MODULES="dm_mod ext4"
# HOOKS="...block keyboard encrypt lvm2 filesystems..."
mkinitcpio -p linux
passwd # set root password
(pacman -Sy) # get multilib
# syslinux
(pacman -S gptfdisk) # gpt
pacman -S syslinux
vim /boot/syslinux/syslinux.cfg
# regular
APPEND root=<partition> ro
# lvm
APPEND root=/dev/mapper/<group>-<name> ro
# encrypted lvm, one line
APPEND root=/dev/mapper/<group>-<name>
cryptdevice=<partition>:<name> ro
syslinux-install_update -iam
exit
umount <partition> # unmount everything
reboot
useradd -d <user>
passwd <user>
systemctl enable dhcpcd
systemctl start dhcpcd
# if needed cronie aswell
# nfs? -> rpcbind
# graphics driver packages
catalyst-kvm # prop. AMD/ATI
xf86-video-ati # oss AMD/ATI
xf86-video-intel # Intel IGP
xf86-video-nv # prop. Nvidia
xf86-video-nouveau # oss Nvidia
xf86-video-cirrus # QEMU
xf86-video-vmware # VMware
virtualbox-guest-utils # VirtualBox
# Xorg
pacman -S xorg-server xorg-server-utils xorg-xinit xorg-utils
# personal favourite software (official repos only)
ccrypt chromium cron conky dmenu dwb epdfview feh ffmpeg firefox flashplugin
gimp git gnupg htop i3lock i3-wm iftop iotop irssi keepassx lightdm
lightdm-gtk3-greeter links linux-headers mirage mpc mpd mubmle munin mutt
ncmpcpp newsbeuter nfs-common nfs-utils nmap ntfs-3g numix-themes offlineimap
openssh p7zip pavucontrol pulseaudio pv python-pip reptyr rpcbind rsync
rtorrent rxvt-unicode scrot skype slim steam tmux traceroute tree texlive-core
ttf-bitsream-vera ttf-dejavu ttf-droid ttf-inconsolata ttf-liberation
ttf-ubuntu-font-family unzip valgrind vim virt-manager vlc weechat wget
xorg-xmodmap zathura-djvu zathura-pdf-mupdf zathura-ps zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment