X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=blobdiff_plain;f=postinst-setup;h=44ab3500e241fe068282eaeb3365176775c70b1d;hp=f56fef2ed9e9f6a6cabd3935e1dd8e5aa4c7cd24;hb=343e156dfb61ceefd01f9d2245d0421fa0622c2e;hpb=b79979bf02600a5c8630cef8556b18695a06cf28 diff --git a/postinst-setup b/postinst-setup index f56fef2..44ab350 100755 --- a/postinst-setup +++ b/postinst-setup @@ -1,18 +1,7 @@ #!/bin/sh -e -# move backup to /var -if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then - cp -a /home/martin/backup /var/backups/martin - rm -rf /home/martin/backup -fi - -# install already shipped debs -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 --no-install-recommends build-essential fakeroot devscripts postfix openssh-server bzr python-paramiko +# need bzr and postfix for the setup below +DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends postfix openssh-server bzr python-paramiko apt-cacher-ng eatmydata # root's ssh stuff if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then @@ -25,81 +14,49 @@ fi # completely cd /etc if [ ! -d /etc/.bzr ]; then - for i in passwd group shadow fstab; do - [ -e $i.originst ] || cp $i $i.originst - done - [ -e /backup-etc ] || bzr get sftp://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc + [ -e /backup-etc ] || bzr branch 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 - - # only restore dchroot part into fstab - grep -A 200 "^# dchroots" fstab >> fstab.originst || true - mv fstab.originst fstab - - # only restore the human users from passwd/group - for i in passwd group; do - perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst - mv $i.originst $i - done - - # only restore some passwords from shadow - egrep 'martin|netti|joe' shadow >> shadow.originst - mv shadow.originst shadow - chown root:shadow shadow - chmod 640 shadow + chmod 700 /etc/ssl/private + chmod 640 /etc/ssl/private/ssl-cert-* + chown root:ssl-cert /etc/ssl/private/ssl-cert* + echo "none /tmp tmpfs defaults 0 0" >> /etc/fstab fi # update postfix for new configuration newaliases /etc/init.d/postfix restart -# copy apt cache -if [ -d /home/aptcache ]; then - find /home/aptcache/ -name "*.deb" -exec cp '{}' /var/cache/apt/archives/ \; - rm -rf /home/aptcache -fi - -# other setup -dpkg -i /home/martin/download/libdvdcss2_*deb || true -locale-gen ru_RU ru_RU.UTF-8 - # remove packages that we do not need 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-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-thai-tlwg landscape-common update-motd|| true - -rm -f /etc/rcS.d/*pcmcia* /etc/rcS.d/*ppp* +apt-get install -y linux-signed-image-generic +apt-get purge -y --auto-remove hplip hplip-data printer-driver-hpcups brltty bluez-cups gnome-accessibility-themes gnome-orca onboard thunderbird deja-dup gnome-screensaver linux-headers-generic linux-generic || true # install packages from network sources killall apt-get || true -apt-get update -o Acquire::Http::No-Cache=true +apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim bzrtools bzr-svn 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 ubuntu-dev-tools dput gnome-blog dchroot fakechroot imagemagick pngquant pdfjam easytag rsnapshot openvpn texlive-lang-german python-coverage -apt-get -y build-dep postgresql-8.3 gnome-mount hal cups apport jockey +DEBIAN_FRONTEND=noninteractive eatmydata apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts python-notify2 listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc git-buildpackage d-feet libnotify-bin pastebinit lptools openvpn pdfjam sbuild schroot exiv2 gstreamer1.0-plugins-ugly gstreamer1.0-libav valgrind calibre autopkgtest +eatmydata apt-get install -y lxc lxd pandoc lmodern texlive-fonts-recommended pep8 pyflakes pssh network-manager-openvpn-gnome i3-wm i3status -if [ `hostname` = donald ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes dhcp3-server ia32-libs latex-beamer sane-utils -fi -if [ `hostname` = tick ]; then - DEBIAN_FRONTEND=noninteractive apt-get install -y powertop -fi +# have schroot use tmpfs +rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/ +ln -s /tmp /var/lib/schroot/unpack +ln -s /tmp /var/lib/schroot/union/overlay -umount /cdrom || true +# set up users +echo "Setting up users" +adduser martin sbuild +if ! getent passwd joe > /dev/null; then + adduser --gecos "Joe" --encrypt-home joe + adduser joe audio + adduser joe video +fi # crontabs crontab -u martin - </dev/null EOF - -# other setup -if [ `hostname` = "donald" ]; then - ifdown eth1 - ifup eth1 - /etc/init.d/dhcp3-server restart - -fi -if [ -x /usr/bin/gtimelog ]; then - patch /usr/bin/gtimelog ~martin/archiv/gtimelog.wednesday.patch -fi