Skip to content

Instantly share code, notes, and snippets.

@tai271828
Last active April 23, 2018 07:00
Show Gist options
  • Save tai271828/cbe426c158c68ae8f51a18b0ad26af52 to your computer and use it in GitHub Desktop.
Save tai271828/cbe426c158c68ae8f51a18b0ad26af52 to your computer and use it in GitHub Desktop.
d-i preseed, a lot of them ; )
# D-I config version 2.0
# search path for the c32 support libraries (libcom32, libutil etc.)
path
include menu.cfg
default vesamenu.c32
prompt 0
timeout 1
ui gfxboot bootlogo
#!/bin/bash
SRC_ROOT="${HOME}/work-my-projects/unatended-server-installation/cbe426c158c68ae8f51a18b0ad26af52"
WORKING_ROOT="${HOME}/work-my-projects/unatended-server-installation/working"
ISO_PATH="${WORKING_ROOT}/ubuntu-16.04.1-server-amd64.iso"
MOUNT_POINT="${WORKING_ROOT}/mnt"
ISO_TARGET="${WORKING_ROOT}/iso"
ISO_FINAL="/var/lib/libvirt/images/ubuntu-16.04.1-server-amd64-autoinstall.iso"
mkdir -p ${MOUNT_POINT}
sudo rm -rf ${ISO_TARGET}
mkdir -p ${ISO_TARGET}
echo "Fetch iso contents..."
sudo mount -o loop ${ISO_PATH} ${MOUNT_POINT}
cp -rT ${MOUNT_POINT} ${ISO_TARGET}
sudo umount ${MOUNT_POINT}
echo "Customizing iso..."
#chmod u+w ${ISO_TARGET}/isolinux/txt.cfg
sudo cp ${SRC_ROOT}/txt.cfg ${ISO_TARGET}/isolinux/txt.cfg
sudo cp ${SRC_ROOT}/isolinux.cfg ${ISO_TARGET}/isolinux/isolinux.cfg
sudo cp ${SRC_ROOT}/unattended-ubuntu-server.seed ${ISO_TARGET}/preseed/
echo "Generating iso..."
pushd ${ISO_TARGET}
sudo mkisofs -r -V "UBUNTU160401" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ${ISO_FINAL} .
popd
echo "Done.!"
default install
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/unattended-ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet languagechooser/language-name=English debian-installer/locale=en_US keyboard-configuration/layoutcode=us ---
# Partitioning
# Old style using d-i command
# Ubuntu server still uses d-i instead of ubiquity
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman-base partman/unmount_active boolean true
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
# This makes partman automatically partition without confirmation
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# Locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
# Network
d-i netcfg/get_hostname string solvcon-master
d-i netcfg/get_domain string solvcon-domain
d-i netcfg/choose_interface select auto
# Clock
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
# Packages, Mirrors, Image
d-i mirror/country string US
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i mirror/http/proxy string
# Policy for applying updates.
# May be
# "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
d-i pkgsel/update-policy select none
# Software selection
# Choices:
# Manual package selection, DNS server, LAMP server, Mail server,
# PostgreSQL database, Samba file server, standard system utilities,
# Virtual Machine host, OpenSSH server
d-i tasksel/first multiselect standard system utilities
d-i pkgsel/include string openssh-server gdisk
# Users
d-i passwd/user-fullname string Ubuntu
d-i passwd/username string ubuntu
d-i passwd/user-password password insecure
d-i passwd/user-password-again password insecure
d-i passwd/auto-login boolean True
d-i user-setup/encrypt-home boolean false
d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i passwd/root-login boolean true
d-i user-setup/allow-password-weak boolean true
# Root password, either in clear text
d-i passwd/root-password password r00tme
d-i passwd/root-password-again password r00tme
# Grub bootloader
d-i grub-installer/only_debian boolean true
### Finishing up the installation
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# Default ubuntu-server.seed
# Suggest LVM by default.
d-i partman-auto/init_automatically_partition string some_device_lvm
d-i partman-auto/init_automatically_partition seen false
# Install the Ubuntu Server seed.
tasksel tasksel/force-tasks string server
# Only install basic language packs. Let tasksel ask about tasks.
d-i pkgsel/language-pack-patterns string
# No language support packages.
d-i pkgsel/install-language-support boolean false
# Only ask the UTC question if there are other operating systems installed.
d-i clock-setup/utc-auto boolean true
# Verbose output and no boot splash screen.
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false
# Install the debconf oem-config frontend (if in OEM mode).
d-i oem-config-udeb/frontend string debconf
# Wait for two seconds in grub
d-i grub-installer/timeout string 20
# Add the network and tasks oem-config steps by default.
oem-config oem-config/steps multiselect language, timezone, keyboard, user, network, tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment