NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Building IPK on PXI with Linux RT

Solved!
Go to solution

I've been trying to get xinetd installed on the PXI and also investigating compiling code from source and building IPK packages so that if needed I might be able to build/install a working xinetd from source if needed.

 

As such I looked at the document provided by Brian D and tried to follow along:

https://forums.ni.com/t5/NI-Linux-Real-Time-Documents/NI-Linux-Real-Time-and-opkg-Introduction-to-ip...

 

I created the HelloWorld.c file on my system and was able to utilize the gcc tools installed to compile to code.  Yes!  It's nice that there is a compiler system on the PXI - I'll have to try it out on some of our other legacy code we're trying to bring forward (but that is for a later topic).

 

Next I tested the executable by running the compiled exe using

# ./hello

 

I was rewarded by 

 

Hello world!

 

printed on the screen.

 

With that success I then tried to follow the directions to build the opkg ipk.  

 

I created the hellopgk folder

hellopgk

    CONTROL {directory}

         control {text file}

    usr {directory}

        bin {directory}

            hello {exe created by gcc compile and tested above}

        lib {folder}

    deiban-binary {text file? with only 2.0 in it}

 

Then I navigated to the opkg-utils folder on my system and ran

 

./opkg-build /SystemPath/hellowworld/hellopkg /SystemPath/helloworld

 

This DID build the hellopkg_1.0.0_x64.ipk in the requested location with no errors. I am not sure if this is correct - having to navigate to the opkg-utils_0.4.1 folder on my system to be able to run the tools there, unlike being able to just run opkg install package-name.ipk for example.

 

I was hopeful this was all going correctly but when I ran opkg install hellopkg_1.0.0_x64.ipk  I got errors unrelated to this package popping up, from a failed prior opkg install...

 

Any clue on why a prior install error would stick around?

 

When I did an opkg info hellopkg after the failed install, it returned nothing.  I suppose this is expected.  

 

Any glaring issues in my procedure above?  I'm curious about the opkg-utils use as well.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 1 of 25
(3,245 Views)

What were the opkg errors from the prior install?

 

I don't see anything glaringly wrong in your steps for creating the package but it would help if you could attach the built ipk just in case. 

Charlie J.
National Instruments
0 Kudos
Message 2 of 25
(3,234 Views)

The Error was from the prior install attempt of xinetd_2.3.15-r2.154_core2-64.ipk. 

 

http://download.ni.com/ni-linux-rt/feeds/2019.1/x64/core2-64/xinetd_2.3.15-r2.154_core2-64.ipk I am working with another NI Engineer on that track, but if you have any ideas in that regard, don't hold back.

 

The error was:

Nothing provides xinetd = 2.3.15-r2.154 that is needed by xinetd-dev_2.3.15-r2.154_core2-64.ipk  or something similar.  Nothing like I would expect when performing opkg install hellopkg

 

I might be able to get the actual ipk loaded by the end of the week, depending on base entrance enforcement.  We're on mandatory remote work due to Covid-19 right now.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 3 of 25
(3,211 Views)

Hmmm... That's not something I've seen before. Can you check if opkg thinks that xinetd-dev is somehow installed even though the installation failed? You can check that with either of the following commands:
opkg list-installed | grep xinetd

opkg info <package name>

 

I'm curious about the "status" of the xinetd package when you run the info command. If it thinks it's installed or in a bad state, try telling opkg to remove it:

opkg remove <package name>

 

And just to confirm, you didn't include xinetd in the hellopkg dependencies, did you? I'm assuming not but have to ask just in case.

Charlie J.
National Instruments
0 Kudos
Message 4 of 25
(3,207 Views)

You know, I might have done that by accident.  I thought I had my helloworld folder one level down from the upper level directory that contained the newly copied over xinetd ipks, but I will have to verify I wasn't that dumb. 😄

The hellopkg level should have been one level down from that even, so I wouldn't think it would have included them in the build.

 

i.e. it should be something like

 

pwd = /etc/opt/external

 

ls returns:

 

xinetd-dev_2.3.15...

xinetd_2.3.15...

xinetd-dbg_2.3.15...

/helloworld

 

cd /helloworld

 

pwd = /etc/opt/external/helloworld

ls returns:

 

hellopgk

  Sub folders etc. as stated in the first post

 

I will try the opkg info xinetd and see what it says, I ran it before, but don't have the response text in front of me.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 5 of 25
(3,199 Views)

opkg info xinetd returned the following, guess I should try removing the 2.3.15-5

 

opkg list-installed | grep xinetd returned nothing, not shown as installed.

 

 

Package: xinetd
Version: 2.3.15-r2.154
Depends: initd-functions, libc6 (>= 2.24), libwrap0 (>= 7.6)
Recommends: update-rc.d
Status: install ok not-installed
Section: base
Architecture: core2-64
Maintainer: NI Linux Real-Time Maintainers <nilrt@ni.com>
MD5Sum: 68036e675c8b9fe6cb5ba9398736b42c
Size: 69892
Filename: xinetd_2.3.15-r2.154_core2-64.ipk
Source: xinetd_2.3.15.bb
Description: Socket-based service activation daemon
OE: xinetd
HomePage: https://github.com/xinetd-org/xinetd
License: BSD

 

Package: xinetd
Version: 2.3.15-5
Depends: libc
Status: unknown ok not-installed
Section: net
Architecture: x86_64
Size: 62337
Filename: xinetd_2.3.15-5_x86_64.ipk
Description: xinetd has access control mechanisms, extensive logging capabilities,
the ability to make services available based on time, can place limits
on the number of servers that can be started, and has deployable
defence mechanisms to protect against port scanners, among other
things.
Installed-Size: 61360
License: xinetd

 

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 6 of 25
(3,165 Views)

Both show as "not-installed" so I don't think that's a concern. If you try to install any other packages, do you see the same errors as when you tried to install your hellopkg?

Charlie J.
National Instruments
0 Kudos
Message 7 of 25
(3,160 Views)

I will try another ipk and see.

 

I moved the xinetd ipk files from adjacent folder and rebuilt the ipk and still get the same error when trying to install.  Attached is the built ipk.

 

Or not attached...I am trying to post the ipk and being told that "The attachment's hellopkg_1.0.0_x64.ipk content type (application/octet-stream) does not match its file extension and has been removed."

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 8 of 25
(3,151 Views)

Try attaching it after renaming it as a .zip folder. I'm guessing the forums don't like that it's a compressed folder which is not labeled as a typical file format. 

Charlie J.
National Instruments
0 Kudos
Message 9 of 25
(3,145 Views)

I picked one random ipk from the one list of available ipk that seemed innocuous, and I got the same error with errors related to the package selected as well.

 

I zipped the ipk file and attached.

 

The image is the errors I obtained when trying to install the other ipk.

 

OPKG_InstallErrors.jpg

 

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
Download All
0 Kudos
Message 10 of 25
(3,142 Views)