Skip to content

Instantly share code, notes, and snippets.

@dynnamitt
Last active December 31, 2015 02:59
Show Gist options
  • Save dynnamitt/7924929 to your computer and use it in GitHub Desktop.
Save dynnamitt/7924929 to your computer and use it in GitHub Desktop.
JustWorks{4Me}Linux
#!/bin/bash
# JustWorks{4Me}Linux --- version 0.0.1a
# each section is prepped for copy and paste
# mount /arch (freshly formatted)
# set some ENVs
# find you mirror here: https://www.archlinux.org/mirrorlist/
export ARCH_MNT=/arch ;\
export MIRR=http://mirror.archlinux.no
# 1b. Bootstrap
# see https://wiki.archlinux.org/index.php/Archbootstrap
wget https://raw2.github.com/tokland/arch-bootstrap/master/arch-bootstrap.sh && \
sudo bash arch-bootstrap.sh -a x86_64 -r "$MIRR" "$ARCH_MNT"
# 2. chroot
m=("proc" "sys" "dev" "dev/pts" "home"); for mnt in $m[@];do \
sudo mount --bind /$mnt $ARCH_MNT/$mnt ;done && \
sudo cp /etc/fstab $ARCH_MNT/etc/fstab.otherdist && \
sudo chroot $ARCH_MNT bash
# 3. post-chroot
pacman-key --init
# see https://wiki.archlinux.org/index.php/pacman-key#Initializing_the_keyring
# ----
# Me just do Ctrl-Z, bg<Enter>, then FOOL AROUND w keyboard
# Install a lot of things
pacman-key --populate archlinux; pacman-key --refresh-keys; \
pacman -Syu; pacman -S base base-devel vim git wget zsh grml-zsh-config archlinux-wallpaper
# pacman colors
sed -e 's/^#Color/Color/' /etc/pacman.conf > /tmp/pacman.conf.coloured &&\
cp /tmp/pacman.conf.coloured /etc/pacman.conf
# find graphicz driver - works for me ;)
echo -e '\nFound VGA:\n '$(lspci | grep VGA)'\n' ;\
VGA_VNDR=$(lspci | grep VGA | sed -e 's/.*controller: *//' | awk '{print $1}'); \
pacman -Ss xf86-video $VGA_VNDR
# .. then install it
# Xorg xinit awesome
pacman -S xorg-server xorg-xinit awesome &&\
(cat /etc/skel/.xinitrc; echo exec awesome) > ~/.xinitrc
# TODO look into dex + rlwrap
# set root password
passwd
# wireless .. partly ok .. not so auto
pacman -S wpa_actiond &&\
sed -e 's/=.*wlan0/=wlp3s0/' /etc/netctl/examples/wireless-wpa > /etc/netctl/homeoffice &&\
vim /etc/netctl/homeoffice &&\
systemctl enable netctl-auto@interface.service
# maybe a restart..?
# netctl restart homeoffice
# create a NEW /etc/fstab ..while peeking into current
vim -o /etc/fstab /etc/fstab.otherdist
# exit chroot and boot
exit
sudo update-grub # if grub is your bootman
# boot at will
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment