[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Patch to build-simple-cdd



This patch actually does two things (well two and a half because of bug 406320).

It gives you the option of specifying a keyboard layout (--keyboard), so
that d-i will go away doing its thing and not speak to you until it asks
which profile you wish to install, and add an option to ignore debconf
preseed errors (--force-preseed), which allows you to build a CD as a
non-root user and still preseed questions only root has access to.

The latter is a bit ugly:
    /usr/bin/debconf-set-selections --checkonly $p || {
	if [ -n "$force_preseed" ]; then
            ...
	fi
    }

I would prefer that to look something like:

    /usr/bin/debconf-set-selections --checkonly $p || if [ -n "$force_preseed" ]; then
        ...
    fi

but it was not to be.

Anyway. Patch:

=== modified file 'build-simple-cdd'
--- old/build-simple-cdd	2007-01-04 09:10:21 +0000
+++ new/build-simple-cdd	2007-01-10 12:28:33 +0000
@@ -28,6 +28,7 @@
 --local-packages  list of files included on CD's local package repository
 --language  select language (languagechooser/language-name debconf question)
 --country  select country (countrychooser/shortlist debconf question)
+--keyboard  select keyboard (debian-installer/keymap debconf question)
 --locale  select locale (overrides language/country, preferred for "etch")
 --http-proxy  sets the http_proxy environment variable
 --debian-mirror  specify debian mirror. default: http://ftp.us.debian.org/debian
@@ -37,6 +38,7 @@
 --kernel-packages  list of kernel packages to include on the CD
 --help|-h  display this help
 --qemu|-q  use qemu to test the image
+--force-preseed  Do not bork if preseeding fails
 EOF
 }
 
@@ -60,6 +62,8 @@
       test -n "$1" && shift ;;
     --country) country="$2" 
       test -n "$1" && shift ;;
+    --keyboard) keyboard="$2" 
+      test -n "$1" && shift ;;
     --locale) locale="$2" 
       test -n "$1" && shift ;;
     --http-proxy) export http_proxy="$2" 
@@ -77,6 +81,7 @@
     --help|-h) get_help 
       exit 0 ;;
     --qemu|-q) use_qemu="true" ;;
+    --force-preseed) force_preseed="yes" ;;
     *) echo "ERROR: unknown commandline option: $1" 
       get_help
       exit 1 ;;
@@ -172,7 +177,14 @@
 
 # verify that preseeding files are valid
 for p in $preseed_files ; do
-    /usr/bin/debconf-set-selections --checkonly $p || exit 1
+    /usr/bin/debconf-set-selections --checkonly $p || {
+	if [ -n "$force_preseed" ]; then
+	    echo "WARNING: preseed file `$p' is invalid."
+	else
+	    echo "ERROR: preseed file `$p' is invalid."
+	    exit 1
+	fi
+    }
 done
 
 if [ -n "$BASE_INCLUDE" ] && [ -n "$base_include_packages" ]; then
@@ -336,12 +348,21 @@
   echo "KERNEL_PARAMS: $KERNEL_PARAMS"
 fi
 
+if [ -n "$keyboard" ]; then
+  echo "setting default keyboard..."
+  KERNEL_PARAMS="$KERNEL_PARAMS console-keymaps-at/keymap=$keyboard"
+  echo "KERNEL_PARAMS: $KERNEL_PARAMS"
+fi
+
 if [ -n "$locale" ]; then
   echo "setting default locale..."
   KERNEL_PARAMS="$KERNEL_PARAMS debian-installer/locale=$locale"
   echo "KERNEL_PARAMS: $KERNEL_PARAMS"
 fi
 
+# Get around bug 406320 in debian-cd for boot-amd64
+KERNEL_PARAMS="$KERNEL_PARAMS "
+
 cd $BASEDIR
 
 # needed to bring 2.6 related udebs (not the kernel itself)

Matthew

-- 
I must take issue with the term "a mere child," for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz

Reply to: