#!/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 Deparement, use under either BSD or GPL license # author Neil Franklin, last modification 2003.04.11 # 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 2 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 # where to add the 2 more base-config scripts BASECONF_DIR=/usr/lib/base-config # --- fix up debconf for no questions # prevent questions while installing packages from woody-proposed-updates # this is also then active later when installing random stuff # 01debconf, so just after 00dbootstrap_settings, after Debian has touched this SCRIPT_DEBCONF=${BASECONF_DIR}/01debconf /bin/cat << EOF > ${SCRIPT_DEBCONF} #!/bin/sh -e # reconfigure debconf to not ask any questions # debconf access needs this, first action (may restart this script!) . /usr/share/debconf/confmodule # make base-config set up debconf to use defaults, without asking questions # get rid of as many dialogs and questions as possible # *NOTE* that we still need debconf-preload because base-config tricks us db_set debconf/priority critical db_set debconf/frontend noninteractive rm ${SCRIPT_DEBCONF} EOF /bin/chmod 755 ${SCRIPT_DEBCONF} # --- insert script to load our host package for this host # do an apt-get install of host package at the end # 99z10hostpackage so it sorts after 99inittab, 'h'<'i' so use 'z' :-( # so after all Debian stuff done, as if user had logged in and done apt-get # this allows us to do anything, including rebooting, without conflicts SCRIPT_HOSTPACKAGE=${BASECONF_DIR}/99z20hostpackage # where we install a facultative script to be run after apt-get has exited # this may be used to trigger an reboot or other actions apt-get dislikes POST_ATP_GET=/etc/dphys/post-apt-get /bin/cat << EOF > ${SCRIPT_HOSTPACKAGE} #!/bin/sh -e # install the host package and all its dependencies # we name all our local packages dphys-*, so host packages are dphys-host-* # dphys-host-`hostname` is expected to: # a) depend on host specific packages (such as kernel) # b) install host specific config files (such as XF86Config) # c) an dphys-site site package which does the rest of the work # dphys-site is expected to: # a) depends on packages used on all hosts # b) installs config files used on all hosts # e) add daily cron job to apt-get update/upgrade, incl newer dphys-site # f) add init.d script for the case cron job is not run due to power off # see "makepackage" for generating/modifying such host and site packages # run yes with nice, else it uses up all CPU und apt-gat gets really slow nice yes '' | apt-get install dphys-host-\`hostname\` # some packages crash out of apt-get install but work when re-run # some being g77 und g77-2.95, if you have such use this dirty fix instead: #while ! nice yes '' | apt-get install dphys-host-\`hostname\`; do :; done if [ -x ${POST_ATP_GET} ] ; then ${POST_ATP_GET} fi rm ${SCRIPT_HOSTPACKAGE} EOF /bin/chmod 755 ${SCRIPT_HOSTPACKAGE}