Changeset 4d6c087


Ignore:
Timestamp:
01/21/14 11:27:05 (8 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
bb8914e
Parents:
b7070c4
Message:

When doing PBI mounting, only do the pauses when an actual mount is happening, and
also make sure system "icons" are available in the container

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pbi-manager/pbime/pbimount

    rb7070c4 r4d6c087  
    33NULLFS="/usr/pbi/.mount_nullfs" 
    44 
     5MNTSLEEP="sleep 0.2" 
     6 
    57is_mounted() { 
    68   if [ ! -d "${1}" ] ; then return 1; fi 
    79   # Slow down the pace of nullfs mounts, this seems to fix the odd panic / hang 
    8    sleep 0.1 
    910   mount | grep -q "on ${1} ("  
    1011   return $? 
     
    4445   is_mounted "${pDir}/virtbase" || $NULLFS / "${pDir}/virtbase" 
    4546   is_mounted "${pDir}/virtbase/dev" || mount -t devfs devfs "${pDir}/virtbase/dev" 
    46    is_mounted "${pDir}/virtbase/usr/local" || $NULLFS ${1}/local "${pDir}/virtbase/usr/local" 
    47    is_mounted "${pDir}/virtbase/var/run" || $NULLFS ${pDir}/run "${pDir}/virtbase/var/run" 
    48    is_mounted "${pDir}/virtbase/compat/linux" || $NULLFS ${1}/linux "${pDir}/virtbase/compat/linux" 
     47   is_mounted "${pDir}/virtbase/usr/local" || ($MNTSLEEP ; $NULLFS ${1}/local "${pDir}/virtbase/usr/local" ) 
     48   is_mounted "${pDir}/virtbase/var/run" || ($MNTSLEEP ; $NULLFS ${pDir}/run "${pDir}/virtbase/var/run" ) 
     49   is_mounted "${pDir}/virtbase/compat/linux" || ($MNTSLEEP ; $NULLFS ${1}/linux "${pDir}/virtbase/compat/linux" ) 
    4950 
    5051   # Sort out the items to mount into the PBI container 
     
    5253   do 
    5354     if [ "$i" = "/" ] ; then continue ; fi 
    54      is_mounted "${pDir}/virtbase${i}" || $NULLFS ${i} "${pDir}/virtbase${i}" 
     55     is_mounted "${pDir}/virtbase${i}" || ($MNTSLEEP ; $NULLFS ${i} "${pDir}/virtbase${i}" ) 
    5556   done 
    5657 
    5758   # Mount any system-wide fonts / cursors / icons into the PBI container 
    5859   if [ -d "${pDir}/virtbase/usr/local/etc/fonts" ] ; then 
    59       is_mounted "${pDir}/virtbase/usr/local/etc/fonts" || $NULLFS /usr/local/etc/fonts "${pDir}/virtbase/usr/local/etc/fonts" 
     60      is_mounted "${pDir}/virtbase/usr/local/etc/fonts" || ($MNTSLEEP ; $NULLFS /usr/local/etc/fonts "${pDir}/virtbase/usr/local/etc/fonts" ) 
    6061   fi 
    6162   if [ -d "${pDir}/virtbase/usr/local/lib/X11/fonts" ] ; then 
    62       is_mounted "${pDir}/virtbase/usr/local/lib/X11/fonts" || $NULLFS /usr/local/lib/X11/fonts "${pDir}/virtbase/usr/local/lib/X11/fonts" 
     63      is_mounted "${pDir}/virtbase/usr/local/lib/X11/fonts" || ($MNTSLEEP ; $NULLFS /usr/local/lib/X11/fonts "${pDir}/virtbase/usr/local/lib/X11/fonts" ) 
    6364   fi 
    6465   if [ -d "${pDir}/virtbase/usr/local/lib/X11/icons" ] ; then 
    65       is_mounted "${pDir}/virtbase/usr/local/lib/X11/icons" || $NULLFS /usr/local/lib/X11/icons "${pDir}/virtbase/usr/local/lib/X11/icons" 
     66      is_mounted "${pDir}/virtbase/usr/local/lib/X11/icons" || ($MNTSLEEP ; $NULLFS /usr/local/lib/X11/icons "${pDir}/virtbase/usr/local/lib/X11/icons" ) 
     67   fi 
     68   if [ -d "${pDir}/virtbase/usr/local/share/icons" ] ; then 
     69      is_mounted "${pDir}/virtbase/usr/local/share/icons" || ($MNTSLEEP ; $NULLFS /usr/local/share/icons "${pDir}/virtbase/usr/local/share/icons" ) 
    6670   fi 
    6771 
     
    7377   sync 
    7478 
     79   sleep 0.1 
    7580   # Copy over the system command 
    7681   cp /usr/pbi/.pbisyscmd "${pDir}/virtbase/usr/local/bin/pbisyscmd" 
     
    8287   cp /usr/pbi/.ldconfig "${pDir}/virtbase/var/run/ldconfig" 
    8388   chroot "${pDir}/virtbase" /var/run/ldconfig start >/dev/null 2>/dev/null 
    84    sleep 0.2 
    8589   sync 
    8690} 
Note: See TracChangeset for help on using the changeset viewer.