Hello folks, I'm proposing a patch to add a new hook to be called before debootstrap run. This is needed for some CDDs (Debian-NP and Liberdade are some examples). What you think about the patch?
=== debian/postinst
==================================================================
--- debian/postinst (/base-installer/trunk) (revision 7)
+++ debian/postinst (/base-installer/local) (revision 7)
@@ -150,6 +150,39 @@
fi
fi
+ # run the scripts found in hook directory before debootstrap
+ partsdir="/usr/lib/base-installer.d"
+ db_progress INFO base-installer/progress/preparing
+
+ tmpfile=/tmp/base-installer-preparing.stderr.log
+ [ -d "$partsdir"] && info "Execution hook before debootstrap"
+ for script in `ls "$partsdir"/*`; do
+ base=$(basename $script | sed 's/[0-9]*//')
+ if ! db_progress INFO base-installer/progress/$base; then
+ db_subst base-installer/progress/fallback SCRIPT "$base"
+ db_progress INFO base-installer/progress/fallback
+ fi
+
+ if [ -x "$script" ] ; then
+ log "info: Running $script"
+ if "$script" 2> $tmpfile ; then
+ :
+ else
+ if [ "$?" = 10 ]; then
+ log "$script backed up"
+ exit 10
+ fi
+ log "warning: $script returned error code $?"
+ fi
+ if [ -s "$tmpfile" ] ; then
+ logger -t base-installer < "$tmpfile"
+ fi
+ rm -f "$tmpfile"
+ else
+ log "error: Unable to execute $script"
+ fi
+ done
+
if [ -e /usr/bin/cdebootstrap ]; then
/usr/bin/cdebootstrap || debootstrap_failed=$?
else
=== debian/changelog
==================================================================
--- debian/changelog (/base-installer/trunk) (revision 7)
+++ debian/changelog (/base-installer/local) (revision 7)
@@ -1,3 +1,10 @@
+base-installer (0.087) UNRELEASED; urgency=low
+
+ * Otavio Salvador
+ - Add hook to be called before debootstrap is run.
+
+ -- Otavio Salvador <otavio@debian.org> Tue, 22 Jun 2004 16:12:07 -0300
+
base-installer (0.086) unstable; urgency=low
* Martin Michlmayr
=== debian/templates
==================================================================
--- debian/templates (/base-installer/trunk) (revision 7)
+++ debian/templates (/base-installer/local) (revision 7)
@@ -129,6 +129,14 @@
Type: text
_Description: Installing the Debian base system
+Template: base-installer/progress/preparing
+Type: text
+_Description: Preparing to install the Debian base system
+
+Template: base-installer/progress/fallback
+Type: text
+_Description: Running: ${SUBST0}...
+
Template: base-installer/debootstrap/section/check_target
Type: text
_Description: Checking the target file system
@@ -229,3 +237,4 @@
Type: text
# Item in the main menu to select this package
_Description: Install the base system
+
--
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."
Attachment:
pgpc6Ir332ggJ.pgp
Description: PGP signature