Changeset b5dbe14


Ignore:
Timestamp:
Oct 8, 2013 7:01:06 AM (7 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
8bea84f, 88de14c
Parents:
228303d
Message:

Fix some issues creating jail templates on UFS.

Also fallback to pulling from FreeBSD mirrors if the PC-BSD mirrors
do not have the dist files we want

Location:
src-sh/warden/scripts/backend
Files:
2 edited

Legend:

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

    re5240d6 rb5dbe14  
    117117      warden template create ${FLAGS} 
    118118      if [ $? -ne 0 ] ; then 
    119         exit_err "Failed create default template" 
     119        # If we failed, lets try again with FreeBSD dist files 
     120        FLAGS="-arch $ARCH -nick $DEFTEMPLATE" 
     121        FLAGS="-fbsd `uname -r | cut -d '-' -f 1-2` $FLAGS" ; export FLAGS 
     122 
     123        if [ "${PLUGINJAIL}" = "YES" ] ; then 
     124          FLAGS="$FLAGS -pluginjail" 
     125        fi 
     126        warden template create ${FLAGS} 
     127        if [ $? -ne 0 ] ; then 
     128          exit_err "Failed create default template" 
     129        fi 
    120130      fi 
    121131  fi 
  • src-sh/warden/scripts/backend/createtemplate.sh

    r228303d rb5dbe14  
    121121    # Sigh, still on UFS?? 
    122122    if [ -d "${JDIR}/.templatedir" ]; then 
     123       chflags -R noschg ${JDIR}/.templatedir 
    123124       rm -rf ${JDIR}/.templatedir 
    124125    fi 
     
    132133      echo "Extrating FreeBSD..." 
    133134      cat ${oldStr}.?? | tar --unlink -xpzf - -C ${JDIR}/.templatedir 2>/dev/null 
     135      if [ $? -ne 0 ] ; then exit_err "Failed to extract FreeBSD" ; fi 
    134136      cd ${JDIR} 
    135137 
     
    142144      echo "Creating template archive..." 
    143145      tar cvjf ${TDIR} -C ${JDIR}/.templatedir 2>/dev/null 
     146      chflags -R noschg ${JDIR}/.templatedir 
    144147      rm -rf ${JDIR}/.templatedir 
    145148    else 
     
    151154        if [ $? -ne 0 ] ; then  
    152155           rm -rf ${JDIR}/.templatedir 
    153            exit_err "Failed extracting ZFS template environment" 
     156           exit_err "Failed extracting template environment" 
    154157        fi 
    155158        rm ${JDIR}/.download/${f} 
     
    163166 
    164167      echo "Creating template archive..." 
    165       tar cvjf ${TDIR} -C ${JDIR}/.templatedir 2>/dev/null 
     168      tar cvjf ${TDIR} -C ${JDIR}/.templatedir . 2>/dev/null 
     169      if [ $? -ne 0 ] ; then  
     170         chflags -R noschg ${JDIR}/.templatedir 
     171         rm -rf ${JDIR}/.templatedir 
     172         exit_err "Failed creating template environment" 
     173      fi 
     174      chflags -R noschg ${JDIR}/.templatedir 
    166175      rm -rf ${JDIR}/.templatedir 
    167176    fi 
    168   fi 
     177  fi # End of UFS section 
    169178 
    170179  rm -rf ${JDIR}/.download 
Note: See TracChangeset for help on using the changeset viewer.