1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#! /bin/sh -e
log() {
logger -t debian-edu-install/base-installer "info: $*"
}
# remove the debianfreespace logical volume. Doing it before
# installing packages, to make it possible to resize volumes on the
# fly during installation.
VG=$(mount | sed -n 's@^/dev/mapper/\(.*\)-root on /target.*@\1@p')
if [ -e /dev/$VG/debianedufreespace ] ; then
if mount | grep -q /debianedufreespace ; then
umount /target/debianedufreespace
fi
lvremove -f /dev/$VG/debianedufreespace
grep -v /debianedufreespace /target/etc/fstab > /target/etc/fstab.new && \
mv /target/etc/fstab.new /target/etc/fstab
rmdir /target/debianedufreespace
fi
# Expand overfull file systems during installation, until /target is umounted.
(
# Make sure debian-edu-fsautoresize uses the same time zone as the
# installer when running during installation (Solves Skolelinux
# bug #1356), to avoid inconsistent time stamps in the
# installation log.
TZ=UTC
export TZ
# Workaround for in-target not accepting arguments as part of the command
# to run. Need to create a temporary script that can be executed without
# arguments. Can not create it in /target/tmp/, as it does not exist yet.
# In Lenny, in-target handle arguments. This workaround can be
# removed and the code made simpler. [pere 2009-12-14]
script=/debian-edu-extend-file-systems
if [ ! -f $script ] ; then # Avoid several loops running at the same time
cat > /target$script <<EOF
#!/bin/sh
/usr/sbin/debian-edu-fsautoresize -n
EOF
chmod a+rx /target$script
while [ -x /target$script ]; do
if [ -x /target/usr/sbin/debian-edu-fsautoresize ] && [ -x /target/usr/bin/perl ]; then
# Avoid in-target, as it can not run in parallel with
# apt-install or in-target
chroot /target $script || true
fi
sleep 10
done
# $script is removed in finish-install.d script
fi
# Close as many file descriptors as possible, to reduce the chance
# of message leaks to debconf
) < /dev/null > /dev/null 2>&1 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 9>&1 &
# Need to do this here, as apt need to work via Squid to install
# debian-edu-config where the permanent file is included.
log "adding /etc/apt/apt.conf.d/90squid-di working around bug in Squid."
cat > /target/etc/apt/apt.conf.d/90squid-di <<EOF
// Avoid Squid handing out corrupt packages, solves Skolelinux bug #1419.
Acquire::http::Pipeline-Depth 0;
EOF
log "setting up aptkey"
if [ -f /usr/share/keyrings/archive.gpg -a ! -f /target/etc/apt/trusted.gpg ] ; then
log "creating /etc/apt in target"
mkdir -p /target/etc/apt
log "copying archive.gpg as trusted.gpg under /etc/apt in target"
cp /usr/share/keyrings/archive.gpg /target/etc/apt/trusted.gpg
else
test -f /usr/share/keyrings/archive.gpg || \
log "missing archive.gpg keyring in the installer"
test -f /target/etc/apt/trusted.gpg && \
log "trusted.gpg already exists under /etc/apt in target"
fi
|