Skip to content
Browse files

Add very preliminary Ubuntu 11.10 support

  • Loading branch information...
1 parent 36638f0 commit 19c06dc3312ca47e73dbebde63aaf8f752e4423c @VictorLowther VictorLowther committed Dec 15, 2011
View
56 ubuntu-11.10-extra/NOTES
@@ -0,0 +1,56 @@
+# Copyright 2011, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+To get through dell firewalls, you need to set the following environment variables (change <password> to the appropriate thing):
+export http_proxy='http://Americas\Gregory_Althaus:<password>@proxy.us.dell.com:80'
+export HTTP_PROXY='http://Americas\Gregory_Althaus:<password>@proxy.us.dell.com:80'
+export https_proxy='http://Americas\Gregory_Althaus:<password>@proxy.us.dell.com:80'
+export HTTPS_PROXY='http://Americas\Gregory_Althaus:<password>@proxy.us.dell.com:80'
+
+To get canonical based debs:
+1. Edit sources.list in the /etc/apt directory
+ a. Change all the #deb to deb
+ b. Comment out the local repos
+2. Run: apt-get update
+3. Run: rm /var/cache/apt/archives/*.deb
+4. Run: apt-get install <packages you need>
+5. Run: cp /var/cache/apt/archives/*.deb /tftpboot/ubuntu_dvd/extra/debs
+
+To get swift debs:
+1. Add the swift repository
+ a. For latest stable: add-apt-repository ppa:swift-core/ppa
+ b. For latest dev: add-apt-repository ppa:swift-core/trunk
+2. Run: apt-get update
+3. Run: rm /var/cache/apt/archives/*.deb
+4. Run: apt-get install python-swift
+5. Run: apt-get install swift swift-proxy swift-account swift-object swift-container
+6. Run: rm /tftpboot/ubuntu_dvd/extra/debs/openstack/swift/*
+7. Run: cp /var/cache/apt/archives/*.deb /tftpboot/ubuntu_dvd/extra/debs/openstack/swift
+
+To get nova debs:
+1. Add the nova repository
+ a. For latest stable: add-apt-repository ppa:nova-core/ppa
+ b. For latest dev: add-apt-repository ppa:nova-core/trunk
+2. Run: apt-get update
+3. Run: rm /var/cache/apt/archives/*.deb
+4. Run: apt-get install python-nova
+5. Run: apt-get install nova-common nova-api nova-objectstore nova-volume nova-compute nova-scheduler nova-doc nova-network nova-ajax-console-proxy
+6. Run: rm /tftpboot/ubuntu_dvd/extra/debs/openstack/nova/*
+7. Run: cp /var/cache/apt/archives/*.deb /tftpboot/ubuntu_dvd/extra/debs/openstack/nova
+
+To build a repos from this directory:
+1. apt-get install build-essential
+2. run: dpkg-scanpackages ./ /dev/null | gzip > Packages.gz
+
View
1 ubuntu-11.10-extra/apt.conf
@@ -0,0 +1 @@
+APT::Get::AllowUnauthenticated 1 ;
View
178 ubuntu-11.10-extra/build_lib.sh
@@ -0,0 +1,178 @@
+#!/bin/bash
+# This file is sourced by build_crowbar.sh when you want to build Crowbar
+# using Ubuntu 10.10 as the base OS. It includes all Ubuntu 10.10 specific
+# build routines.
+
+# OS information for the OS we are building crowbar on to.
+OS=ubuntu
+OS_VERSION=11.10
+OS_TOKEN="$OS-$OS_VERSION"
+OS_CODENAME=oneiric
+# Server to download the mirror from if we need to.
+ISO_MIRROR="http://mirror.anl.gov/pub"
+PKG_TYPE="debs"
+PKG_ALLOWED_ARCHES=("amd64" "all")
+CHROOT_PKGDIR="var/cache/apt/archives"
+CHROOT_GEMDIR="var/lib/gems/1.8/cache"
+declare -A SEEN_DEBS
+# The name of the OS iso we are using as a base.
+[[ $ISO ]] || ISO="ubuntu-$OS_VERSION-server-amd64.iso"
+
+# The location for OS packages on $ISO
+find_cd_pool() ( echo "$IMAGE_DIR/pool"; )
+
+fetch_os_iso() {
+ # Try and download our ISO if we don't already have it
+ echo "$(date '+%F %T %z'): Downloading and caching $ISO"
+ curl -o "$ISO_LIBRARY/$ISO" \
+ "$ISO_MIRROR/ubuntu-iso/CDs/$OS_VERSION/$ISO" || \
+ die 1 "Missing our source image"
+}
+
+# Have the chroot update its package databases.
+chroot_update() { in_chroot /usr/bin/apt-get -y --force-yes \
+ --allow-unauthenticated update; }
+
+# Install some packages in the chroot environment.
+chroot_install() {
+ if [[ $1 ]]; then
+ in_chroot /usr/bin/apt-get -y --force-yes \
+ --allow-unauthenticated install "$@"
+ fi
+}
+
+# Fetch (but do not install) packages into the chroot environment
+chroot_fetch() {
+ if [[ $1 ]]; then
+ in_chroot /usr/bin/apt-get -y --force-yes \
+ --allow-unauthenticated --download-only install "$@"
+ fi
+}
+
+# Add repositories to the local chroot environment.
+add_repos() {
+ local repo ppas=()
+ local f=$(mktemp /tmp/ubuntu_repos.XXXXXX)
+ for repo in "$@"; do
+ case $repo in
+ ppa*) ppas+=("${ppa#* }");;
+ deb*) echo "$repo" >> "$f";;
+ *) die "Unknown Debian repository type $repo";;
+ esac
+ done
+ in_chroot mkdir -p /etc/apt/sources.list.d
+ sudo cp "$f" "$CHROOT/etc/apt/sources.list.d/${f##*.}.list"
+ rm "$f"
+ [[ $ppas ]] || return 0
+ chroot_install python-software-properties
+ for repo in "${ppas[@]}"; do
+ in_chroot apt-add-repository "ppa:${repo}"
+ done
+}
+
+# Test to see we were passed a valid package file name.
+is_pkg() { [[ $1 = *.deb ]]; }
+
+# Look up name and version information for a package using
+# dpkg. Make sure and memoize things.
+dpkg_info() {
+ # $1 = package to examine
+ local name arch ver f1 f2
+ [[ -f $1 && $1 = *.deb ]] || die "$1 is not a debian package!"
+ if [[ ! ${SEEN_DEBS["${1##*/}"]} ]]; then
+ while read f1 f2; do
+ case $f1 in
+ Package:) name="$f2";;
+ Version:) ver="$f2";;
+ Architecture:) arch="$f2";;
+ esac
+ [[ $name && $ver && $arch ]] && break || :
+ done < <(dpkg -I "$1")
+ SEEN_DEBS["${1##*/}"]="$name-$arch $ver"
+ fi
+ echo "${SEEN_DEBS["${1##*/}"]}"
+}
+
+# Get the package file name in $name-$arch format.
+pkg_name() {
+ local n="$(dpkg_info "$1")"
+ echo "${n%% *}"
+}
+
+# OS specific part of making our chroot environment.
+__make_chroot() {
+ # debootstrap a minimal install of our target version of
+ # Ubuntu to ensure that we don't interfere with the host's package cache.
+ local d repo bc f
+ sudo mount -t tmpfs -o size=4G "$OS_TOKEN-chroot" "$CHROOT"
+ sudo debootstrap "$OS_CODENAME" "$CHROOT" \
+ "file://$IMAGE_DIR" || \
+ die 1 "Could not bootstrap our scratch target!"
+ # mount some important directories for the chroot
+ for d in proc sys dev dev/pts; do
+ bind_mount "/$d" "$CHROOT/$d"
+ done
+ in_chroot mkdir -p "/base_repo"
+ sudo mount --bind "$IMAGE_DIR" "$CHROOT/base_repo"
+ # make sure the chroot can resolve hostnames
+ sudo cp /etc/resolv.conf "$CHROOT/etc/resolv.conf"
+ # make sure the chroot honors proxies
+ if [[ $http_proxy || $https_proxy ]]; then
+ f=$(mktemp /tmp/apt.http.conf.XXXXXX)
+ [[ $http_proxy ]] && echo \
+ "Acquire::http::Proxy \"$http_proxy\";" >> "$f"
+ [[ $https_proxy ]] && echo \
+ "Acquire::https::Proxy \"$https_proxy\";" >> "$f"
+ echo "Acquire::http::Proxy::127.0.0.1 \"DIRECT\";" >> "$f"
+ in_chroot mkdir -p "/etc/apt/apt.conf.d/"
+ sudo cp "$f" "$CHROOT/etc/apt/apt.conf.d/00http_proxy"
+ fi
+}
+
+# Test to see of package $1 is more recent than package $2
+pkg_cmp() {
+ # $1 = Debian package 1
+ # $2 = Debian package 2
+ local deb1="$(dpkg_info "$1")"
+ local deb2="$(dpkg_info "$2")"
+ [[ ${deb1%% *} = ${deb2%% *} ]] || \
+ die "$1 and $2 do not reference the same package!"
+ vercmp "${deb1#* }" "${deb2#* }"
+}
+
+final_build_fixups() {
+ # Copy our isolinux and preseed files.
+ mv "$BUILD_DIR/extra/isolinux" "$BUILD_DIR/extra/preseed" "$BUILD_DIR"
+ # Copy our initrd images
+ (cd "$IMAGE_DIR"; find -name initrd.gz |cpio -o) | \
+ (cd "$BUILD_DIR"; cpio -i --make-directories)
+ chmod -R u+w "$BUILD_DIR"
+ # Fix up the initrd
+ ( cd "$CROWBAR_DIR/initrd"
+ debug "Fixing up initrd"
+ [[ -d scratch ]] && rm -rf scratch
+ mkdir scratch
+ # Grab _all_ the nic drivers. We probably don't need them,
+ # but a little paranoia never hurt anyone.
+ ( cd scratch;
+ debug "Adding all nic drivers"
+ for udeb in "$IMAGE_DIR/pool/main/l/linux/"nic-*-generic-*.udeb; do
+ ar x "$udeb"
+ tar xzf data.tar.gz
+ rm -rf debian-binary *.tar.gz
+ done
+ # Make sure installing off a USB connected DVD will work
+ debug "Adding USB connected DVD support"
+ mkdir -p var/lib/dpkg/info
+ cp ../cdrom-detect.postinst var/lib/dpkg/info
+ # Append our new gzipped CPIO archive onto the old one.
+ find . |cpio --create --format=newc --owner root:root 2>/dev/null | \
+ gzip -9 >> "$BUILD_DIR/install/initrd.gz" )
+ rm -rf scratch )
+}
+
+# Check to make sure all our prerequisites are met.
+for cmd in debootstrap ar; do
+ which "$cmd" &>/dev/null || \
+ die "Please install $cmd before trying to build Crowbar."
+done
View
63 ubuntu-11.10-extra/chef_install_lib.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+# Ubuntu specific chef install functionality
+DVD_PATH="/tftpboot/ubuntu_dvd"
+OS_TOKEN="ubuntu-11.10"
+update_hostname() { update_hostname.sh $FQDN; }
+
+install_base_packages() {
+ cp apt.conf /etc/apt
+ log_to apt sed -i "s/__HOSTNAME__/$FQDN/g" ./debsel.conf
+ log_to apt /usr/bin/debconf-set-selections ./debsel.conf
+ # First, make a repo for crowbar-extras
+ apt-get -y install dpkg-dev
+ mkdir -p "/tftpboot/$OS_TOKEN/crowbar-extra"
+ (cd "/tftpboot/$OS_TOKEN/crowbar-extra";
+ # Find all the staged barclamps
+ for bc in "/opt/dell/barclamps/"*; do
+ [[ -d $bc/cache/$OS_TOKEN/pkgs ]] || continue
+ # Link them in.
+ ln -s "$bc/cache/$OS_TOKEN/pkgs" "${bc##*/}"
+ done
+ dpkg-scanpackages . 2>/dev/null |gzip -9 >Packages.gz)
+ echo "deb file:/tftpboot/$OS_TOKEN/crowbar-extra /" >>/etc/apt/sources.list
+ log_to apt apt-get update
+ log_to apt apt-get -y remove apparmor
+ log_to apt apt-get -y install rubygems gcc ruby \
+ libcurl4-gnutls-dev build-essential ruby-dev
+}
+
+bring_up_chef() {
+ log_to apt apt-get -y install chef kwalify
+ service chef-client stop
+ killall chef-client
+ log_to apt apt-get -y install chef-server chef-server-webui
+
+ # HACK AROUND CHEF-2005
+ cp patches/data_item.rb /usr/share/chef-server-api/app/controllers
+ # HACK AROUND CHEF-2005
+ rl=$(find /usr/lib/ruby -name run_list.rb)
+ cp -f "$rl" "$rl.bak"
+ cp -f patches/run_list.rb "$rl"
+ # Make the Rubygems provider in Chef respect gemrc files.
+ cp -f patches/rubygems.rb /usr/lib/ruby/vendor_ruby/chef/provider/package
+ log_to svc service chef-server restart
+}
+
+# Make sure we use the right OS installer. By default we want to install
+# the same OS as the admin node.
+fix_up_os_deployer() {
+ for t in provisioner deployer; do
+ sed -i '/os_install/ s/os_install/ubuntu_install/' \
+ /opt/dell/barclamps/${t}/chef/data_bags/crowbar/bc-template-${t}.json
+ done
+}
+
+pre_crowbar_fixups() { : ; }
+
+update_admin_node() {
+ log_to apt apt-get -y upgrade
+}
+
+restart_ssh() {
+ service ssh restart
+}
View
130 ubuntu-11.10-extra/common_install.sh
@@ -0,0 +1,130 @@
+#!/bin/bash
+# Copyright 2011, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This script is called by the other install scripts to layout the crowbar
+# software + dell pieces.
+#
+# Requires:
+# /tftpboot/ubuntu_dvd is populated with a tarball of the dvd and this file.
+#
+
+export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '
+set -x
+exec > /root/post-install.log 2>&1
+
+BASEDIR="/tftpboot/ubuntu_dvd"
+OS_TOKEN="ubuntu-11.10"
+
+# Make sure /opt is created
+mkdir -p /opt/dell/bin
+
+mkdir -p "/tftpboot/$OS_TOKEN"
+(cd "/tftpboot/$OS_TOKEN"; ln -s ../ubuntu_dvd install)
+echo "deb file:/tftpboot/$OS_TOKEN/install oneiric main restricted" \
+ > /etc/apt/sources.list
+
+# Make a destination for dell finishing scripts
+
+finishing_scripts=(update_hostname.sh parse_node_data)
+( cd "$BASEDIR/dell"; cp "${finishing_scripts[@]}" /opt/dell/bin; )
+
+# "Install h2n for named management"
+cd /opt/dell/
+tar -zxf "$BASEDIR/extra/h2n.tar.gz"
+ln -s /opt/dell/h2n-2.56/h2n /opt/dell/bin/h2n
+
+# Set up initial syslog
+cp "$BASEDIR/rsyslog.d/"* /etc/rsyslog.d/
+
+# Barclamp preparation (put them in the right places)
+mkdir /opt/dell/barclamps
+for i in "$BASEDIR/dell/barclamps/"*".tar.gz"; do
+ [[ -f $i ]] || continue
+ (cd /opt/dell/barclamps && tar xzf "$i")
+ echo "copy new format $i"
+done
+
+barclamp_scripts=(barclamp_install.rb barclamp_multi.rb)
+( cd "/opt/dell/barclamps/crowbar/bin"; \
+ cp "${barclamp_scripts[@]}" /opt/dell/bin; )
+
+# Make sure the bin directory is executable
+chmod +x /opt/dell/bin/*
+
+# Make sure we can actaully install Crowbar
+chmod +x "$BASEDIR/extra/"*
+
+# Make sure the ownerships are correct
+chown -R crowbar.admin /opt/dell
+
+# Look for any crowbar specific kernel parameters
+for s in $(cat /proc/cmdline); do
+ VAL=${s#*=} # everything after the first =
+ case ${s%%=*} in # everything before the first =
+ crowbar.hostname) CHOSTNAME=$VAL;;
+ crowbar.url) CURL=$VAL;;
+ crowbar.use_serial_console)
+ sed -i "s/\"use_serial_console\": .*,/\"use_serial_console\": $VAL,/" /opt/dell/chef/data_bags/crowbar/bc-template-provisioner.json;;
+ crowbar.debug.logdest)
+ echo "*.* $VAL" >> /etc/rsyslog.d/00-crowbar-debug.conf
+ mkdir -p "$BASEDIR/rsyslog.d"
+ echo "*.* $VAL" >> "$BASEDIR/rsyslog.d/00-crowbar-debug.conf"
+ ;;
+ crowbar.authkey)
+ mkdir -p "/root/.ssh"
+ printf "$VAL\n" >>/root/.ssh/authorized_keys
+ printf "$VAL\n" >>/opt/dell/barclamps/provisioner/chef/cookbooks/provisioner/templates/default/authorized_keys.erb
+ ;;
+ crowbar.debug)
+ sed -i -e '/config.log_level/ s/^#//' \
+ -e '/config.logger.level/ s/^#//' \
+ /opt/dell/barclamps/crowbar/crowbar_framework/config/environments/production.rb
+ ;;
+
+ esac
+done
+
+if ! grep -q '192\.168\.124\.10' /etc/network/interfaces; then
+ cat >> /etc/network/interfaces <<EOF
+auto eth0
+iface eth0 inet static
+ address 192.168.124.10
+ netmask 255.255.255.0
+EOF
+fi
+
+if [[ $CHOSTNAME ]]; then
+ cat > /install_system.sh <<EOF
+#!/bin/bash
+set -e
+cd /tftpboot/ubuntu_dvd/extra
+./install $CHOSTNAME
+
+rm -f /etc/rc2.d/S99install
+rm -f /etc/rc3.d/S99install
+rm -f /etc/rc5.d/S99install
+
+rm -f /install_system.sh
+
+EOF
+
+ chmod +x /install_system.sh
+ ln -s /install_system.sh /etc/rc3.d/S99install
+ ln -s /install_system.sh /etc/rc5.d/S99install
+ ln -s /install_system.sh /etc/rc2.d/S99install
+
+fi
View
12 ubuntu-11.10-extra/debsel.conf
@@ -0,0 +1,12 @@
+# New password for the 'admin' user in the Chef Server WebUI:
+chef-server-webui chef-server-webui/admin_password password password
+# New password for the 'chef' AMQP user in the RabbitMQ vhost "/chef":
+chef-solr chef-solr/amqp_password password password
+chef chef/chef_server_url string http://__HOSTNAME__:4000
+
+# Do you accept the DLJ license terms?
+sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
+sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
+sun-java6-jre sun-java6-jre/stopthread boolean true
+sun-java6-jre sun-java6-jre/jcepolicy note
+
View
20 ubuntu-11.10-extra/install
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Copyright 2011, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+cd /tftpboot/ubuntu_dvd/extra
+script -f -c "./install-chef.sh $1" /var/log/install.log
+cd -
+
View
10 ubuntu-11.10-extra/isolinux/isolinux.cfg
@@ -0,0 +1,10 @@
+include menu.cfg
+default CrowbarAdmin
+prompt 0
+timeout 10
+
+LABEL CrowbarAdmin
+ menu label ^Crowbar Admin Installation
+ kernel /install/vmlinuz
+ append file=/cdrom/preseed/crowbar_admin.seed debian-installer/locale=en_US.utf8 console-setup/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true cdrom-detect/load_floppy?=false cdrom-detect/load_media=false cdrom-detect/manual_config=true cdrom-detect/cdrom_module=none cdrom-detect/cdrom_device=/dev/scd0 initrd=/install/initrd.gz ramdisk_size=16384 root=/dev/ram rw quiet --
+
View
BIN ubuntu-11.10-extra/isolinux/pxelinux.0
Binary file not shown.
View
11 ubuntu-11.10-extra/isolinux/pxelinux.cfg/default
@@ -0,0 +1,11 @@
+include ../menu.cfg
+default CrowbarAdmin
+prompt 0
+timeout 10
+
+LABEL CrowbarAdmin
+ menu label ^Crowbar Admin installation
+ kernel ../ubuntu_dvd/install/netboot/ubuntu-installer/amd64/linux
+ append url=http://192.168.1.2:8091/ubuntu_dvd/preseed/crowbar_admin_net.seed debian-installer/locale=en_US.utf8 console-setup/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true netcfg/wireless_wep= netcfg/choose_interface=auto netcfg/dhcp_timeout=120 netcfg/get_hostname="redundant" initrd=../ubuntu_dvd/install/netboot/ubuntu-installer/amd64/initrd.gz ramdisk_size=16384 root=/dev/ram rw quiet --
+ IPAPPEND 2
+
View
5 ubuntu-11.10-extra/packages/base.list
@@ -0,0 +1,5 @@
+## LEGACY:
+
+# All repo, package, and gem information that was here has been migrated to
+# barclamps/*/crowbar.yml. Base OS repositories and packages are in
+# barclamps/crowbar/crowbar.yml!
View
108 ubuntu-11.10-extra/patches/data_item.rb
@@ -0,0 +1,108 @@
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Author:: Christopher Brown (<cb@opscode.com>)
+# Author:: Nuo Yan (<nuo@opscode.com>)
+# Copyright:: Copyright (c) 2008 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/data_bag'
+require 'chef/data_bag_item'
+
+class DataItem < Application
+
+ provides :json
+
+ before :populate_data_bag
+ before :authenticate_every
+ before :is_admin, :only => [ :create, :update, :destroy ]
+
+ def populate_data_bag
+ begin
+ @data_bag = Chef::DataBag.cdb_load(params[:data_bag_id])
+ rescue Chef::Exceptions::CouchDBNotFound => e
+ raise NotFound, "Cannot load data bag #{params[:data_bag_id]}"
+ end
+ end
+
+ def show
+ begin
+ @data_bag_item = Chef::DataBagItem.cdb_load(params[:data_bag_id], params[:id])
+ rescue Chef::Exceptions::CouchDBNotFound => e
+ raise NotFound, "Cannot load data bag #{params[:data_bag_id]} item #{params[:id]}"
+ end
+ display @data_bag_item
+ end
+
+ def create
+ raw_data = nil
+ if params.has_key?("inflated_object")
+ raw_data = params["inflated_object"].raw_data
+ else
+ raw_data = params
+ raw_data.delete(:action)
+ raw_data.delete(:controller)
+ raw_data.delete(:data_bag_id)
+ end
+ @data_bag_item = nil
+ begin
+ @data_bag_item = Chef::DataBagItem.cdb_load(@data_bag.name, params[:id])
+ rescue Chef::Exceptions::CouchDBNotFound
+ @data_bag_item = Chef::DataBagItem.new
+ @data_bag_item.data_bag(@data_bag.name)
+ else
+ raise Conflict, "Databag Item #{params[:id]} already exists" if @data_bag_item
+ end
+ @data_bag_item.raw_data = raw_data
+ @data_bag_item.cdb_save
+ display @data_bag_item
+ end
+
+ def update
+ raw_data = nil
+ if params.has_key?("inflated_object")
+ raw_data = params["inflated_object"].raw_data
+ else
+ raw_data = params
+ raw_data.delete(:action)
+ raw_data.delete(:controller)
+ raw_data.delete(:data_bag_id)
+ end
+
+ begin
+ @data_bag_item = Chef::DataBagItem.cdb_load(@data_bag.name, params[:id])
+ rescue Chef::Exceptions::CouchDBNotFound => e
+ raise NotFound, "Cannot load Databag Item #{params[:id]}"
+ end
+
+ @data_bag_item.raw_data = raw_data
+ @data_bag_item.cdb_save
+ display @data_bag_item
+
+ end
+
+
+ def destroy
+ begin
+ @data_bag_item = Chef::DataBagItem.cdb_load(params[:data_bag_id], params[:id])
+ rescue Chef::Exceptions::CouchDBNotFound => e
+ raise NotFound, "Cannot load data bag #{params[:data_bag_id]} item #{params[:id]}"
+ end
+ @data_bag_item.cdb_destroy
+ @data_bag_item.couchdb_rev = nil
+ display @data_bag_item
+ end
+
+end
View
459 ubuntu-11.10-extra/patches/rubygems.rb
@@ -0,0 +1,459 @@
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Author:: Daniel DeLeo (<dan@opscode.com>)
+# Copyright:: Copyright (c) 2008, 2010 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/provider/package'
+require 'chef/mixin/command'
+require 'chef/resource/package'
+require 'chef/mixin/get_source_from_package'
+
+# Class methods on Gem are defined in rubygems
+require 'rubygems'
+# Ruby 1.9's gem_prelude can interact poorly with loading the full rubygems
+# explicitly like this. Make sure rubygems/specification is always last in this
+# list
+require 'rubygems/version'
+require 'rubygems/dependency'
+require 'rubygems/spec_fetcher'
+require 'rubygems/platform'
+require 'rubygems/format'
+require 'rubygems/dependency_installer'
+require 'rubygems/uninstaller'
+require 'rubygems/specification'
+
+class Chef
+ class Provider
+ class Package
+ class Rubygems < Chef::Provider::Package
+ class GemEnvironment
+ # HACK: trigger gem config load early. Otherwise it can get lazy
+ # loaded during operations where we've set Gem.sources to an
+ # alternate value and overwrite it with the defaults.
+ Gem.configuration
+
+ DEFAULT_UNINSTALLER_OPTS = {:ignore => true, :executables => true}
+
+ ##
+ # The paths where rubygems should search for installed gems.
+ # Implemented by subclasses.
+ def gem_paths
+ raise NotImplementedError
+ end
+
+ ##
+ # A rubygems source index containing the list of gemspecs for all
+ # available gems in the gem installation.
+ # Implemented by subclasses
+ # === Returns
+ # Gem::SourceIndex
+ def gem_source_index
+ raise NotImplementedError
+ end
+
+ ##
+ # Lists the installed versions of +gem_name+, constrained by the
+ # version spec in +gem_dep+
+ # === Arguments
+ # Gem::Dependency +gem_dep+ is a Gem::Dependency object, its version
+ # specification constrains which gems are returned.
+ # === Returns
+ # [Gem::Specification] an array of Gem::Specification objects
+ def installed_versions(gem_dep)
+ gem_source_index.search(gem_dep)
+ end
+
+ ##
+ # Yields to the provided block with rubygems' source list set to the
+ # list provided. Always resets the list when the block returns or
+ # raises an exception.
+ def with_gem_sources(*sources)
+ sources.compact!
+ original_sources = Gem.sources
+ Gem.sources = sources unless sources.empty?
+ yield
+ ensure
+ Gem.sources = original_sources
+ end
+
+ ##
+ # Determines the candidate version for a gem from a .gem file on disk
+ # and checks if it matches the version contraints in +gem_dependency+
+ # === Returns
+ # Gem::Version a singular gem version object is returned if the gem
+ # is available
+ # nil returns nil if the gem on disk doesn't match the
+ # version constraints for +gem_dependency+
+ def candidate_version_from_file(gem_dependency, source)
+ spec = Gem::Format.from_file_by_path(source).spec
+ if spec.satisfies_requirement?(gem_dependency)
+ logger.debug {"#{@new_resource} found candidate gem version #{spec.version} from local gem package #{source}"}
+ spec.version
+ else
+ # This is probably going to end badly...
+ logger.warn { "#{@new_resource} gem package #{source} does not satisfy the requirements #{gem_dependency.to_s}" }
+ nil
+ end
+ end
+
+ ##
+ # Finds the newest version that satisfies the constraints of
+ # +gem_dependency+. The version is determined from the cache or a
+ # round-trip to the server as needed. The architecture and gem
+ # sources will be set before making the query.
+ # === Returns
+ # Gem::Version a singular gem version object is returned if the gem
+ # is available
+ # nil returns nil if the gem could not be found
+ def candidate_version_from_remote(gem_dependency, *sources)
+ raise NotImplementedError
+ end
+
+ ##
+ # Find the newest gem version available from Gem.sources that satisfies
+ # the constraints of +gem_dependency+
+ def find_newest_remote_version(gem_dependency, *sources)
+ # DependencyInstaller sorts the results such that the last one is
+ # always the one it considers best.
+ spec_with_source = dependency_installer.find_gems_with_sources(gem_dependency).last
+
+ spec = spec_with_source && spec_with_source[0]
+ version = spec && spec_with_source[0].version
+ if version
+ logger.debug { "#{@new_resource} found gem #{spec.name} version #{version} for platform #{spec.platform} from #{spec_with_source[1]}" }
+ version
+ else
+ source_list = sources.compact.empty? ? "[#{Gem.sources.join(', ')}]" : "[#{sources.join(', ')}]"
+ logger.warn { "#{@new_resource} failed to find gem #{gem_dependency} from #{source_list}" }
+ nil
+ end
+ end
+
+ ##
+ # Installs a gem via the rubygems ruby API.
+ # === Options
+ # :sources rubygems servers to use
+ # Other options are passed to Gem::DependencyInstaller.new
+ def install(gem_dependency, options={})
+ with_gem_sources(*options.delete(:sources)) do
+ with_correct_verbosity do
+ dependency_installer(options).install(gem_dependency)
+ end
+ end
+ end
+
+ ##
+ # Uninstall the gem +gem_name+ via the rubygems ruby API. If
+ # +gem_version+ is provided, only that version will be uninstalled.
+ # Otherwise, all versions are uninstalled.
+ # === Options
+ # Options are passed to Gem::Uninstaller.new
+ def uninstall(gem_name, gem_version=nil, opts={})
+ gem_version ? opts[:version] = gem_version : opts[:all] = true
+ with_correct_verbosity do
+ uninstaller(gem_name, opts).uninstall
+ end
+ end
+
+ ##
+ # Set rubygems' user interaction to ConsoleUI or SilentUI depending
+ # on our current debug level
+ def with_correct_verbosity
+ Gem::DefaultUserInteraction.ui = Chef::Log.debug? ? Gem::ConsoleUI.new : Gem::SilentUI.new
+ yield
+ end
+
+ def dependency_installer(opts={})
+ Gem::DependencyInstaller.new(opts)
+ end
+
+ def uninstaller(gem_name, opts={})
+ Gem::Uninstaller.new(gem_name, DEFAULT_UNINSTALLER_OPTS.merge(opts))
+ end
+
+ private
+
+ def logger
+ Chef::Log.logger
+ end
+
+ end
+
+ class CurrentGemEnvironment < GemEnvironment
+
+ def gem_paths
+ Gem.path
+ end
+
+ def gem_source_index
+ Gem.source_index
+ end
+
+ def candidate_version_from_remote(gem_dependency, *sources)
+ with_gem_sources(*sources) do
+ find_newest_remote_version(gem_dependency, *sources)
+ end
+ end
+
+ end
+
+ class AlternateGemEnvironment < GemEnvironment
+ JRUBY_PLATFORM = /(:?universal|x86_64|x86)\-java\-[0-9\.]+/
+
+ def self.gempath_cache
+ @gempath_cache ||= {}
+ end
+
+ def self.platform_cache
+ @platform_cache ||= {}
+ end
+
+ include Chef::Mixin::ShellOut
+
+ attr_reader :gem_binary_location
+
+ def initialize(gem_binary_location)
+ @gem_binary_location = gem_binary_location
+ end
+
+ def gem_paths
+ if self.class.gempath_cache.key?(@gem_binary_location)
+ self.class.gempath_cache[@gem_binary_location]
+ else
+ # shellout! is a fork/exec which won't work on windows
+ shell_style_paths = shell_out!("#{@gem_binary_location} env gempath").stdout
+ # on windows, the path separator is (usually? always?) semicolon
+ paths = shell_style_paths.split(::File::PATH_SEPARATOR).map { |path| path.strip }
+ self.class.gempath_cache[@gem_binary_location] = paths
+ end
+ end
+
+ def gem_source_index
+ @source_index ||= Gem::SourceIndex.from_gems_in(*gem_paths.map { |p| p + '/specifications' })
+ end
+
+ ##
+ # Attempt to detect the correct platform settings for the target gem
+ # environment.
+ #
+ # In practice, this only makes a difference if different versions are
+ # available depending on platform, and only if the target gem
+ # environment has a radically different platform (i.e., jruby), so we
+ # just try to detect jruby and fall back to the current platforms
+ # (Gem.platforms) if we don't detect it.
+ #
+ # === Returns
+ # [String|Gem::Platform] returns an array of Gem::Platform-compatible
+ # objects, i.e., Strings that are valid for Gem::Platform or actual
+ # Gem::Platform objects.
+ def gem_platforms
+ if self.class.platform_cache.key?(@gem_binary_location)
+ self.class.platform_cache[@gem_binary_location]
+ else
+ gem_environment = shell_out!("#{@gem_binary_location} env").stdout
+ if jruby = gem_environment[JRUBY_PLATFORM]
+ self.class.platform_cache[@gem_binary_location] = ['ruby', Gem::Platform.new(jruby)]
+ else
+ self.class.platform_cache[@gem_binary_location] = Gem.platforms
+ end
+ end
+ end
+
+ def with_gem_platforms(*alt_gem_platforms)
+ alt_gem_platforms.flatten!
+ original_gem_platforms = Gem.platforms
+ Gem.platforms = alt_gem_platforms
+ yield
+ ensure
+ Gem.platforms = original_gem_platforms
+ end
+
+ def candidate_version_from_remote(gem_dependency, *sources)
+ with_gem_sources(*sources) do
+ with_gem_platforms(*gem_platforms) do
+ find_newest_remote_version(gem_dependency, *sources)
+ end
+ end
+ end
+
+ end
+
+ include Chef::Mixin::ShellOut
+
+ attr_reader :gem_env
+
+ def logger
+ Chef::Log.logger
+ end
+
+ include Chef::Mixin::GetSourceFromPackage
+
+ def initialize(new_resource, run_context=nil)
+ super
+ if new_resource.gem_binary or Gem.configuration["gem"]
+ if new_resource.options && new_resource.options.kind_of?(Hash)
+ msg = "options cannot be given as a hash when using an explicit gem_binary\n"
+ msg << "in #{new_resource} from #{new_resource.source_line}"
+ raise ArgumentError, msg
+ end
+ @gem_env = AlternateGemEnvironment.new(new_resource.gem_binary || "gem")
+ else
+ @gem_env = CurrentGemEnvironment.new
+ end
+ end
+
+ def gem_dependency
+ Gem::Dependency.new(@new_resource.package_name, @new_resource.version)
+ end
+
+ def source_is_remote?
+ return true if @new_resource.source.nil?
+ URI.parse(@new_resource.source).absolute?
+ end
+
+ def current_version
+ #raise 'todo'
+ # If one or more matching versions are installed, the newest of them
+ # is the current version
+ if !matching_installed_versions.empty?
+ gemspec = matching_installed_versions.last
+ logger.debug { "#{@new_resource} found installed gem #{gemspec.name} version #{gemspec.version} matching #{gem_dependency}"}
+ gemspec
+ # If no version matching the requirements exists, the latest installed
+ # version is the current version.
+ elsif !all_installed_versions.empty?
+ gemspec = all_installed_versions.last
+ logger.debug { "#{@new_resource} newest installed version of gem #{gemspec.name} is #{gemspec.version}" }
+ gemspec
+ else
+ logger.debug { "#{@new_resource} no installed version found for #{gem_dependency.to_s}"}
+ nil
+ end
+ end
+
+ def matching_installed_versions
+ @matching_installed_versions ||= @gem_env.installed_versions(gem_dependency)
+ end
+
+ def all_installed_versions
+ @all_installed_versions ||= begin
+ @gem_env.installed_versions(Gem::Dependency.new(gem_dependency.name, '>= 0'))
+ end
+ end
+
+ def gem_sources
+ @new_resource.source ? Array(@new_resource.source) : nil
+ end
+
+ def load_current_resource
+ @current_resource = Chef::Resource::Package::GemPackage.new(@new_resource.name)
+ @current_resource.package_name(@new_resource.package_name)
+ if current_spec = current_version
+ @current_resource.version(current_spec.version.to_s)
+ end
+ @current_resource
+ end
+
+ def candidate_version
+ @candidate_version ||= begin
+ if target_version_already_installed?
+ nil
+ elsif source_is_remote?
+ @gem_env.candidate_version_from_remote(gem_dependency, *gem_sources).to_s
+ else
+ @gem_env.candidate_version_from_file(gem_dependency, @new_resource.source).to_s
+ end
+ end
+ end
+
+ def target_version_already_installed?
+ return false unless @current_resource && @current_resource.version
+ return false if @current_resource.version.nil?
+ # in the future we could support squiggly requirements like "~> 1.2.0"
+ # for now, the behavior when using anything other than exact
+ # requirements is undefined.
+ Gem::Requirement.new(@new_resource.version).satisfied_by?(Gem::Version.new(@current_resource.version))
+ end
+
+ ##
+ # Installs the gem, using either the gems API or shelling out to `gem`
+ # according to the following criteria:
+ # 1. Use gems API (Gem::DependencyInstaller) by default
+ # 2. shell out to `gem install` when a String of options is given
+ # 3. use gems API with options if a hash of options is given
+ def install_package(name, version)
+ case
+ when Gem.configuration["gem"] || @new_resource.gem_binary || @new_resource.options.kind_of?(String)
+ install_via_gem_command(name,version)
+ when source_is_remote? && @new_resource.options.kind_of?(Hash)
+ options = @new_resource.options
+ options[:sources] = gem_sources
+ @gem_env.install(gem_dependency, options)
+ when source_is_remote?
+ @gem_env.install(gem_dependency, :sources => gem_sources)
+ else
+ @gem_env.install(@new_resource.source)
+ end
+ true
+ end
+
+ def gem_binary_path
+ @new_resource.gem_binary || 'gem'
+ end
+
+ def install_via_gem_command(name, version)
+ src = @new_resource.source && " --source=#{@new_resource.source} --source=http://rubygems.org"
+ shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src}#{opts}", :env=>nil)
+ end
+
+ def upgrade_package(name, version)
+ install_package(name, version)
+ end
+
+ def remove_package(name, version)
+ case
+ when Gem.configuration["gem"] || @new_resource.gem_binary || @new_resource.options.kind_of?(String)
+ uninstall_via_gem_command(name, version)
+ when @new_resource.options.kind_of?(Hash)
+ @gem_env.uninstall(name, version, @new_resource.options)
+ else
+ @gem_env.uninstall(name, version)
+ end
+ end
+
+ def uninstall_via_gem_command(name, version)
+ if version
+ shell_out!("#{gem_binary_path} uninstall #{name} -q -x -I -v \"#{version}\"#{opts}", :env=>nil)
+ else
+ shell_out!("#{gem_binary_path} uninstall #{name} -q -x -I -a#{opts}", :env=>nil)
+ end
+ end
+
+ def purge_package(name, version)
+ remove_package(name, version)
+ end
+
+ private
+
+ def opts
+ expand_options(@new_resource.options)
+ end
+
+ end
+ end
+ end
+end
View
170 ubuntu-11.10-extra/patches/run_list.rb
@@ -0,0 +1,170 @@
+#
+# Author:: Adam Jacob (<adam@opscode.com>)
+# Author:: Nuo Yan (<nuoyan@opscode.com>)
+# Author:: Tim Hinderliter (<tim@opscode.com>)
+# Author:: Christopher Walters (<cw@opscode.com>)
+# Author:: Seth Falcon (<seth@opscode.com>)
+# Copyright:: Copyright (c) 2008-2011 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require 'chef/run_list/run_list_item'
+require 'chef/run_list/run_list_expansion'
+require 'chef/run_list/versioned_recipe_list'
+require 'chef/mixin/params_validate'
+
+class Chef
+ class RunList
+ include Enumerable
+ include Chef::Mixin::ParamsValidate
+
+ # @run_list_items is an array of RunListItems that describe the items to
+ # execute in order. RunListItems can load from and convert to the string
+ # forms users set on roles and nodes.
+ # For example:
+ # @run_list_items = ['recipe[foo::bar]', 'role[webserver]']
+ # Thus,
+ # self.role_names would return ['webserver']
+ # self.recipe_names would return ['foo::bar']
+ attr_reader :run_list_items
+
+ # For backwards compat
+ alias :run_list :run_list_items
+
+ def initialize(*run_list_items)
+ @run_list_items = run_list_items.map { |i| coerce_to_run_list_item(i) }
+ end
+
+ def role_names
+ @run_list_items.inject([]){|memo, run_list_item| memo << run_list_item.name if run_list_item.role? ; memo}
+ end
+
+ alias :roles :role_names
+
+ def recipe_names
+ @run_list_items.inject([]){|memo, run_list_item| memo << run_list_item.name if run_list_item.recipe? ; memo}
+ end
+
+ alias :recipes :recipe_names
+
+ # Add an item of the form "recipe[foo::bar]" or "role[webserver]";
+ # takes a String or a RunListItem
+ def <<(run_list_item)
+ run_list_item = coerce_to_run_list_item(run_list_item)
+ @run_list_items << run_list_item unless @run_list_items.include?(run_list_item)
+ self
+ end
+
+ alias :push :<<
+
+ def ==(other)
+ if other.kind_of?(Chef::RunList)
+ other.run_list_items == @run_list_items
+ else
+ if other.kind_of?(String)
+ other_run_list_items = [ coerce_to_run_list_item(other) ]
+ else
+ other_run_list_items = other.dup
+ end
+ return false unless other.respond_to?(:size) && (other.size == @run_list_items.size)
+ return false unless other.respond_to?(:map!)
+
+ other_run_list_items.map! { |item| coerce_to_run_list_item(item) }
+ other_run_list_items == @run_list_items
+ end
+ end
+
+ def to_s
+ @run_list_items.join(", ")
+ end
+
+ def to_json(*args)
+ to_a.to_json(*args)
+ end
+
+ def empty?
+ @run_list_items.length == 0 ? true : false
+ end
+
+ def [](pos)
+ @run_list_items[pos]
+ end
+
+ def []=(pos, item)
+ @run_list_items[pos] = parse_entry(item)
+ end
+
+ def each(&block)
+ @run_list_items.each { |i| block.call(i) }
+ end
+
+ def each_index(&block)
+ @run_list_items.each_index { |i| block.call(i) }
+ end
+
+ def include?(item)
+ @run_list_items.include?(parse_entry(item))
+ end
+
+ def reset!(*args)
+ @run_list_items.clear
+ args.flatten.each do |item|
+ if item.kind_of?(Chef::RunList)
+ item.each { |r| self << r }
+ else
+ self << item
+ end
+ end
+ self
+ end
+
+ def remove(item)
+ @run_list_items.delete_if{|i| i == item}
+ self
+ end
+ alias :delete :remove
+
+ # Expands this run_list: recursively expand roles into their included
+ # recipes.
+ # Returns a RunListExpansion object.
+ def expand(environment, data_source='server', expansion_opts={})
+ expansion = expansion_for_data_source(environment, data_source, expansion_opts)
+ expansion.expand
+ expansion
+ end
+
+ # Converts a string run list entry to a RunListItem object.
+ def parse_entry(entry)
+ RunListItem.new(entry)
+ end
+
+ def coerce_to_run_list_item(item)
+ item.kind_of?(RunListItem) ? item : parse_entry(item)
+ end
+
+ def expansion_for_data_source(environment, data_source, opts={})
+ case data_source.to_s
+ when 'disk'
+ RunListExpansionFromDisk.new(environment, @run_list_items)
+ when 'server'
+ RunListExpansionFromAPI.new(environment, @run_list_items, opts[:rest])
+ when 'couchdb'
+ RunListExpansionFromCouchDB.new(environment, @run_list_items, opts[:couchdb])
+ end
+ end
+
+
+ end
+end
+
View
37 ubuntu-11.10-extra/post-install.sh
@@ -0,0 +1,37 @@
+# Copyright 2011, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This script is called by the ubuntu.seed file during
+# ubuntu install. It handles doing the manual sets needed to layout the
+# filesystem the rest of the way before running the common_install.sh.
+#
+# The intent is that once the system is finished installing, the customer
+# will edit the config.json file and run install.sh to complete installation
+# and initial configuration.
+#
+
+#
+# We are a cd install.
+#
+
+mkdir -p /target/tftpboot/ubuntu_dvd/extra
+cp /cdrom/extra/common_install.sh /target/tftpboot/ubuntu_dvd/extra
+cd /cdrom
+cp -a . /target/tftpboot/ubuntu_dvd
+
+mount /proc /target/proc
+chroot /target bash /tftpboot/ubuntu_dvd/extra/common_install.sh
+
View
386 ubuntu-11.10-extra/preseed/crowbar_admin.seed
@@ -0,0 +1,386 @@
+#### Contents of the preconfiguration file (for &releasename;)
+### Localization
+# Locale sets language and country.
+d-i debian-installer/locale string en_US.utf8
+
+# Keyboard selection.
+# Disable automatic (interactive) keymap detection.
+d-i console-setup/ask_detect boolean false
+#d-i console-setup/modelcode string pc105
+d-i console-setup/layoutcode string us
+# To select a variant of the selected layout (if you leave this out, the
+# basic form of the layout will be used):
+#d-i console-setup/variantcode string dvorak
+
+### Network configuration
+# 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
+
+# To pick a particular interface instead:
+#d-i netcfg/choose_interface select eth1
+
+# If you have a slow dhcp server and the installer times out waiting for
+# it, this might be useful.
+d-i netcfg/dhcp_timeout string 3
+
+# If you prefer to configure the network manually, uncomment this line and
+# the static network configuration below.
+#d-i netcfg/disable_dhcp boolean true
+
+# If you want the preconfiguration file to work on systems both with and
+# without a dhcp server, uncomment these lines and the static network
+# configuration below.
+d-i netcfg/dhcp_failed note
+d-i netcfg/dhcp_options select Do not configure the network at this time
+
+# Static network configuration.
+#d-i netcfg/get_nameservers string 192.168.1.1
+#d-i netcfg/get_ipaddress string 192.168.1.42
+#d-i netcfg/get_netmask string 255.255.255.0
+#d-i netcfg/get_gateway string 192.168.1.1
+#d-i netcfg/confirm_static boolean true
+
+# Any hostname and domain names assigned from dhcp take precedence over
+# values set here. However, setting the values still prevents the questions
+# from being shown, even if values come from dhcp.
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# Disable that annoying WEP key dialog.
+#d-i netcfg/wireless_wep string
+# The wacky dhcp hostname that some ISPs use as a password of sorts.
+#d-i netcfg/dhcp_hostname string radish
+
+# 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
+
+### Mirror settings
+# If you select ftp, the mirror/country string does not need to be set.
+#d-i mirror/protocol string ftp
+#d-i mirror/country string manual
+#d-i mirror/http/hostname string http.us.debian.org
+#d-i mirror/http/directory string /ubuntu
+#d-i mirror/http/proxy string
+
+# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
+# CC is the ISO-3166-2 code for the selected country. You can preseed this
+# so that it does so without asking.
+#d-i mirror/http/mirror select CC.archive.ubuntu.com
+
+# Suite to install.
+#d-i mirror/suite string &releasename;
+# Suite to use for loading installer components (optional).
+#d-i mirror/udeb/suite string &releasename;
+# Components to use for loading installer components (optional).
+#d-i mirror/udeb/components multiselect main, restricted
+
+### Clock and time zone setup
+# Controls whether or not the hardware clock is set to UTC.
+d-i clock-setup/utc boolean true
+
+# You may set this to any valid setting for $TZ; see the contents of
+# /usr/share/zoneinfo/ for valid values.
+d-i time/zone string US/Central
+
+# Controls whether to use NTP to set the clock during the install
+#d-i clock-setup/ntp boolean true
+# NTP server to use. The default is almost always fine here.
+#d-i clock-setup/ntp-server string ntp.example.com
+
+### Partitioning
+# If the system has free space you can choose to only partition that space.
+# Alternatives: custom, some_device, some_device_crypto, some_device_lvm.
+#d-i partman-auto/init_automatically_partition select biggest_free
+
+# Alternatively, you can specify a disk to partition. The device name must
+# be given in traditional non-devfs format.
+# Note: A disk must be specified, unless the system has only one disk.
+# For example, to use the first SCSI/SATA hard disk:
+d-i partman-auto/disk string /dev/sda
+# In addition, you'll need to specify the method to use.
+# The presently available methods are: "regular", "lvm" and "crypto"
+d-i partman-auto/method string lvm
+
+# If one of the disks that are going to be automatically partitioned
+# contains an old LVM configuration, the user will normally receive a
+# warning. This can be preseeded away...
+d-i partman-lvm/device_remove_lvm boolean true
+
+# If one of the disks that are going to be automatically partitioned
+# contains an old LVM configuration, the user will normally receive a
+# warning. This can be preseeded away...
+d-i partman-auto/purge_lvm_from_device boolean true
+
+
+# The same applies to pre-existing software RAID array:
+d-i partman-md/device_remove_md boolean true
+# And the same goes for the confirmation to write the lvm partitions.
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nochanges boolean true
+d-i partman-lvm/confirm_nooverwrite 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
+#d-i partman-auto-lvm/guided_size string 10GB
+#d-i partman-auto-lvm/guided_size string 50%
+
+# 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
+
+# Or provide a recipe of your own...
+# The recipe format is documented in the file devel/partman-auto-recipe.txt.
+# If you have a way to get a recipe file into the d-i environment, you can
+# just point at it.
+#d-i partman-auto/expert_recipe_file string /hd-media/recipe
+
+# If not, you can put an entire recipe into the preconfiguration file in one
+# (logical) line. This example creates a small /boot partition, suitable
+# swap, and uses the rest of the space for the root partition:
+#d-i partman-auto/expert_recipe string \
+# boot-root :: \
+# 40 50 100 ext3 \
+# $primary{ } $bootable{ } \
+# method{ format } format{ } \
+# use_filesystem{ } filesystem{ ext3 } \
+# mountpoint{ /boot } \
+# . \
+# 500 10000 1000000000 ext3 \
+# method{ format } format{ } \
+# use_filesystem{ } filesystem{ ext3 } \
+# mountpoint{ / } \
+# . \
+# 64 512 300% linux-swap \
+# method{ swap } format{ } \
+# .
+
+# 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
+
+# This makes partman automatically partition without confirmation, provided
+# that you told it what to do using one of the methods above.
+d-i partman/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
+
+### Controlling how partitions are mounted
+# The default is to mount by UUID, but you can also choose "traditional" to
+# use traditional device names, or "label" to try filesystem labels before
+# falling back to UUIDs.
+#d-i partman/mount_style select uuid
+
+### Base system installation
+# The kernel image (meta) package to be installed; "none" can be used if no
+# kernel is to be installed.
+#d-i base-installer/kernel/image string linux-generic
+
+### Account setup
+# Skip creation of a root account (normal user account will be able to
+# use sudo). The default is false; preseed this to true if you want to set
+# a root password.
+#d-i passwd/root-login boolean false
+# Alternatively, to skip creation of a normal user account.
+#d-i passwd/make-user boolean false
+
+# Root password, either in clear text
+#d-i passwd/root-password password r00tme
+#d-i passwd/root-password-again password r00tme
+# or encrypted using an MD5 hash.
+#d-i passwd/root-password-crypted password [MD5 hash]
+
+# To create a normal user account.
+d-i passwd/user-fullname string Admin Account
+d-i passwd/username string crowbar
+# Normal user's password, either in clear text
+d-i passwd/user-password password crowbar
+d-i passwd/user-password-again password crowbar
+# or encrypted using an MD5 hash.
+#d-i passwd/user-password-crypted password [MD5 hash]
+# Create the first user with the specified UID instead of the default.
+#d-i passwd/user-uid string 1010
+# The installer will warn about weak passwords. If you are sure you know
+# what you're doing and want to override it, uncomment this.
+d-i user-setup/allow-password-weak boolean true
+
+# The user account will be added to some standard initial groups. To
+# override that, use this.
+#d-i passwd/user-default-groups string audio cdrom video
+
+# Set to true if you want to encrypt the first user's home directory.
+d-i user-setup/encrypt-home boolean false
+
+### Apt setup
+# 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
+# Uncomment this if you don't want to use a network mirror.
+#d-i apt-setup/use_mirror boolean false
+# 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
+
+# Additional repositories, local[0-9] available
+#d-i apt-setup/local0/repository string \
+# http://local.server/ubuntu &releasename; main
+#d-i apt-setup/local0/comment string local server
+# Enable deb-src lines
+#d-i apt-setup/local0/source boolean true
+# 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
+
+### Package selection
+#tasksel tasksel/first multiselect ubuntu-desktop
+tasksel tasksel/first multiselect ubuntu-standard, openssh-server
+#tasksel tasksel/first multiselect kubuntu-desktop
+
+# Individual additional packages to install
+d-i pkgsel/include string openssh-server curl dpkg-dev
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+#d-i pkgsel/upgrade select none
+
+# Language pack selection
+#d-i pkgsel/language-packs multiselect de, en, zh
+
+# 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
+
+# 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
+
+# By default, the system's locate database will be updated after the
+# installer has finished installing most packages. This may take a while, so
+# if you don't want it, you can set this to "false" to turn it off.
+#d-i pkgsel/updatedb boolean true
+
+### Boot loader installation
+# Grub is the default boot loader (for x86). If you want lilo installed
+# instead, uncomment this:
+#d-i grub-installer/skip boolean true
+# To also skip installing lilo, and install no bootloader, uncomment this
+# too:
+#d-i lilo-installer/skip boolean true
+
+# This is fairly safe to set, it makes grub install automatically to the MBR
+# if no other operating system is detected on the machine.
+d-i grub-installer/only_debian boolean true
+
+# This one makes grub-installer install to the MBR if it also finds some other
+# OS, which is less safe as it might not be able to boot that other OS.
+#d-i grub-installer/with_other_os boolean true
+
+# Alternatively, if you want to install to a location other than the mbr,
+# uncomment and edit these lines:
+#d-i grub-installer/only_debian boolean false
+#d-i grub-installer/with_other_os boolean false
+#d-i grub-installer/bootdev string (hd0,0)
+# To install grub to multiple disks:
+#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
+
+# Optional password for grub, either in clear text
+#d-i grub-installer/password password r00tme
+#d-i grub-installer/password-again password r00tme
+# or encrypted using an MD5 hash, see grub-md5-crypt(8).
+#d-i grub-installer/password-crypted password [MD5 hash]
+
+### Finishing up the installation
+# During installations from serial console, the regular virtual consoles
+# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next
+# line to prevent this.
+#d-i finish-install/keep-consoles boolean true
+
+# Avoid that last message about the install being complete.
+d-i finish-install/reboot_in_progress note
+
+# This will prevent the installer from ejecting the CD during the reboot,
+# which is useful in some situations.
+#d-i cdrom-detect/eject boolean false
+
+# This is how to make the installer shutdown when finished, but not
+# reboot into the installed system.
+#d-i debian-installer/exit/halt boolean true
+# This will power off the machine instead of just halting it.
+#d-i debian-installer/exit/poweroff boolean true
+
+### X configuration
+# X can detect the right driver for some cards, but if you're preseeding,
+# you override whatever it chooses. Still, vesa will work most places.
+#xserver-xorg xserver-xorg/config/device/driver select vesa
+
+# A caveat with mouse autodetection is that if it fails, X will retry it
+# over and over. So if it's preseeded to be done, there is a possibility of
+# an infinite loop if the mouse is not autodetected.
+#xserver-xorg xserver-xorg/autodetect_mouse boolean true
+
+# Monitor autodetection is recommended.
+xserver-xorg xserver-xorg/autodetect_monitor boolean true
+# Uncomment if you have an LCD display.
+#xserver-xorg xserver-xorg/config/monitor/lcd boolean true
+# X has three configuration paths for the monitor. Here's how to preseed
+# the "medium" path, which is always available. The "simple" path may not
+# be available, and the "advanced" path asks too many questions.
+xserver-xorg xserver-xorg/config/monitor/selection-method \
+ select medium
+xserver-xorg xserver-xorg/config/monitor/mode-list \
+ select 1024x768 @ 60 Hz
+
+### Preseeding other packages
+# Depending on what software you choose to install, or if things go wrong
+# during the installation process, it's possible that other questions may
+# be asked. You can preseed those too, of course. To get a list of every
+# possible question that could be asked during an install, do an
+# installation, and then run these commands:
+# debconf-get-selections --installer > file
+# debconf-get-selections >> file
+
+
+#### Advanced options
+### Running custom commands during the installation
+# d-i preseeding is inherently not secure. Nothing in the installer checks
+# for attempts at buffer overflows or other exploits of the values of a
+# preconfiguration file like this one. Only use preconfiguration files from
+# trusted locations! To drive that home, and because it's generally useful,
+# here's a way to run any shell command you'd like inside the installer,
+# automatically.
+
+# This first command is run as early as possible, just after
+# preseeding is read.
+#d-i preseed/early_command string anna-install some-udeb
+
+# 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 apt-install zsh; in-target chsh -s /bin/zsh
+
+d-i preseed/late_command string /cdrom/extra/post-install.sh
+
View
392 ubuntu-11.10-extra/preseed/crowbar_admin_net.seed
@@ -0,0 +1,392 @@
+#### Contents of the preconfiguration file (for &releasename;)
+### Localization
+# Locale sets language and country.
+d-i debian-installer/locale string en_US.utf8
+
+# Keyboard selection.
+# Disable automatic (interactive) keymap detection.
+d-i console-setup/ask_detect boolean false
+#d-i console-setup/modelcode string pc105
+d-i console-setup/layoutcode string us
+# To select a variant of the selected layout (if you leave this out, the
+# basic form of the layout will be used):
+#d-i console-setup/variantcode string dvorak
+
+### Network configuration
+# 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
+
+# To pick a particular interface instead:
+#d-i netcfg/choose_interface select eth1
+
+# If you have a slow dhcp server and the installer times out waiting for
+# it, this might be useful.
+d-i netcfg/dhcp_timeout string 120
+
+# If you prefer to configure the network manually, uncomment this line and
+# the static network configuration below.
+#d-i netcfg/disable_dhcp boolean true
+
+# If you want the preconfiguration file to work on systems both with and
+# without a dhcp server, uncomment these lines and the static network
+# configuration below.
+#d-i netcfg/dhcp_failed note
+#d-i netcfg/dhcp_options select Configure network manually
+
+# Static network configuration.
+#d-i netcfg/get_nameservers string <%= @admin_gateway %>
+#d-i netcfg/get_ipaddress string <%= @admin_address %>
+#d-i netcfg/get_netmask string <%= @admin_netmask %>
+#d-i netcfg/get_gateway string <%= @admin_gateway %>
+#d-i netcfg/confirm_static boolean true
+
+# Any hostname and domain names assigned from dhcp take precedence over
+# values set here. However, setting the values still prevents the questions
+# from being shown, even if values come from dhcp.
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# Disable that annoying WEP key dialog.
+#d-i netcfg/wireless_wep string
+# The wacky dhcp hostname that some ISPs use as a password of sorts.
+#d-i netcfg/dhcp_hostname string radish
+
+# 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
+
+### Mirror settings
+# If you select ftp, the mirror/country string does not need to be set.
+#d-i mirror/protocol string ftp
+#d-i mirror/country string manual
+#d-i mirror/http/hostname string http.us.debian.org
+#d-i mirror/http/directory string /ubuntu
+#d-i mirror/http/proxy string
+# If you select ftp, the mirror/country string does not need to be set.
+d-i mirror/country string manual
+d-i mirror/protocol string http
+d-i mirror/http/hostname string 192.168.1.2:8091
+d-i mirror/http/directory string /ubuntu_dvd
+d-i mirror/http/proxy string
+
+# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
+# CC is the ISO-3166-2 code for the selected country. You can preseed this
+# so that it does so without asking.
+#d-i mirror/http/mirror select CC.archive.ubuntu.com
+
+# Suite to install.
+#d-i mirror/suite string &releasename;
+# Suite to use for loading installer components (optional).
+#d-i mirror/udeb/suite string &releasename;
+# Components to use for loading installer components (optional).
+#d-i mirror/udeb/components multiselect main, restricted
+
+### Clock and time zone setup
+# Controls whether or not the hardware clock is set to UTC.
+d-i clock-setup/utc boolean true
+
+# You may set this to any valid setting for $TZ; see the contents of
+# /usr/share/zoneinfo/ for valid values.
+d-i time/zone string US/Central
+
+# Controls whether to use NTP to set the clock during the install
+d-i clock-setup/ntp boolean false
+# NTP server to use. The default is almost always fine here.
+#d-i clock-setup/ntp-server string ntp.example.com
+
+### Partitioning
+# If the system has free space you can choose to only partition that space.
+# Alternatives: custom, some_device, some_device_crypto, some_device_lvm.
+#d-i partman-auto/init_automatically_partition select biggest_free
+
+# Alternatively, you can specify a disk to partition. The device name must
+# be given in traditional non-devfs format.
+# Note: A disk must be specified, unless the system has only one disk.
+# For example, to use the first SCSI/SATA hard disk:
+d-i partman-auto/disk string /dev/sda
+# In addition, you'll need to specify the method to use.
+# The presently available methods are: "regular", "lvm" and "crypto"
+d-i partman-auto/method string lvm
+
+# If one of the disks that are going to be automatically partitioned
+# contains an old LVM configuration, the user will normally receive a
+# warning. This can be preseeded away...
+d-i partman-lvm/device_remove_lvm boolean true
+
+# If one of the disks that are going to be automatically partitioned
+# contains an old LVM configuration, the user will normally receive a
+# warning. This can be preseeded away...
+d-i partman-auto/purge_lvm_from_device boolean true
+
+
+# The same applies to pre-existing software RAID array:
+d-i partman-md/device_remove_md boolean true
+# And the same goes for the confirmation to write the lvm partitions.
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nochanges boolean true
+d-i partman-lvm/confirm_nooverwrite 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
+#d-i partman-auto-lvm/guided_size string 10GB
+#d-i partman-auto-lvm/guided_size string 50%
+
+# 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
+
+# Or provide a recipe of your own...
+# The recipe format is documented in the file devel/partman-auto-recipe.txt.
+# If you have a way to get a recipe file into the d-i environment, you can
+# just point at it.
+#d-i partman-auto/expert_recipe_file string /hd-media/recipe
+
+# If not, you can put an entire recipe into the preconfiguration file in one
+# (logical) line. This example creates a small /boot partition, suitable
+# swap, and uses the rest of the space for the root partition:
+#d-i partman-auto/expert_recipe string \
+# boot-root :: \
+# 40 50 100 ext3 \
+# $primary{ } $bootable{ } \
+# method{ format } format{ } \
+# use_filesystem{ } filesystem{ ext3 } \
+# mountpoint{ /boot } \
+# . \
+# 500 10000 1000000000 ext3 \
+# method{ format } format{ } \
+# use_filesystem{ } filesystem{ ext3 } \
+# mountpoint{ / } \
+# . \
+# 64 512 300% linux-swap \
+# method{ swap } format{ } \
+# .
+
+# 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
+
+# This makes partman automatically partition without confirmation, provided
+# that you told it what to do using one of the methods above.
+d-i partman/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
+
+### Controlling how partitions are mounted
+# The default is to mount by UUID, but you can also choose "traditional" to
+# use traditional device names, or "label" to try filesystem labels before
+# falling back to UUIDs.
+#d-i partman/mount_style select uuid
+
+### Base system installation
+# The kernel image (meta) package to be installed; "none" can be used if no
+# kernel is to be installed.
+#d-i base-installer/kernel/image string linux-generic
+
+### Account setup
+# Skip creation of a root account (normal user account will be able to
+# use sudo). The default is false; preseed this to true if you want to set
+# a root password.
+#d-i passwd/root-login boolean false
+# Alternatively, to skip creation of a normal user account.
+#d-i passwd/make-user boolean false
+
+# Root password, either in clear text
+#d-i passwd/root-password password r00tme
+#d-i passwd/root-password-again password r00tme
+# or encrypted using an MD5 hash.
+#d-i passwd/root-password-crypted password [MD5 hash]
+
+# To create a normal user account.
+d-i passwd/user-fullname string Admin Account
+d-i passwd/username string crowbar
+# Normal user's password, either in clear text
+d-i passwd/user-password password crowbar
+d-i passwd/user-password-again password crowbar
+# or encrypted using an MD5 hash.
+#d-i passwd/user-password-crypted password [MD5 hash]
+# Create the first user with the specified UID instead of the default.
+#d-i passwd/user-uid string 1010
+# The installer will warn about weak passwords. If you are sure you know
+# what you're doing and want to override it, uncomment this.
+d-i user-setup/allow-password-weak boolean true
+
+# The user account will be added to some standard initial groups. To
+# override that, use this.
+#d-i passwd/user-default-groups string audio cdrom video
+
+# Set to true if you want to encrypt the first user's home directory.
+d-i user-setup/encrypt-home boolean false
+
+### Apt setup
+# 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
+# Uncomment this if you don't want to use a network mirror.
+#d-i apt-setup/use_mirror boolean false
+# 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
+
+# Additional repositories, local[0-9] available
+#d-i apt-setup/local0/repository string \
+# http://local.server/ubuntu &releasename; main
+#d-i apt-setup/local0/comment string local server
+# Enable deb-src lines
+#d-i apt-setup/local0/source boolean true
+# 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
+
+### Package selection
+#tasksel tasksel/first multiselect ubuntu-desktop
+tasksel tasksel/first multiselect ubuntu-standard, openssh-server
+#tasksel tasksel/first multiselect kubuntu-desktop
+
+# Individual additional packages to install
+d-i pkgsel/include string openssh-server curl dpkg-dev
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+#d-i pkgsel/upgrade select none
+
+# Language pack selection
+#d-i pkgsel/language-packs multiselect de, en, zh
+
+# 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
+
+# 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
+
+# By default, the system's locate database will be updated after the
+# installer has finished installing most packages. This may take a while, so
+# if you don't want it, you can set this to "false" to turn it off.
+#d-i pkgsel/updatedb boolean true
+
+### Boot loader installation
+# Grub is the default boot loader (for x86). If you want lilo installed
+# instead, uncomment this:
+#d-i grub-installer/skip boolean true
+# To also skip installing lilo, and install no bootloader, uncomment this
+# too:
+#d-i lilo-installer/skip boolean true
+
+# This is fairly safe to set, it makes grub install automatically to the MBR
+# if no other operating system is detected on the machine.
+d-i grub-installer/only_debian boolean true
+
+# This one makes grub-installer install to the MBR if it also finds some other
+# OS, which is less safe as it might not be able to boot that other OS.
+#d-i grub-installer/with_other_os boolean true
+
+# Alternatively, if you want to install to a location other than the mbr,
+# uncomment and edit these lines:
+#d-i grub-installer/only_debian boolean false
+#d-i grub-installer/with_other_os boolean false
+#d-i grub-installer/bootdev string (hd0,0)
+# To install grub to multiple disks:
+#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0)
+
+# Optional password for grub, either in clear text
+#d-i grub-installer/password password r00tme
+#d-i grub-installer/password-again password r00tme
+# or encrypted using an MD5 hash, see grub-md5-crypt(8).
+#d-i grub-installer/password-crypted password [MD5 hash]
+
+### Finishing up the installation
+# During installations from serial console, the regular virtual consoles
+# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next
+# line to prevent this.
+#d-i finish-install/keep-consoles boolean true
+
+# Avoid that last message about the install being complete.
+d-i finish-install/reboot_in_progress note
+
+# This will prevent the installer from ejecting the CD during the reboot,
+# which is useful in some situations.
+#d-i cdrom-detect/eject boolean false
+
+# This is how to make the installer shutdown when finished, but not
+# reboot into the installed system.
+#d-i debian-installer/exit/halt boolean true
+# This will power off the machine instead of just halting it.
+#d-i debian-installer/exit/poweroff boolean true
+
+### X configuration
+# X can detect the right driver for some cards, but if you're preseeding,
+# you override whatever it chooses. Still, vesa will work most places.
+#xserver-xorg xserver-xorg/config/device/driver select vesa
+
+# A caveat with mouse autodetection is that if it fails, X will retry it
+# over and over. So if it's preseeded to be done, there is a possibility of
+# an infinite loop if the mouse is not autodetected.
+#xserver-xorg xserver-xorg/autodetect_mouse boolean true
+
+# Monitor autodetection is recommended.
+xserver-xorg xserver-xorg/autodetect_monitor boolean true
+# Uncomment if you have an LCD display.
+#xserver-xorg xserver-xorg/config/monitor/lcd boolean true
+# X has three configuration paths for the monitor. Here's how to preseed
+# the "medium" path, which is always available. The "simple" path may not
+# be available, and the "advanced" path asks too many questions.
+xserver-xorg xserver-xorg/config/monitor/selection-method \
+ select medium
+xserver-xorg xserver-xorg/config/monitor/mode-list \
+ select 1024x768 @ 60 Hz
+
+### Preseeding other packages
+# Depending on what software you choose to install, or if things go wrong
+# during the installation process, it's possible that other questions may
+# be asked. You can preseed those too, of course. To get a list of every
+# possible question that could be asked during an install, do an
+# installation, and then run these commands:
+# debconf-get-selections --installer > file
+# debconf-get-selections >> file
+
+
+#### Advanced options
+### Running custom commands during the installation
+# d-i preseeding is inherently not secure. Nothing in the installer checks
+# for attempts at buffer overflows or other exploits of the values of a
+# preconfiguration file like this one. Only use preconfiguration files from
+# trusted locations! To drive that home, and because it's generally useful,
+# here's a way to run any shell command you'd like inside the installer,
+# automatically.
+
+# This first command is run as early as possible, just after
+# preseeding is read.
+#d-i preseed/early_command string anna-install some-udeb
+
+# 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 apt-install zsh; in-target chsh -s /bin/zsh
+
+d-i preseed/late_command string wget http://192.168.1.2:8091/ubuntu_dvd/preseed/net-post-install.sh -O /target/net-post-install.sh ; chmod +x /target/net-post-install.sh ; chroot /target /net-post-install.sh 192.168.1.2 8091
+
View
23 ubuntu-11.10-extra/preseed/net-post-install.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+BASEDIR="/tftpboot/ubuntu_dvd"
+# copy the install image.
+mkdir -p "$BASEDIR"
+( cd "$BASEDIR"
+ while ! wget -q http://192.168.1.2:8091/files.list; do sleep 1; done
+ while read f; do
+ wget -a /root/post-install-wget.log -x -nH --cut-dirs=1 \
+ "http://192.168.1.2:8091/${f#./}"
+ done < files.list
+ rm files.list
+)
+
+# Fix links
+while read file dest; do
+ L_FILE=${file##*/}
+ L_DIR=${file%/*}
+ T_FILE=$dest
+ (cd "${BASEDIR}/$L_DIR" ; ln -s "$T_FILE" "$L_FILE")
+done < "${BASEDIR}/crowbar_links.list"
+
+. "$BASEDIR/extra/common_install.sh"
View
2 ubuntu-11.10-extra/sources-cdrom.list
@@ -0,0 +1,2 @@
+deb file:/tftpboot/ubuntu_dvd oneiric main restricted
+

0 comments on commit 19c06dc

Please sign in to comment.
Something went wrong with that request. Please try again.