Ignore:
Timestamp:
08/20/13 07:08:24 (14 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:
8378d50
Parents:
0de3f5a
Message:

Update the linux install scripts from here:

https://github.com/freenas/freenas/commit/0e003b142cb3e1d54262f6d175e74231b4429045

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/linux-installs/debian-6-squeeze

    r1620346 r70427a2  
    33# Author: Kris Moore <kris@pcbsd.org> 
    44 
    5 # Jail / chroot dir 
    6 jDIR="$1" 
     5SELF="debian-6-squeeze" 
     6SELFDIR="${JDIR}/.${SELF}" 
     7ERRORFILE="/tmp/.${SELF}.error" 
    78 
    8 # Target jail IP address 
    9 jIP="$2" 
     9get_distfiles() 
     10{ 
     11    rm -f "${ERRORFILE}" 
    1012 
    11 # Jail meta-directory 
    12 jMETA="$3" 
     13    if [ ! -d "${SELFDIR}" ] ; then 
     14      mkdir -p "${SELFDIR}" 
     15    fi 
     16} 
    1317 
    14 if [ ! -e "${jDIR}" ] ; then 
    15   mkdir -p "${jDIR}" 
    16 fi 
     18template_install() 
     19{ 
     20    rm -f "${ERRORFILE}" 
    1721 
    18 debootstrap squeeze ${jDIR} 
    19 err=$? 
     22    local TDIR="${1}" 
     23    if [ -z "${TDIR}" ] ; then  
     24      echo "TDIR is not defined" 
     25      touch "${ERRORFILE}"       
     26      exit 1 
     27    fi 
    2028 
    21 umount -f ${jDIR}/dev/fd >/dev/null 2>/dev/null 
    22 umount -f ${jDIR}/dev >/dev/null 2>/dev/null 
    23 umount -f ${jDIR}/sys >/dev/null 2>/dev/null 
    24 umount -f ${jDIR}/proc >/dev/null 2>/dev/null 
     29    debootstrap squeeze ${TDIR} 
    2530 
    26 # Fix log file 
    27 sed -i '' 's|/dev/xconsole|/var/log/xconsole|g' ${jDIR}/etc/rsyslog.conf 
     31    umount -f ${TDIR}/dev/fd >/dev/null 2>/dev/null 
     32    umount -f ${TDIR}/dev >/dev/null 2>/dev/null 
     33    umount -f ${TDIR}/sys >/dev/null 2>/dev/null 
     34    umount -f ${TDIR}/proc >/dev/null 2>/dev/null 
    2835 
    29 # Get rid of umount 
    30 mv ${jDIR}/sbin/umount ${jDIR}/sbin/umount.prev 
    31 ln -s /bin/true ${jDIR}/sbin/umount 
     36    # Fix log file 
     37    sed -i '' 's|/dev/xconsole|/var/log/xconsole|g' ${TDIR}/etc/rsyslog.conf 
    3238 
    33 # Setup some custom start / stop stuff 
    34 echo "/etc/init.d/rc 3" > ${jMETA}/jail-start 
    35 echo "/etc/init.d/rc 0" > ${jMETA}/jail-stop 
     39    # Get rid of umount 
     40    mv ${TDIR}/sbin/umount ${TDIR}/sbin/umount.prev 
     41    ln -s /bin/true ${TDIR}/sbin/umount 
     42} 
    3643 
    37 exit $err 
     44jail_configure() 
     45{ 
     46    rm -f "${ERRORFILE}" 
     47 
     48    local JMETADIR="${1}" 
     49    if [ -z "${JMETADIR}" ] ; then  
     50      echo "JMETADIR is not defined" 
     51      exit 1 
     52    fi 
     53 
     54    # Setup some custom start / stop stuff 
     55    echo "/etc/init.d/rc 3" > ${JMETADIR}/jail-start 
     56    echo "/etc/init.d/rc 0" > ${JMETADIR}/jail-stop 
     57} 
     58 
     59error() 
     60{ 
     61    if [ -f "${ERRORFILE}" ] ; then 
     62        rm -f "${ERRORFILE}" 
     63        return 1 
     64    fi 
     65 
     66    return 0 
     67} 
     68 
     69main() 
     70{ 
     71    case "${1}" in 
     72      get_distfiles) shift; get_distfiles "$@" ;;  
     73      template_install) shift; template_install "$@" ;; 
     74      jail_configure) shift; jail_configure "$@" ;; 
     75      error) shift; error "$@" ;; 
     76    esac 
     77 
     78    if [ "$?" != "0" ] ; then 
     79      touch "${ERRORFILE}" 
     80    fi 
     81} 
     82 
     83 
     84main "$@" 
Note: See TracChangeset for help on using the changeset viewer.