NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Zip and Unzip on Linux RT

Solved!
Go to solution

I normally use the OpenG Zip tools when I need to zip, both on Windows and VxWorks targets, but having just started using Linux through the use of a cRIO-9030 and a SOM I needed to find a different solution (at leats until such support is added to the OpenG toolkit).

I have not concluded the implementation yet (My goal is to wrap this into a set of VIs that can replace the OpenG VIs I'm using whenever the target is Linux RT...), but thought I should share the results so far here - in case anyone is trying the same thing, or has already gotten much further(?). Attached is a VI that explains the process of getting zip and unzip tools installed on the target, and how to use them via the system exec VI.

PS. I was a bit surprised that when I tested the zip tool from the command line I did not get access to create any files from a user that was in the admin group, only from the admin account itself...(why?) but that is not an issue when running the commands from LabVIEW.

Mads

zipand unzip.JPG

0 Kudos
Message 1 of 6
(6,765 Views)

Hi Mads,

The issue about the unzipping as a user in the NIAuth admin group is that the "admin" group pertains more to LabVIEW and NI software authentication. This is different than the underlying OS authentication/permissions. It comes down to where you are trying to extract the zip file to. If the user you have created does not have write permission to the folder you're attempting to extract into, you won't be allowed to do so.

You can check to see what groups the OS sees your user being in by logging into the target (either over serial console or SSH) and issuing the command

groups

To see the permissions of the folder you are attempting to extract into, you can use the command

ls -ld /path/to/directory

In your instructions, note that, if you've never run

opkg update

before, it absolutely is required

As I recall, the directory from which the System Exec VI is run is /usr/local/natinst/labview, so all relative paths will be from there. Of course, you can use the absolute path if in doubt.

Message 2 of 6
(5,004 Views)

Thanks Brad. As it was possible to connect to the console using the user account I had created from the NI web interface I kind of expected the user rights to also apply to the OS as a whole...but anyway.

I had forgotten that I also need to do deflate/inflate on strings in memory...(to replace similar use of the OpenG zlib based deflate/inflate), so I need to do some more digging to figure out a good solution for that too.

0 Kudos
Message 3 of 6
(5,005 Views)

Mads Have you made any progress on this.  I'd like to deflate a string on my 9068, and then push the deflated output through a TCP/IP connection to a Java based receiver where it can be inflated. 

0 Kudos
Message 4 of 6
(5,005 Views)

No for the string inflate/deflate functionality I've just made a temporrary workaround unfortunately. I'm waiting for the update of the OpenG Zip Toolkit as the final solution (it would be best if this functionality came as part of LabVIEW, but that's another issue...).

I'm not sure when it will be ready, but there has been activity on the sourceforge site recently, so I'm sure Rolf Kalbermatter is working on it.

0 Kudos
Message 5 of 6
(5,005 Views)
Solution
Accepted by topic author Mads

A first (beta) release of OpenG Zip Tools for Linux targets was made today. Thanks to Rolf Kalbermatter we now have inflate/deflate and zip file functionality on Linux RT as well.

0 Kudos
Message 6 of 6
(5,005 Views)