Test and Measurement Forum

Installing when /opt is mapped to a network share?

Discussion forum for the new Picoscope Linux software

Installing when /opt is mapped to a network share?

Postby mprowe » Mon Jul 07, 2014 10:58 am

Hi Linux users,

I really am very glad that pico are releasing this software under Linux, however, I have a small problem I'm hoping that someone can solve for me?

I am using SUSE 13.1 64bit and my /opt directory is linked to an NFS share. When I try an run the install, I get:
Code: Select all
Subprocess failed. Error: RPM failed: error: unpacking of archive failed on file /opt/picoscope/include/libps5000-1.5: cpio: chown failed - Operation not permitted
error: libps5000-1.5.1-3r02.x86_64: install failed


However, If I test the install on a "clean" machine (/opt is on the local file system), I have no problems.

Two routes seem open to me:
1. Change the install location. Unfortunately, my Linux skills don't extend to unpacking the RPM and editing the scripts.
2. Solve the copy/change ownership issue. Once again, I am stymied by the above skills limitations!!

Best regards, Martin
mprowe
Newbie
 
Posts: 0
Joined: Sun Jul 06, 2014 7:55 pm

Re: Installing when /opt is mapped to a network share?

Postby mario_ » Tue Jul 08, 2014 7:24 am

Hi Martin,

The workaround I propose is to make a mount with bind to another folder. Assuming you have root permission (enter via sudo su), run the following:

1. Create folder where you want to keep picoscope files, ie /usr/local/picoscope
Code: Select all
mkdir -p /usr/local/picoscope


2. Create mount point in your NFS share (if you don't have permission to do that - ask NFS admin if this is possible, if not... we'll try something else ;) )
Code: Select all
mkdir /opt/picoscope


3. Bind your local to remote location folder. This way all calls to remote location /opt/picoscope will be passed on to local folder:
Code: Select all
mount --bind /usr/local/picoscope /opt/picoscope


4. Install picoscope as you would normally do...

5. If step 4. worked, make the bind to be made on system start. To do that, edit file /etc/fstab and add following line at the bottom:
Code: Select all
/usr/local/picoscope    /opt/picoscope          none    bind            0 0



Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Installing when /opt is mapped to a network share?

Postby mprowe » Wed Jul 09, 2014 5:45 pm

Hi Mario,

Thank you for the advice on how to install Picoscope - it worked a treat. However....

I now have the next problem. It won't run. From your collogue, Hitesh, I got the advice to run the following tests.

1. USBTEST. Results below:
Code: Select all
mprowe@gzunder:~> /opt/picoscope/share/doc/libps3000a/usbtest

****************************************************************************
*                  Pico Technology Linux USB Diagnostics                   *
****************************************************************************

This script looks for Pico USB devices connected to your computer
and checks whether you are able to access them. If your user account
does not have permission to access the devices, the script will try
to suggest how to correct this for your particular Linux installation.

Press enter to continue...

Getting user and group information...
- You are running this script as mprowe.                                                                                                           
- You are in the following groups:                                                                                                                 
     users sys lp pico vboxusers                                                                                                                     

Please connect your Pico USB device and press enter to continue...

Pico USB device found: /dev/bus/usb/002/007

- It belongs to root (which is not you) who has permissions rw-
- The members of group pico (which you are in) have permissions rw-
- Everyone else has permissions r--
- You can write to this device and so will be able to use it.
mprowe@gzunder:~>


2. Run Picoscope as root. Results below:
Code: Select all
mprowe@gzunder:~> sudo picoscope
root's password:

Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.UserControl..ctor () [0x00000] in <filename unknown>:0
  at fN..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) fN:.ctor ()
  at cD.a () [0x00000] in <filename unknown>:0
  at ax.a () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.UserControl..ctor () [0x00000] in <filename unknown>:0
  at fN..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) fN:.ctor ()
  at cD.a () [0x00000] in <filename unknown>:0
  at ax.a () [0x00000] in <filename unknown>:0
mprowe@gzunder:~>


This doesn't look good?
Reading the first few lines I note reference to X-Server and the environment variable "$DISPLAY".
Checking this out before mailing you, I see:
Code: Select all
gzunder:~ # X -version

This is a pre-release version of the X server from The X.Org Foundation.
It is not supported in any way.
Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
Select the "xorg" product for bugs you find in this release.
Before reporting bugs in pre-release versions please check the
latest version in the X.Org Foundation git repository.
See http://wiki.x.org/wiki/GitPage for git access instructions.

X.Org X Server 1.14.3.901 (1.14.4 RC 1)
Release Date: 2013-10-26
X Protocol Version 11, Revision 0
Build Operating System: openSUSE SUSE LINUX
Current Operating System: Linux gzunder 3.11.10-17-desktop #1 SMP PREEMPT Mon Jun 16 15:28:13 UTC 2014 (fba7c1f) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.11.10-17-desktop root=UUID=fc65b592-4b18-42f5-af86-28af4c8d081f splash=verbose showopts i8042.nopnp
Build Date: 17 April 2014  05:37:34AM

Current version of pixman: 0.30.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
gzunder:~ #

By the way, the above information is identical (ignoring UUIDs node names) to my working testbed.

Code: Select all
gzunder:~ # echo "$DISPLAY"
:0
gzunder:~ #


I hope that you will be able to suggest further test and possible solutions?

Best regards, Martin
mprowe
Newbie
 
Posts: 0
Joined: Sun Jul 06, 2014 7:55 pm

Re: Installing when /opt is mapped to a network share?

Postby mario_ » Thu Jul 10, 2014 6:50 am

Hi Martin,

I'm glad the workaround for installation worked.

Now, the usbtest script has confirmed that your permissions are set up correctly to operate the device. No need to follow the path of running the app as root.

To get verbose output of the startup, run picoscope without management script:

Code: Select all
cd /opt/picoscope/lib
mono PicoScope.GTK.exe


Should get us more information on what is going wrong.

Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Installing when /opt is mapped to a network share?

Postby mprowe » Thu Jul 10, 2014 7:24 am

Good morning Mario,

Okay, done that. I've now got a fairly lengthy output for you to ponder on!
I have attached it to this posting as picoscope.20140710.txt.

Regards, Martin
Attachments
picoscope.20140710.txt
Terminal output from "mono PicoScope.GTK.exe"
(16.6 KiB) Downloaded 93 times
mprowe
Newbie
 
Posts: 0
Joined: Sun Jul 06, 2014 7:55 pm

Re: Installing when /opt is mapped to a network share?

Postby mario_ » Thu Jul 10, 2014 7:52 am

Thanks for the logs.

Code: Select all
Exception: Error: Unhandled Exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: picoipp


Is /opt/picoscope/lib/libpicoipp.so present on your system? Should, it comes as dependency during installation... Unless the situation with /opt being on NFS manifested itself on loader cache side. Try running picoscope from mapped directory source (assuming /usr/local/picoscope):
Code: Select all
cd /usr/local/picoscope/lib
export LD_LIBRARY_PATH=/usr/local/picoscope/lib
mono PicoScope.GTK.exe


If above works, do the following as root:

1. Edit /usr/local/picoscope/bin/picoscope, replace on the bottom:
Code: Select all
export MONO_PATH=/opt/picoscope/lib
cd /opt/picoscope/lib
exec sg $PICO_GROUP -c "$RUN_CMD /opt/picoscope/lib/PicoScope.GTK.exe" 2>&1 >/dev/null

with
Code: Select all
export MONO_PATH=/usr/local/picoscope/lib
cd /usr/local/picoscope/lib
exec sg $PICO_GROUP -c "$RUN_CMD /usr/local/picoscope/lib/PicoScope.GTK.exe" 2>&1 >/dev/null


2. Edit /etc/ld.so.conf.d/picoscope.conf and add another line with path /usr/local/picoscope/lib

3. Run ldconfig to reload loader cache

4. Try running picoscope normally... (no root)

Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Installing when /opt is mapped to a network share?

Postby mprowe » Fri Jul 11, 2014 8:01 am

Is /opt/picoscope/lib/libpicoipp.so present on your system? Should, it comes as dependency during installation... Unless the situation with /opt being on NFS manifested itself on loader cache side. Try running picoscope from mapped directory source (assuming /usr/local/picoscope):


Right on the money Mario!! No libpicoipp.so to be found on my system?
As a preface to correcting the above, I have moved all my other applications that were on my linked (NFS share) directory and made /opt local again. So we don't have to worry about that issue any more.

To correct the missing /opt/picoscope/lib/libpicoipp.so, I reinstalled libpicoipp (sudo zypper install libpicoipp).
Code: Select all
gzunder:~ # ldconfig -p | grep /opt/picoscope
        libps6000.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps6000.so.2
        libps6000.so (libc6,x86-64) => /opt/picoscope/lib/libps6000.so
        libps5000a.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps5000a.so.2
        libps5000a.so (libc6,x86-64) => /opt/picoscope/lib/libps5000a.so
        libps5000.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps5000.so.2
        libps5000.so (libc6,x86-64) => /opt/picoscope/lib/libps5000.so
        libps4000a.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps4000a.so.2
        libps4000a.so (libc6,x86-64) => /opt/picoscope/lib/libps4000a.so
        libps4000.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps4000.so.2
        libps4000.so (libc6,x86-64) => /opt/picoscope/lib/libps4000.so
        libps3000a.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps3000a.so.2
        libps3000a.so (libc6,x86-64) => /opt/picoscope/lib/libps3000a.so
        libps3000.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps3000.so.2
        libps3000.so (libc6,x86-64) => /opt/picoscope/lib/libps3000.so
        libps2000a.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps2000a.so.2
        libps2000a.so (libc6,x86-64) => /opt/picoscope/lib/libps2000a.so
        libps2000.so.2 (libc6,x86-64) => /opt/picoscope/lib/libps2000.so.2
        libps2000.so (libc6,x86-64) => /opt/picoscope/lib/libps2000.so
        libpicoipp.so.1 (libc6,x86-64) => /opt/picoscope/lib/libpicoipp.so.1
        libpicoipp.so (libc6,x86-64) => /opt/picoscope/lib/libpicoipp.so
        libiomp5.so (libc6,x86-64) => /opt/picoscope/lib/libiomp5.so
gzunder:~ #


Then I tried the application (log file attached). WhaaHooo...... Runs like a dream :D
If you would just scan the attached log file to confirm this, I'd be most appreciative.

Best regards, and thank you for your help. Martin.

PS - I hope that Pico Technology gain a lot of extra business following this additional support for the Linux market.
I for one, am most grateful.
Attachments
picoscope.20140711.txt
Running with a full compliment of *.so files
(7.35 KiB) Downloaded 88 times
mprowe
Newbie
 
Posts: 0
Joined: Sun Jul 06, 2014 7:55 pm


Return to PicoScope for Linux

Who is online

Users browsing this forum: No registered users and 0 guests