• install temporary proxmox ve install in KVM VM
  • aptitude install dab
  • make a temporary directory with the following files (based on PVE debian minimal and debian 64-bit vm's):

dab.conf:

Suite: jessie
CacheDir: ../cache
Source: http://ftp.us.debian.org/debian/ SUITE main
Source: http://ftp.us.debian.org/debian/ SUITE-updates main
Source: http://security.debian.org/ SUITE/updates main
Architecture: amd64
Name: debian-8.0-tom
Version: 8.1-tom1
Section: system
Maintainer: Tom Dobes <tomdobes@purdue.edu>
Infopage: http://wiki.mcpstars.org/build_debian_jessie_amd64_openvz_pve_template
Description: Debian Jessie for Tom
 The base Debian Jessie amd64 install plus common utils.

Side note: Yes, the name really does need to contain 8.0. If it doesn't, dab makes the filename of the resulting template really long by including both debian-8.0 and your name. Argh!

Makefile:

BASEDIR:=$(shell dab basedir)

all: info/init_ok
	dab bootstrap --minimal
	dab install aptitude
	dab install udev
	dab install systemd
	dab install systemd-sysv
	dab install dbus
	dab exec aptitude -y purge sysvinit-core
	dab exec aptitude -y purge dmidecode kmod
	dab install locales
	sed -e 's/^# en_US.UTF-8/en_US.UTF-8/' -i ${BASEDIR}/etc/locale.gen
	dab exec dpkg-reconfigure -f noninteractive locales
	echo "LANG=en_US.UTF-8" > ${BASEDIR}/etc/default/locale
	dab install screen rsync psmisc file patch tcpdump vim strace bzip2 lsof
	dab install dnsutils
	dab install unattended-upgrades
	echo $\'APT::Periodic::Update-Package-Lists "1";\nAPT::Periodic::Unattended-Upgrade "1";' > ${BASEDIR}/etc/apt/apt.conf.d/20auto-upgrades
	dab exec cp /dev/null /etc/motd
	dab exec systemctl disable ssh.service
	dab exec systemctl enable ssh.socket
	dab exec systemctl mask console-getty.service
	dab exec systemctl mask getty-static.service
	dab exec systemctl mask proc-sys-fs-binfmt_misc.automount
	dab exec systemctl mask systemd-binfmt.service
	dab exec systemctl mask systemd-udevd.service
	mkdir -p ${BASEDIR}/etc/systemd/system/getty\@tty1.service.d
	echo '[Service]' > ${BASEDIR}/etc/systemd/system/getty\@tty1.service.d/noclear.conf
	echo 'TTYVTDisallocate=no' >> ${BASEDIR}/etc/systemd/system/getty\@tty1.service.d/noclear.conf
	echo "America/Chicago" > ${BASEDIR}/etc/timezone
	dab exec dpkg-reconfigure -f noninteractive tzdata
	cat sources.list > ${BASEDIR}/etc/apt/sources.list
	dab exec aptitude forget-new
	rm ${BASEDIR}/etc/ssh/ssh_host_*_key*
	dab finalize

info/init_ok: dab.conf
	dab init
	touch $@

.PHONY: clean
clean:
	dab clean
	rm -f *~

.PHONY: dist-clean
dist-clean:
	dab dist-clean
	rm -f *~

Note that when testing this you need to be sure to run dab init before the commands in the 'all' section. Also, note that it's important that the dpkg-reconfigure for locales go BEFORE setting the contents of the /etc/default/locale file, or else it will get commented out.

sources.list:

deb http://ftp.us.debian.org/debian/ jessie main
deb-src http://ftp.us.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ jessie-updates main
deb-src http://ftp.us.debian.org/debian/ jessie-updates main

# jessie-backports, previously on backports.debian.org
#deb http://ftp.us.debian.org/debian/ jessie-backports main
#deb-src http://ftp.us.debian.org/debian/ jessie-backports main
  • run make in that directory (Note: Since dab is in /usr/sbin/, this has to be done as root)

BUGS:

  • at the end of this, we don't seem to have a package cache in the VM… maybe related to the sources.list copy which we do to add the deb-src lines? Everything's fine after you run aptitude update once in the VM.
computer/build_debian_jessie_amd64_openvz_pve_template.txt · Last modified: 2015/06/18 02:40 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS