Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1583 - Netgear WNDR3800 rejects factory image due to long version ID (likely 3700v1,v2, others?) #6611

Closed
openwrt-bot opened this issue Jun 9, 2018 · 0 comments
Labels

Comments

@openwrt-bot
Copy link

hnyman:

WNDR3800 rejects Openwrt factory images if the Openwrt version string is too long. Up-to-date git version 2.17.1 generates too long build version ID for openwrt-18.06 and master.

I tested only WNDR3800, but I assume that the same goes for other Netgear routers using the TFTP recovery mode.

I can fix my own build by forcing a shorter git hash in getver.sh

TFTP log of r7161-c8677ca89e:

Bytes transferred = 6946949 (6a0085 hex) HW ID on board: 29763654+16+128 HW ID on image: 29763654+16+128 Firmware Image HW ID matched Board HW ID

MODEL ID on board: WNDR3800
MODEL ID on image:
Firmware Image MODEL ID do not match Board model ID
Board MODEL ID mismatch,it is forbidden to be written to flash!!

Header:

device:WNDR3800 version:VOpenWrt.r7161-c8677ca89e region: hd_id:29763654+16+128

TFTP log of r7161-c8677ca:

Bytes transferred = 6619269 (650085 hex) HW ID on board: 29763654+16+128 HW ID on image: 29763654+16+128 Firmware Image HW ID matched Board HW ID

MODEL ID on board: WNDR3800
MODEL ID on image: WNDR3800
Firmware Image MODEL ID matched Board model ID

Header:

device:WNDR3800 version:VOpenWrt.r7161-c8677ca region: hd_id:29763654+16+128

Otherwise exactly same build, but shorted hash forced in scripts/getver.sh

Does not work: master device:WNDR3800 version:VOpenWrt.r7161-c8677ca89e region: hd_id:29763654+16+128 18.06 device:WNDR3800 version:VOpenWrt.r6995-ba204d941c region: hd_id:29763654+16+128 Works: master my build (short hash) device:WNDR3800 version:VOpenWrt.r7161-c8677ca region: hd_id:29763654+16+128 17.01 my build device:WNDR3800 version:VLEDE.r3898-4a38c0cad5 region: hd_id:29763654+16+128 master buildbot: device:WNDR3800 version:VOpenWrt.r7161-c8677ca region: hd_id:29763654+16+128 18.06 buildbot: device:WNDR3800 version:VOpenWrt.r7009-48c5d6a region: hd_id:29763654+16+128 17.01 buildbot: device:WNDR3800 version:VLEDE.r3909-b6a1f43 region: hd_id:29763654+16+128

Based on that I determine that the field "version" has a maximum length that will get exceeded in buildhosts with up-to-date git 2.17

Background:

the "factory" image of WNDR3800 built by me in Ubuntu 18.04 for master or 18.06 does not install into the router in the TFTP flash mode. But the factory image for 17.01 installs ok, and so do buildbot snapshots. All of them install ok as sysupgrades, so it is about the factory image header

The error seems to be related to the router model detection in the header. For some reason the model detection goes wrong, although the model itself is quite similar way in the image header. It seems that the "version" field's length is restricted and we are now surpassing that. That field itself is not even mentioned in the TFTP console log.

The only practical difference between for the image generation in my build (in Ubuntu-18.06) and buildbot (some older hosts) is the underlying git. The new git versions generates slightly longer version ID by default as the hash is shown as 10 digits instead of 7. So it is possible that one other string in the header is too long. I will test the idea, but strange.
EDIT: my guess proved to be right.

I can fix my own build by forcing a shorter git hash in getver.sh

--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -40,7 +40,7 @@ try_git() {
REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
fi

  •           REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}"
    
  •           REV="${REV:+r$REV-$(git log -n 1 --format="%h" --abbrev=7 $UPSTREAM_BASE)}"
    
              ;;
      esac
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant