Skip to content

Instantly share code, notes, and snippets.

@abhishekkr
Last active January 22, 2016 19:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishekkr/6355994 to your computer and use it in GitHub Desktop.
Save abhishekkr/6355994 to your computer and use it in GitHub Desktop.
ArchLinux Bootstrap Script [non-UEFI]

Using it

Check for Internet connectivity, get that working.

Then run "pre_arch_chroot.sh" with manual UEFI mods if required. This will ask some confirmations, give it.

And obviously these scripts have my name for 'username', so run following command on both scripts before using.

sed -i 's/abhishekkr/$YOUR_USER_NAME/g' post_arch_chroot.sh

Once it get you to chroot, run "post_arch_chroot.sh".

Most basic set-up

just use "fdisk /dev/sdX" to get your partitions right, use "mkfs.ext4 /dev/sdXY" or similar util to format... and get ahead with the provided scripts to get the base set-up.

Package List

all names preceding 'pacman -S' are the package that these scripts will install for you, which are mainly XFCE Desktop Manager, Firefox, Chromium, VLC, MPlayer, Ruby, Python, Haskell, VIM, Lua, VirtualBox, Qemu, Slim Login Manager, Thunar File Manager, etc.

#!bash
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
ln -fs /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
echo abhishekkr.edu > /etc/hostname
systemctl enable dhcpcd.service
dd if=/dev/zero of=/mnt/swapfile1 bs=1024 count=2097152
chown root:root /swapfile1
chmod 0600 /swapfile1
mkswap /swapfile1
swapon /swapfile1
echo "" | tee -a /etc/fstab
echo "# /swapfile1 swap" | tee -a /etc/fstab
echo "/swapfile1 none swap sw 0 0" | tee -a /etc/fstab
pacman --noconfirm -S ifplugd iw wpa_supplicant dialog syslinux grub
pacman --noconfirm -S freetype2 fuse dosfstools efibootmgr os-prober mtools
syslinux-install_update -i -a -m
sed -i 's/dev\/sda[0-9]/dev\/$1/g' /boot/syslinux/syslinux.cfg
grub-install --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
passwd
cat >> /etc/pacman.conf << EOFPACMAN
[multilib]
Include = /etc/pacman.d/mirrorlist
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/\$arch
EOFPACMAN
pacman -Syu
pacman --noconfirm -S xorg-server xorg-server-utils xorg-xinit mesa xorg-twm xterm
pacman --noconfirm -S nouveau-dri xf86-video-nouveau
pacman --noconfirm -S xf86-input-synaptics xf86-input-keyboard xf86-input-mouse xorg-xclock
pacman --noconfirm -S ttf-dejavu
pacman --noconfirm -S xfce4 xfce4-goodies
pacman --noconfirm -S connman texlive-core poppler-data
pacman --noconfirm -S vlc mplayer firefox chromium xchat pidgin
pacman --noconfirm -S gnome-do xorg-xprop pcmanfm thunar xmms alsa-plugins pulseaudio tcl
pacman --noconfirm -S virtualbox qemu libvirt qemu-launcher
pacman --noconfirm -S qt4 vde2 virtualbox-host-dkms net-tools
pacman --noconfirm -S rrdtool hddtemp networkmanager
pacman --noconfirm -S ruby python lua51 usb_modeswitch dhclient dnsmasq bluez4 slim
pacman --noconfirm -S ghostscript tk cups vim zsh git
pacman --noconfirm -S go ghc
pacman --noconfirm -S sudo
pacman --noconfirm -Syu yaourt
pacman --noconfirm -S customizepkg rsync
pacman --noconfirm -S slim-themes
systemctl enable slim.service
cat > ~/.xinitrc << EOFXINIT
#!/bin/bash
exec startxfce4
EOFXINIT
mkdir -p ~/go
echo 'export GOPATH=~/go:$GOPATH' >> /etc/profile.d/go.sh
useradd abhishekkr
passwd abhishekkr
mkdir -p /home/abhishekkr
chown abhishekkr /home/abhishekkr
usermod -G wheel abhishekkr
echo '%wheel ALL=(ALL) ALL' >> /etc/sudoers
cat > /home/abhishekkr/.xinitrc << EOFXINITHOME
#!/bin/bash
exec startxfce4
EOFXINITHOME
chown -R abhishekkr /home/abhishekkr
#!bash
##### get your internet access ready
if [[ $# -lt 1 ]]; then
echo "SYNTAX: $) <hdddev>"
exit 1
fi
mkfs.ext4 /dev/$1
mount /dev/$1 /mnt
pacstrap -i /mnt base base-devel
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment