#! /bin/sh -e
# Bring up everything that's needed to fetch a Kickstart file from a hard
# disk.

# without this, debconf clients will talk debconf protocol to syslog
. /usr/share/debconf/confmodule

PACKAGES='ext2-modules vfat-modules fs-core-modules fs-secondary-modules'
if [ ! -x /var/lib/dpkg/info/disk-detect.postinst ]; then
	PACKAGES="$PACKAGES disk-detect"
fi

/lib/kickseed/kickseed-anna $PACKAGES

if [ -x /var/lib/dpkg/info/disk-detect.postinst ]; then
	/lib/kickseed/kickseed-udpkg disk-detect
else
	logger -t kickseed "disk-detect cannot be installed"
	exit 1
fi

depmod -a >/dev/null 2>&1 || true
log-output -t kickseed modprobe -q ext2 || true
log-output -t kickseed modprobe -q vfat || true

exit 0
