#!/bin/sh # http://www.phys.ethz.ch/~franklin/Projects/dphys2/endfirstrun # - script to be run at end of /sbin/dbootstrap for further automation # copyright ETH Zuerich Physics Departement, # use under either BSD or GPL license # author Neil Franklin, last modification 2004.02.12 # this script is intended to be run as root by dbootstrap chroot-ed to the # target disk, at the end of the first installation stage # this script generates scripts to be run by base-config, that fix up the # installed system, so that it autoinstalls our desired packages and configs # and does so without any questions being asked # --- read in setup, for ${CONF_*}, ${DEBUG_*} and ${SYS_*} # this is shared by Makefile, dbootstrap, get*, makeroot, makerescue . /etc/setup-dphys2 # --- insert script to load our site package # do an apt-get install of site package at the end # this allows us to do anything, including rebooting, without conflicts /bin/echo "--------------------------------------------------------" /bin/echo "*** Apt-get Install Site Package *** for autoinstall ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # this script will run as part of second stage of install, from base-config # 99sitepackage after all other stuff has been done, as if user had logged in SCRIPT_SITEPACKAGE=/usr/lib/base-config/99sitepackage /bin/cat << EOF > ${SCRIPT_SITEPACKAGE} #!/bin/sh -e # install the site package and all its dependencies # install identd, else we will not get access to site package(s) and files /usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install oidentd # and now we can access extra package lists, so let apt update package database /usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get update # and let dpkg also update its package database /usr/bin/apt-cache dumpavail > /var/cache/apt/available /usr/bin/dpkg --update-avail /var/cache/apt/available /bin/rm -f /var/cache/apt/available # enable access to dphys site configuration files by packages wanting them # this variable name and path are also used in dphys-admin dphys-setup.pl /bin/cat << EOF2 > /etc/default/dphys # baseurl of dphys configfiles # author dsbg, last modification Thu, 23 Oct 2003 17:22:33 +0200 CONF_BASEURL="http://debian.ethz.ch/pub/debian-local/share" EOF2 # and trigger installing of all our site dependant stuff # run yes with nice, else it uses up all CPU und apt-get gets really slow # we name all our local packages dphys-*, # you are advised to use -*-* # see "makesourcepackage" for generating/modifying such packages # dphys-site package is expected to: # a) depends on packages used on all hosts # b) installs config files used on all hosts # c) depend on dphys-admin and dphys-setup-* packages # dphys-setup-* packages are expected to: # a) install host specific files (such as ssh host keys) # b) generate host specific config files (such as XF86Config) # 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 /usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install dphys-site if [ x${DEBUG_LEAVE_BC_SCRIPTS} != xyes ] ; then /bin/rm ${SCRIPT_SITEPACKAGE} fi # and the last action of the 2nd install phase, pass on to dphys-admin # this should have been dependancy-installed by dphys-site /bin/echo "### activate dphys-admin dphys-setup.pl via init.d" /etc/init.d/dphys-admin start exit 0 EOF /bin/chmod 755 ${SCRIPT_SITEPACKAGE} if [ x${DEBUG_WAIT_STEP} = xyes ] ; then /bin/echo "--- debug info ---" /bin/ls -al ${SCRIPT_SITEPACKAGE} /bin/echo "--- end debug info ---" read dummy fi