From a7dc4b944cbdb993b407431ab2072524c23e556f Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 20 Mar 2008 09:35:01 +0100 Subject: [PATCH] postinst-setup: generalize to cover laptop, too --- postinst-setup | 59 +++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/postinst-setup b/postinst-setup index f6f1f2c..3b5c151 100755 --- a/postinst-setup +++ b/postinst-setup @@ -7,13 +7,15 @@ if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then fi # install already shipped debs -[ -e /mirror ] || ln -s /home/ubuntu-mirror /mirror -mount -o loop /home/martin/download/ubuntu/hardy-alternate-amd64.iso /cdrom -apt-cdrom -m add +UBUNTU_CD="/home/martin/download/ubuntu/`lsb_release -c`-alternate-`dpkg --print-architecture`.iso" +if [ -r "$UBUNTU_CD" ]; then + mount -o loop "$UBUNTU_CD" /cdrom + apt-cdrom -m add +fi DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential fakeroot devscripts postfix openssh-server bzr # root's ssh stuff -if [ ! -d /root/ssh ]; then +if [ ! -d /root/ssh ] && [ -d /home/martin/.ssh ]; then mkdir -p /root/.ssh chmod 700 /root/.ssh cp /home/martin/.ssh/id_dsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/ @@ -26,10 +28,10 @@ if [ ! -d /etc/.bzr ]; then for i in passwd group shadow fstab; do cp $i $i.originst done - bzr get bzr+ssh://martin@piware.de/home/martin/backup/desktop-etc /desktop-etc - cp -av /desktop-etc/* /etc/ - cp -av /desktop-etc/.bzr/ /etc/ - rm -rf /desktop-etc + bzr get bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc + cp -av /backup-etc/* /etc/ + cp -av /backup-etc/.bzr/ /etc/ + rm -rf /backup-etc chmod 600 /etc/ssh/ssh_*_key fi @@ -61,34 +63,37 @@ fi dpkg -i /home/martin/download/libdvdcss2_*deb || true locale-gen ru_RU ru_RU.UTF-8 -# cronjob goo -killall apt-get || true - # remove packages that we do not need -apt-get purge -y --auto-remove hplip brltty bluez-cups gnome-accessibility-themes gnome-mag gnome-orca onboard tomboy ttf-arabeyes ttf-arphic-uming ttf-baekmuk ttf-gentium ttf-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-mgopen ttf-thai-tlwg +killall apt-get || true # cronjob goo +apt-get purge -y --auto-remove hplip brltty bluez-cups gnome-accessibility-themes gnome-mag gnome-orca onboard tomboy ttf-arabeyes ttf-arphic-uming ttf-baekmuk ttf-gentium ttf-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-mgopen ttf-thai-tlwg || true rm /etc/rcS.d/*pcmcia* /etc/rcS.d/*ppp* -# cronjob goo -killall apt-get || true - # install packages from network sources +killall apt-get || true apt-get update -o Acquire::Http::No-Cache=true -DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes vim bzrtools bzr-svn python-paramiko patchutils offlineimap wipe gnome-gpg diffstat dchroot gtimelog rsnapshot jigdo-file libtool devhelp python-doc manpages-dev gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-ffmpeg weechat weechat-plugins weechat-scripts dpatch wdiff dhcp3-server grep-dctrl ccache subversion listadmin quilt apache2 python-dev cryptsetup mutt editmoin lintian ia32-libs easytag latex-beamer python-gtk2-doc fakechroot +DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes vim bzrtools bzr-svn python-paramiko patchutils offlineimap wipe diffstat gtimelog jigdo-file libtool devhelp python-doc manpages-dev gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-ffmpeg weechat weechat-plugins weechat-scripts dpatch wdiff grep-dctrl ccache subversion listadmin quilt python-dev cryptsetup mutt editmoin lintian python-gtk2-doc fakechroot apt-get -y build-dep postgresql-8.3 gnome-volume-manager hal cupsys apport jockey -umount /cdrom +if [ `hostname` = donald ]; then + DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes dchroot rsnapshot dhcp3-server apache2 ia32-libs easytag latex-beamer fakechroot +fi + +umount /cdrom || true # other setup -ln -s /mirror /var/www/mirror -ifdown eth1 -ifup eth1 -/etc/init.d/dhcp3-server restart -patch /usr/bin/gtimelog ~martin/archiv/gtimelog.wednesday.patch - -# crontabs -crontab -u martin - </dev/null +if [ `hostname` = "donald" ]; then + [ -e /mirror ] || ln -s /home/ubuntu-mirror /mirror + ln -s /mirror /var/www/mirror + ifdown eth1 + ifup eth1 + /etc/init.d/dhcp3-server restart + patch /usr/bin/gtimelog ~martin/archiv/gtimelog.wednesday.patch + + # crontabs + crontab -u martin - </dev/null EOF +fi -- 2.39.5