Changeset 9662914


Ignore:
Timestamp:
Apr 1, 2014 11:22:30 AM (3 weeks ago)
Author:
Kris Moore <kris@…>
Branches:
master
Children:
22bb9cb
Parents:
b2a6e70
Message:

Add support for running 32bit applications in the new PBI wrapper layer

Location:
src-sh
Files:
8 edited

Legend:

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

    r1cafdcc r9662914  
    139139install -o root -g wheel -m 4751 pbild ${LB}/share/pbi-manager/.pbild 
    140140install -o root -g wheel -m 755 pbirun ${LB}/share/pbi-manager/.pbirun 
     141install -o root -g wheel -m 755 pbirun32 ${LB}/share/pbi-manager/.pbirun32 
    141142install -o root -g wheel -m 755 pbiinit ${LB}/share/pbi-manager/.pbiinit 
    142143install -o root -g wheel -m 755 ldconfig ${LB}/share/pbi-manager/.ldconfig 
     
    147148  install -o root -g wheel -m 4751 pbild /usr/pbi/.pbild 
    148149  install -o root -g wheel -m 755 pbirun /usr/pbi/.pbirun 
     150  install -o root -g wheel -m 755 pbirun32 /usr/pbi/.pbirun32 
    149151  install -o root -g wheel -m 755 pbiinit /usr/pbi/.pbiinit 
    150152  install -o root -g wheel -m 755 ldconfig /usr/pbi/.ldconfig 
     
    156158cd ${DIR}/pbi_preload && make  
    157159install -o root -g wheel -m 755 pbi_preload.so ${LB}/share/pbi-manager/.pbi_preload.so 
     160install -o root -g wheel -m 755 pbi_preload32.so ${LB}/share/pbi-manager/.pbi_preload32.so 
    158161if [ "${LB}" = "/usr/local" ] ; then 
    159162  install -o root -g wheel -m 755 pbi_preload.so /usr/pbi/.pbi_preload.so 
     163  install -o root -g wheel -m 755 pbi_preload32.so /usr/pbi/.pbi_preload32.so 
    160164fi 
    161165 
  • src-sh/pbi-manager/pbi_preload/Makefile

    r1cafdcc r9662914  
    55        ${CC} -fPIC -c -o pbi_preload.o pbi_preload.c 
    66        ${CC} -shared -o pbi_preload.so pbi_preload.o  
     7        ${CC} -mtune=i386 -march=i386 -m32 -fPIC -c -o pbi_preload32.o pbi_preload.c 
     8        ${CC} -mtune=i386 -march=i386 -m32 -shared -o pbi_preload32.so pbi_preload32.o 
    79 
    810install: pbi_preload 
    911        install -o root -g wheel -m 755 pbi_preload.so /usr/pbi/.pbi_preload.so 
     12        install -o root -g wheel -m 755 pbi_preload32.so /usr/pbi/.pbi_preload32.so 
    1013 
    1114clean: 
    1215        rm pbi_preload.so 
    1316        rm pbi_preload.o 
     17        rm pbi_preload32.so 
     18        rm pbi_preload32.o 
  • src-sh/pbi-manager/pbi_preload/pbi_preload.c

    rb2a6e70 r9662914  
    181181{  
    182182        // Just break out now if path == NULL 
    183         if ( opath == NULL ) 
     183        if ( opath == NULL || opath[0] == '\0') { 
    184184                return -1; 
     185        } 
    185186 
    186187        // If the process is requesting to breakout of the container 
     
    438439        typeof(access) *sys_access; 
    439440        sys_access = dlsym(RTLD_NEXT, "access"); 
    440         return (*sys_access)(newpath, mode); 
     441        return (*sys_access)(newpath, mode); 
    441442} 
    442443 
     
    450451        typeof(_access) *sys_access; 
    451452        sys_access = dlsym(RTLD_NEXT, "_access"); 
    452         return (*sys_access)(newpath, mode); 
     453        return (*sys_access)(newpath, mode); 
    453454} 
    454455 
     
    461462        typeof(__acl_aclcheck_file) *sys_acl; 
    462463        sys_acl = dlsym(RTLD_NEXT, "__acl_aclcheck_file"); 
    463         return (*sys_acl)(newpath, _type, _aclp); 
     464        return (*sys_acl)(newpath, _type, _aclp); 
    464465} 
    465466 
     
    472473        typeof(acl_get_file) *sys_acl; 
    473474        sys_acl = dlsym(RTLD_NEXT, "acl_get_file"); 
    474         return (*sys_acl)(newpath, type); 
     475        return (*sys_acl)(newpath, type); 
    475476} 
    476477 
     
    11941195 
    11951196        dbug("stat()", path, newpath); 
    1196  
    11971197        typeof(stat) *sys_stat; 
    11981198        sys_stat = dlsym(RTLD_NEXT, "stat"); 
  • src-sh/pbi-manager/pbime/Makefile

    r1cafdcc r9662914  
    55        ${CC} -lutil -o pbime pbime.c 
    66        ${CC} -lutil -o pbirun pbirun.c 
     7        ${CC} -mtune=i386 -march=i386 -m32 -lutil -o pbirun32 pbirun.c 
    78        ${CC} -lutil -o pbild pbild.c 
    89 
     
    1112        install -o root -g wheel -m 4751 pbild /usr/pbi/.pbild 
    1213        install -o root -g wheel -m 755 pbirun /usr/pbi/.pbirun 
     14        install -o root -g wheel -m 755 pbirun32 /usr/pbi/.pbirun32 
    1315        install -o root -g wheel -m 755 pbiinit /usr/pbi/.pbiinit 
    1416        install -o root -g wheel -m 755 ldconfig /usr/pbi/.ldconfig 
    1517        install -o root -g wheel -m 755 pbisyscmd /usr/pbi/.pbisyscmd 
    1618        install -o root -g wheel -m 755 pbisyscmd /usr/bin/openwith 
     19 
     20clean: 
     21        rm pbirun 
     22        rm pbirun32 
     23        rm pbime 
     24        rm pbild 
  • src-sh/pbi-manager/pbime/pbime.c

    r1cafdcc r9662914  
    6464 
    6565        // Set the environment variables 
    66         setenv("LD_PRELOAD", "/usr/pbi/.pbi_preload.so", 1); 
    67         setenv("PBI_PRELOAD", "/usr/pbi/.pbi_preload.so", 1); 
     66        setenv("LD_32_PBIPRELOAD", "/usr/pbi/.pbi_preload32.so", 1); 
     67        setenv("LD_PBIPRELOAD", "/usr/pbi/.pbi_preload.so", 1); 
     68 
    6869        setenv("PBI_RUNDIR", argv[2], 1); 
    6970        unsetenv("PBI_BREAKOUT"); 
     
    7374        strcat(hintsfile, basename(argv[2])); 
    7475        setenv("LD_ELF_HINTS_PATH", hintsfile, 1); 
     76        strcpy(hintsfile, "/var/run/ld-elf32.so.hints."); 
     77        strcat(hintsfile, basename(argv[2])); 
     78        setenv("LD_32_ELF_HINTS_PATH", hintsfile, 1); 
    7579         
    7680        // Do the init of the environment 
     
    7882        strcat(initscript, argv[2]); 
    7983        //printf( "initscript: %s \n", initscript); 
    80         if ( system(initscript) != 0 ) 
    81                 err(1, "Failed PBI init!"); 
     84        //if ( system(initscript) != 0 ) 
     85        //      err(1, "Failed PBI init!"); 
    8286         
    8387        // Backwards compat check for old PBIs 
     
    9195 
    9296        // Setup the newargv with right stack 
     97        //if (strstr(argv[2], "-i386")) 
     98        //      strcpy(pbirun, "/usr/pbi/.pbirun32"); 
     99        //else 
     100 
    93101        strcpy(pbirun, "/usr/pbi/.pbirun"); 
     102 
    94103        newargv[0] = pbirun; 
    95104        newargv[1] = argv[3]; 
  • src-sh/pbi-manager/pbime/pbirun.c

    r1cafdcc r9662914  
    6464 
    6565        // Execute the PBI now 
     66        //printf("Running %s\n", argv[1]); 
    6667        return execvp(argv[1], newargv); 
    6768} 
  • src-sh/port-files/pkg-install

    r1cafdcc r9662914  
    3131if [ -e "${PREFIX}/share/pbi-manager/.pbime" ] ; then 
    3232   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbime /usr/pbi/.pbime 
    33    install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbime /usr/pbi/.pbirun 
     33   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbirun /usr/pbi/.pbirun 
     34   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbirun32 /usr/pbi/.pbirun32 
    3435   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbiinit /usr/pbi/.pbiinit 
    3536   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.ldconfig /usr/pbi/.ldconfig 
     
    3738   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/openwith /usr/bin/openwith 
    3839   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbi_preload.so /usr/pbi/.pbi_preload.so 
     40   install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.pbi_preload32.so /usr/pbi/.pbi_preload32.so 
    3941fi 
    4042 
  • src-sh/port-files/pkg-plist

    r1cafdcc r9662914  
    589589share/pbi-manager/.pbiinit 
    590590share/pbi-manager/.pbirun 
     591share/pbi-manager/.pbirun32 
    591592share/pbi-manager/.pbisyscmd 
    592593share/pbi-manager/.ldconfig 
    593594share/pbi-manager/.pbi_preload.so 
     595share/pbi-manager/.pbi_preload32.so 
    594596share/pbi-manager/.pbiwrapper-i386 
    595597share/pbi-manager/.pbiwrapper-amd64 
Note: See TracChangeset for help on using the changeset viewer.