[Debian-NP-Commits] r262 - people/vagrant/simple-cdd

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Fri, 26 Nov 2004 02:05:02 -0700


Author: vagrant-guest
Date: Fri Nov 26 02:04:44 2004
New Revision: 262

Added:
   people/vagrant/simple-cdd/simple-cdd   (contents, props changed)
   people/vagrant/simple-cdd/simple-cdd.mnu
Modified:
   people/vagrant/simple-cdd/CONF.sh
   people/vagrant/simple-cdd/build-simple-cdd
   people/vagrant/simple-cdd/default.preseed
   people/vagrant/simple-cdd/simple-cdd-profiles
Log:
generate base includes file, add debconf-utils to base includes, attempt to use base-config script to install profile packages.


Modified: people/vagrant/simple-cdd/CONF.sh
==============================================================================
--- people/vagrant/simple-cdd/CONF.sh	(original)
+++ people/vagrant/simple-cdd/CONF.sh	Fri Nov 26 02:04:44 2004
@@ -57,7 +57,7 @@
 
 ## debpartial-mirror values ##
 
-# use a proxy (FIXME: does debpartial-mirror pay attention to proxy?)
+# use a proxy 
 #export http_proxy=http://localhost:3128
 
 # download a specific codename branch, such as sid, sarge, or etch.
@@ -89,6 +89,12 @@
 
 ## More debian-cd options ##
 
+# packages to include in initial debootstrap install
+BASE_INCLUDE=$simple_cdd_dir/base_include
+# if this is set, generate a base includes file with the listed packages.
+# order is important, and dependency resolution must be done manually...
+base_include_packages="$(/usr/sbin/debootstrap --arch $ARCH --print-debs $CODENAME) debconf-utils"
+
 # location where generated CD image(s) will be put
 export OUT=$simple_cdd_dir/images/
 

Modified: people/vagrant/simple-cdd/build-simple-cdd
==============================================================================
--- people/vagrant/simple-cdd/build-simple-cdd	(original)
+++ people/vagrant/simple-cdd/build-simple-cdd	Fri Nov 26 02:04:44 2004
@@ -49,6 +49,16 @@
 
 sort -u $TASK.cache >> $TASK
 
+if [ -n "$BASE_INCLUDE" ] && [ -n "$base_include_packages" ]; then
+  mv -f $BASE_INCLUDE $BASE_INCLUDE.bak
+  echo "#ifdef ARCH_$ARCH" > $BASE_INCLUDE
+  for p in $base_include_packages ; do
+    echo $p >> $BASE_INCLUDE
+  done
+  echo "#endif" >> $BASE_INCLUDE
+  echo "" >> $BASE_INCLUDE
+fi
+
 # TODO make debpartial-mirror optional
 
 debpartial_conf=debpartial-mirror.conf
@@ -138,27 +148,6 @@
 
 cat $simple_cdd_dir/simple-cdd.templates | sed s/CHOICES/$choices/g | sed -e 's/,/, /g' > $extras_dir/simple-cdd.templates
 
-# FIXME provide a selection mechanism for profile package and debconf
-# selections, rather than just installing them all
-
-# add files to be installed
-#for p in $extras_dir/*.packages ; do
-#  cat $p >> $extras_dir/default.packages.cache
-#done
-#sort -u $extras_dir/default.packages.cache > $extras_dir/install.packages
-#rm $extras_dir/default.packages.cache
-
-# preseeding include files
-#for p in $extras_dir/*.preseed  ; do
-#  pfile="$(basename $p)"
-#  if [ "$pfile" != "default.preseed" ]; then
-#    preseed_includes="$preseed_includes $pfile"
-#  fi
-#done
-#if [ -n "$preseed_includes" ]; then
-#  echo d-i  preseed/include string $preseed_includes >> $extras_dir/default.preseed
-#fi
-
 echo simple-cdd: extra files for simple-cdd
 make bin-extras CD=1 ROOTSRC=$simple_cdd_dir/extras DIR=.
 

Modified: people/vagrant/simple-cdd/default.preseed
==============================================================================
--- people/vagrant/simple-cdd/default.preseed	(original)
+++ people/vagrant/simple-cdd/default.preseed	Fri Nov 26 02:04:44 2004
@@ -56,7 +56,7 @@
 # This command is run just before the install finishes, but when there is
 # still a usable /target directory.
 #d-i  preseed/late_command    string for deb in /hd-media/*.deb; do cp $deb /target/tmp; chroot /target dpkg -i /tmp/$(basename $deb); done
-d-i  preseed/late_command    string mkdir -p /target/usr/local/simple-cdd ; cp /cdrom/simple-cdd/* /cdrom/pool/main/d/debconf/debconf-utils_*.deb /target/usr/local/simple-cdd/
+d-i  preseed/late_command    string mkdir -p /target/usr/local/simple-cdd ; cp /cdrom/simple-cdd/* /target/usr/local/simple-cdd/ ; cp /cdrom/simple-cdd/simple-cdd /cdrom/simple-cdd/simple-cdd.mnu /target/usr/lib/base-config/menu/
 # This command is run just as base-config is starting up.
 #base-config  base-config/early_command string echo hi mom
 base-config  base-config/early_command string /usr/local/simple-cdd/simple-cdd-profiles

Added: people/vagrant/simple-cdd/simple-cdd
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd	Fri Nov 26 02:04:44 2004
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# base-config script to install packages included by profiles
+
+profiles="$(debconf-show simple-cdd | grep simple-cdd/profiles | cut -d : -f 2 | sed -e 's/,/ /g')"
+for p in $profiles ; do
+  if [ -r "$p.packages" ]; then
+    echo "Installing packages for profile: $p"
+    packages="$(egrep -v ^# $p.packages)"
+    apt-get -yu install $packages
+    if [ "0" != "$?" ]; then
+      echo "Problems encountered installing packages for profile $p,"
+      echo "installing packages one at a time..."
+      for a in $packages ; do
+        apt-get -yu install $a
+      done
+    fi
+  fi
+done

Modified: people/vagrant/simple-cdd/simple-cdd-profiles
==============================================================================
--- people/vagrant/simple-cdd/simple-cdd-profiles	(original)
+++ people/vagrant/simple-cdd/simple-cdd-profiles	Fri Nov 26 02:04:44 2004
@@ -4,35 +4,27 @@
 
 echo "preparing to configure simple-cdd profiles..."
 
-dpkg -i ./debconf-utils_*.deb
-
 debconf-loadtemplate simple-cdd ./simple-cdd.templates
 
+set -e
+
 # load debconf
 . /usr/share/debconf/confmodule
 
 db_input high simple-cdd/profiles || /bin/true
 db_go
-
-db_get simple-cdd/profiles || /bin/true
-profiles=$(echo $RET | sed -e 's/,/ /g')
 db_stop
 
+set +e
+
+profiles="$(debconf-show simple-cdd | grep simple-cdd/profiles | cut -d : -f 2 | sed -e 's/,/ /g')"
+
+cd /usr/local/simple-cdd
+
 for p in $profiles ; do
   echo "Setting up profile: $p"
   if [ -r "$p.preseed" ]; then
-    echo "debconf preseeding for $p"
+    echo "debconf preseeding: $p"
     debconf-set-selections $p.preseed
   fi
-  if [ -r "$p.packages" ]; then
-    echo "Installing packages for $p"
-    packages="$(egrep -v ^# $p.packages)"
-    apt-get -yu install $packages
-    if [ "0" != "$?" ]; then
-      echo "Problems encountered for $p, installing packages one at a time..."
-      for a in $packages ; do
-        apt-get -yu install $a
-      done
-    fi
-  fi
 done

Added: people/vagrant/simple-cdd/simple-cdd.mnu
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd.mnu	Fri Nov 26 02:04:44 2004
@@ -0,0 +1,3 @@
+Only-New: true
+Debconf: false
+Order: 75