Ignore:
Timestamp:
01/22/14 07:45:43 (9 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
4f9718b
Parents:
3f348f3
Message:

Add a check when doing PBI startup for linux compat, and if the PBI includes it, then
check the system for nvidia-driver and if both exist, do some magic to enable linux nvidia
accell

File:
1 edited

Legend:

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

    r4d6c087 rf8d250a  
    4040} 
    4141 
     42check_nvidia_linux() 
     43{ 
     44   # Check if this PBI even has a linux compat layer with GL support 
     45   if [ ! -d "${1}/linux/usr/lib" ] ; then return; fi 
     46   ls ${1}/linux/usr/lib/libGL* 2>/dev/null >/dev/null 
     47   if [ $? -ne 0 ] ; then return ; fi 
     48 
     49   # Ok, we have linux compat in the PBI, is the system using nvidia? 
     50   pkg info -e nvidia-driver 
     51   if [ $? -ne 0 ] ; then return ; fi 
     52 
     53   # We have nvidia, lets do our linux lib population now 
     54   for i in `pkg info -l nvidia-driver 2>/dev/null | grep 'compat/linux/usr/lib' | awk '{print $1}'` 
     55   do 
     56      cp ${i} ${1}/linux/usr/lib/ 
     57   done 
     58} 
     59 
    4260mount_dirs() { 
    4361 
    4462   # Check some of the common items to mount into the PBI container 
    45    is_mounted "${pDir}/virtbase" || $NULLFS / "${pDir}/virtbase" 
     63   is_mounted "${pDir}/virtbase" || ( $NULLFS / "${pDir}/virtbase" ; check_nvidia_linux "${1}" ) 
     64 
    4665   is_mounted "${pDir}/virtbase/dev" || mount -t devfs devfs "${pDir}/virtbase/dev" 
    4766   is_mounted "${pDir}/virtbase/usr/local" || ($MNTSLEEP ; $NULLFS ${1}/local "${pDir}/virtbase/usr/local" ) 
     
    87106   cp /usr/pbi/.ldconfig "${pDir}/virtbase/var/run/ldconfig" 
    88107   chroot "${pDir}/virtbase" /var/run/ldconfig start >/dev/null 2>/dev/null 
     108 
    89109   sync 
    90110} 
Note: See TracChangeset for help on using the changeset viewer.