Changeset 6330d7c


Ignore:
Timestamp:
02/27/14 14:46:08 (6 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
1338bf6
Parents:
4e7809d
Message:

Huge update to pbi-managger for 10.0

Welcome our new "pbifs" FUSE launcher. This will replace about a dozen "nullfs" mounts
used to create a virtual "PBI" container with a single fuse mount, which internally does
all the mapping required to create virtual /usr/local namespaces.

This update should hopefully also improve stability going forward

Location:
src-sh
Files:
5 added
7 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pbi-manager/install.sh

    ra7429d5 r6330d7c  
    149149fi 
    150150 
    151 # Install the nullfs binary 
    152 cd ${DIR}/mount_nullfs && make  
    153 install -o root -g wheel -m 755 mount_nullfs ${LB}/share/pbi-manager/.mount_nullfs 
     151# Install the pbifs binary 
     152cd ${DIR}/pbifs && make  
     153install -o root -g wheel -m 755 pbifs ${LB}/share/pbi-manager/.pbifs 
    154154if [ "${LB}" = "/usr/local" ] ; then 
    155   install -o root -g wheel -m 755 mount_nullfs /usr/pbi/.mount_nullfs 
     155  install -o root -g wheel -m 755 pbifs /usr/pbi/.pbifs 
    156156fi 
    157157 
  • src-sh/pbi-manager/pbime/pbimount

    r58035e0 r6330d7c  
    11#!/bin/sh 
    22 
    3 NULLFS="/usr/pbi/.mount_nullfs" 
    43MNTLOCK="/usr/pbi/.mntLock" 
    54MNTSLEEP="sleep 0.5" 
     
    9190mount_dirs() { 
    9291 
    93    do_mount_lock "1" 
     92   # Mount our FUSE file-system 
     93   /usr/pbi/.pbifs ${1} ${pDir}/run ${pDir}/virtbase 
    9494 
    95    # Check some of the common items to mount into the PBI container 
    96    is_mounted "${pDir}/virtbase" || ( $NULLFS / "${pDir}/virtbase" ; $MNTSLEEP ; check_nvidia_linux "${1}" ) 
     95   # Can't get rid of these nullfs / devfs mounts, needed for unix sockets to work 
     96   is_mounted "${pDir}/virtbase/dev" || mount -t devfs devfs "${pDir}/virtbase/dev" 
     97   is_mounted "${pDir}/virtbase/tmp" || mount_nullfs /tmp "${pDir}/virtbase/tmp" 
    9798 
    98    is_mounted "${pDir}/virtbase/dev" || (mount -t devfs devfs "${pDir}/virtbase/dev" ; $MNTSLEEP ) 
    99    is_mounted "${pDir}/virtbase/usr/local" || ($NULLFS ${1}/local "${pDir}/virtbase/usr/local" ; $MNTSLEEP ) 
    100    is_mounted "${pDir}/virtbase/var/run" || ($NULLFS ${pDir}/run "${pDir}/virtbase/var/run" ; $MNTSLEEP ) 
    101    if [ -d "/var/run/dbus" ] ; then 
    102      is_mounted "${pDir}/virtbase/var/run/dbus" || ( mkdir ${pDir}/virtbase/var/run/dbus 2>/dev/null ; $NULLFS /var/run/dbus "${pDir}/virtbase/var/run/dbus" ; $MNTSLEEP ) 
    103    fi 
    104  
    105    # If the host has Linux compat 
    106    if [ -d "${pDir}/virtbase/compat/linux" ] ; then 
    107      is_mounted "${pDir}/virtbase/compat/linux" || ($NULLFS ${1}/linux "${pDir}/virtbase/compat/linux" ; $MNTSLEEP ) 
    108    fi 
    109  
    110    # Sort out the items to mount into the PBI container 
    111    for i in `mount | grep -e "(zfs" -e "(smbfs" -e "(nfs" -e "(ufs" -e "(msdos" -e "(ntfs" -e "(fusefs" | grep -e "on /" | grep -v "/usr/jails" | grep -v "/usr/pbi" | grep -v "/usr/local" | awk '{print $3}'` 
    112    do 
    113      if [ "$i" = "/" ] ; then continue ; fi 
    114      is_mounted "${pDir}/virtbase${i}" || ($NULLFS ${i} "${pDir}/virtbase${i}" ; $MNTSLEEP ) 
    115    done 
    116  
    117    # Mount any system-wide fonts / cursors / icons into the PBI container 
    118    if [ -d "${pDir}/virtbase/usr/local/etc/fonts" -a -d "/usr/local/etc/fonts" ] ; then 
    119       is_mounted "${pDir}/virtbase/usr/local/etc/fonts" || ($NULLFS /usr/local/etc/fonts "${pDir}/virtbase/usr/local/etc/fonts" ; $MNTSLEEP ) 
    120    fi 
    121    if [ -d "${pDir}/virtbase/usr/local/lib/X11/fonts" -a -d "/usr/local/lib/X11/fonts" ] ; then 
    122       is_mounted "${pDir}/virtbase/usr/local/lib/X11/fonts" || ($NULLFS /usr/local/lib/X11/fonts "${pDir}/virtbase/usr/local/lib/X11/fonts" ; $MNTSLEEP ) 
    123    fi 
    124    if [ -d "${pDir}/virtbase/usr/local/lib/X11/icons" -a -d "/usr/local/lib/X11/icons" ] ; then 
    125       is_mounted "${pDir}/virtbase/usr/local/lib/X11/icons" || ($NULLFS /usr/local/lib/X11/icons "${pDir}/virtbase/usr/local/lib/X11/icons" ; $MNTSLEEP ) 
    126    fi 
    127    if [ -d "${pDir}/virtbase/usr/local/share/icons" -a -d "/usr/local/share/icons" ] ; then 
    128       is_mounted "${pDir}/virtbase/usr/local/share/icons" || ($NULLFS /usr/local/share/icons "${pDir}/virtbase/usr/local/share/icons" ; $MNTSLEEP ) 
    129    fi 
    130  
    131    # Support for some font packages(example: japanese/font-vlgothic) 
    132    for fontdir in /usr/local/share/font-* 
    133    do 
    134       subdir=`basename $fontdir` 
    135       if [ ! -d "${pDir}/virtbase/usr/local/share/$subdir" ]; then 
    136          mkdir "${pDir}/virtbase/usr/local/share/$subdir" 
    137       fi 
    138       is_mounted "${pDir}/virtbase/usr/local/share/$subdir" || ($NULLFS /usr/local/share/$subdir "${pDir}/virtbase/usr/local/share/$subdir" ; $MNTSLEEP ) 
    139    done 
    140  
    141    # Check if we need to mount linprocfs in the PBI container 
    142    if [ -d "${pDir}/virtbase/compat/linux/proc" ] ; then 
    143       is_mounted "${pDir}/virtbase/compat/linux/proc" || (mount -t linprocfs linproc "${pDir}/virtbase/compat/linux/proc" ; $MNTSLEEP ) 
    144    fi 
    145  
    146    undo_mount_lock 
    147  
    148    sleep 1 
    149    sync 
    150  
    151    # Copy over the system command 
    152    cp /usr/pbi/.pbisyscmd "${pDir}/virtbase/usr/local/bin/pbisyscmd" 
    153    cp /usr/pbi/.pbisyscmd "${pDir}/virtbase/usr/local/bin/openwith" 
    154    cp /usr/pbi/.pbisyscmd "${pDir}/virtbase/usr/local/bin/xdg-open" 
    155    chmod 755 "${pDir}/virtbase/usr/local/bin/pbisyscmd"  
    156  
    157    # Copy the custom ldconfig 
    158    cp /usr/pbi/.ldconfig "${pDir}/virtbase/var/run/ldconfig" 
    159    chroot "${pDir}/virtbase" /var/run/ldconfig start >/dev/null 2>/dev/null 
     99   # Start the ldconfig run 
     100   chroot "${pDir}/virtbase" /etc/rc.d/ldconfig start >/dev/null 2>/dev/null 
    160101 
    161102   # Start devfs to ensure /dev/* get proper permissions 
    162103   chroot "${pDir}/virtbase" /etc/rc.d/devfs start >/dev/null 2>/dev/null 
    163  
    164    sync 
    165104} 
    166105 
  • src-sh/port-files/pkg-install

    r1aede14 r6330d7c  
    3535   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbisyscmd /usr/pbi/.pbisyscmd 
    3636   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbisyslisten /usr/pbi/.pbisyslisten 
    37    install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.mount_nullfs /usr/pbi/.mount_nullfs 
     37   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbifs /usr/pbi/.pbifs 
    3838fi 
    3939 
Note: See TracChangeset for help on using the changeset viewer.