Re: EMC version numbers



Ray wrote:

> I'm wondering if there is a way to modify the install scripts so that when
> EMC is installed it generates a small file -- some thing like sysinfo.txt
> -- that holds some PC info, linux version, rtlinux version, EMC
> release date, and type of release.  For other OS's it could hold equivalent
> information.

For system stuff, you can look in the /proc filesystem. There's lot of
interesting stuff here, e.g.,

you> cat /proc/rtlinux
RT-Linux version 2.2.14-rtl2.2

you> cat /proc/version
Linux version 2.2.14-rtl2.2 (root-at-hostname) (gcc version egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)) #2 Tue Aug 15 15:45:01 EDT 2000

you> cat < /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  64970752 63041536  1929216 24428544 37478400 10010624
Swap: 139821056  3354624 136466432
MemTotal:     63448 kB
MemFree:       1884 kB
MemShared:    23856 kB
Buffers:      36600 kB
Cached:        9776 kB
SwapTotal:   136544 kB
SwapFree:    133268 kB

you> cat < /proc/interrupts 
           CPU0       
  0:    9108213          XT-PIC  timer
  1:       2939          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  4:      13899          XT-PIC  serial
 10:     158741          XT-PIC  eth0
 13:          1          XT-PIC  fpu
 14:      40071          XT-PIC  ide0
 15:          7          XT-PIC  ide1
 60:          0        rtl-soft  fifo
 61:          1        rtl-soft  RTL-scheduler
 62:          0        rtl-soft  rtl_printf
 63:          0        rtl-soft  RTL-clock
NMI:          0

In Tcl/Tk, try this:

you> wish
% text .text -height 24 -width 80
.text
% .text insert end [exec /bin/cat /proc/rtlinux]
% .text insert end "\n\n"
% .text insert end [exec /bin/cat /proc/interrupts]
% pack .text
% exit

EMC information is harder to get. You can see just what went into your
bridgeporttask binary with this nifty command:

ident emc/plat/linux_2_2_14/bin/bridgeporttask
...
     $Id: rcs.hh,v 4.31 2000/07/26 14:04:29 wshackle Exp $
     $Id: emcmotglb.h,v 1.1.1.1 2000/06/14 19:37:07 wshackle Exp $
     $Id: emcmotcfg.h,v 1.1.1.1 2000/06/14 19:37:07 wshackle Exp $
     $Id: emcmotglb.c,v 1.1.1.1 2000/06/14 19:37:07 wshackle Exp $
     $Id: emc.hh,v 1.4 2000/08/10 20:02:55 proctor Exp $
     $Id: emctask.cc,v 1.2 2000/08/07 22:19:27 proctor Exp $
     $Id: emccanon.cc,v 1.4 2000/08/07 22:19:27 proctor Exp $
     $Id: emc.hh,v 1.4 2000/08/10 20:02:55 proctor Exp $
...

which shows that bridgeporttask was compiled from version 4.31 of
rcs.hh, etc. This isn't useful at the EMC GUI, but it can be used to
reverse-engineer a binary and build it again manually.

Since the various EMC releases differ in general by some revision number
on some particular file, due to bug fixes, etc., there's no way to use
this ident info to figure out what EMC release the thing was in. It may
be identical across a few releases if it didn't change.

You could use heuristics like the most recent emc-*.tgz file in the
/usr/local/nist directory, but this isn't necessarily what you're
running. We could create some file with the EMC release number in it
when the install script is run. This is probably the best. The file
could be created in the emc/ directory, where the generic.run script is,
so it is likely to match the code you're actually running.

How about we create a file, "emcversion", in the emc/ directory created
by the install, that contains for example

29-Feb-2000

We could also give the whole release a version number, like 1.23, which
we would use instead of the DD-Mon-YYYY release numbering. Thus, the
next release would be started at say 1.1.0, and the release file would
be emc-1.1.0.tgz. Installing this would create a file, emc/emcversion,
that contains 1.1.0. The GUI could just cat this and pop up the version
in a title bar or something.

Does this sound OK?

On a related note, it's possible to pop up a GIF file when the script
starts, and kill it after say 5 seconds. The GIF file would default to
some EMC graphic with the version number, but you could make it
anything.

Here's Tcl/Tk code for this:

proctor-at-spinerfem> wish
% image create photo image1 -file /usr/lib/tk8.0/demos/images/earth.gif
image1
% label .label -image image1
.label
% pack .label
% after 5000 destroy .label
after#1

You can put this at the beginning of the TkEMC, or make a script that
does this and call it at the beginning of the run script.

--Fred



Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact