Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 71 lines (56 sloc) 1.59 KB
#!/bin/sh
hostname=$1
if [ -z "$hostname" ]; then
echo >&2 "Usage: $0 HOSTNAME"
exit 2
fi
locale="en_US.UTF-8"
timezone="America/Phoenix"
initcpio_modules="crc32c"
initcpio_extra_hooks=
font="terminus-font ter-220n"
root_fs="$(grep ' /mnt/ ' /proc/mounts|awk '{print $3}')"
alias pacman="pacman --noconfirm"
pacman -Sy
# Hostname
echo $hostname >/etc/hostname
sed -i -e "s,\tlocalhost,\t$hostname localhost," /etc/hosts
# Timezone
ln -sf /usr/share/zoneinfo/$timezone /etc/localtime
echo $timezone >/etc/timezone
# Locales
sed -i -e "/^#$locale /s/^#//" /etc/locale.gen
locale-gen
echo "LANG=$locale" >/etc/locale.conf
# Initramfs
if [ "$root_fs" = "btrfs" ]; then
pacman -S btrfs-progs
initcpio_extra_hooks="$initcpio_extra_hooks btrfs"
fi
sed -i -e"s,^MODULES=\"\",MODULES=\"$initcpio_modules\"," /etc/mkinitcpio.conf
if [ -n "$initcpio_extra_hooks" ]; then
sed -i -e"s,^HOOKS=\"\(.*\)\",HOOKS=\"\1 $initcpio_extra_hooks\"," /etc/mkinitcpio.conf
fi
mkinitcpio -p linux
# Console font
if [ -n "$font" ]; then
package=$(echo $font|cut -d" " -f1)
fontname=$(echo $font|cut -d" " -f2)
pacman -S $package
echo "FONT=$fontname" >/etc/vconsole.conf
fi
# SCM
pacman -S git mercurial
# User setup
groupadd -r -g 51 staff
chgrp -R staff /usr/local
chmod -R g+rwX /usr/local
find /usr/local -type d -exec chmod g+s "{}" \;
pacman -S sudo
sudo sed -i -e 's/# \(%wheel ALL=(ALL) ALL\)/\1/' /etc/sudoers
pacman -S fish
useradd -m -g users -G staff,wheel,uucp,storage -s /usr/bin/fish kergoth
passwd kergoth
# Install bootloader and set root password
syslinux-install_update -i -a -m
passwd root
Something went wrong with that request. Please try again.