#!/bin/sh
#
# Author: Petter Reinholdtsen
# Date:   2005-12-07
#
# Script to convert a LTSP thin client to a LDAP authenticating
# half-thick client.
#
# TODO:
#  - Verity package list to make sure we get a working desktop.
#  - Verify config file list to make sure they are complete.  (still
#    some left at the moment)
#  - Check and fix LTSP config to make /var/lib/nfs/ writable. (fixed
#    in newer LTSP packages)

LTSPROOT=/opt/ltsp/i386

extrapackages="\
    libnss-ldap \
    libpam-ldap \
    x-window-system-core \
    kdm \
    education-workstation \
    "

copyfiles="\
  /etc/nsswitch.conf \
  /etc/pam.d/common-account \
  /etc/pam.d/common-password \
  /etc/pam.d/common-auth \
  /etc/pam.d/common-session \
  /etc/libnss-ldap.conf \
  /etc/pam_ldap.conf \
  "

# Make sure there is enough room, make an LVM volume for it

# first install the required packages
chroot $LTSPROOT aptitude install $extrapackages 

# Copy while preserving permissions and ownership
for file in $copyfiles ; do
    cp -a $file $LTSPROOT/$file
done
