[PATCH][REFACTORED] Better flexibility to control system base installation, try 3
Hello folks,
I implemented the changes proposed by Frans and Joey. Currently the
code accepts values splited by comas and spaces. Please comment.
=== debian/base-installer.templates
==================================================================
--- debian/base-installer.templates (/upstream/trunk/packages/base-installer) (revision 4347)
+++ debian/base-installer.templates (/base-installer) (revision 4347)
@@ -412,3 +412,17 @@
# TRANSLATORS: <65 columns
_Description: Install the base system
+Template: base-installer/debootstrap_script
+Type: string
+Description: for internal use; can be preseeded
+ Force use of a specific debootstrap script
+
+Template: base-installer/includes
+Type: string
+Description: for internal use; can be preseeded
+ Packages to be included in base installation
+
+Template: base-installer/excludes
+Type: string
+Description: for internal use; can be preseeded
+ Packages to be excluded in base installation
=== debian/postinst
==================================================================
--- debian/postinst (/upstream/trunk/packages/base-installer) (revision 4347)
+++ debian/postinst (/base-installer) (revision 4347)
@@ -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="$(printf '%s' "$RET" | sed 's/ /,/g')" || true
+
+db_get base-installer/excludes
+EXCLUDES="$(printf '%s' "$RET" | sed 's/ /,/g')" || 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/^,//g;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/^,//g;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/debootstrap_script
+ DEBOOTSTRAP_SCRIPT="$RET" || true
# run the scripts found in hook directory before debootstrap
partsdir="/usr/lib/base-installer.d"
@@ -236,6 +245,7 @@
${keyring} \
${DISTRIBUTION} /target \
"$PROTOCOL://$MIRROR$DIRECTORY" \
+ ${DEBOOTSTRAP_SCRIPT} \
|| debootstrap_failed=$?
fi
=== debian/changelog
==================================================================
--- debian/changelog (/upstream/trunk/packages/base-installer) (revision 4347)
+++ debian/changelog (/base-installer) (revision 4347)
@@ -8,6 +8,15 @@
* Don't offer yaird for S/390 as it does not configure the dasds.
* Add kernel selection support for ppc64. Closes: #383135.
+ [ 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.
+
-- Frans Pop <fjp@debian.org> Wed, 16 Aug 2006 02:47:58 +0200
base-installer (1.64) unstable; urgency=low
Property changes on:
___________________________________________________________________
Name: svk:merge
+48c42b26-1dd6-0310-b98f-a58d8bce7237:/trunk/packages/base-installer:39871
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: