#!/bin/sh -e
. /usr/share/debconf/confmodule

if [ -e /root/dbootstrap_settings ]; then
	. /root/dbootstrap_settings || true
fi

# Check whether the system needs pcmcia.
db_get base-config/remove-pcmcia
if [ "$RET" = true -a "$PCMCIA" != yes ]; then
	echo pcmcia-cs purge | dpkg --set-selections
	echo pcmcia-modules-`uname -r` purge | dpkg --set-selections
	# In a sane world, I would not need to do this. Welcome to my world.
	rm -rf /etc/pcmcia /lib/modules/`uname -r`/pcmcia
	depmod -a >/dev/null || true
	# Delete lines above if/when those files are registed with dpkg.
fi
