#!/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.                                   #
##                                                                         #
############################################################################

mirror_site="$1"
if [ "$mirror_site" = "" ]; then
  mirror_site="http://opensource.nchc.org.tw"
fi

apt-get update

# rungetty - autologin
apt-get install rungetty

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

# etherboot, bootcd
apt-get -y install etherboot
apt-get -y install bootcd

# some useful tools
apt-get -y install rsync
apt-get -y install debootstrap
apt-get -y install sudo
apt-get -y install dialog xdialog netmask
apt-get -y install gawk sed perl
apt-get -y install vim joe less wget socket
apt-get -y install ssh bin86
apt-get -y install findutils sysutils coreutils
apt-get -y install tcpdump traceroute
apt-get -y install pppoeconf
#apt-get -y install raidtools raidtools2
#apt-get -y install discover
apt-get -y install ntpdate
echo "NTPSERVERS=\"tick.stdtime.gov.tw\"" > /etc/default/ntp-servers
apt-get -y install bzip2 binutils
apt-get -y install unzip zip
apt-get -y install screen
apt-get -y install expect
apt-get -y install rcconf
apt-get -y install sg3-utils
apt-get -y install makepasswd
#apt-get -y install webmin webmin-core
apt-get -y install rstatd
apt-get -y install libtool automake
apt-get -y install mkisofs cdrecord netpbm
apt-get -y install k3b cdrdao
apt-get -y install xawtv
apt-get -y install linneighborhood 
# 2004/03/01/ zh-TW locale for linneighborhood 
apt-get -y install linneighborhood-i18n
apt-get -y install gftp-gtk
apt-get -y install iperf
apt-get -y install imagemagick
apt-get -y install eject
# am-utils
#apt-get -y install am-utils
#mv /etc/init.d/am-utils /etc/init.d/am-utils.real
#cat <<-EOF > /etc/init.d/am-utils
##!/bin/sh
#/etc/init.d/am-utils.real \$1
#exit 0
#EOF
#chmod 755 /etc/init.d/am-utils
#ln -fs ../init.d/am-utils /etc/rc1.d/S35am-utils
#/usr/bin/perl -p -i -e "s/auto_dir = .*/auto_dir = \/mnt\/amd/" /etc/am-utils/amd.conf
# clamav, chntpw
apt-get -y install clamav chntpw

# netinstall
apt-get -y install rh-8.0-netinstall
apt-get -y install rh-9-netinstall
apt-get -y install rh-fc1-netinstall
apt-get -y install rh-fc2-netinstall
apt-get -y install mdk-9.2-netinstall
apt-get -y install mdk-10.0-netinstall

# x window system
apt-get -y install kdm
apt-get -y install x-window-system
apt-get -y install kdelibs
apt-get -y install kdebase
apt-get -y install kdeadmin
apt-get -y install kdemultimedia
apt-get -y install kdenetwork
apt-get -y install kdegraphics
apt-get -y install kdeutils
apt-get -y install kdetoys
apt-get -y install kdegames
apt-get -y install kdepim
apt-get -y install kdeartwork
apt-get -y install kdeaddons
apt-get -y install kde-i18n-zhtwbig5
tar -C /usr/share/apps/ksplash/ -xvzf /root/2597-deb.tar.gz
cp /root/97xfree86-common_mkdesktophdicons /etc/X11/Xsession.d/
cp /root/98xfree86-common_chinese /etc/X11/Xsession.d/

#mv /etc/kde3/kdm/kdmrc /etc/kde3/kdm/kdmrc.orig
#cp /root/kdmrc /etc/kde3/kdm/
/usr/bin/perl -p -i -e "s/#AutoLoginEnable=.*/AutoLoginEnable=true/" /etc/kde3/kdm/kdmrc
/usr/bin/perl -p -i -e "s/#AutoLoginUser=.*/AutoLoginUser=root/" /etc/kde3/kdm/kdmrc
if [ ! -e /etc/kde3/kdm/Xstartup.orig ]; then
  mv /etc/kde3/kdm/Xstartup /etc/kde3/kdm/Xstartup.orig
  cp /root/Xstartup /etc/kde3/kdm/Xstartup
fi
# Blake, 2004/03/12
#tar -C /root -xzf /root/kde.tar.gz
#chown -R root.root /root/.drbl
tar -C /etc/skel -xzf /root/kde.tar.gz
tar -C /etc/skel -xzf /root/desktop.tar.gz
#cp /etc/openoffice/openoffice.desktop /etc/skel/.drbl/.kde-default/Autostart
#cp /etc/openoffice/openoffice.desktop /etc/skel/.drbl/.kde-mac/Autostart
#cp /etc/openoffice/openoffice.desktop /etc/skel/.drbl/.kde-xp/Autostart

cp -r /etc/skel/.drbl /root/
# Blake, 2004/01/27
ln -fs .drbl/.kde-mac /root/.kde

# chinese
apt-get -y install libfreetype6 libgimpprint1
apt-get -y install cmap-adobe-cns1 cmap-adobe-gb1
apt-get -y install gs-common gs gs-cjk-resource gsfonts
apt-get -y install psfontmgr x-ttcidfont-conf defoma
apt-get -y install ttf-arphic-bsmi00lp ttf-arphic-bkai00mp
# Blake, 2004/03/29, wangfont
apt-get -y install ttf-wangfont
apt-get -y install xfonts-intl-chinese
apt-get -y install xcin rxvt-ml
cp /root/xcinrc /etc
cp /root/cd-defoma /etc/init.d/cd-defoma
ln -fs ../init.d/cd-defoma /etc/rc2.d/S97cd-defoma
ln -fs ../init.d/cd-defoma /etc/rc5.d/S97cd-defoma
#apt-get -y install libming-fonts-openoffice

# games
apt-get -y install gnome-games
apt-get -y install frozen-bubble
apt-get -y install ace-of-penguins
apt-get -y install enigma gnuchess gtans imaze
apt-get -y install katomic kbattleship kmahjongg koules ksokoban
apt-get -y install rocks-n-diamonds xbattle xboing xgalaga xskat
apt-get -y install freeciv-client-gtk freeciv-data freeciv-server

# thin client: fvwm95
apt-get -y install fvwm95 fvwm95-icons
/usr/bin/perl -p -i -e "s/Netscape/Mozilla/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/netscape/mozilla/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/nscape.xpm/mozilla.xpm/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/xview/gimp/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/gimp.xpm/wilber.xpm/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/Exec \"xv\" xv/Exec \"gimp\" gimp/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/Exec \"gimp\"/Exec \"The GIMP\"/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/Title xterm/Title crxvt/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/\"XTerm\" xterm/\"crxvt-big5\" crxvt/g" /etc/X11/fvwm95/system.fvwm95rc
/usr/bin/perl -p -i -e "s/-ls -sb -title \"Color xterm\"/-ls -fg white -bg black/g" /etc/X11/fvwm95/system.fvwm95rc
cp /root/wilber.xpm /usr/share/fvwm95/icons

# x apps
apt-get -y install mozilla
apt-get -y install xmms xine-ui vlc vlc-alsa vlc-gtk
apt-get -y install xpdf xpdf-chinese-traditional ghostview gnome-gv kghostview
apt-get -y install gimp gimageview gtksee
apt-get -y install kgeo drgeo kopete 
apt-get -y install dia
apt-get -y install pydict
apt-get -y install xvncviewer

# Blake, 2004/03/01, mozilla 1.6 backport from backport.org is ready
# install mozilla 1.5 in /usr/local
#tar -C /usr/local -xvzf /root/mozilla-i686-pc-linux-gnu-1.5-zhTW-sea.tar.gz
#libstdc=`ls /usr/lib/libstdc++-3-libc*`
#ln -s $libstdc /usr/lib/libstdc++-libc6.1-1.so.2
#ln -fs /usr/local/mozilla/mozilla /usr/bin/mozilla
# Blake, 2004/02/24, about mozilla print chinese
#cp /root/unix.js /usr/local/mozilla/defaults/pref/
apt-get -y install mozilla-locale-zh-tw
cp /root/unix.js /usr/lib/mozilla/defaults/pref/
# Blake, 2004/03/09, default locale: zh-TW
/usr/bin/perl -p -i -e "s/locale,install,select,en-US/locale,install,select,zh-TW/" /var/lib/mozilla/chrome.d/99default
/usr/sbin/update-mozilla-chrome
# mozplugger
apt-get -y install mozplugger

# man page
apt-get -y install man-db manpages manpages-dev

# numerical library
apt-get -y install atlas2-base atlas2-base-dev
apt-get -y install blas blas-dev
apt-get -y install fftw2

# rat
apt-get -y install nchc-rat
#dpkg -i /root/rat_4.2.24-1_i386.deb
# nchc-vic
#apt-get -y install gcc3.0-base libgcc1 libstdc++3
#dpkg --force-overwrite -i /root/nchc-vic_1.0_i386.deb
apt-get -y install nchc-vic
# memtest86
#dpkg -i /root/memtest86_3.0-4_i386.deb
apt-get -y install memtest86
apt-get -y install memtest86+

# network block device
apt-get -y install nbd-server nbd-client
mknod -m 660 /dev/nbd0 b 43 0
mknod -m 660 /dev/nbd1 b 43 1
chown root.disk /dev/nbd*
#mv /etc/rc2.d/S20nbd-client /etc/rcS.d/S89nbd-client
mv /etc/rc2.d/S20nbd-client /etc/rc2.d/K20nbd-client

# cups
#apt-get -y install cupsys cupsysbsd cupsys-client cupsys-driver-gimpprint
apt-get -y install cupsys cupsys-driver-gimpprint
cp /root/cups-tiny.xpm /usr/share/icons

# webmin 1.100
apt-get -y install openssl libssl-dev
apt-get -y install libnet-ssleay-perl

## Blake, 2004/07/19, use apt-get install to install webmin
##if [ "$NO_WEBMIN" = "" ]; then
##  webmin_pid=`/bin/ps -e | grep 'miniserv.pl' | sed -e 's/^ *//' -e 's/ .*//'`
##  if [ "$webmin_pid" != "" ]; then kill -9 $webmin_pid; fi
##
##  export config_dir="/etc/webmin/"
##  export var_dir="/var/webmin"
##  export login="root"
##  export password="x"
##  export perl="/usr/bin/perl"
##  export atboot=1
##  export port=10000
##  export ssl=1
##  tar -C /root -xvzf /root/webmin-1.100-minimal.tar.gz
##  /root/webmin-1.100/setup.sh /usr/share/webmin
##  acl=`cat /etc/webmin/webmin.acl`
##  for wbm in `ls /root/wbm`
##  do
##    if [ "$wbm" != "CVS" ]; then
##      /usr/share/webmin/install-module.pl /root/wbm/$wbm
##	  wbm=${wbm/\.wbm/}
##	  acl="$acl $wbm"
##    fi
##  done
##  echo "$acl" > $config_dir/webmin.acl
##  rm -rf /root/webmin-1.100
##  rm -rf /root/wbm
##
##  webmin_pid=`/bin/ps -e | grep 'miniserv.pl' | sed -e 's/^ *//' -e 's/ .*//'`
##  if [ "$webmin_pid" != "" ]; then kill -9 $webmin_pid; fi
##
##  if [ ! -f /etc/rc2.d/S99webmin -a -f /etc/init.d/webmin ]; then
##    ln -fs ../init.d/webmin /etc/rc2.d/S99webmin
##  fi
##fi
apt-get -y install webmin webmin-core webmin-firewall
rm -rf /root/wbm

# openmosix
apt-get -y install openmosix openmosixview
#mv /etc/rc2.d/S20openmosix /etc/rc2.d/K20openmosix
#mv /etc/rc2.d/S20openmosixcollector /etc/rc2.d/K20openmosixcollector
mv /etc/init.d/openmosix /etc/init.d/openmosix.real
mv /etc/init.d/openmosixcollector /etc/init.d/openmosixcollector.real
cat <<-EOF > /etc/init.d/openmosix
#!/bin/sh
if [ ! -d /proc/hpc ]; then exit; fi
/etc/init.d/openmosix.real \$1
EOF
cat <<-EOF > /etc/init.d/openmosixcollector
#!/bin/sh
if [ ! -d /proc/hpc ]; then exit; fi
/etc/init.d/openmosixcollector.real \$1
EOF
chmod 755 /etc/init.d/openmosix
chmod 755 /etc/init.d/openmosixcollector

## openoffice
#if [ -f /root/oo-xvfb-run -a "$NO_OO" = "" ]; then
#
#  tar -C / -xvzf /root/openoffice.tar.gz
#
#  wget http://openoffice.nchc.org.tw/download/1.1.2_zh-TW/OOo_1.1.2_LinuxIntel_install_zh-TW.tar.gz
#  tar -C /root -xvzf OOo_1.1.2_LinuxIntel_install_zh-TW.tar.gz
#  /root/oo-xvfb-run /root/OOo_1.1.2_LinuxIntel_install_zh-TW/setup -r /etc/openoffice/autoresponse-network.conf
#
#  cp /etc/openoffice/Common.xcu /opt/OpenOffice.org1.1.2/share/registry/data/org/openoffice/Office/
#
#  rm -f OOo_1.1.2_LinuxIntel_install_zh-TW.tar.gz
#  rm -rf /root/OOo_1.1.2_LinuxIntel_install_zh-TW
#
##  # ooopdb
##  tar -C /root -xvzf /root/ooopdb.tar.gz
##  cp -r /root/ooopdb/soffice.cfg /opt/OpenOffice.org1.1.2/user/config
##  cp /root/ooopdb/Module1.xba /opt/OpenOffice.org1.1.2/user/basic/Standard
##  rm -rf /root/ooopdb
#fi

#if [ "$NO_OO" = "" ]; then
#  yes "" | apt-get -y install openoffice.org-l10n-zh-tw openoffice.org-bin
#  tar -C / -xvzf /root/openoffice.tar.gz
#  cp /etc/openoffice/Common.xcu /usr/lib/openoffice/share/registry/data/org/openoffice/Office/
#  #yes "" | apt-get -y install openoffice.org-bin
#  #tar -C / -xvzf /root/openoffice.tar.gz
#fi

# alsa
#apt-get -y install alsa-source
#apt-get -y install alsa-base alsa-utils

# ocs
#apt-get -y install partimage-server partimage
apt-get -y install partimage zlib1g-dev
apt-get -y install parted
apt-get -y install busybox-source-0.60.3

# osts
#apt-get -y install lm-sensors-source
#apt-get -y memtest86
#dpkg -i /root/cpuburn_1.4-4_i386.deb

# will be used in drblpush - for no network installation
apt-get -y install mknbi syslinux
apt-get -y install make gcc g77 libc6-dev libpcap0 libpcap-dev

# grub
apt-get -y install grub
cp /root/grub-debian.xpm.gz /usr/share/icons

# 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

# xfree86 4.3
cp /etc/apt/sources.list /root
if [ "$mirror_site" = "original" ]; then
  cat <<-EOF > /etc/apt/sources.list
deb http://www.debian.or.jp/~kmuto/x430 ./
EOF
else
  cat <<-EOF > /etc/apt/sources.list
deb $mirror_site/apt/xfree86-4.3/woody ./
EOF
fi
apt-get update
#apt-get install x-window-system xfree86-common xserver-xfree86
#debconf version mismatch when we try to install xfree86-common
#maybe we can fix this problem when we use "testing" branch to release DRBLCD
apt-get install x-window-system xserver-xfree86
cp /root/sources.list /etc/apt/
apt-get update

# Blake, 2004/01/27, kde theme
tar xzf /root/kde_xp_full.tar.gz
cp -R -f kde_xp_full/icons/kde_xp /usr/share/icons
cp -R -f kde_xp_full/bar.png /usr/share/icons
cp -R -f kde_xp_full/accesso.jpg /usr/share/icons
cp -R -f kde_xp_full/kde_xpStyle/pixmaps /usr/share/apps/kstyle
cp -R -f kde_xp_full/kde_xpStyle/themes /usr/share/apps/kstyle
cp -R -f kde_xp_full/kde_xpStyle/wallpapers /usr/share/
cp -f kde_xp_full/kde_xpTheme/kde_xp.ktheme /usr/share/apps/kthememgr/Themes/
cp -R -f kde_xp_full/kde_xpTheme/kde_xp /usr/share/apps/kwin/icewm-themes/
rm -rf kde_xp_full
cp /root/kmenu.png /usr/share/icons/kde_xp/16x16/apps/
cp /root/kmenu.png /usr/share/icons/kde_xp/32x32/apps/
cp /root/kmenu.png /usr/share/icons/kde_xp/48x48/apps/

#tar xzf /root/8621-Aqua_Mac_beta.tar.gz
#cp -R -f Aqua_Mac_beta/pixmaps /usr/share/apps/kstyle/
#cp -R -f Aqua_Mac_beta/themes /usr/share/apps/kstyle/
#cp -R -f Aqua_Mac_beta/Aqua_Mac /usr/share/apps/kwin/icewm-themes/
#rm -rf Aqua_Mac_beta
tar xzf /root/153-Acqua-3.1.tar.gz
cp -R -f Acqua-3.1/style/pixmaps /usr/share/apps/kstyle/
cp -R -f Acqua-3.1/style/themes /usr/share/apps/kstyle/
cp -R -f Acqua-3.1/style/wallpapers /usr/share/
cp -R -f Acqua-3.1/icewm-themes/Acqua /usr/share/apps/kwin/icewm-themes/
rm -rf Acqua-3.1

tar -C /usr/share/icons -xzf /root/AquaFusion.tar.gz
#cp /root/acqua.jpg /usr/share/wallpapers

# /usr/share/applnk/Utilities/Debian-XShells/CRxvt_(Big5)_.desktop 
cat <<-EOF > "/usr/share/applnk/Utilities/Debian-XShells/CRxvt_(Big5)_.desktop"
[Desktop Entry]
Name=CRxvt (Big5)
Comment=CRxvt: terminal emulator for X with Chinese (Big5) support
Exec=crxvt-big5 -ls -im xcin -pt Root -fg white -bg black -fn 7x14
Icon=konsole
Type=Application
EOF
cat <<-EOF > "/var/lib/kde/menu/XShells/CRxvt_(Big5)_.desktop"
[Desktop Entry]
Name=CRxvt (Big5)
Comment=CRxvt: terminal emulator for X with Chinese (Big5) support
Exec=crxvt-big5 -ls -im xcin -pt Root -fg white -bg black -fn 7x14
Icon=konsole
Type=Application
EOF
# /usr/share/applnk/Internet/Debian/Mozilla Components/Mozilla_Browser.desktop
cat <<-EOF > "/usr/share/applnk/Internet/Debian/Mozilla Components/Mozilla_Browser.desktop"
[Desktop Entry]
Type=Application
Exec=mozilla-1.6
Name=Mozilla Browser
Comment=Mozilla Browser
Icon=mozilla
EOF
cat <<-EOF > "/var/lib/kde/menu/Net/Mozilla Components/Mozilla_Browser.desktop"
[Desktop Entry]
Type=Application
Exec=mozilla-1.6
Name=Mozilla Browser
Comment=Mozilla Browser
Icon=mozilla
EOF

# clean
apt-get clean
updatedb

# dhcp3-server tftpd-hda nis nfs-user-server devfsd diskless
apt-get -y install dhcp3-server -d
apt-get -y install tftpd-hpa -d
apt-get -y install nis -d
#apt-get -y install nfs-user-server -d
apt-get -y install nfs-kernel-server -d
apt-get -y install devfsd -d
apt-get -y install ntp -d
apt-get -y install diskless -d
# openoffice
#if [ "$NO_OO" = "" ]; then
#  apt-get -y install openoffice.org-l10n-zh-tw -d
#fi

if [ -d /opt/drblcd/pkg ]; then
  cp /var/cache/apt/archives/*.deb /opt/drblcd/pkg
fi
# drblcd-hdinstall & ebrom-detect
if [ -d /opt/drblcd ]; then
  cp /root/drblcd-hdinstall /opt/drblcd/
  cp /root/ebrom-detect /opt/drblcd/
  # Blake, 2004/04/02, SCSI HD
  cp /root/include-modules /opt/drblcd/
fi

drbl_version=$(grep "Version: " /etc/drbl_version)
drbl_version=${drbl_version/Version: /}
mkdir -p "/root/.kde/share/applnk/Penguinzilla $drbl_version"
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-install.desktop"
[Desktop Entry]
Name=DRBL Installation (Big5)
Name[zh_TW]=DRBLw
Icon=drbl.xpm
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --locale zh_TW.Big5
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-install-en.desktop"
[Desktop Entry]
Name=DRBL Installation (English)
Icon=drbl.xpm
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --locale C
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/debian-install.desktop"
[Desktop Entry]
Name=Debian Installation (Big5)
Name[zh_TW]=Debianw
Icon=tux
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --debian-only --locale zh_TW.Big5
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/debian-install-en.desktop"
[Desktop Entry]
Name=Debian Installation (English)
Icon=tux
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --locale C --debian-only
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-netconfig.desktop"
[Desktop Entry]
Name=Network Configuration (Big5)
Name[zh_TW]=]w
Icon=linuxconf
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --netconfig --locale zh_TW.Big5
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-netconfig-en.desktop"
[Desktop Entry]
Name=Network Configuration (English)
Icon=linuxconf
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/drblcd-hdinstall --netconfig --locale C
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/ebrom-detect.desktop"
[Desktop Entry]
Name=EBRom Detection (Big5)
Name[zh_TW]=EBRom
Icon=etherboot.xpm
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/ebrom-detect
Type=Application
Terminal=0
EOF
cat <<-EOF > "/root/.kde/share/applnk/Penguinzilla $drbl_version/ebrom-detect-en.desktop"
[Desktop Entry]
Name=EBRom Detection (English)
Icon=etherboot.xpm
Exec=crxvt -ls -fn 7x14 -bg black -fg white -e /opt/drblcd/ebrom-detect en
Type=Application
Terminal=0
EOF
rm -rf /root/Desktop
mkdir -p /root/Desktop
cp "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-install.desktop" /root/Desktop
cp "/root/.kde/share/applnk/Penguinzilla $drbl_version/debian-install.desktop" /root/Desktop
cp "/root/.kde/share/applnk/Penguinzilla $drbl_version/drbl-install-en.desktop" /root/Desktop
cp "/root/.kde/share/applnk/Penguinzilla $drbl_version/debian-install-en.desktop" /root/Desktop

tar -C /usr/share -xzf /root/icons.tar.gz
cp /root/drbl.png /usr/share/wallpapers
/usr/bin/perl -p -i -e "s/Wallpaper=.*/Wallpaper=drbl.png/" /etc/kde3/kdm/backgroundrc
/usr/bin/perl -p -i -e "s/LogoArea=.*/LogoArea=None/" /etc/kde3/kdm/kdmrc
/usr/bin/perl -p -i -e "s/#ShowUsers=.*/ShowUsers=None/" /etc/kde3/kdm/kdmrc

# housekeeping
rmdir /home/klhaung/.mozilla
rm -rf /home/klhaung/.netscape
rm -rf /home/klhaung/.netscape6
rmdir /home/klhaung
