Permalink
Browse files

Merge pull request #258 from jimi1283/preseed_improvements

New default preseed, and a few minor changes to make ubuntu auto install work better
  • Loading branch information...
2 parents 0874e6a + c602ca5 commit 05cc57a3cb17e2da63d604a8aab751d01d1db58b @jmaas jmaas committed Jul 24, 2012
Showing with 213 additions and 80 deletions.
  1. +5 −0 cobbler/kickgen.py
  2. +1 −1 cobbler/pxegen.py
  3. +107 −77 kickstarts/sample.seed
  4. +98 −0 kickstarts/sample_old.seed
  5. +2 −2 koan/app.py
View
@@ -29,6 +29,7 @@
import glob
import traceback
import errno
+import urlparse
import utils
from cexceptions import *
@@ -266,6 +267,10 @@ def generate_kickstart(self, profile=None, system=None):
meta["kernel_options"] = utils.hash_to_string(meta["kernel_options"])
# meta["config_template_files"] = self.generate_template_files_stanza(g, False)
+ # add extra variables for other distro types
+ p = urlparse.urlparse(meta["tree"])
+ meta["install_source_directory"] = p.path
+
try:
raw_data = utils.read_file_contents(kickstart_path, self.api.logger,
self.settings.template_remote_kickstarts)
View
@@ -695,7 +695,7 @@ def build_kernel_options(self, system, profile, distro, image, arch,
elif distro.breed == "suse":
append_line = "%s autoyast=%s" % (append_line, kickstart_path)
elif distro.breed == "debian" or distro.breed == "ubuntu":
- append_line = "%s auto-install/enable=true url=%s" % (append_line, kickstart_path)
+ append_line = "%s auto-install/enable=true priority=critical url=%s" % (append_line, kickstart_path)
# rework kernel options for debian distros
translations = { 'ksdevice':"interface" , 'lang':"locale" }
View
@@ -1,98 +1,128 @@
-#platform=x86, AMD64, or Intel EM64T
-# System authorization information
-
-# System bootloader configuration
-d-i grub-installer/only_debian boolean true
-#grub-installer grub-installer/bootdev string hd0
-d-i grub-installer/bootdev string hd0
-### add kernel postinst options (--kopts-post)
-d-i debian-installer/add-kernel-opts string $kernel_options_post
-
-# Partition clearing information
-### Partitioning available methods are: "regular", "lvm" and "crypto"
-d-i partman-auto/disk string /dev/sda
+# Mostly based on the Ubuntu installation guide
+# https://help.ubuntu.com/12.04/installation-guide/
+
+# Preseeding only locale sets language, country and locale.
+d-i debian-installer/locale string en_US
+
+# Keyboard selection.
+# Disable automatic (interactive) keymap detection.
+d-i console-setup/ask_detect boolean false
+d-i keyboard-configuration/layoutcode string us
+d-i keyboard-configuration/variantcode string
+
+# netcfg will choose an interface that has link if possible. This makes it
+# skip displaying a list if there is more than one interface.
+d-i netcfg/choose_interface select auto
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# If non-free firmware is needed for the network or other hardware, you can
+# configure the installer to always try to load it, without prompting. Or
+# change to false to disable asking.
+# d-i hw-detect/load_firmware boolean true
+
+# NTP/Time Setup
+d-i time/zone string US/Eastern
+d-i clock-setup/utc boolean true
+d-i clock-setup/ntp boolean true
+d-i clock-setup/ntp-server string ntp.ubuntu.com
+
+# Setup the installation source
+d-i mirror/country string manual
+d-i mirror/http/hostname string $http_server:$http_port
+d-i mirror/http/directory string $install_source_directory
+d-i mirror/http/proxy string
+
+# Suite to install.
+# d-i mirror/suite string precise
+# d-i mirror/udeb/suite string precise
+
+# Components to use for loading installer components (optional).
+#d-i mirror/udeb/components multiselect main, restricted
+
+# Disk Partitioning
+# Use LVM, and wipe out anything that already exists
d-i partman-auto/method string lvm
-d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
-#d-i partman-auto/init_automatically_partition \\
-# select Guided - use entire disk and set up LVM
-
-#d-i partman-auto/expert_recipe_file string /recipe
+# You can choose one of the three predefined partitioning recipes:
+# - atomic: all files in one partition
+# - home: separate /home partition
+# - multi: separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
-d-i partman/confirm_write_new_label boolean true
+# This makes partman automatically partition without confirmation, provided
+# that you told it what to do using one of the methods above.
+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
+# If you just want to change the default filesystem from ext3 to something
+# else, you can do that without providing a full recipe.
+# d-i partman/default_filesystem string ext4
-# Use text mode install
-
-# Firewall configuration
-
-# Run the Setup Agent on first boot
-
-# System keyboard
-d-i console-setup/dont_ask_layout note
-d-i console-keymaps-at/keymap select us
-# System language
-
-# Use network installation
-# NOTE : The suite seems to be hardcoded on installer
-d-i mirror/suite string $suite
-d-i mirror/country string enter information manually
-d-i mirror/http/hostname string $hostname
-d-i mirror/http/directory string $directory
-d-i mirror/http/proxy string
-# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
-#apt-setup-udeb apt-setup/services-select multiselect security
-d-i apt-setup/services-select multiselect security
-d-i apt-setup/security_host string $hostname$directory-security
-d-i apt-setup/volatile_host string $hostname$directory-volatile
+# root account and password
+d-i passwd/root-login boolean true
+d-i passwd/root-password-crypted password $default_password_crypted
-# Network information
-# NOTE : this questions are asked before downloading preseed
-#d-i netcfg/get_hostname string unassigned-hostname
-#d-i netcfg/get_domain string unassigned-hostname
+# skip creation of a normal user account.
+d-i passwd/make-user boolean false
-# Reboot after installation
-finish-install finish-install/reboot_in_progress note
+# You can choose to install restricted and universe software, or to install
+# software from the backports repository.
+# d-i apt-setup/restricted boolean true
+# d-i apt-setup/universe boolean true
+# d-i apt-setup/backports boolean true
-#Root password
-d-i passwd/root-password-crypted password \$1\$mF86/UHC\$WvcIcX2t6crBz2onWxyac.
-user-setup-udeb passwd/root-login boolean true
-user-setup-udeb passwd/make-user boolean false
-# SELinux configuration
+# Uncomment this if you don't want to use a network mirror.
+# d-i apt-setup/use_mirror boolean false
-# Do not configure the X Window System
+# Select which update services to use; define the mirrors to be used.
+# Values shown below are the normal defaults.
+# d-i apt-setup/services-select multiselect security
+# d-i apt-setup/security_host string security.ubuntu.com
+# d-i apt-setup/security_path string /ubuntu
-# System timezone
-clock-setup clock-setup/utc boolean false
-tzsetup-udeb time/zone select America/New_York
-# Install OS instead of upgrade
+# Additional repositories, local[0-9] available
+# d-i apt-setup/local0/repository string \
+# http://local.server/ubuntu precise main
+# d-i apt-setup/local0/comment string local server
-# Clear the Master Boot Record
+# Enable deb-src lines
+# d-i apt-setup/local0/source boolean true
-
-# Select individual packages and groups for install
-d-i pkgsel/include string openssh-server
-tasksel tasksel/first multiselect standard, desktop
-
-# Disable automatic updates
-d-i pkgsel/update-policy select none
-
-# Debian specific configuration
-# See http://www.debian.org/releases/stable/i386/apbs04.html.en & preseed documentation
+# URL to the public key of the local repository; you must provide a key or
+# apt will complain about the unauthenticated repository and so the
+# sources.list line will be left commented out
+# d-i apt-setup/local0/key string http://local.server/key
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
# authentication. Warning: Insecure, not recommended.
-d-i debian-installer/allow_unauthenticated string true
-
-# Some versions of the installer can report back on what software you have
-# installed, and what software you use. The default is not to report back,
-# but sending reports helps the project determine what software is most
-# popular and include it on CDs.
-popularity-contest popularity-contest/participate boolean false
-
+# d-i debian-installer/allow_unauthenticated boolean true
+
+# Use the following option to add additional boot parameters for the
+# installed system (if supported by the bootloader installer).
+# Note: options passed to the installer will be added automatically.
+d-i debian-installer/add-kernel-opts string $kernel_options_post
+
+# Avoid that last message about the install being complete.
+d-i finish-install/reboot_in_progress note
+
+# This first command is run as early as possible, just after preseeding is read.
+# d-i preseed/early_command string [command]
+
+# This command is run immediately before the partitioner starts. It may be
+# useful to apply dynamic partitioner preseeding that depends on the state
+# of the disks (which may not be visible when preseed/early_command runs).
+# d-i partman/early_command \
+# string debconf-set partman-auto/disk "\$(list-devices disk | head -n1)"
+
+# This command is run just before the install finishes, but when there is
+# still a usable /target directory. You can chroot to /target and use it
+# directly, or use the apt-install and in-target commands to easily install
+# packages and run commands in the target system.
+# d-i preseed/late_command string [command]
View
@@ -0,0 +1,98 @@
+#platform=x86, AMD64, or Intel EM64T
+# System authorization information
+
+# System bootloader configuration
+d-i grub-installer/only_debian boolean true
+#grub-installer grub-installer/bootdev string hd0
+d-i grub-installer/bootdev string hd0
+### add kernel postinst options (--kopts-post)
+d-i debian-installer/add-kernel-opts string $kernel_options_post
+
+# Partition clearing information
+### Partitioning available methods are: "regular", "lvm" and "crypto"
+d-i partman-auto/disk string /dev/sda
+d-i partman-auto/method string lvm
+d-i partman-auto/purge_lvm_from_device boolean true
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-lvm/confirm boolean true
+
+#d-i partman-auto/init_automatically_partition \\
+# select Guided - use entire disk and set up LVM
+
+#d-i partman-auto/expert_recipe_file string /recipe
+d-i partman-auto/choose_recipe select atomic
+
+d-i partman/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+
+
+# Use text mode install
+
+# Firewall configuration
+
+# Run the Setup Agent on first boot
+
+# System keyboard
+d-i console-setup/dont_ask_layout note
+d-i console-keymaps-at/keymap select us
+# System language
+
+# Use network installation
+# NOTE : The suite seems to be hardcoded on installer
+d-i mirror/suite string $suite
+d-i mirror/country string enter information manually
+d-i mirror/http/hostname string $hostname
+d-i mirror/http/directory string $directory
+d-i mirror/http/proxy string
+# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
+#apt-setup-udeb apt-setup/services-select multiselect security
+d-i apt-setup/services-select multiselect security
+d-i apt-setup/security_host string $hostname$directory-security
+d-i apt-setup/volatile_host string $hostname$directory-volatile
+
+# Network information
+# NOTE : this questions are asked before downloading preseed
+#d-i netcfg/get_hostname string unassigned-hostname
+#d-i netcfg/get_domain string unassigned-hostname
+
+# Reboot after installation
+finish-install finish-install/reboot_in_progress note
+
+#Root password
+d-i passwd/root-password-crypted password \$1\$mF86/UHC\$WvcIcX2t6crBz2onWxyac.
+user-setup-udeb passwd/root-login boolean true
+user-setup-udeb passwd/make-user boolean false
+# SELinux configuration
+
+# Do not configure the X Window System
+
+# System timezone
+clock-setup clock-setup/utc boolean false
+tzsetup-udeb time/zone select America/New_York
+# Install OS instead of upgrade
+
+# Clear the Master Boot Record
+
+
+# Select individual packages and groups for install
+d-i pkgsel/include string openssh-server
+tasksel tasksel/first multiselect standard, desktop
+
+# Disable automatic updates
+d-i pkgsel/update-policy select none
+
+# Debian specific configuration
+# See http://www.debian.org/releases/stable/i386/apbs04.html.en & preseed documentation
+
+# By default the installer requires that repositories be authenticated
+# using a known gpg key. This setting can be used to disable that
+# authentication. Warning: Insecure, not recommended.
+d-i debian-installer/allow_unauthenticated string true
+
+# Some versions of the installer can report back on what software you have
+# installed, and what software you use. The default is not to report back,
+# but sending reports helps the project determine what software is most
+# popular and include it on CDs.
+popularity-contest popularity-contest/participate boolean false
+
View
@@ -711,7 +711,7 @@ def get_install_tree_for_debian_ubuntu(self, profile_data):
tree = profile_data["ks_meta"].split("@@")[-1].strip()
# Ensure we only take the tree in case ks_meta args are passed
tree = tree.split()[0]
- profile_data["install_tree"] = tree
+ profile_data["install_tree"] = "http://" + profile_data["http_server"] + tree
if self.safe_load(profile_data,"install_tree"):
print "install_tree:", profile_data["install_tree"]
@@ -1273,7 +1273,7 @@ def calc_kernel_args(self, pd, replace_self=0):
if breed is not None and breed == "suse":
kextra = "autoyast=" + kickstart
elif breed is not None and breed == "debian" or breed =="ubuntu":
- kextra = "auto url=" + kickstart
+ kextra = "auto-install/enable=true priority=critical url=" + kickstart
else:
kextra = "ks=" + kickstart

0 comments on commit 05cc57a

Please sign in to comment.