[PATCH] Better flexibility to control system base installation
Hello,
I've hack this patch to fulfill some needs that we had at O.S. Systems
doing Debian based distributions and would like to merge it at d-i to
allow others to use it too. Following patch adds possibility to
specify the debootstrap script to use and include or exclude packages
from base without need to use base_include or base_exclude files.
Does anyone has comments about it?
=== debian/base-installer.templates
==================================================================
--- debian/base-installer.templates (/upstream/trunk/packages/base-installer) (revision 4217)
+++ debian/base-installer.templates (/base-installer) (revision 4217)
@@ -412,3 +412,17 @@
# TRANSLATORS: <65 columns
_Description: Install the base system
+Template: base-installer/script
+Type: string
+Description: Script to use when different of suite codename
+ For preseeding only; not translated.
+
+Template: base-installer/includes
+Type: string
+Description: Packages to be included in base installation
+ For preseeding only; not translated.
+
+Template: base-installer/excludes
+Type: string
+Description: Packages to be excluded in base installation
+ For preseeding only; not translated.
=== debian/postinst
==================================================================
--- debian/postinst (/upstream/trunk/packages/base-installer) (revision 4217)
+++ debian/postinst (/base-installer) (revision 4217)
@@ -11,8 +11,6 @@
DIRECTORY=
COMPONENTS=
DISTRIBUTION=
-INCLUDES=
-EXCLUDES=
KERNEL=
KERNEL_LIST=/tmp/available_kernels.txt
KERNEL_MAJOR="$(uname -r | cut -d . -f 1,2)"
@@ -38,6 +36,14 @@
SUBARCH="$(archdetect)"
SUBARCH="${SUBARCH#*/}"
+# Set initial value to includes and excludes
+db_get base-installer/includes
+INCLUDES="$RET" || true
+
+db_get base-installer/excludes
+EXCLUDES="$RET" || true
+
+
log() {
logger -t base-installer "$@"
}
@@ -125,11 +131,11 @@
COMPONENTS="*"
fi
if [ -s /cdrom/.disk/base_include ]; then
- INCLUDES=`grep -v '^#' /cdrom/.disk/base_include | tr '\n' , | sed 's/,$//'`
+ INCLUDES="$INCLUDES,`grep -v '^#' /cdrom/.disk/base_include | tr '\n' , | sed 's/,$//'`"
fi
if [ -s /cdrom/.disk/base_exclude ]; then
- EXCLUDES=`grep -v '^#' /cdrom/.disk/base_exclude | tr '\n' , | sed 's/,$//'`
+ EXCLUDES="$EXCLUDES,`grep -v '^#' /cdrom/.disk/base_exclude | tr '\n' , | sed 's/,$//'`"
fi
# Sanity check: an error reading /cdrom/.disk/base_components can cause
@@ -193,6 +199,9 @@
export http_proxy
fi
fi
+
+ db_get base-installer/script
+ DEBOOTSTRAP_SCRIPT="$RET" || true
# run the scripts found in hook directory before debootstrap
partsdir="/usr/lib/base-installer.d"
@@ -232,13 +241,15 @@
--components="${COMPONENTS}" \
--debian-installer \
--resolve-deps \
+ --print-debs \
${include} ${exclude} \
${keyring} \
${DISTRIBUTION} /target \
"$PROTOCOL://$MIRROR$DIRECTORY" \
+ ${DEBOOTSTRAP_SCRIPT} \
|| debootstrap_failed=$?
fi
-
+ exit 1
if [ true = "$copied_fstab" ] ; then
mv /target/etc/fstab.orig /target/etc/fstab
fi
=== debian/changelog
==================================================================
--- debian/changelog (/upstream/trunk/packages/base-installer) (revision 4217)
+++ debian/changelog (/base-installer) (revision 4217)
@@ -4,6 +4,15 @@
* Handle the ARM sub-architectures iop32x, iop33x and ixp4xx.
* Add a test suite entry for arm/iop32x based on the Thecus N2100.
+ [ Otavio Salvador ]
+ * Add facility to use a specific script by preseeding
+ base-installer/script. That's a very interesting feature for Custom
+ Debian Distributions and derivatives.
+ * Add facility to include and exclude packages from base by preseeding
+ base-installer/includes and base-installer/excludes. The previous way
+ of doing that, using base_include and base_include CD files still
+ works and the packages are added to the preseeded ones.
+
-- Martin Michlmayr <tbm@cyrius.com> Fri, 11 Aug 2006 01:50:39 +0200
base-installer (1.64) unstable; urgency=low
Property changes on:
___________________________________________________________________
Name: svk:merge
+48c42b26-1dd6-0310-b98f-a58d8bce7237:/trunk/packages/base-installer:39695
a1877ced-7cdd-0310-a81f-9c9987c16c32:/base-installer/local:12
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio@debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://www.freedom.ind.br/otavio
---------------------------------------------
"Microsoft gives you Windows ... Linux gives
you the whole house."
Reply to: