Unable to install iperf3 on OpenWRT21.02.2

Hello:

Once I solved the rootfs capacity problem, I decided I wanted to visit the WD MyBook ethernet throughput issue again.

ie: why is it that both my box and the WDMyBook are 1000baseT/Full but I've barely been able to get 20GiB/s throughput via rsync?

I found a couple of pages with the mention of iperf3 and went about setting it up.

First I checked to see if my my box had iperf3 installed and, after removing iperf, installed it to then login to the WDMyBook via SSH to install it there also.

But I got this:

~# opkg install iperf3
Unknown package 'iperf3'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency libc for iperf3
 * pkg_hash_fetch_best_installation_candidate: Packages for iperf3 found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package iperf3.
~# exit

Rather strange as it shows up as available on the UI:

This is the error I get when attepting to install via de UI:

iperf3_error

Any idea what's going on?
An undeclared dependency?
ie: libc

Thanks in advance.
Best,

PCL

Be sure to run
opkg update
before attempting to install something if you didn't. The package list needs to be fetched after every reboot as it is stored in RAM.

Hello:

Of course.

~$ opkg update
Downloading https://downloads.openwrt.org/releases/21.02.2/targets/apm821xx/sata/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/21.02.2/targets/apm821xx/sata/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/telephony/Packages.sig
Signature check passed.
~$

And then su - ...

~# opkg install iperf3
Unknown package 'iperf3'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency libc for iperf3
 * pkg_hash_fetch_best_installation_candidate: Packages for iperf3 found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package iperf3.
~#

That said, libc is a dependency of iperf3.

But libc, is a metapackage, nowhere to be found.

Any idea?

Thanks in advance.

Best,

PCL

Can you install other packages?
Is your modified filesystem really working properly?

Specific to iperf3:
Assuming that you are running a standard build and did not compile/build your own and you have not customized opkg config etc, my Idea is the following:

Run commands like the following:
ubus call system board to check the target and release version.
Look at details of libc with
opkg info libc
opkg files libc
Hopefully it shows up as present like the output on my router as shown below with any architecture differences etc.

I include info on the kernel and iperf packages to show that the architectures match, although they are common to the generic parent target (or whatever the proper term is).

I don't know what to suggest if libc really is missing.

Did the iperf3 package download to the temp space? Does it look like the right one?

You can browse the downloads site to see the files and versions/dates etc. I can post info on that later if you need it. Just let me know the target info.

Output from my system below.

Good luck!

~# ubus call system board
{
	"kernel": "5.10.161",
	"hostname": "R4S-wrt",
	"system": "ARMv8 Processor rev 4",
	"model": "FriendlyElec NanoPi R4S",
	"board_name": "friendlyarm,nanopi-r4s",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.3",
		"revision": "r20028-43d71ad93e",
		"target": "rockchip/armv8",
		"description": "OpenWrt 22.03.3 r20028-43d71ad93e"
	}
}
~# opkg info libc
Package: libc
Version: 1.2.3-4
Depends: libgcc
Status: install hold,user installed
Essential: yes
Architecture: aarch64_generic
Installed-Time: 1672705461

~# opkg files libc
Package libc (1.2.3-4) is installed on root and has the following files:
/lib/ld-musl-aarch64.so.1
/lib/libc.so
/usr/bin/ldd

~# opkg find kernel
kernel - 5.10.161-1-978cadea017a004ae5b73fcf48befb86
~# opkg info kernel
Package: kernel
Version: 5.10.161-1-978cadea017a004ae5b73fcf48befb86
Depends: libc
Status: install user installed
Architecture: aarch64_generic
Installed-Time: 1672705461

~# opkg info iperf3
Package: iperf3
Version: 3.11-1
Depends: libc
Status: install user installed
Section: net
Architecture: aarch64_generic
Size: 51368
Filename: iperf3_3.11-1_aarch64_generic.ipk
Description: Iperf is a modern alternative for measuring TCP and UDP bandwidth
 performance, allowing the tuning of various parameters and
 characteristics.
Installed-Time: 1672705461
~# 

Hello:

Thanks for the prompt reply.

I hate quoting myself ...
Neverthesess, I think I have an idea of what happened.

Let me roll back to when I ran out of space in rootfs.

Did not mention it but I got a line that stated:
* parse_from_stream_nomalloc: Missing new line character at end of file!

I solved* the problem by doing some basic gparted on the WD MyBook HDD, that line did not go away. * Not really sure, jury is still out.

Looking around I found a post that gave a solution ...

cp /usr/lib/opkg/status /usr/lib/opkg/status.bak
rm /usr/lib/opkg/status

Edit:
... which did get rid of the message and as I expected, /usr/lib/opkg/status was regenerated once I rebooted.

No. I missread.
The file is status.bak.
Getting old ... 8^/

But now the problem is that this regenerated status file does not contain the same information contained in the original one.

It seems that this status file contains a list of the all packages installed by OpenWRT at the beginning and from then on.

The problem at hand is that when you want to install a package in OpenWRT and there is not enough room in rootfs to do that, somehow /usr/lib/opkg/status gets corrupted.

See the the last two entries of the backed up /usr/lib/opkg/status.bak file:

Package: hostapd-common
Version: 2020-06-08-5a8b3662-41
Depends: libc
Status: install user installed
Architecture: powerpc_464fp
Installed-Time: 1692295891

Package: libpopt0
ABIVersion: 0
Version: 1.16-2
Depen

Just how many entries are missing?

I have no idea.
The system does not automatically backup the original status file before attempting to install or upgrade a package.

Makes sense because it is not needed for the typical OpenWRT installation.

Fortunately, I have a /dev/sda2 image from when I first installed OpenWRT in WD-MBL.

Opening the status file from the image with Pluma shows that the last line number is 1257 but opening the (corrupt) backed up one shows that the last line number is 1748.

What to do now?

Thanks in advance.

Best,

PCL

Hello:

I acted on a hunch.

For whatever reason, the idea of a /usr/lib/opkg/status file with a large number of missing lines made little sense to me, so I set about editing status.bak, adding what seemed to be the missing data to the last package entry on the list.

So, after some trial and error ...

Package: libpopt0
ABIVersion: 0
Version: 1.16-2
Depen

... became:

Package: libpopt0
ABIVersion: 0
Version: 1.16-2
Depends: libc, librt, libpthread
Provides: libpopt
Status: install user installed
Architecture: powerpc_464fp
Auto-Installed: yes

I'm happy to report that everything is (apparently) back to normal and I have been able to install iperf3 with no errors.

~# opkg install iperf3
Installing iperf3 (3.10.1-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/powerpc_464fp/packages/iperf3_3.10.1-1_powerpc_464fp.ipk
Configuring iperf3.
~#

Now I need to write up a script that will save a copy of /usr/lib/opkg/status somewhere at boot time, just in case.

Thanks for your input.
Best,

PCL

1 Like

I see you just posted a good update just before I was finishing the following reply. It may be useful / interesting to you.
Is Package: libpopt0 part of what you were installing when the storage filled up? Hopefully so and it was trying to append the file. You could look at dependencies / dependents to make sure no other pieces are missing.

Original reply:
I'm no dev nor an expert but I have tinkered around with opkg a bit. I even wrote a script to produce a list of installed packages excluding all the dependent packages that can then be fed to unattended sysupgrade or the firmware selector to have a reasonably short list to paste, but it depends on the opkg files so wouldn't help you much.

I just checked a backup and it does not include files in /usr/lib/opkg/* and I assume yours is the same.
I have added that to the backup include list in the past though.

Hopefully you have a list of installed packages documented.

On quick thought, try to piece together a list of packages from:
the files in /usr/lib/opkg/info/,
your status file from the initial installation,
the config files in /etc/ ( and elsewhere if they exist),
look through the files in /bin , /sbin , /usr/lib/* etc for evidence of what is installed.

You may be in for re-installing from scratch to get this all sorted. If so, consider upgrading to a newer version.

Good luck!

Hello:

... libpopt0 part of what you were installing when the storage filled up?
No idea. I think I was trying to install iperf3 (?).

... look at dependencies / dependents to make sure no other pieces are missing.
In my Linux box, I rely on apt install -f for that.
Don't know how to solve that in OpenWRT.

... a list of installed packages documented.
Nope. 8^/

... piece together a list of packages from:
... files in /usr/lib/opkg/info/,
... status file from the initial installation,
... config files in /etc/ ( and elsewhere if they exist),
... files in /bin , /sbin , /usr/lib/* etc for evidence ...
Yes, I'll have a look at those.
For the moment, things work as before.
Thanks for the heads up.

... re-installing from scratch to get this all sorted.
Hope not.

In any case, I really don't think a newer OpenWRT version (save some heavy security fix or an updated version of the ibm_emac driver) will do anything much for this outdated hardware. 20MiB/s between two 1000baseT ports is quite a limiting factor for anything but cold storage, if that.

Thanks for your input.

Best,

PCL

1 Like

You are welcome.