#!/bin/sh # http://www.phys.ethz.ch/~franklin/Projects/dphys3/end2stage.dphys # - script to be run at end of second install stage for further automation # sets up and runs dphys-config[1] and dphys-admin[2] as used on our site # [1] http://www.phys.ethz.ch/~franklin/Projects/dphys-config/ # [2] http://www.phys.ethz.ch/~franklin/Projects/dphys-admin/ # author Neil Franklin, last modification 2005.10.27 # copyright ETH Zuerich Physics Departement, # use under either BSD or GPL license # this script is intended to be run as root at end of second stage install # / is root of the final system, as we are just short before login prompt ### ------ configuration for this script # first CONF_* various site or subnet dependant user config variables # then DEBUG_* various debugging settings # last SYS_* various system internal values # some of these are overridable by hostname input line options # --- CONF_* various site or subnet dependant user config variables # none of these currently # --- DEBUG_*, various debugging settings # these can be set to "yes" by -D option, followed by name without DEBUG_ # set this to sleep after displaying each steps header, number is in seconds #DEBUG_SLEEP=2 # set this to output debug state info after each step #DEBUG_PRINT_STEP=yes # set this to output debug state info and wait after each step #DEBUG_WAIT_STEP=yes # --- SYS_*, various system internal values # none of these currently ### ------ actual implementation from here on # no user settings any more below this point if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # --- load our sites packages # install identd, else no access to non-free site packages and config files # this was once needed, for woody, but sarge already loads an pidentd # run yes with nice , else it uses up all CPU und apt-get gets really slow #/usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install oidentd # - tell apt where to find dphys-config and dphys-admin cat << END-APT-SOURCES >> /etc/apt/sources.list deb http://debian.ethz.ch/pub/debian-local sarge/local main contrib non-free END-APT-SOURCES /usr/bin/apt-get update # - then configure dphys-config so it can find all the config files # http://www.phys.ethz.ch/~franklin/Projects/dphys-config/ cat << END-DHPYS-CONFIG > /etc/dphys-config CONF_BASEURL=http://debian.ethz.ch/pub/debian-local/configs/sarge END-DHPYS-CONFIG # install it, and auto-run it via its /etc/init.d script # run yes with nice , else it uses up all CPU und apt-get gets really slow /usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install dphys-config # now our apt sources.list and dphys-admin config and list files are here # /usr/bin/apt-get update and apt-cache dumpavail and dpkg --update-avail # are all done as part of running dphys-admin # - then install of all packages our site wants, by using dphys-admin # http://www.phys.ethz.ch/~franklin/Projects/dphys-admin/ # dphys-admin package is expected to: # a) add daily cron job to apt-get update/upgrade, incl newer dphys-admin # b) add init script for the case cron job is not run due to power off # c) get run by its init script, fetching all packages we want # this allows us to do anything else, as part of packages postinst scripts # including even rebooting, without any conflicts or hard coded stuff # we name all our self made packages dphys-*, # you are advised to use -* # see "makesourcepackage" for generating/modifying such packages # install it # it will not auto-run it via its /etc/init.d script, because apt-get active /usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install dphys-admin # so run manually, as if by init, we allow reboots at install time /usr/sbin/dphys-admin init if [ x${DEBUG_WAIT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al ${SCRIPT_SITEPACKAGE} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi exit 0