#!/bin/sh # http://www.phys.ethz.ch/~franklin/Projects/dphys2/dbootstrap # - replaces /sbin/dbootstrap of install root floppy of Debian woody (3.0) # copyright ETH Zuerich Physics Departement, # use under either BSD or GPL license # author Neil Franklin, last modification 2004.10.14 # this script replaces the Debian /sbin/dbootstrap binary program # whose purpose is to install an basic Debian system # this replacement does so without asking lots of question - automatically # so that we can install 100s of machines without lots of work time usage # based on / derived from the Debian boot-floppies-3.0.22 utilities/dbootstrap ### ------ configuration for this site # 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 # base from which all Debian stuff can be downloaded CONF_DEBSERVER=http://ftp.debian.org/debian # are we using an 2.2 or 2.4 style kernel # if Debian kernels, this selects whether standard 2.2.20 or bf24 2.4.18 # if own kernels, this determines which Debian .config to use as base # if no own config is provided in CONF_KERNEL_CONFIG # so set this allways, if using or making an 2.4 kernel, instead of 2.2 CONF_KERNEL_24=no # use this to select an own (2.2 or 2.4) kernel source, to self compile # only needed if making own kernel CONF_KERNEL_OWN="" # where the machines being installed can http-fetch the rescue and drivers from # used for generating the URLs. to access our packages web server # the end result should parallel the scp login@server:/basedir above CONF_OWNSERVER=http://not-configured-server/not/configured/directory # this is the directory to use, within dists/woody/local/main/disks-i386 tree # vary this for multiple sets of rescue images and drivers archives # naming schemes maybe by subnets, or by kernel options, or by compiling user CONF_DISKSVERSION=custom # what keyboard layout you use # filename is relative to /usr/share/keymaps/ and without the .kmap.gz ending CONF_KEYBD=i386/qwerty/us # where we want our final system on the target system to be installed on to # if empty, try to auto-select, use /dev/hda if existant, else /dev/sda # so most people can leave this unset as it is # if above fails, set an specific disk by hand # you will need CONF_DISK=/dev/hd or sd, usually = a CONF_DISK="" # use this to force DMA usage on some stupid hd disk drives CONF_DISK_IDEDMA=no # amount of disk to use for the swap partition, if wanted, in MBytes # set to 0 or "", will make no partition and disable its use # this defaults to off, because we use swap files around here # as they are more flexible, auto-resizable, and not relevantly slower # to autogenerate/mount/umount swapfiles install the dphys-swapfile package: # http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/ CONF_SWAP_SIZE=0 # what net drivers we want included in our install root floppy drivers archive # net is needed to install from, to fetch files # this can be left empty if needed drivers are compiled into kernel CONF_MODULESNET="" # what network interface we are using, most people can leave this as it is CONF_IF=eth0 # use DHCP to get IP-addr/netmask/network/broadcast/gateway/nameservers # to use static IP config, set this to "no" CONF_DHCP=yes # site specific network stuff # only needed if *no* DHCP is being used CONF_DOMAIN=not-configured-domain CONF_NAMESERVER1=not-configured-server CONF_NAMESERVER2="" CONF_NAMESERVER3="" CONF_NAMESERVER4="" # subnet specific network stuff # only needed if *no* DHCP is being used # for each subnet generate its own(!) replacement root floppy # you are advised to write on the floppy "replacement root /" CONF_NETMASK=not-configured-netmask CONF_NETWORK=not-configured-network CONF_GATEWAY=not-configured-gateway CONF_BROADCAST=not-configured-broadcast # if you don't want an LILO password, comment out the next line # of course this is _not_ the password we actually use, not even similar :-) CONF_PASSWORD_LILO="" # debconf-preload - 15tzconfig - timezone stuff # where we are # directoryname and filename relative to /usr/share/zoneinfo/ CONF_TIMEZONE_AREA=not-configured-area CONF_TIMEZONE_PLACE=not-configured-place # debconf-preload - 20passwd - password setup stuff # security as we like it CONF_PASSWORD_MD5=yes CONF_PASSWORD_SHADOW=yes # we assume that many will use twice the same password CONF_PASSWORD_ROOT=${CONF_PASSWORD_LILO} # debconf-preload - 25pcmcia - PCMCIA remove stuff # remove PCMCIA support if not a notebook # change this to CONF_REMOVE_PCMCIA=false if you want to keep it CONF_PCMCIA_REMOVE=yes # debconf-preload - 40apt-setup - apt config what stuff we use # what additional package types we want to use, main is allways in # use packages that are not strictly by the GPL religion CONF_USE_CONTRIB=yes CONF_USE_NON_FREE=yes # use new packages being added to woody, for next dot release CONF_USE_PROPOSED=yes # debconf-preload - 40apt-setup - apt set non-US and security package servers # we use our own local mirror here, the same server as for normal packages # works for exeryone, so save us time reconfiguring for tests # add non-US if wanted CONF_DEBSERVER_NON_US=http://non-us.debian.org/debian-non-US # add security if wanted CONF_DEBSERVER_SECURITY=http://security.debian.org/ # prevent questions while installing packages from woody-proposed-updates # this is also then active later when installing random stuff # install everything with maintainers defaults, then fix up with own scripts CONF_SILENCE_DEBCONF=yes # --- DEBUG_*, various debugging settings # these can be set to "yes" by -D option, followed by name without DEBUG_ # as this is called by canned scripts, do this on the hostname input line # such as like this: -D PRINT_STEP -D WAIT_FIRST_REBOOT # 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 wait after each debug state info #DEBUG_WAIT_STEP=yes # set this to wait before deleting debconf-preload #DEBUG_WAIT_DEL_PRELOAD=yes # set this to leave debconf-preload, instead of tidying it up #DEBUG_LEAVE_PRELOAD=yes # set this to wait before deleting e f r user script #DEBUG_WAIT_DEL_EFR=yes # set this to leave end first run user script, instead of tidying it up #DEBUG_LEAVE_EFR=yes # set this to wait before reboot at end of first stage #DEBUG_WAIT_FIRST_REBOOT=yes # set this leave our generated base-config scripts, instead of deleting #DEBUG_LEAVE_BC_SCRIPTS=yes # --- SYS_*, various system internal values # note: this program has only been designed for and tested with i386 # others at own risk, I expect them to fail badly SYS_ARCH=i386 # where we will place the drivers archive within root floppy SYS_DRIVERSTGZ_ON_FLOPPY=/drivers.tgz SYS_DRIVERSTGZ_ON_TARGET=/drivers.tgz # where we will place our merged config file SYS_DPHYS2CONF_ON_FLOPPY=/dphys2 SYS_DPHYS2CONF_ON_TARGET=/dphys2 # where we will place our modifier for debconf for 2nd stage without dialogs SYS_PRELOAD_ON_FLOPPY=/debconf-preload SYS_PRELOAD_ON_TARGET=/debconf-preload # where we will place our user command to run SYS_ENDFIRSTRUN_ON_FLOPPY=/endfirstrun SYS_ENDFIRSTRUN_ON_TARGET=/endfirstrun ### ------ actual implementation from here on # no user settings any more below this point # --- config file stuff # what we are NAME=dbootstrap PNAME=dphys2 # check user config file(s), let user override settings # same config files used in dphys2[rescue|root|cd|pxe] and dbootstrap # but all merged into one file for inclusion on floppy by dphys2root if [ -f ${SYS_DPHYS2CONF_ON_FLOPPY} ] ; then . ${SYS_DPHYS2CONF_ON_FLOPPY} else /bin/echo "$0: ERROR: no config file, can not install" >&2 read -p "--- ERROR: wait reboot ---" dummy /sbin/reboot fi # --- announce that we are running /bin/echo "============================================================" /bin/echo "*** dphys2 Debian 3.0 (woody) simple automated installer ***" /bin/echo "============================================================" /bin/echo # increase chance that root floppy is removed from drive /bin/echo "-> eject root floppy, so that later reboot from HD does not fail <-" /bin/echo # --- host specific stuff, changes for each host - ask user at install time # get user input /bin/echo "----------------------------------------" /bin/echo "*** Input host specific settings *** ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # hostnames are usually unique read -p "enter [-D ] : " HOSTNAME # IP addresses must be unique if [ x${CONF_DHCP} != xyes ] ; then read -p "enter : " IPADDR fi /bin/echo "no further questions will be asked, now auto-installing ..." /bin/echo # --- parse hostname line in case it contains options # parse options /bin/echo "-------------------------------------------------" /bin/echo "*** Extracting Options from Hostname Line *** ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi while [ x`/bin/echo ${HOSTNAME} | /usr/bin/cut -c 1` = x- ] ; do OPTS_AND_HOSTNAME=${HOSTNAME} # split into parameters and rest OPTS=`/bin/echo ${HOSTNAME} | /usr/bin/cut -f 1 -d " "` HOSTNAME=`/bin/echo ${HOSTNAME} | /usr/bin/cut -f 2- -d " "` # extract options from parameter (cut off the "-") OPTS=`/bin/echo ${OPTS} | /usr/bin/cut -c 2-` # so long still unprocessed option characters while [ x${OPTS} != x ] ; do # first option to process OPT=`/bin/echo ${OPTS} | /usr/bin/cut -c 1` # and rest of options for later OPTS=`/bin/echo ${OPTS} | /usr/bin/cut -c 2-` case ${OPT} in D) # Debug: set an debug option to yes # export these so that endfirstrun als gets an chance to see them eval export DEBUG_`/bin/echo ${HOSTNAME} | \ /usr/bin/cut -f 1 -d " "`=yes HOSTNAME=`/bin/echo ${HOSTNAME} | /usr/bin/cut -f 2- -d " "` export ;; esac done if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/echo ${OPTS_AND_HOSTNAME} /bin/echo ${HOSTNAME} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi done # ------ from here on code to do the actual actions, follows Debians menus # --- "Configure the Keyboard" menu # [all *.c and *() are relative to boot-floppies-3.0.22/utilities/dbootstrap] # replaces kbdconfig.c configure_keyboard() # set our standard keyboard /bin/echo "---------------------------------------------------" /bin/echo "*** Configure the Keyboard *** to ${CONF_KEYBD} ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /bin/echo "KEYBD='${CONF_KEYBD}'" > /tmp/keybd_settings /bin/zcat /etc/keymaps.tgz | /bin/tar -xOf - ${CONF_KEYBD}.bmap | \ /sbin/loadkmap if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /tmp/keybd_settings /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- auto-select disk drive type IDE vs SCSI we want to install on # replaces partition_config.c select_drive() # if user has set ${CONF_DISK} to /dev/??? use that, else auto-select if [ x${CONF_DISK} = x ] ; then /bin/echo "------------------------------------------------------" /bin/echo "*** Auto-Select Drive hda vs sda *** for CONF_DISK ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi if [ x`/bin/ls -1d /proc/ide/hd? | /bin/grep hda` != x ] ; then # we have got an bootable (hda) IDE disk in here CONF_DISK=/dev/hda else # else assume we have got an bootable (sda) SCSI disk in here CONF_DISK=/dev/sda fi # fixup config, so /target/${SYS_ENDFIRSTRUN_ON_TARGET} can use ${CONF_DISK} /bin/echo >> ${SYS_DPHYS2CONF_ON_FLOPPY} /bin/echo "# ------ added by ${NAME} " >> ${SYS_DPHYS2CONF_ON_FLOPPY} /bin/echo >> ${SYS_DPHYS2CONF_ON_FLOPPY} /bin/echo "CONF_DISK=${CONF_DISK}" >> ${SYS_DPHYS2CONF_ON_FLOPPY} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/echo "auto-selected ${CONF_DISK} for CONF_DISK" /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi fi # --- set up IDE DMA so that installation is not slowed down # this is not part of the normal Debian installation prosess # use this to force IDE DMA usage on some stupid hd disk drives if [ x${CONF_DISK_IDEDMA} = xyes ] ; then /bin/echo "-----------------------------------------------------" /bin/echo "*** Force enabling of IDE DMA *** on ${CONF_DISK} ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi DRIVE=`/bin/echo ${CONF_DISK} | /usr/bin/cut -f 3 -d "/"` /bin/echo "using_dma:1" > /proc/ide/${DRIVE}/settings /bin/echo "io_32bit:1" > /proc/ide/${DRIVE}/settings if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /proc/ide/${DRIVE}/settings /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi fi # --- "Partition a Hard Disk" menu # replaces partition_config.c partition_disk() if [ x${CONF_SWAP_SIZE} = x -o x${CONF_SWAP_SIZE} = x0 ] ; then # no swap, use an very simple boot+root configuration /bin/echo "-----------------------------------------------------------" /bin/echo "*** Partition Hard Disk *** ${CONF_DISK} into boot+root ..." else # with swap, use an simple boot+swap+root configuration /bin/echo "----------------------------------------------------------------" /bin/echo "*** Partition Hard Disk *** ${CONF_DISK} into boot+swap+root ..." fi if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi if [ x${CONF_SWAP_SIZE} = x -o x${CONF_SWAP_SIZE} = x0 ] ; then # sfdisk is an command line driven fdisk, no menu, scriptable # our root disk builder adds it to the root file system # 16M Linux for /boot, no swap, rest Linux for / /sbin/sfdisk -uM ${CONF_DISK} << END-SFDISK-INPUT ,16,L ,,L ; ; END-SFDISK-INPUT else # 16M Linux for /boot, ${CONF_SWAP_SIZE} Swap for swap, rest Linux for / /sbin/sfdisk -uM ${CONF_DISK} << END-SFDISK-INPUT ,16,L ,${CONF_SWAP_SIZE},S ,,L ; END-SFDISK-INPUT fi # generate partition names if [ x${CONF_SWAP_SIZE} = x -o x${CONF_SWAP_SIZE} = x0 ] ; then PART_BOOT=${CONF_DISK}1 PART_ROOT=${CONF_DISK}2 else PART_BOOT=${CONF_DISK}1 PART_SWAP=${CONF_DISK}2 PART_ROOT=${CONF_DISK}3 fi # and number for "activate" PART_BOOT_NO=1 if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /sbin/fdisk -l ${CONF_DISK} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Initialize and Activate a Swap Partition" menu # replaces partition_config.c init_swap() # if user wants no swap, nothing to do here if [ x${CONF_SWAP_SIZE} = x -o x${CONF_SWAP_SIZE} = x0 ] ; then # no usage of swap partition /bin/echo "------------------------------------------" /bin/echo "*** Skipping making Swap Partition *** ..." else # straightforward usage of our swap partition /bin/echo "---------------------------------------------------------------" /bin/echo "*** Initialize and Activate Swap Partition *** ${PART_SWAP} ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /sbin/mkswap ${PART_SWAP} /sbin/swapon ${PART_SWAP} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /usr/bin/free /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi fi # --- "Initialize a Linux Partition" menu, twice # replaces partition_config.c init_linux() and init_ext() # first set up our root partition /bin/echo "---------------------------------------------------------------" /bin/echo "*** Initialize and Mount Partition *** root on ${PART_ROOT} ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /sbin/mkfs.ext2 ${PART_ROOT} /bin/mount -t ext2 ${PART_ROOT} /target # second add our boot partition /bin/echo "*** Initialize and Mount Partition *** boot on ${PART_BOOT} ..." /bin/mkdir /target/boot /sbin/mkfs.ext2 ${PART_BOOT} /bin/mount -t ext2 ${PART_BOOT} /target/boot if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/mount /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Install Kernel and Driver Modules menu" # replaces extract_kernel.c extract_kernel_and_modules() and # choose_and_install() /bin/echo "--------------------------------------------------------------" /bin/echo "*** Install Kernel and Driver Modules menu *** from floppy ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # - subpart check_pending_config() # just duplicate Debian code effects, write config sofar exists to disk /bin/echo "* writing base config setting to disk ..." /bin/mkdir /target/root /bin/echo "BUILDTIME='2002.01.01-07:53+0000'" >/target/root/dbootstrap_settings /bin/cat /tmp/keybd_settings >> /target/root/dbootstrap_settings /bin/echo "LANG_INST='C'" >> /target/root/dbootstrap_settings /bin/echo "LANGUAGE_INST='en'" >> /target/root/dbootstrap_settings if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/root/dbootstrap_settings /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi ## - subpart extract_kernel.c install_floppy() # # install kernel, requires rescue floppy to be in drive after boot # *** do not do this here, wait until net working, then install from net *** # #/bin/echo "* installing kernel from rescue disk in /dev/fd0 ..." # ## -t auto gives warnings, -t msdos avoids them, but hangs with bf2.4 kernel #/bin/mount -r -t auto /dev/fd0 /floppy ## allow retries if it fails (say due to an wrong disk) #while [ ! -f /floppy/type.txt ] ; do # /bin/echo "$0: ERROR: no rescue floppy in /dev/fd0, insert proper disk" >&2 # # give User chance for corrective action, possibly using 2nd console # read -p "--- ERROR: wait correction ---" dummy #done #cd /floppy #./install.sh /target #cd / #/bin/umount /floppy # #if [ x${DEBUG_PRINT_STEP} = xyes ] ; then # /bin/echo "--- DEBUG: info ---" # /bin/ls -al /target /target/boot # /bin/echo "--- end info ---" #fi #if [ x${DEBUG_WAIT_STEP} = xyes ] ; then # read -p "--- DEBUG: wait after step ---" dummy #fi # - subpart extract_kernel.c install_floppies() # install drivers, small selection instead of 4 disks, no disk jockey /bin/echo "* installing our small selection of drivers ..." /bin/mkdir /target/tmp; chown 0.3 /target/tmp; chmod 01777 /target/tmp /bin/mkdir /target/tmp/drivers; chown 0.3 /target/tmp/drivers; # here Debian fetches the 4 drivers archive disks to /target/drivers.tgz # we have already included an small drivers file on this root disk # because this is incomplete we will have to add all the rest later from net /bin/cp -p ${SYS_DRIVERSTGZ_ON_FLOPPY} /target/${SYS_DRIVERSTGZ_ON_TARGET} cd /target/tmp/drivers /bin/zcat /target/${SYS_DRIVERSTGZ_ON_TARGET} | /bin/tar -x ./install.sh /target cd / /bin/rm /target/${SYS_DRIVERSTGZ_ON_TARGET} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -alR /target/lib/modules /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - back from choose_and_install() do util.c frob_lib_modules() # from install system to use now installed modules /bin/echo "* using installed modules while install ..." /bin/rm -rf /lib/modules.old /bin/mv /lib/modules /lib/modules.old /bin/ln -s /target/lib/modules /lib/modules # - back from frob_lib_modules() /sbin/depmod -a if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -ald /lib/modules* /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Configure Device Driver Modules" menu # replaces baseconfig.c configure_drivers() # try to activate all our possible Ethernet drivers /bin/echo "-------------------------------------------------------------------" /bin/echo "*** Configure Device Driver Modules*** for our Ethernet drivers ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /sbin/depmod -a /bin/echo /sbin/modprobe >/proc/sys/kernel/modprobe /usr/bin/test -f /target/etc/modules || /bin/cp -p /etc/modules /target/etc/ # here Debian uses GUI modconf to ask which drivers to install # we simply try through all our few pre-selected drivers # ***BUGFIX*** Debian only does this "cp" for s390, we need it also for x86 # perhaps this is a difference of modconf GUI vs --load-only mode /bin/cp -a /etc/modules.conf /target/etc/ for module in ${CONF_MODULESNET}; do modulebase=`/bin/echo $module | /usr/bin/cut -f 1 -d "."` /target/usr/sbin/modconf --target /target --libdir /tmp/drivers \ --load-only ${modulebase} done # then we add our driver line to /etc/modules /sbin/lsmod | /bin/grep -v ^Module | /bin/grep -v ^unix | \ /bin/grep -v ^af_packet | /usr/bin/cut -f 1 -d " " >> /target/etc/modules /bin/echo /bin/true >/proc/sys/kernel/modprobe if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/etc/modules /sbin/lsmod /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Configure the Network" menu # replaces netconfig.c configure_network() # set network for system given up at top of script /bin/echo "--------------------------------------------------------" /bin/echo "*** Configure the Network *** for our network config ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # - subpart netconfig.c write_common_network() /bin/echo "* writing common net config files to disk ..." # this first part just sets up an network-less network config (only lo) /bin/mkdir /target/etc/network /bin/echo "${HOSTNAME}" > /target/etc/hostname # deviate from Debians use of putting hostname here #/bin/echo "127.0.0.1 ${HOSTNAME} localhost" > /target/etc/hosts /bin/echo "127.0.0.1 localhost" > /target/etc/hosts /bin/echo "# /etc/network/interfaces --" \ "configuration file for ifup(8), ifdown(8)" \ > /target/etc/network/interfaces /bin/echo "" >> /target/etc/network/interfaces /bin/echo "# The loopback interface" >> /target/etc/network/interfaces /bin/echo "auto lo" >> /target/etc/network/interfaces /bin/echo "iface lo inet loopback" >> /target/etc/network/interfaces if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/etc/hosts /bin/echo "---" /bin/cat /target/etc/network/interfaces if [ -f /target/etc/resolv.conf ] ; then /bin/echo "---" /bin/cat /target/etc/resolv.conf fi /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi if [ x${CONF_DHCP} = xyes ] ; then # - subpart netconfig.c configure_network() /bin/echo "* getting network configuraton by DHCP ..." if [ -x /sbin/dhclient-2.2.x ] ; then /bin/echo "interface \"${CONF_IF}\" {" > /etc/dhclient.conf /bin/echo " send host-name \"${HOSTNAME}\";" >> /etc/dhclient.conf /bin/echo " }" >> /etc/dhclient.conf /sbin/dhclient-2.2.x -e -lf /tmp/dhcp.leases ${CONF_IF} else # Debian has this in their code, despite program not included :-) /sbin/pump -i ${CONF_IF} -h ${HOSTNAME} fi # - subpart netconfig.c write_dhcp_network() /bin/echo "* writing dynamic net config files to disk ..." # this adds config for ${CONF_IF}, using DHCP /bin/cp -p /etc/resolv.conf /target/etc/resolv.conf /bin/echo "# The first network card -" \ "this entry was created during the Debian/dphys2 installation" \ >> /target/etc/network/interfaces /bin/echo "auto ${CONF_IF}" >> /target/etc/network/interfaces /bin/echo "iface ${CONF_IF} inet dhcp" >> /target/etc/network/interfaces else # - subpart netconfig.c configure_static_network() and write_static_network() /bin/echo "* writing static net config files to disk ..." # this adds config for ${CONF_IF}, using static data # overwrite previous localhost-only /etc/hosts file /bin/echo "127.0.0.1 localhost" \ > /target/etc/hosts /bin/echo "${IPADDR} ${HOSTNAME}.${CONF_DOMAIN}" \ >> /target/etc/hosts /bin/echo "localnet ${CONF_NETWORK}" > /target/etc/networks /bin/echo "search ${CONF_DOMAIN}" > /target/etc/resolv.conf /bin/echo "nameserver ${CONF_NAMESERVER1}" >> /target/etc/resolv.conf if [ x${CONF_NAMESERVER2} != x ] ; then /bin/echo "nameserver ${CONF_NAMESERVER2}" >> /target/etc/resolv.conf fi if [ x${CONF_NAMESERVER3} != x ] ; then /bin/echo "nameserver ${CONF_NAMESERVER3}" >> /target/etc/resolv.conf fi if [ x${CONF_NAMESERVER4} != x ] ; then /bin/echo "nameserver ${CONF_NAMESERVER4}" >> /target/etc/resolv.conf fi /bin/echo "# The first network card -" \ "this entry was created during the Debian/dphys2 installation" \ >> /target/etc/network/interfaces /bin/echo "# (network, broadcast and gateway are optional)" >> /target/etc/network/interfaces /bin/echo "auto ${CONF_IF}" >> /target/etc/network/interfaces /bin/echo "iface ${CONF_IF} inet static" >> /target/etc/network/interfaces /bin/echo -e "\taddress ${IPADDR}" >> /target/etc/network/interfaces /bin/echo -e "\tnetmask ${CONF_NETMASK}" >> /target/etc/network/interfaces /bin/echo -e "\tnetwork ${CONF_NETWORK}" >> /target/etc/network/interfaces /bin/echo -e "\tbroadcast ${CONF_BROADCAST}" \ >> /target/etc/network/interfaces /bin/echo -e "\tgateway ${CONF_GATEWAY}" >> /target/etc/network/interfaces fi if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/etc/hosts /bin/echo "---" /bin/cat /target/etc/network/interfaces if [ -f /target/etc/resolv.conf ] ; then /bin/echo "---" /bin/cat /target/etc/resolv.conf fi /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - subpart netconfig.c activate_static_network() /bin/echo "* activating net config ..." /bin/rm /etc/resolv.conf /bin/ln -s /target/etc/resolv.conf /etc/resolv.conf /sbin/ifconfig lo 127.0.0.1 if [ x${CONF_DHCP} != xyes ] ; then # in case fo DHCP ${CONF_IF} already got configured above /sbin/ifconfig ${CONF_IF} down /sbin/ifconfig ${CONF_IF} ${IPADDR} netmask ${CONF_NETMASK} \ broadcast ${CONF_BROADCAST} /sbin/route add default gw ${CONF_GATEWAY} metric 1 fi if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /sbin/ifconfig /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- compute paths on disk image server # paths for Debian files we download from server DEBDISKS=dists/woody/main/disks-${SYS_ARCH}/current # for standard 2.2(.20) kernel DEBRESCUE=${DEBDISKS}/images-1.44/rescue.bin DEBROOT=${DEBDISKS}/images-1.44/root.bin DEBDRIVERS=${DEBDISKS}/drivers.tgz # for bf2.4 (2.4.18) kernel DEBRESCUE_BF24=${DEBDISKS}/images-1.44/bf2.4/rescue.bin DEBROOT_BF24=${DEBDISKS}/images-1.44/bf2.4/root.bin DEBDRIVERS_BF24=${DEBDISKS}/bf2.4/drivers.tgz # paths for dphys2 files we upload to and fetch from server OWNDISKS=dists/woody/local/main/disks-${SYS_ARCH}/${CONF_DISKSVERSION} OWNRESCUE=${OWNDISKS}/images-1.44/rescue-dphys.bin OWNROOT=${OWNDISKS}/images-1.44/root-dphys.bin OWNDRIVERS=${OWNDISKS}/drivers-dphys.tgz # --- redo "Install Kernel and Driver Modules menu", now that net is running # this is not part of the normal Debian installation prosess /bin/echo "-----------------------------------------------------------" /bin/echo "*** Install Kernel and Driver Modules menu *** from net ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # - subpart extract_kernel.c install_floppy() # moved here from above, now that we have network, no rescue floppy needed # install kernel, requires network /bin/echo "* installing kernel from rescue floppy image from net ..." # fetch correct rescue floppy image file from the net, and "insert" it if [ x${CONF_KERNEL_OWN} != x ] ; then RESC_URL="${CONF_OWNSERVER}/${OWNRESCUE}" elif [ x${CONF_KERNEL_24} = xyes ] ; then RESC_URL="${CONF_DEBSERVER}/${DEBRESCUE_BF24}" else RESC_URL="${CONF_DEBSERVER}/${DEBRESCUE}" fi /usr/bin/wget -P /target ${RESC_URL} # short file name # no /usr/bin/basename on root disk mini system, so emulate it here RESC=${RESC_URL} while [ x`echo ${RESC} | grep '/'` != x ] ; do RESC=`echo ${RESC} | cut -f 2- -d '/'` done # -t auto gives warnings, -t msdos avoids them, but hangs with bf2.4 kernel /bin/mount -r -t auto -o loop /target/${RESC} /floppy # allow retries if it fails (say due to an wrong disk) while [ ! -f /floppy/type.txt ] ; do /bin/echo "$0: ERROR: no rescue floppy in /dev/fd0, insert proper" >&2 # give User chance for corrective action, possibly using 2nd console read -p "--- ERROR: wait correction ---" dummy done cd /floppy ./install.sh /target cd / /bin/umount /floppy # "eject" rescue floppy image file rm /target/${RESC} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al /target /target/boot /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - subpart extract_kernel.c install_floppies() # redo install drivers, now full set of them, now that net is running /bin/echo "* installing drivers from drivers archive from net ..." # these directories still exit from first driver install #/bin/mkdir /target/tmp; chown 0.3 /target/tmp; chmod 01777 /target/tmp #/bin/mkdir /target/tmp/drivers; chown 0.3 /target/tmp/drivers; # here Debian fetches the 4 drivers disks to /target/drivers.tgz, but we # fetch the correct full drivers archive from the net if [ x${CONF_KERNEL_OWN} != x ] ; then DRV_URL="${CONF_OWNSERVER}/${OWNDRIVERS}" elif [ x${CONF_KERNEL_24} = xyes ] ; then DRV_URL="${CONF_DEBSERVER}/${DEBDRIVERS_BF24}" else DRV_URL="${CONF_DEBSERVER}/${EBDRIVERS}" fi /usr/bin/wget -P /target ${DRV_URL} # short file name # no /usr/bin/basename on root disk mini system, so emulate it here DRV=${DRV_URL} while [ x`echo ${DRV} | grep '/'` != x ] ; do DRV=`echo ${DRV} | cut -f 2- -d '/'` done cd /target/tmp/drivers /bin/zcat /target/${DRV} | /bin/tar -x ./install.sh /target cd / # get rid of drivers archive file /bin/rm /target/${DRV} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al /target/lib/modules/* /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - back from choose_and_install() do frob_lib_modules() # symlink is already set from first driver install #/bin/rm -rf /lib/modules.old #/bin/mv /lib/modules /lib/modules.old #/bin/ln -s /target/lib/modules /lib/modules # - back from frob_lib_modules() /sbin/depmod -a if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -ald /lib/modules* /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Install the Base System" menu # replaces main_menu.c main_menu_extract_base() and debootstrap_extract_base() # install base.tgz, fetching it from now running network, no floppies /bin/echo "------------------------------------------------" /bin/echo "*** Install the Base System *** from network ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # thankfully Debian put all this stuff into an separate program # so we can just run it unchanged # even more thankfully, as it is nearly unreadable code /bin/echo "* running debootstrap to install base.tzg ..." # test whether download works omitted: #/usr/bin/wget -q $SOURCE/dists/woody/Release # we get it via standard http, so no need to set up NFS to get it /usr/sbin/debootstrap --arch ${SYS_ARCH} woody /target ${CONF_DEBSERVER}/ # tell the installed system what was used DEBMETHOD=`echo ${CONF_DEBSERVER} | cut -f 1 -d ":"` DEBPATH=`echo ${CONF_DEBSERVER} | cut -f 2- -d ":"` DEBHOST=`echo ${DEBPATH} | cut -f 3 -d "/"` DEBDIR=`echo ${DEBPATH} | cut -f 4- -d "/"` /bin/echo "DEBIAN_MIRROR_HOSTNAME='${DEBHOST}'" \ >> /target/root/dbootstrap_settings /bin/echo "DEBIAN_MIRROR_METHOD='${DEBMETHOD}'" >> /target/root/dbootstrap_settings /bin/echo "DEBIAN_MIRROR_PATH='${DEBDIR}'" \ >> /target/root/dbootstrap_settings /bin/echo "DEBIAN_MIRROR_PORT='80'" >> /target/root/dbootstrap_settings /bin/echo "SUITE='testing'" >> /target/root/dbootstrap_settings /bin/mv /target/etc/inittab /target/etc/inittab.real /bin/cp -p /etc/inittab.install /target/etc/inittab if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/root/dbootstrap_settings /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - subpart baseconfig.c write_fstab() # surprising that they do this so late /bin/echo "* generating fstab ..." /bin/echo "# /etc/fstab: static file system information." > /target/etc/fstab /bin/echo "#" >> /target/etc/fstab /bin/echo -e \ "# \t\t\t\t\t\t\t" \ >> /target/etc/fstab # root /bin/echo -e "${PART_ROOT}\t/\t\text2\tdefaults,errors=remount-ro\t0\t1" \ >> /target/etc/fstab # swap, if user wants it if [ x${CONF_SWAP_SIZE} = x -o x${CONF_SWAP_SIZE} = x0 ] ; then /bin/echo -e "# no/zero swap partition selected" >> /target/etc/fstab else /bin/echo -e "${PART_SWAP}\tnone\t\tswap\tsw\t\t\t0\t0" >> /target/etc/fstab fi # proc /bin/echo -e "proc\t\t/proc\t\tproc\tdefaults\t\t\t0\t0" >> /target/etc/fstab # floppy and cdrom /bin/echo -e "/dev/fd0\t/floppy\t\tauto\tdefaults,user,noauto\t\t0\t0\n" \ >> /target/etc/fstab /bin/echo -e \ "/dev/cdrom\t/cdrom\t\tiso9660\tdefaults,ro,user,noauto\t\t0\t0\n" \ >> /target/etc/fstab # others, for us just /boot /bin/echo -e "${PART_BOOT}\t/boot\t\text2\tdefaults\t0\t2" >> /target/etc/fstab if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/cat /target/etc/fstab /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # - subpart baseconfig.c configure_base() # this is actually outdated code, but do it for safety /bin/echo "* tidying up unconfigured.sh ..." /bin/rm -f /target/sbin/unconfigured.sh if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al /target /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- "Make System Bootable" menu # replaces bootconfig.c make_bootable() and run_lilo() # setup LILO to boot system /bin/echo "---------------------------------------------------------------" /bin/echo "*** Make System Bootable *** with LILO, mbr, boot partition ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # we are putting LILO in MBR (unclean), because bug using mbr and LILO in ROOT # the boot code does not get written (or written and then overwriten?) # and this is a single-OS system anyway, and its better for security also # lilo.conf is 1/4 size of this script, so don't generate it, use template file # replace template %PLACEHOLDER% place holders with entire actual lines if [ x${CONF_PASSWORD_LILO} != x ] ; then /bin/sed -e "s@%PART_BOOT%@boot=${CONF_DISK}@" \ -e "s@%PART_ROOT%@root=${PART_ROOT}@" \ -e "s@%PASSWORD%@password=${CONF_PASSWORD_LILO}@" \ -e "s@%RESTRICTED%@restricted@" \ /etc/lilo.conf > /target/etc/lilo.conf else # user did not want an LILO password /bin/sed -e "s@%PART_BOOT%@boot=${CONF_DISK}@" \ -e "s@%PART_ROOT%@root=${PART_ROOT}@" \ -e "s@%PASSWORD%@# no password installed@" \ -e "s@%RESTRICTED%@# restricted if password were set@" \ /etc/lilo.conf > /target/etc/lilo.conf fi # *** WARNING *** # this file must be chmod 600 because of LILO password in it /bin/chmod 600 /target/etc/lilo.conf /usr/sbin/chroot /target /sbin/lilo # activate boot partition export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; \ /target/sbin/activate ${CONF_DISK} ${PART_BOOT_NO} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /sbin/fdisk -l ${CONF_DISK} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- fix up installed system so that 2nd boot stage has no dialogs # this is not part of the 1st stage Debian installation process # replaces the 2nd stage (after reboot) Debconf questions # fix up debconf database to prevent base-config dialogs /bin/echo "---------------------------------------------------------" /bin/echo "*** Fixing up debconf *** for no dialogs after reboot ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # debconf-preload is 1/2 size of this script, don't generate, use template file # replace template %PLACEHOLDER% place holders with actual content (no lines) /bin/sed -e "s@%CONF_TIMEZONE_AREA%@${CONF_TIMEZONE_AREA}@" \ -e "s@%CONF_TIMEZONE_PLACE%@${CONF_TIMEZONE_PLACE}@" \ -e "s@%CONF_PASSWORD_MD5%@${CONF_PASSWORD_MD5}@" \ -e "s@%CONF_PASSWORD_SHADOW%@${CONF_PASSWORD_SHADOW}@" \ -e "s@%CONF_PASSWORD_ROOT%@${CONF_PASSWORD_ROOT}@" \ -e "s@%CONF_PCMCIA_REMOVE%@${CONF_PCMCIA_REMOVE}@" \ -e "s@%CONF_DEBSERVER%@${CONF_DEBSERVER}@" \ -e "s@%CONF_PCMCIA_REMOVE%@${CONF_PCMCIA_REMOVE}@" \ -e "s@%CONF_USE_CONTRIB%@${CONF_USE_CONTRIB}@" \ -e "s@%CONF_USE_NON_FREE%@${CONF_USE_NON_FREE}@" \ -e "s@%CONF_USE_PROPOSED%@${CONF_USE_PROPOSED}@" \ -e "s@%CONF_DEBSERVER_NON_US%@${CONF_DEBSERVER_NON_US}@" \ -e "s@%CONF_DEBSERVER_SECURITY%@${CONF_DEBSERVER_SECURITY}@" \ ${SYS_PRELOAD_ON_FLOPPY} > /target/${SYS_PRELOAD_ON_TARGET} # *** WARNING *** # this file must be chmod 700 because of root password in it /bin/chmod 700 /target/${SYS_PRELOAD_ON_TARGET} /usr/sbin/chroot /target ${SYS_PRELOAD_ON_TARGET} if [ x${DEBUG_WAIT_DEL_PRELOAD} = xyes ] ; then read -p "--- DEBUG: wait delete /target/${SYS_PRELOAD_ON_TARGET} ---" dummy fi if [ x${DEBUG_LEAVE_PRELOAD} != xyes ] ; then /bin/rm /target/${SYS_PRELOAD_ON_TARGET} fi if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al /target/var/cache/debconf /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi # --- silence debconf as far as possible, for automated installs # this is not part of the normal Debian installation process if [ x${CONF_SILENCE_DEBCONF} != x ] ; then # prevent questions while installing packages from woody-proposed-updates # this is also then active later when installing random stuff /bin/echo "--------------------------------------------------------------" /bin/echo "*** Silence Debconf *** for no questions while 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 # 01debconf, just after 00dbootstrap_settings, after Debian touched this SCRIPT_DEBCONF=/target/usr/lib/base-config/01debconf /bin/cat << END-DEBCONF-MOD-SCRIPT > ${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 if [ x${DEBUG_LEAVE_BC_SCRIPTS} != xyes ] ; then /bin/rm ${SCRIPT_DEBCONF} fi exit 0 END-DEBCONF-MOD-SCRIPT /bin/chmod 755 ${SCRIPT_DEBCONF} if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al ${SCRIPT_DEBCONF} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi fi # --- run user script at end of first install stage, for further automation # this is not part of the normal Debian installation process # give user chance to do further site specific automation if [ -f ${SYS_ENDFIRSTRUN_ON_FLOPPY} ] ; then /bin/echo "--------------------------------------------------" /bin/echo "*** Run user script *** for further automation ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /bin/cp -p ${SYS_ENDFIRSTRUN_ON_FLOPPY} /target/${SYS_ENDFIRSTRUN_ON_TARGET} /bin/chmod a+x /target/${SYS_ENDFIRSTRUN_ON_TARGET} # so that ${SYS_ENDFIRSTRUN_ON_TARGET} can also be configured from same file /bin/cp -p ${SYS_DPHYS2CONF_ON_FLOPPY} /target/${SYS_DPHYS2CONF_ON_TARGET} /usr/sbin/chroot /target ${SYS_ENDFIRSTRUN_ON_TARGET} if [ x${DEBUG_WAIT_DEL_EFR} = xyes ] ; then read -p "--- DEBUG: wait delete /target/${SYS_ENDFIRSTRUN_ON_TARGET} ---" d fi if [ x${DEBUG_LEAVE_EFR} != xyes ] ; then /bin/rm /target/${SYS_ENDFIRSTRUN_ON_TARGET} /bin/rm /target/${SYS_DPHYS2CONF_ON_TARGET} fi if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" # not particularly sensible, endfirstrun script should do sensible output /bin/ls -al /target /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi fi # --- "Reboot the System" menu # replaces reboot_system.c reboot_system() # reboot into 2nd stage of install /bin/echo "----------------------------------------------" /bin/echo "*** Reboot the System *** for second stage ..." if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi /bin/sync /bin/umount /instmnt /bin/cp -p /var/log/messages /target/var/log/installer.log if [ x${DEBUG_PRINT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/df /usr/bin/free /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi if [ x${DEBUG_WAIT_FIRST_REBOOT} = xyes ] ; then read -p "--- DEBUG: wait reboot ---" dummy fi /sbin/reboot