summaryrefslogtreecommitdiff
path: root/libre/debootstrap
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-28 22:33:48 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-28 22:33:48 -0300
commit2171f93c32d4106c873bb17f75da36f4f2ea3cec (patch)
treea80af6aa1392341ae16ed083f8a5692b54574f5a /libre/debootstrap
parentff729803bb49198248d8a72931e9c5dee3cca67a (diff)
debootstrap-1.0.80-1.parabola1: updating version
Diffstat (limited to 'libre/debootstrap')
-rw-r--r--libre/debootstrap/PKGBUILD88
-rw-r--r--libre/debootstrap/arch-detect.patch17
-rw-r--r--libre/debootstrap/debootstrap.8198
-rw-r--r--libre/debootstrap/gnewsense194
-rw-r--r--libre/debootstrap/trisquel199
5 files changed, 696 insertions, 0 deletions
diff --git a/libre/debootstrap/PKGBUILD b/libre/debootstrap/PKGBUILD
new file mode 100644
index 000000000..679820cf9
--- /dev/null
+++ b/libre/debootstrap/PKGBUILD
@@ -0,0 +1,88 @@
+# $Id: PKGBUILD 168492 2016-03-26 16:16:17Z fyan $
+# Maintainer (Arch): Felix Yan <felixonmars@archlinux.org>
+# Maintainer: André Silva <emulatorman@parabola.nu>
+
+pkgname=debootstrap
+pkgver=1.0.80
+pkgrel=1.parabola1
+pkgdesc="Bootstrap a basic gNewSense and Trisquel system, without Debian support"
+arch=('any')
+license=('GPL')
+url="https://tracker.debian.org/pkg/debootstrap"
+depends=('wget')
+makedepends=('git' 'makedev')
+replaces=(${pkgname}-libre)
+conflicts=(${pkgname}-libre)
+source=("git+https://anonscm.debian.org/git/d-i/debootstrap.git#tag=$pkgver"
+ arch-detect.patch
+ debootstrap.8
+ gnewsense
+ trisquel)
+md5sums=('SKIP'
+ '60043aaeb9afc1c2d7d2a2d9888eca35'
+ '654761198068b51b027d47cba4b7cfa2'
+ '13978bdd1d877a0dd2c3c874ecd54f03'
+ 'b020aa8426e70a6024c8e76312c17d78')
+
+prepare() {
+ cd debootstrap
+
+ sed -i 's/sbin/bin/g' Makefile
+
+ # gNewSense/Trisquel defaults
+ sed -i 's|export PATH|export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"|' debootstrap
+
+ # Detect Architecture
+ patch -p1 -i ../arch-detect.patch
+
+ # Workaround permission errors
+ # MAKEDEV is not happy with the instructions here
+ sed -e 's/install -o root -g root/install/' \
+ -e '/chown 0:0 dev/d' \
+ -e 's/(cd dev && $(MAKEDEV) std ptmx fd consoleonly)/$(MAKEDEV) -d dev std ptmx fd consoleonly/' \
+ -i Makefile
+
+ # Remove Debian files
+ rm -v debootstrap.8
+
+ # Add rebranded man
+ install -m644 ../debootstrap.8 .
+
+ # Remove Debian scripts
+ rm -v scripts/*
+
+ # Add gNewSense script
+ install -m644 $srcdir/gnewsense scripts
+
+ # Add Trisquel script
+ install -m644 $srcdir/trisquel scripts
+
+ # Enter to scripts dir
+ cd scripts
+
+ # Create gNewSense symlinks
+ ln -s gnewsense parkes
+
+ # Create Trisquel symlinks
+ ln -s trisquel awen
+ ln -s trisquel belenos
+ ln -s trisquel brigantia
+ ln -s trisquel dagda
+ ln -s trisquel dwyn
+ ln -s trisquel robur
+ ln -s trisquel slaine
+ ln -s trisquel taranis
+ ln -s trisquel toutatis
+}
+
+build() {
+ cd debootstrap
+ fakeroot make
+}
+
+package() {
+ cd debootstrap
+ make DESTDIR="$pkgdir" install
+
+ install -Dm644 debootstrap.8 "$pkgdir"/usr/share/man/man8/debootstrap.8
+}
diff --git a/libre/debootstrap/arch-detect.patch b/libre/debootstrap/arch-detect.patch
new file mode 100644
index 000000000..8d2030ae6
--- /dev/null
+++ b/libre/debootstrap/arch-detect.patch
@@ -0,0 +1,17 @@
+--- a/debootstrap 2016-03-22 21:13:58.000000000 +0800
++++ b/debootstrap 2016-03-22 21:13:09.573621800 +0800
+@@ -419,6 +419,14 @@
+ HOST_ARCH=`/usr/bin/udpkg --print-architecture`
+ elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
+ HOST_ARCH=`cat $DEBOOTSTRAP_DIR/arch`
++elif in_path pacman; then
++ CARCH="$(. /etc/makepkg.conf && echo $CARCH)"
++ case "$CARCH" in
++ "i686") HOST_ARCH="i386" ;;
++ "x86_64") HOST_ARCH="amd64" ;;
++ "armv7h") HOST_ARCH="armhf" ;;
++ *) echo "Unknown architecture: $CARCH" && exit 1
++ esac
+ fi
+ HOST_OS="$HOST_ARCH"
+ # basic host OS guessing for non-Debian systems
diff --git a/libre/debootstrap/debootstrap.8 b/libre/debootstrap/debootstrap.8
new file mode 100644
index 000000000..f44366474
--- /dev/null
+++ b/libre/debootstrap/debootstrap.8
@@ -0,0 +1,198 @@
+.TH DEBOOTSTRAP 8
+.SH NAME
+debootstrap \- Bootstrap a basic gNewSense or Trisquel system
+.SH SYNOPSIS
+.B debootstrap
+.RB [ OPTION\&.\&.\&. ]
+.I SUITE TARGET
+.RI [ MIRROR
+.RI [ SCRIPT ]]
+
+.B debootstrap
+.RB [ OPTION\&.\&.\&. ]
+\-\-second\-stage
+.SH DESCRIPTION
+.B debootstrap
+bootstraps a basic gNewSense or Trisquel system of
+.I SUITE
+into
+.I TARGET
+from
+.I MIRROR
+by running
+.IR SCRIPT .
+.I MIRROR
+can be an http:// or https:// URL, a file:/// URL, or an ssh:/// URL.
+.PP
+The
+.I SUITE
+may be a release code name (eg, gnewsense, trisquel)
+or a symbolic name (eg, parkes, toutatis, belenos)
+.PP
+Notice that file:/ URLs are translated to file:/// (correct scheme as
+described in RFC1738 for local filenames), and file:// will \fBnot\fR work.
+ssh://USER@HOST/PATH URLs are retrieved using
+.BR scp ;
+use of
+.B ssh\-agent
+or similar is strongly recommended.
+.PP
+\fBDebootstrap\fR can be used to install gNewSense or Trisquel in a system without using an
+installation disk but can also be used to run a different gNewSense or Trisquel flavor in a \fBchroot\fR
+environment.
+This way you can create a full (minimal) gNewSense or Trisquel installation which
+can be used for testing purposes (see the \fBEXAMPLES\fR section).
+If you are looking for a chroot system to build packages please take a look at
+\fBpbuilder\fR.
+.SH "OPTIONS"
+.PP
+.IP "\fB\-\-arch=ARCH\fP"
+Set the target architecture (use if dpkg isn't installed).
+See also \-\-foreign.
+.IP
+.IP "\fB\-\-include=alpha,beta\fP"
+Comma separated list of packages which will be added to download and extract
+lists.
+.IP
+.IP "\fB\-\-exclude=alpha,beta\fP"
+Comma separated list of packages which will be removed from download and
+extract lists.
+WARNING: you can and probably will exclude essential packages, be
+careful using this option.
+.IP
+.IP "\fB\-\-components=alpha,beta\fP"
+Use packages from the listed components of the archive.
+.IP
+.IP "\fB\-\-no\-resolve\-deps\fP"
+By default, debootstrap will attempt to automatically resolve any missing
+dependencies, warning if any are found.
+Note that this is not a complete dependency resolve in the sense of dpkg
+or apt, and that it is far better to specify the entire base system than
+rely on this option.
+With this option set, this behaviour is disabled.
+.IP
+.IP "\fB\-\-variant=minbase|buildd|fakechroot|scratchbox\fP"
+Name of the bootstrap script variant to use.
+Currently, the variants supported are minbase, which only includes
+essential packages and apt; buildd, which installs the build-essential
+packages into
+.IR TARGET ;
+and fakechroot, which installs the packages without root privileges.
+Finally there is variant scratchbox, which is for creating targets
+for scratchbox usage.
+The default, with no \fB\-\-variant=X\fP argument, is to create a base
+gNewSense or Trisquel installation in
+.IR TARGET .
+.IP
+.IP "\fB\-\-keyring=KEYRING\fP"
+Override the default keyring for the distribution being bootstrapped,
+and use
+.IR KEYRING
+to check signatures of retrieved Release files.
+.IP
+.IP "\fB\-\-no-check-gpg\fP"
+Disables checking gpg signatures of retrieved Release files.
+.IP
+.IP "\fB\-\-verbose\fP"
+Produce more info about downloading.
+.IP
+.IP "\fB\-\-print\-debs\fP"
+Print the packages to be installed, and exit.
+Note that a TARGET directory must be specified so debootstrap can
+download Packages files to determine which packages should be installed,
+and to resolve dependencies.
+The TARGET directory will be deleted unless \-\-keep\-debootstrap\-dir
+is specified.
+.IP
+.IP "\fB\-\-download\-only\fP"
+Download packages, but don't perform installation.
+.IP
+.IP "\fB\-\-foreign\fP"
+Do the initial unpack phase of bootstrapping only, for example if the
+target architecture does not match the host architecture.
+A copy of debootstrap sufficient for completing the bootstrap process
+will be installed as /debootstrap/debootstrap in the target filesystem.
+You can run it with the \fB\-\-second\-stage\fP option to complete the
+bootstrapping process.
+.IP
+.IP "\fB\-\-second\-stage\fP"
+Complete the bootstrapping process.
+Other arguments are generally not needed.
+.IP
+.IP "\fB\-\-second\-stage\-target=DIR\fP"
+Run second stage in a subdirectory instead of root. (can be used to create
+a foreign chroot) (requires \-\-second\-stage)
+.IP
+.IP "\fB\-\-keep\-debootstrap\-dir\fP"
+Don't delete the /debootstrap directory in the target after completing the
+installation.
+.IP
+.IP "\fB\-\-unpack\-tarball=FILE\fP"
+Acquire .debs from tarball FILE instead of downloading via http.
+.IP
+.IP "\fB\-\-make\-tarball=FILE\fP"
+Instead of bootstrapping, make a tarball (written to FILE) of the downloaded
+packages.
+The resulting tarball may be passed to a later
+.BR \-\-unpack\-tarball .
+.IP
+.IP "\fB\-\-debian\-installer\fP"
+Used for internal purposes by the debian-installer
+.IP
+.IP "\fB\-\-extractor=TYPE\fP"
+Override automatic .deb extractor selection to
+.IR TYPE .
+Supported extractors are: dpkg-deb and ar.
+.IP
+.IP "\fB\-\-no\-check\-certificate\fP"
+Do not check certificate against certificate authorities
+.IP
+.IP "\fB\-\-certificate=FILE\fP"
+Use the client certificate stored in file (PEM)
+.IP
+.IP "\fB\-\-private\-key=FILE\fP"
+Read the private key from file
+
+.SH EXAMPLES
+.
+.PP
+To setup a \fIparkes\fR system:
+.PP
+ debootstrap parkes ./parkes-chroot http://archive.gnewsense.org/gnewsense-three/gnewsense
+.PP
+ debootstrap parkes ./parkes-chroot file:///LOCAL_MIRROR/gnewsense
+.PP
+To setup a \fItoutatis\fR system:
+.PP
+ debootstrap toutatis ./toutatis-chroot http://archive.trisquel.info/trisquel
+.PP
+ debootstrap toutatis ./toutatis-chroot file:///LOCAL_MIRROR/trisquel
+.PP
+Full process to create a complete gNewSense installation of \fIparkes\fR
+in a chroot:
+.PP
+ main # debootstrap parkes parkes-root http://archive.gnewsense.org/gnewsense-three/gnewsense
+ [ ... watch it download the whole system ]
+ main # echo "proc parkes-root/proc proc defaults 0 0" >> /etc/fstab
+ main # mount proc parkes-root/proc -t proc
+ main # echo "sysfs parkes-root/sys sysfs defaults 0 0" >> /etc/fstab
+ main # mount sysfs parkes-root/sys -t sysfs
+ main # cp /etc/hosts parkes-root/etc/hosts
+ main # chroot parkes-root /bin/bash
+.PP
+Full process to create a complete Trisquel installation of \fItoutatis\fR
+in a chroot:
+.PP
+ main # debootstrap toutatis toutatis-root http://archive.trisquel.info/trisquel
+ [ ... watch it download the whole system ]
+ main # echo "proc toutatis-root/proc proc defaults 0 0" >> /etc/fstab
+ main # mount proc toutatis-root/proc -t proc
+ main # echo "sysfs toutatis-root/sys sysfs defaults 0 0" >> /etc/fstab
+ main # mount sysfs toutatis-root/sys -t sysfs
+ main # cp /etc/hosts toutatis-root/etc/hosts
+ main # chroot toutatis-root /bin/bash
+.SH AUTHOR
+.B debootstrap
+was written by Anthony Towns <ajt@debian.org>.
+This manpage was written by Matt Kraai <kraai@debian.org>.
+gNewSense and Trisquel rebranding was written by André Silva <emulatorman@parabola.nu>.
diff --git a/libre/debootstrap/gnewsense b/libre/debootstrap/gnewsense
new file mode 100644
index 000000000..884ac88a0
--- /dev/null
+++ b/libre/debootstrap/gnewsense
@@ -0,0 +1,194 @@
+default_mirror http://archive.gnewsense.org/gnewsense-three/gnewsense
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd fakechroot minbase scratchbox
+
+if doing_variant fakechroot; then
+ test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
+fi
+
+case $ARCH in
+ alpha|ia64) LIBC="libc6.1" ;;
+ kfreebsd-*) LIBC="libc0.1" ;;
+ hurd-*) LIBC="libc0.3" ;;
+ *) LIBC="libc6" ;;
+esac
+
+work_out_debs () {
+ required="$(get_debs Priority: required)"
+
+ if doing_variant - || doing_variant fakechroot; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd || doing_variant scratchbox; then
+ base="apt $(get_debs Build-Essential: yes)"
+ elif doing_variant minbase; then
+ base="apt"
+ fi
+
+ if doing_variant fakechroot; then
+ # ldd.fake needs binutils
+ required="$required binutils"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ : >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ if doing_variant fakechroot; then
+ setup_devices_fakechroot
+ else
+ setup_devices
+ fi
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(extract_deb_field "$TARGET/$deb" Version)"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ if doing_variant fakechroot; then
+ setup_proc_fakechroot
+ elif doing_variant scratchbox; then
+ true
+ else
+ setup_proc
+ in_target /sbin/ldconfig
+ fi
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk "$TARGET/usr/bin/awk"
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ if doing_variant fakechroot; then
+ install_fakechroot_tools
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm "$TARGET/usr/bin/awk"
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ exec 7>&1
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ setup_available $required $base
+ done_predeps=
+ while predep=$(get_next_predep); do
+ # We have to resolve dependencies of pre-dependencies manually because
+ # dpkg --predep-package doesn't handle this.
+ predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
+ # XXX: progress is tricky due to how dpkg_progress works
+ # -- cjwatson 2009-07-29
+ p; smallyes '' |
+ in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
+ base=$(without "$base" "$predep")
+ done_predeps="$done_predeps $predep"
+ done
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
diff --git a/libre/debootstrap/trisquel b/libre/debootstrap/trisquel
new file mode 100644
index 000000000..7efa062f9
--- /dev/null
+++ b/libre/debootstrap/trisquel
@@ -0,0 +1,199 @@
+default_mirror http://archive.trisquel.info/trisquel
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd fakechroot minbase
+
+if doing_variant fakechroot; then
+ test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
+fi
+
+case $ARCH in
+ alpha|ia64) LIBC="libc6.1" ;;
+ *) LIBC="libc6" ;;
+esac
+
+work_out_debs () {
+ required="$(get_debs Priority: required)"
+
+ if doing_variant -; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ base="$(get_debs Build-Essential: yes)"
+ elif doing_variant fakechroot || doing_variant minbase; then
+ base="apt"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ : >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ if doing_variant fakechroot; then
+ setup_devices_fakechroot
+ else
+ setup_devices
+ fi
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(extract_deb_field "$TARGET/$deb" Version)"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ if doing_variant fakechroot; then
+ setup_proc_fakechroot
+ else
+ setup_proc
+ in_target /sbin/ldconfig
+ fi
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk "$TARGET/usr/bin/awk"
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/Etc/UTC "$TARGET/etc/localtime"
+ fi
+
+ if doing_variant fakechroot; then
+ install_fakechroot_tools
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm "$TARGET/usr/bin/awk"
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
+
+ info CONFREQ "Configuring required packages..."
+
+ if doing_variant fakechroot; then
+ # fix initscripts postinst (no mounting possible, and wrong if condition)
+ sed -i '/dpkg.*--compare-versions/ s/\<lt\>/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
+ fi
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ if [ -x "$TARGET/sbin/initctl" ]; then
+ mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl"
+ chmod 755 "$TARGET/sbin/initctl"
+ fi
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ setup_available $required $base
+ done_predeps=
+ while predep=$(get_next_predep); do
+ # We have to resolve dependencies of pre-dependencies manually because
+ # dpkg --predep-package doesn't handle this.
+ predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
+ # XXX: progress is tricky due to how dpkg_progress works
+ # -- cjwatson 2009-07-29
+ p; smallyes '' | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
+ base=$(without "$base" "$predep")
+ done_predeps="$done_predeps $predep"
+ done
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
+
+ if [ -x "$TARGET/sbin/initctl.REAL" ]; then
+ mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl"
+ fi
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}