Ignore:
Timestamp:
05/03/13 08:48:28 (20 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
cee08ee
Parents:
aa37de2
Message:

Add ability to create templates of very OLD versions of FreeBSD, tested back to FreeBSD 5.1-RELEASE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/scripts/backend/createtemplate.sh

    raa37de2 r5093cde  
    2929     done 
    3030  else 
     31      
     32     # Check if we are on REAL old versions of FreeBSD 
     33     if [ "$oldFBSD" = "YES" ] ; then 
     34         # Get the .inf list file 
     35         fetch -o "${JDIR}/.download/base.inf" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/base/base.inf" 
     36         if [ $? -ne 0 ] ; then 
     37           exit_err "Failed downloading: FreeBSD ${FBSDVER} - base.inf" 
     38         fi 
     39         # Now read in the list of files to fetch 
     40         while read line 
     41         do 
     42            echo "$line" | grep -q '^cksum' 
     43            if [ $? -ne 0 ] ; then continue ; fi 
     44            fName=`echo $line | cut -d " " -f 1 | sed 's|cksum|base|g'` 
     45            fetch -o "${JDIR}/.download/$fName" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/base/$fName" 
     46            if [ $? -ne 0 ] ; then 
     47              exit_err "Failed downloading: FreeBSD ${FBSDVER} - $fName" 
     48            fi 
     49         done < ${JDIR}/.download/base.inf 
     50         return 
     51     fi 
     52 
    3153     for f in $DFILES 
    3254     do 
     
    6284    # Using a supplied tar file? 
    6385    if [ -n "$FBSDTAR" ] ; then 
    64         tar xvpf $FBSDTAR -C ${TDIR} 2>/dev/null 
    65         if [ $? -ne 0 ] ; then exit_err "Failed extracting: $FBSDTAR"; fi 
     86      tar xvpf $FBSDTAR -C ${TDIR} 2>/dev/null 
     87      if [ $? -ne 0 ] ; then exit_err "Failed extracting: $FBSDTAR"; fi 
     88    elif [ "$oldFBSD" = "YES" ] ; then 
     89      cd ${JDIR}/.download/ 
     90      cat base.?? | tar --unlink -xpzf - -C ${TDIR} #2>/dev/null 
     91      cd ${JDIR} 
    6692    else 
    6793      # Extract the dist files 
     
    81107       rm -rf ${JDIR}/.templatedir 
    82108    fi 
    83     mkdir ${JDIR}/.templatedir 
    84109 
    85110    if [ -n "$FBSDTAR" ] ; then 
    86111      # User-supplied tar file  
    87112      cp $FBSDTAR ${TDIR} 
     113    elif [ "$oldFBSD" = "YES" ] ; then 
     114      mkdir ${JDIR}/.templatedir 
     115      cd ${JDIR}/.download/ 
     116      echo "Extrating FreeBSD..." 
     117      cat base.?? | tar --unlink -xpzf - -C ${JDIR}/.templatedir 2>/dev/null 
     118      cd ${JDIR} 
     119      echo "Creating template archive..." 
     120      tar cvjf ${TDIR} -C ${JDIR}/.templatedir 2>/dev/null 
     121      rm -rf ${JDIR}/.templatedir 
    88122    else 
    89123      # Extract the dist files 
     124      mkdir ${JDIR}/.templatedir 
    90125      for f in $DFILES 
    91126      do 
     
    170205fi 
    171206 
     207# Check if we are on REAL old versions of FreeBSD 
     208if [ -n "$FBSDVER" ] ; then 
     209  mV=`echo $FBSDVER | cut -d '.' -f 1` 
     210  if [ $mV -lt 9 ] ; then oldFBSD="YES"; fi 
     211fi 
     212 
     213 
    172214# If not using a tarball, lets download our files 
    173215if [ -z "$FBSDTAR" ] ; then 
Note: See TracChangeset for help on using the changeset viewer.