BASH   64
do install
Guest on 26th August 2023 12:11:55 PM


  1. do_install() {
  2.  
  3.   # mount  
  4.   mount -o noatime /dev/${MD_ROOT} ${VDMNT}
  5.   mount /dev/${MD_TMP} ${VDMNT}/tmp
  6.   mount /dev/${MD_VAR} ${VDMNT}/var
  7.   mount /dev/${MD_USR} ${VDMNT}/usr
  8.  
  9.   # make distribution directories
  10.   cd ${SRCDIR}/etc
  11.   make distrib-dirs DESTDIR=${DESTDIR}
  12.  
  13.   # run merge master
  14.   mkdir -p ${TEMPROOT}
  15.   mergemaster -i -m ${SRCDIR}/etc -t ${TEMPROOT} -D ${DESTDIR}
  16.  
  17.   # install world
  18.   cd ${SRCDIR}
  19.   make installworld DESTDIR=${DESTDIR} ${BUILDDEFINES}  
  20.  
  21.   # copy system files
  22.   cp ${SETUPDIR}/${FSTABTMP} ${DESTDIR}/etc/fstab
  23.   cp /etc/localtime ${DESTDIR}/etc/localtime
  24.   cp ${SRCDIR}/sys/boot/forth/loader.conf  ${DESTDIR}/boot/defaults
  25.   cp ${SRCDIR}/sys/i386/conf/GENERIC.hints ${DESTDIR}/boot/device.hints
  26.    
  27.   # copied shamelessly from "FreeBSD From Scratch"
  28.   cd ${TEMPROOT}
  29.   find . -type f | sed 's,^\./,,' |
  30.   while read f; do
  31.     if test -r ${DESTDIR}/${f}; then
  32.       echo "${DESTDIR}/${f} already exists; not copied"
  33.     else
  34.       echo "Creating empty ${DESTDIR}/${f}"
  35.       cp -p ${f} ${DESTDIR}/${f}
  36.     fi
  37.   done
  38.   chflags -R 0 ${TEMPROOT}
  39.   rm -rf ${TEMPROOT}
  40.  
  41.   # install kernel
  42.   cd ${SRCDIR}
  43.   make installkernel DESTDIR=${DESTDIR} KERNCONF=${KERNCONF}  
  44.  
  45.   # unmount and unload virtual disk device
  46.   umount /dev/${MD_TMP}
  47.   umount /dev/${MD_VAR}
  48.   umount /dev/${MD_USR}
  49.   umount /dev/${MD_ROOT}
  50. }

Raw Paste

Login or Register to edit or fork this paste. It's free.