multistrap/emdebian.grip

102 lines
2.7 KiB
Text
Raw Normal View History

# emdebian secondstage support (Grip version)
#
# Copyright (C) 2007-2009 Neil Williams <codehelp@debian.org>
#
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
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
LIBC=libc6
if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
LIBC="libc6.1"
elif [ "$ARCH" = "hurd-i386" ]; then
LIBC="libc0.3"
fi
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; then
base="$(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
PRESERVE_BUILDPLACE="yes"
. /usr/share/emdebian-tools/emrootfslib
make_dpkg_dirs
basic_etc_fstab
basic_etc_profile
if [ -x "$TARGET/usr/bin/md5sum.textutils" ] && [ \! -e "$TARGET/usr/bin/md5sum" ]; then
cp "$TARGET/usr/bin/md5sum.textutils" "$TARGET/usr/bin/md5sum"
fi
if doing_variant fakechroot; then
setup_devices_fakechroot
else
setup_devices
fi
x_feign_install dpkg
info INSTCORE " -> Unpacking packages in $BUILDPLACE"
unpack_debootstrap
disable_apt_recommends
info INSTCORE " -> First stage install complete in $BUILDPLACE"
}
second_stage_install () {
if [ -f /datestring ]; then
TIME=`cat /datestring`
echo "Setting approximate time of $TIME"
date -s $TIME
fi
info INSTCORE "Running ldconfig..."
in_target /sbin/ldconfig
in_target depmod
info INSTCORE "Setting debconf environment"
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
if doing_variant fakechroot; then
install_fakechroot_tools
fi
setup_dselect_method apt
info CONFBASE "Configuring packages..."
./emsecondstage
}