#!/bin/sh
############################################################################
##                                                                         #
##   This program 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 2 of the License, or     #
##   (at your option) any later version.                                   #
##                                                                         #
############################################################################

cat <<-EOF > /etc/apt/sources.list
deb http://opensource.nchc.gov.tw/debian woody main contrib non-free
deb http://opensource.nchc.gov.tw/debian-non-US woody/non-US main contrib non-free
deb-src http://opensource.nchc.gov.tw/debian woody main contrib non-free
deb-src http://opensource.nchc.gov.tw/debian-non-US woody/non-US main contrib non-free
EOF

cat <<-EOF > /etc/hosts
127.0.0.1	livecd	localhost
140.110.17.49	opensource.nchc.gov.tw
EOF

cat <<-EOF > /etc/hostname
livecd
EOF

rm -f /etc/resolv.conf
touch /etc/resolv.conf

apt-get update

# rungetty - autologin
apt-get install rungetty
cp /root/inittab /etc/

# filesystem tools
apt-get -y install reiserfsprogs
apt-get -y install xfsprogs

# some useful tools
apt-get -y install sudo
apt-get -y install dialog netmask
apt-get -y install gawk sed perl
apt-get -y install vim less wget
apt-get -y install ssh
#apt-get -y install discover

# locales
apt-get -u install locales
cat <<-EOF > /etc/locale.gen
en_US ISO-8859-1
zh_TW BIG5
EOF
locale-gen

# setup timezone
echo "Asia/Taipei" > /etc/timezone
ln -fs /usr/share/zoneinfo/Asia/Taipei /etc/localtime

# disable pcmcia
cat <<-EOF > /etc/default/pcmcia
PCMCIA=no
PCIC=
PCIC_OPTS=
CORE_OPTS=
CARDMGR_OPTS=
EOF

# clean
apt-get clean
updatedb

# drblcd-hdinstall
cp /root/drblcd-hdinstall /opt/drblcd/
