Ignore:
Timestamp:
02/14/14 09:31:50 (7 months ago)
Author:
Kris Moore <kris@…>
Branches:
releng/10.0
Children:
1c3c665
Parents:
0604f47
git-author:
Kris Moore <kris@…> (02/14/14 09:31:10)
git-committer:
Kris Moore <kris@…> (02/14/14 09:31:50)
Message:

Fix adding source / ports when creating new jails

File:
1 edited

Legend:

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

    r84e6670 rdb49124  
    9191# If using a ARCHIVEFILE we can skip this step 
    9292if [ -z "$TEMPLATE" -a -z "$ARCHIVEFILE" ] ; then 
    93   which uname 
    94   uname -r 
    9593  DEFTEMPLATE="`uname -r | cut -d '-' -f 1-2`-${ARCH}" 
    9694  echo "DEF: $DEFTEMPLATE" 
     
    270268  echo "Fetching ports..." 
    271269  mkdir -p "${JAILDIR}/usr/ports" 
    272   cat /usr/sbin/portsnap | sed 's|! -t 0|-z '1'|g' | /bin/sh -s "fetch" "extract" "update" "-p" "${JAILDIR}/usr/ports" >/dev/null 2>/dev/null 
    273   if [ $? -eq 0 ] ; then 
     270  cd ${JAILDIR} 
     271  SYSVER="$(uname -r | cut -d '-' -f 1-2)" 
     272  get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/ports.txz" "ports.txz" "iso" 
     273  if [ $? -ne 0 ] ; then 
     274    echo "Error while downloading the ports tree." 
     275  else 
     276    echo "Extracting ports.. May take a while.." 
     277    tar xvf ports.txz -C "${JAILDIR}" 2>/dev/null 
     278    rm ports.txz 
    274279    echo "Done" 
    275   else 
    276     echo "Failed! Please run \"portsnap fetch extract update\" within the jail." 
    277280  fi 
    278281fi 
Note: See TracChangeset for help on using the changeset viewer.