Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: EPICS3.14.12 RTEMS patch for nfsMount() ( was Re: Autosave and RTEMS-4.10)
From: Kate Feng <feng@bnl.gov>
To: tech-talk@aps.anl.gov
Cc: wenorum@lbl.gov, 송영기 <ygsong@kaeri.re.kr>
Date: Tue, 15 May 2012 12:18:12 -0400
It seems like an oversight that nfsMount() command was declared static in rtems_init.c().
The patch below for EPICS3.14.12.x would simply solve the error of
"undefined reference to `nfsMount'  ".  This should be fixed in R3.14.12.2 and higher version too.

diff -Naur R3.14.12.1/src/RTEMS/base/rtems_init.c.orig R3.14.12.1/src/RTEMS/base/rtems_init.c
--- R3.14.12.1/src/RTEMS/base/rtems_init.c.orig    2011-04-26 16:40:09.000000000 -0400
+++ R3.14.12.1/src/RTEMS/base/rtems_init.c    2012-05-15 11:42:57.619344534 -0400
@@ -173,8 +173,7 @@
 #if __RTEMS_MAJOR__>4 || \
    (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__>9) || \
    (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__==9 && __RTEMS_REVISION__==99)
-static int
-nfsMount(char *uidhost, char *path, char *mntpoint)
+int nfsMount(char *uidhost, char *path, char *mntpoint)
 {
     int   devl = strlen(uidhost) + strlen(path) + 2;
     char *dev;


Thus, the original patch for nfs.c in RTEMS-4.10.0 would not need to unblock the nfsMount() command.
diff -a -u nfs.c.orig nfs.c
--- nfs.c.orig    2010-07-01 11:18:06.000000000 -0400
+++ nfs.c    2012-04-26 12:41:25.383414776 -0400
@@ -128,7 +128,6 @@
 /* we use a dynamically assigned major number */
 #define NFS_MAJOR                        (nfsGlob.nfs_major)
 
-
 /* NOTE: RTEMS (ss-20020301) uses a 'short st_ino' type :-( but the
  * NFS fileid is 32 bit. [Later versions of RTEMS have fixed this;
  * nfsInit() issues a warning if you run a version with 'short st_ino'.]
@@ -1574,7 +1573,7 @@
          */
         assert( node->args.name );
 
-        *(const char**)arg = pathname + (node->args.name - p);
+        *(arg->c) = pathname + (node->args.name - p);
 
 #if 0
         /* restore the directory node */
@@ -2616,6 +2615,9 @@
     if (count > NFS_MAXDATA)
         count = NFS_MAXDATA;
 
+    if (count > nfsStBlksize)
+        count = nfsStBlksize;
+
     SERP_ARGS(node).readarg.offset        = iop->offset;
     SERP_ARGS(node).readarg.count          = count;
     SERP_ARGS(node).readarg.totalcount    = UINT32_C(0xdeadbeef);
@@ -2720,6 +2722,8 @@
     if (count > NFS_MAXDATA)
         count = NFS_MAXDATA;
 
+    if (count > nfsStBlksize)
+        count = nfsStBlksize;
 
     SERP_ARGS(node).writearg.beginoffset   = UINT32_C(0xdeadbeef);
     if ( LIBIO_FLAGS_APPEND & iop->flags ) {
@@ -3247,8 +3251,8 @@
     return 0;
 }

Cheers,
Kate

On 04/26/2012 12:50 PM, Kate Feng wrote:
If one use RTEMS4-10.0, one needs to apply the patch below for the cpukit/libfs/src/nfsclient/src/nfs.c,
in addition to https://www.rtems.org/bugzilla/show_bug.cgi?id=1797 and
https://www.rtems.org/bugzilla/show_bug.cgi?id=1786

Cheers,
Kate Feng

********************************************************************************

diff -a -u nfs.c.orig nfs.c
--- nfs.c.orig    2010-07-01 11:18:06.000000000 -0400
+++ nfs.c    2012-04-26 12:41:25.383414776 -0400
@@ -128,7 +128,6 @@
 /* we use a dynamically assigned major number */
 #define NFS_MAJOR                        (nfsGlob.nfs_major)
 
-
 /* NOTE: RTEMS (ss-20020301) uses a 'short st_ino' type :-( but the
  * NFS fileid is 32 bit. [Later versions of RTEMS have fixed this;
  * nfsInit() issues a warning if you run a version with 'short st_ino'.]
@@ -1574,7 +1573,7 @@
          */
         assert( node->args.name );
 
-        *(const char**)arg = pathname + (node->args.name - p);
+        *(arg->c) = pathname + (node->args.name - p);
 
 #if 0
         /* restore the directory node */
@@ -2616,6 +2615,9 @@
     if (count > NFS_MAXDATA)
         count = NFS_MAXDATA;
 
+    if (count > nfsStBlksize)
+        count = nfsStBlksize;
+
     SERP_ARGS(node).readarg.offset        = iop->offset;
     SERP_ARGS(node).readarg.count          = count;
     SERP_ARGS(node).readarg.totalcount    = UINT32_C(0xdeadbeef);
@@ -2720,6 +2722,8 @@
     if (count > NFS_MAXDATA)
         count = NFS_MAXDATA;
 
+    if (count > nfsStBlksize)
+        count = nfsStBlksize;
 
     SERP_ARGS(node).writearg.beginoffset   = UINT32_C(0xdeadbeef);
     if ( LIBIO_FLAGS_APPEND & iop->flags ) {
@@ -3247,8 +3251,8 @@
     return 0;
 }
 
-#if 0
-CCJ_REMOVE_MOUNT
+#if 1
+/*CCJ_REMOVE_MOUNT*/
 /* convenience wrapper
  *
  * NOTE: this routine calls NON-REENTRANT
@@ -3328,7 +3332,11 @@
         strcat(dev,path);
     }
 
+#if 0
     printf("Trying to mount %s on %s\n",dev,mntpoint);
+#else
+    printf("Mounting %s\n",dev);
+#endif
 
     if (mount(dev,
               mntpoint,


On 04/26/2012 10:42 AM, Kate Feng wrote:
1. In RTEMS-4.10, the nfsMount wrapper is blocked out in the file cpukit/libfs/src/nfsclient/src/nfs.c
    Instead, it was moved to EPICS-3.14.12.1 in the file src/RTEMS/base/rtems_init.c
    However, it does not work.  My work around was to unblock the nfsMount wrapper in the
    cpukit/libfs/src/nfsclient/src/nfs.c in RTEMS-4.10. 

2. You can try to use RTEMS4-10.1 because there were many patches applied since RTEMS4-10.0,
    although one still need to unblock the nfsMount wrapper in cpukit/libfs/src/nfsclient/src/nfs.c.
  
3. However, there was a minor bug with NFS in RTEMS4-10.1, which did not exist in RTEMS4-10.0.
    The bug needs to be fixed. I will try to fix it starting today.  I am still using RTEMS4-10.0 with all the
    patches I have sent to RTEMS.  This version is robust.
    They are

    https://www.rtems.org/bugzilla/show_bug.cgi?id=1797
    https://www.rtems.org/bugzilla/show_bug.cgi?id=1786

   Cheers,
   Kate Feng

On 04/26/2012 02:24 AM, 송영기 wrote:

Hi all,

 

I successfully installed the autosave-4.8 with RTEMS-4.9.2 and EPICS base-3.14.12.1.
I would like to use the autosave with the RTEMS-4.10 and EPICS base-3.14.12.1.  
So, i installed them (RTEMS + base) and tried to install the autosave-4.8. 
But an error occured as follows: 

/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-gcc --pipe -B/usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/ -specs bsp_specs -qrtems -fasm -c -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altivec -mvrsave=no -mmultiple -mstring -mstrict-align -DUNIX -O2 -g -g -Wall -DMY_DO_BOOTP=NULL -DHAVE_MOTLOAD -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048 -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120 -DBSP_NVRAM_BASE_ADDR=0xf1110000 -MMD -I. -I../O.Common -I. -I../os/RTEMS -I../os/default -I.. -I../.../../include/os/RTEMS -I../../../include -I/usr/local/epics/base_ppc/rtems410/base-3.14.12.1/include/os/RTEMS -I/usr/local/epics/base_ppc/rtems410/base-3.14.12.1/include ../os/RTEMS/osdNfs.c 
.../os/RTEMS/osdNfs.c: In function 'mountFileSystem': 
.../os/RTEMS/osdNfs.c:44: warning: implicit declaration of function 'nfsMount' 
/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-ar rc libautosave.a dbrestore.o save_restore.o initHooks.o fGetDateStr.o osdNfs.o 
/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-ranlib libautosave.a 
echo "Installing library ../../../lib/RTEMS-mvme5500/libautosave.a" 
Installing library ../../../lib/RTEMS-mvme5500/libautosave.a 
perl /usr/local/epics/base_ppc/rtems410/base-3.14.12.1/bin/linux-x86/registerRecordDeviceDriver.pl ../O.Common/as.dbd as_registerRecordDeviceDriver /usr/local/epics/base_ppc/rtems410/autosave-4-8 > as.tmp 
/bin/mv as.tmp as_registerRecordDeviceDriver.cpp 

/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-g++ -B/usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/ -specs bsp_specs -qrtems -c -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altivec -mvrsave=no -mmultiple -mstring -mstrict-align -DUNIX -O2 -g -g -Wall -DMY_DO_BOOTP=NULL -DHAVE_MOTLOAD -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048 -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120 -DBSP_NVRAM_BASE_ADDR=0xf1110000 -MMD -I. -I../O.Common -I. -I../os/RTEMS -I../os/default -I.. -I../../../include/os/RTEMS -I../../../include -I/usr/local/epics/base_ppc/rtems410/base-3.14..12.1/include/os/RTEMS -I/usr/local/epics/base_ppc/rtems410/base-3.14.12.1/include as_registerRecordDeviceDriver.cpp 

/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-g++ -B/usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/ -specs bsp_specs -qrtems -c -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altivec -mvrsave=no -mmultiple -mstring -mstrict-align -DUNIX -O2 -g -g -Wall -DMY_DO_BOOTP=NULL -DHAVE_MOTLOAD -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048 -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120 -DBSP_NVRAM_BASE_ADDR=0xf1110000 -MMD -I. -I../O.Common -I. -I../os/RTEMS -I../os/default -I.. -I../../../include/os/RTEMS -I../../../include -I/usr/local/epics/base_ppc/rtems410/base-3.14..12.1/include/os/RTEMS -I/usr/local/epics/base_ppc/rtems410/base-3.14.12.1/include ../asMain.cpp 
/usr/local/rtems/rtems-4.10/bin/powerpc-rtems4.10-g++ -B/usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/ -specs bsp_specs -qrtems -o asApp -static -L/usr/local/epics/base_ppc/rtems410/autosave-4-8/lib/RTEMS-mvme5500 -L/usr/local/epics/base_ppc/rtems410/base-3.14.12.1/lib/RTEMS-mvme5500 -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altivec -mvrsave=no -mmultiple -mstring -mstrict-align -u Init /usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/no-dpmem.rel /usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/no-mp.rel /usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/no-part.rel /usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/no-signal.rel /usr/local/rtems/rtems-4.10/powerpc-rtems4.10/mvme5500/lib/no-rtmon.rel as_registerRecordDeviceDriver.o asMain.o -lautosave -l re cI oc -lsoftDevIoc -lmiscIoc -lrsrvIoc -ldbtoolsIoc -lasIoc -ldbIoc -lregistryIoc -ldbStaticIoc -lca -lCom -lreadline -lncurses -lbspExt -lm -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm 
/usr/local/epics/base_ppc/rtems410/autosave-4-8/lib/RTEMS-mvme5500/libautosave.a(osdNfs.o): In function `mountFileSystem': 
/usr/local/epics/base_ppc/rtems410/autosave-4-8/asApp/src/O.RTEMS-mvme5500/.../os/RTEMS/osdNfs.c:44: undefined reference to `nfsMount' 
collect2: ld returned 1 exit status 
make[3]: *** [asApp] Error 1 
make[3]: Leaving directory `/usr/local/epics/base_ppc/rtems410/autosave-4-8/asApp/src/O.RTEMS-mvme5500' 
make[2]: *** [install.RTEMS-mvme5500] Error 2 
make[2]: Leaving directory `/usr/local/epics/base_ppc/rtems410/autosave-4-8/asApp/src' 
make[1]: *** [src.install] Error 2 
make[1]: Leaving directory `/usr/local/epics/base_ppc/rtems410/autosave-4-8/asApp' 
make: *** [asApp.install] Error 2 


I checked the librtemsNfs.h. 
I found the nfsMount function in RTEMS4.9.2-4.9.6. 
But the RTEMS4.10.0 doesn't include the nfsMount function.

What is the difference between both RTEMS versions?

How can i install the autosave with RTEMS4.10?


Thanks and Best Regards,
Young-gi 






Replies:
Re: EPICS3.14.12 RTEMS patch for nfsMount() ( was Re: Autosave and RTEMS-4.10) Andrew Johnson
References:
Autosave and RTEMS-4.10 송영기
Re: Autosave and RTEMS-4.10 Kate Feng
Re: Autosave and RTEMS-4.10 Kate Feng

Navigate by Date:
Prev: Re: Channel Access monitoring tools Ralph Lange
Next: RE: using areaDetector as a support library only Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
Navigate by Thread:
Prev: Re: Autosave and RTEMS-4.10 Kate Feng
Next: Re: EPICS3.14.12 RTEMS patch for nfsMount() ( was Re: Autosave and RTEMS-4.10) Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·