luci icon indicating copy to clipboard operation
luci copied to clipboard

luci-mod-status: firmware version should include revision number

Open dannil opened this issue 1 year ago • 8 comments

Steps to reproduce:

  1. Go to: Status -> Overview
  2. Notice that the Firmware version field does not include a revision number.

Actual behavior:

  • Firmware version doesn't include the revision number.

Expected behavior:

  • Firmware version should include the revision number.

Additional Information:

The output of ubus call system board was changed in https://github.com/openwrt/procd/commit/0f88a52dc8a5451bd7f1f33ffff3b1ba3db98174 which introduced this problem. First discovered and discussed on the forum at https://forum.openwrt.org/t/strange-firmware-version-string/213745

Here's the SNAPSHOT r27893 at point in time of writing this which doesn't work:

{
        "kernel": "6.6.57",
        "hostname": "labmouse",
        "system": "AMD Ryzen 7 3700X 8-Core Processor",
        "model": "VMware, Inc. VMware Virtual Platform",
        "board_name": "vmware-inc-vmware-virtual-platform",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "description": "OpenWrt SNAPSHOT",
                "revision": "r27893-b6bbc76c0b",
                "target": "x86/64",
                "builddate": "1729635115"
        }
}

Screenshot_10

and here's a device I run r27687 on which does work

{
        "kernel": "6.6.54",
        "hostname": "JetFuel",
        "system": "ARMv8 Processor rev 4",
        "model": "Linksys MX4200v1",
        "board_name": "linksys,mx4200v1",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r27687-b62e6f5beb",
                "target": "qualcommax/ipq807x",
                "description": "OpenWrt SNAPSHOT r27687-b62e6f5beb"
        }
}

Screenshot_11

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r27893-b6bbc76c0b'
DISTRIB_TARGET='x86/64'
DISTRIB_ARCH='x86_64'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r27893-b6bbc76c0b'
DISTRIB_TAINTS=''

dannil avatar Oct 23 '24 16:10 dannil

To get to parity as before I assume we would need to change boardinfo.release.description to boardinfo.release.description + ' ' + boardinfo.release.revision at https://github.com/openwrt/luci/blob/c85af3d7618b55c499ce4bf58e3896068bd413ae/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js#L41 I'm a bit unsure where the stable versions end up but if it's baked in to the description as "description": "OpenWrt 24.10" (assuming that'll be the next stable version) that should work.

dannil avatar Oct 23 '24 16:10 dannil

Yeah.👍 if we depend on the new file, this is likely a good update. Feeling up for a PR?

systemcrash avatar Oct 23 '24 18:10 systemcrash

Maybe the OpenWrt side change should be fixed, the commit sort of implies that the intention was to provide the same data and there's probably other downstream users affected by this as well.

jow- avatar Oct 23 '24 22:10 jow-

Unfortunately, I didn't know that information was missing here. The question is whether I should fix this in the procd as suggested by @jow- or in the LuCI as suggested by @dannil.

I would fix this in the procd. And would replace PRETTY_NAME with the information from OPENWRT_RELESE ? Does the value CONFIG_VERSION_CODE is having the correct value SNAPSHOT?

I don't have access to any system at the moment as I'm travelling. So can someone send me the output of /usr/lib/os-release and /etc/openwrt_release, then we can compare and check what the correct value is.

feckert avatar Oct 24 '24 06:10 feckert

Now I was too hasty. I have just seen that these two values DISTRIB_DESCRIPTION in /etc/openwrt_release and OPENWRT_RELEASE in /usr/lib/os-release are the same, so I will create a Patch and use OPENWRT_RELEASE in procd to fix this.

feckert avatar Oct 24 '24 06:10 feckert

I don't have access to any system at the moment as I'm travelling. So can someone send me the output of /usr/lib/os-release and /etc/openwrt_release, then we can compare and check what the correct value is.`

@feckert if you still need it.

root@labmouse:~# cat /usr/lib/os-release
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r27893-b6bbc76c0b"
OPENWRT_BOARD="x86/64"
OPENWRT_ARCH="x86_64"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r27893-b6bbc76c0b"
OPENWRT_BUILD_DATE="1729635115"

root@labmouse:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r27893-b6bbc76c0b'
DISTRIB_TARGET='x86/64'
DISTRIB_ARCH='x86_64'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r27893-b6bbc76c0b'
DISTRIB_TAINTS=''

dannil avatar Oct 24 '24 15:10 dannil

Patch is on the way https://patchwork.ozlabs.org/project/openwrt/patch/[email protected]/

feckert avatar Oct 25 '24 09:10 feckert

I'm going to leave the issue open for visibility - at least until the patch is merged.

systemcrash avatar Oct 25 '24 20:10 systemcrash

@feckert did you also send a PR to repo also?

systemcrash avatar Oct 29 '24 18:10 systemcrash

24.10 has now been branched without this fix being merged to procd and at least since 19.07 it hasn't had stable branches so backporting doesn't seem trivial in that repo. How do we go about solving this issue now?

dannil avatar Nov 01 '24 14:11 dannil

Stay the course. There are a few rc to go yet.

systemcrash avatar Nov 01 '24 14:11 systemcrash

@feckert any update on the patch?

systemcrash avatar Nov 05 '24 23:11 systemcrash

@feckert did you also send a PR to repo also?

No. I only send this to patchwork

@feckert any update on the patch?

No. Sorry

@systemcrash Lets highlight the core maintainer to merge the procd fix for this issue.

@jow- @hauke Could anyone merge this into procd? To Fix this issue?

feckert avatar Nov 06 '24 07:11 feckert

@feckert I will take care of that. Just one question the PRETTY_NAME was never used? It got dropped?

Ansuel avatar Nov 06 '24 08:11 Ansuel

@feckert I will take care of that. Just one question the PRETTY_NAME was never used? It got dropped?

@Ansuel Correct PRETTY_NAME was never used in the old implementation.

Before my change procd reads the variable DISTRIB_DESCRIPTION from /etc/openwrt_release. After my change procd reads the varialbe PRETTY_NAME from /usr/lib/os-release.

This is not correct. Unfortunately, I overlooked that. The same information can be found in the variable OPENWRT_RELEASE in /usr/lib/os-release. The patch for procd fixes this. So we have the same information available as before.

feckert avatar Nov 06 '24 08:11 feckert

Fixed procd pushed. This will be magically fixed once updated packages gets built.

Ansuel avatar Nov 06 '24 09:11 Ansuel

@Ansuel Thank you for taking care of this.

feckert avatar Nov 06 '24 10:11 feckert

Thanks @Ansuel

systemcrash avatar Nov 06 '24 10:11 systemcrash