Skip to content

Instantly share code, notes, and snippets.

@chusiang
Last active August 29, 2015 14:16
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 chusiang/5937fc70b594b85b58ff to your computer and use it in GitHub Desktop.
Save chusiang/5937fc70b594b85b58ff to your computer and use it in GitHub Desktop.
Kickstart script for Ubuntu 12.04
# ====================================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: ks.cfg.
# Modified: 2015-02-25 10:30
# Description: Kickstart Configurator for Ubuntu 12.04.5 LTS server (amd64)
# Reference:
#
# 1. 作業系統自動安裝應答 CD 製作 - kickstart | iThome Download
# - http://download.ithome.com.tw/article/index/id/1792
# 2. KickstartCompatibility | Community Help Wiki
# - https://help.ubuntu.com/community/KickstartCompatibility
# 3. How do I create a completely unattended install of Ubuntu? | Ask Ubuntu
# - http://askubuntu.com/a/122506/74671
#
# ====================================================================
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone Asia/Taipei
#Root password
rootpw --disabled
#Initial user
user jonny --fullname "Chu-Siang Lai" --iscrypted --password $1$3saQvX1g$Z0nr0oPCzKExBBGHunn6G0
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
# - idc103
part /boot --fstype ext4 --asprimary --size=200
part / --fstype ext4 --asprimary --size=100000
part swap --asprimary --size=128000
part /home --fstype ext4 --grow --size=1
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=static --ip=10.62.173.121 --netmask=255.255.255.128 --gateway=10.62.173.126 --nameserver=10.62.172.56 --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
%packages
dnsutils
iputils-tracepath
less
mdadm
openssh-client
openssh-server
screen
tmux
vim
w3m
%post
# Setting the default editor to Vim.
update-alternatives --set editor /usr/bin/vim.basic
default kickstart
label kickstart
menu label ^Auto install with Kickstart
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz ks=cdrom:/ks.cfg
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet --
label cloud
menu label ^Multiple server install with MAAS
kernel /install/vmlinuz
append modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet --
label check
menu label ^Check disc for defects
kernel /install/vmlinuz
append MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet --
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment