openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.36k stars 2.53k forks source link

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

Open dannil opened 1 week ago

dannil commented 1 week ago

Steps to reproduce:

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

Actual behavior:

Expected behavior:

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 commented 1 week ago

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.

systemcrash commented 1 week ago

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

jow- commented 1 week ago

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.

feckert commented 1 week ago

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 commented 1 week ago

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.

dannil commented 1 week ago

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=''
feckert commented 1 week ago

Patch is on the way https://patchwork.ozlabs.org/project/openwrt/patch/20241025090410.66601-1-fe@dev.tdt.de/

systemcrash commented 6 days ago

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

systemcrash commented 3 days ago

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

dannil commented 4 hours ago

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?

systemcrash commented 4 hours ago

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