Support “lb config --debootstrap-script <script>”

This option lets you use an alternate bootstrap script when running
debootstrap. Thanks to Sjoerd Simons <sjoerd@debian.org> for the initial
patch.

Closes: #790033
This commit is contained in:
Raphaël Hertzog 2016-11-28 16:43:50 +01:00
parent 822459c7b2
commit 164f23368e
4 changed files with 23 additions and 4 deletions

3
debian/changelog vendored
View File

@ -25,6 +25,9 @@ live-build (1:20160105) UNRELEASED; urgency=medium
Thanks to Chris Lamb <lamby@debian.org> for the patch.
* Set xorriso's "modification time" to SOURCE_DATE_EPOCH. Closes: #831379
Thanks to Chris Lamb <lamby@debian.org> for the patch.
* Support “lb config --debootstrap-script <script>” to use an alternate
bootstrap script when running debootstrap. Thanks to Sjoerd Simons
<sjoerd@debian.org> for the initial patch. Closes: #790033
[ Kristian Klausen ]
* Include ext{3,4} journal size when calculating image size. Closes: #801712

View File

@ -74,6 +74,10 @@
[\fB\-\-debian\-installer\-preseedfile\fR \fIFILE\fR|\fIURL\fR]
.br
[\fB\-\-debian\-installer\-gui\fR true|false]
.br
[\fB\-\-debootstrap\-options\fR \fIOPTIONS\fR]
.br
[\fB\-\-debootstrap\-script\fR \fISCRIPT\fR]
.br
[\fB\-\-debug\fR]
.br
@ -299,6 +303,10 @@ defines the distribution where the debian\-installer files should be taken out f
sets the filename or URL for an optionally used and included preseeding file for debian\-installer. If config/binary_debian\-installer/preseed.cfg exists, it will be used by default.
.IP "\fB\-\-debian\-installer\-gui\fR true|false" 4
defines if the debian\-installer graphical GTK interface should be true or not. In Debian mode and for most versions of Ubuntu, this option is true, whereas otherwise false, by default.
.IP "\fB\-\-debootstrap\-options\fR \fIOPTIONS\fR" 4
passes the given options to debootstrap when setting up the base system.
.IP "\fB\-\-debootstrap\-script\fR \fISCRIPT\fR" 4
tells debootstrap to use an alternate bootstrap script (last parameter to debootstrap).
.IP "\fB\-\-debug\fR" 4
turn on debugging informational messages.
.IP "\-d|\fB\-\-distribution\fR \fICODENAME\fR" 4

View File

@ -88,7 +88,7 @@ then
fi
Echo_breakage "Running debootstrap (download-only)... "
debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}" ${DEBOOTSTRAP_SCRIPT}
# Removing old cache
rm -f cache/packages.bootstrap/*.deb
@ -109,13 +109,13 @@ then
fi
Echo_message "Bootstrap will be foreign"
debootstrap ${DEBOOTSTRAP_OPTIONS} --foreign "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
debootstrap ${DEBOOTSTRAP_OPTIONS} --foreign "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}" ${DEBOOTSTRAP_SCRIPT}
Echo_message "Running debootstrap second stage under QEMU"
cp ${LB_BOOTSTRAP_QEMU_STATIC} chroot/usr/bin
Chroot chroot /bin/sh /debootstrap/debootstrap --second-stage ${FOREIGN_DEBOOTSTRAP_OPTIONS}
else
debootstrap ${DEBOOTSTRAP_OPTIONS} "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
debootstrap ${DEBOOTSTRAP_OPTIONS} "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}" ${DEBOOTSTRAP_SCRIPT}
fi
# Deconfiguring debootstrap configurations

View File

@ -51,6 +51,8 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--debian-installer-distribution daily|CODENAME]\n\
\t [--debian-installer-preseedfile FILE|URL]\n\
\t [--debian-installer-gui true|false]\n\
\t [--debootstrap-options OPTIONS]\n\
\t [--debootstrap-script SCRIPT]\n\
\t [--debug]\n\
\t [-d|--distribution CODENAME]\n\
\t [--parent-distribution CODENAME]\n\
@ -126,7 +128,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
Local_arguments ()
{
LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-options:,aptitude-options:,debootstrap-options:,
LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-options:,aptitude-options:,debootstrap-options:,debootstrap-script:,
apt-pipeline:,apt-recommends:,apt-secure:,apt-source-archives:,bootstrap:,cache:,cache-indices:,cache-packages:,
cache-stages:,debconf-frontend:,debconf-priority:,dump,
initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,system:,tasksel:,
@ -259,6 +261,11 @@ Local_arguments ()
shift 2
;;
--debootstrap-script)
DEBOOTSTRAP_SCRIPT="${2}"
shift 2
;;
--cache)
LB_CACHE="${2}"
shift 2
@ -996,6 +1003,7 @@ _QUIET="${_QUIET}"
APT_OPTIONS="${APT_OPTIONS}"
APTITUDE_OPTIONS="${APTITUDE_OPTIONS}"
DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS}"
DEBOOTSTRAP_SCRIPT="${DEBOOTSTRAP_SCRIPT}"
GZIP_OPTIONS="${GZIP_OPTIONS}"
ISOHYBRID_OPTIONS="${ISOHYBRID_OPTIONS}"
EOF