Skip to content

Instantly share code, notes, and snippets.

@alexsavio
Forked from ludo/kickstart
Last active January 4, 2016 00:18
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 alexsavio/8540491 to your computer and use it in GitHub Desktop.
Save alexsavio/8540491 to your computer and use it in GitHub Desktop.
install
# Ridiculous URL... I know...
url --url http://nl.archive.ubuntu.com/ubuntu/ubuntu/ubuntu/ubuntu/ubuntu/
text
lang en_US
langsupport en_US
keyboard es
#rootpw pa$$word # you should replace, and use --iscrypted
auth --useshadow --enablemd5
user --disabled
bootloader --location=mbr
zerombr yes
clearpart --all --initlabel
part /boot --asprimary --fstype=ext2 --size=64
part / --asprimary --fstype=ext4 --grow --label=root
part swap --asprimary --fstype=swap --size=2048
#Network
network --onboot yes --device eth0 --bootproto dhcp --noipv6
# network --device=eth0 --bootproto=static --ip=10.0.0.50 --netmask=255.255.255.0 \
# --nameserver=10.0.0.1 --gateway=10.0.0.1
firewall --disabled
#firewall --enabled --ssh
# Skip Xserver setup
skipx
# Authentication
authconfig --enableshadow --passalgo=sha512
# SELinux
selinux --disabled
# Timezone
#timezone Etc/UTC
timezone --utc Europe/Madrid
%packages
ubuntu-minimal
openssh-server
screen
curl
wget
tee
pax
oddjob
sgpio
certmonger
pam_krb5
krb5-workstation
scrub
%post
# update fstab for the root partition
perl -pi -e 's/(errors=remount-ro)/noatime,nodiratime,$1,barrier=0/' /etc/fstab
# point sh to bash instead of dash
rm /bin/sh
ln -s /bin/bash /bin/sh
# add normal apt source list
(
cat <<'EOP'
deb http://us.archive.ubuntu.com/ubuntu/ saucy main restricted universe
deb http://us.archive.ubuntu.com/ubuntu/ saucy-security main restricted universe
deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates main restricted universe
EOP
) > /etc/apt/sources.list
apt-get update
apt-get upgrade -y
#Neurodebian
wget -O- http://neuro.debian.net/lists/saucy.de-md.full | tee /etc/apt/sources.list.d/neurodebian.sources.list
apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
# install some additional packages
apt-get install -y xenstore-utils
#set up xenserver automation scripts
AUTOMATER_REPO=https://raw.github.com/krobertson/xenserver-automater
curl $AUTOMATER_REPO/master/usr/sbin/xe-set-hostname > /usr/sbin/xe-set-hostname
curl $AUTOMATER_REPO/master/usr/sbin/xe-set-network > /usr/sbin/xe-set-network
curl $AUTOMATER_REPO/master/usr/sbin/generate-sshd-keys > /usr/sbin/generate-sshd-keys
curl $AUTOMATER_REPO/master/etc/init/xe-automator.conf > /etc/init/xe-automator.conf
chmod a+x /usr/sbin/xe-set-hostname
chmod a+x /usr/sbin/xe-set-network
chmod a+x /usr/sbin/generate-sshd-keys
# setup locales
locale-gen en_US.UTF-8
update-locale LANG="en_US.UTF-8"
echo 'LANG=en_US.UTF-8' >> /etc/environment
echo 'LC_ALL=en_US.UTF-8' >> /etc/environment
# install xe tools
# cd /tmp
# wget http://some/url/to/xe-guest-utilities_6.0.0-743_amd64.deb
# dpkg -i xe-guest-utilities_6.0.0-743_amd64.deb
# install paravirt kernel image
apt-get install -f -y linux-virtual
dpkg -l | grep generic | grep linux | awk '{print $2}' | xargs apt-get remove -y
# clean up some stuff
rm -f /etc/ssh/ssh_host_*
rm -f /var/cache/apt/archives/*.deb
rm -f /var/cache/apt/*cache.bin
rm -f /var/lib/apt/lists/*_Packages
%end
firstboot --disabled
shutdown
%post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment