odedlaz / ax3600-files

43 stars 18 forks source link

Merge into upstream? #5

Closed Neustradamus closed 3 years ago

Neustradamus commented 3 years ago

Hello @odedlaz,

Can you look forks?

@eisaev: Good to harmonize all?

eisaev commented 3 years ago

One note about my changes: crash/crash_unlock.img in my fork has been changed for the AC2350 model and this file needs to be either moved to another folder or renamed.

odedlaz commented 3 years ago

I can do that. A few questions:

  1. why did you bump the python version to 3.7?
  2. Can you explain the changes in this commit? these calculations should work for AX1800+AX3600. Do they break for AC2350? If they do, I can add a model directive.

https://github.com/eisaev/ax3600-files/commit/2c3e9afe1b3b2e3530eb90ba3e0ff525d81c67a9#diff-364c0caef5400e7d66152631df9cdf99b524c8e5340677a7c703e71aa5dd146dR105

On Sat, 28 Aug 2021 at 19:38 Evgeniy Isaev @.***> wrote:

One note about my changes: crash/crash_unlock.img in my fork has been changed for the AC2350 model and this file needs to be either moved to another folder or renamed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/odedlaz/ax3600-files/issues/5#issuecomment-907651419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUJOT7I2HULT46RTINUSU3T7EGI3ANCNFSM5C7HZYQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

eisaev commented 3 years ago
  1. The python version has bumped because support for version 3.6 will end in December 2021 (see https://devguide.python.org/#status-of-python-branches).
    • The old code broke on values containing the equality symbol:
    • header = dict((x.decode().split("=") for x in raw_header))
    • header = dict((x.decode().split("=", 1) for x in raw_header))
      
      For example: `bootargs: board=AP152 console=ttyS0,115200  rootfstype=squashfs,jffs2 noinitrd miboot=firmware0 uart_en=0`
    • The AC2350 uses a different byte order (big-endian vs little-endian). Because of this, the checksum in the output file must be written in reverse order:
    • new_raw_crc32 = bytes.fromhex(crc32.calculate(data_without_crc32)[len("0x"):])
    • new_raw_crc32 = bytes.fromhex(crc32.calculate(data_without_crc32)[len("0x"):])[::-1]
      
      For example: `D0 9D 2B AD` vs `AD 2B 9D D0`
odedlaz commented 3 years ago

Got it. I’ll rebase the changes and add a flag indicating the model so we’ll be able to create model-specific code-paths (like byte-order, etc’)

On Wed, 1 Sep 2021 at 9:55 Evgeniy Isaev @.***> wrote:

  1. The python version has bumped because support for version 3.6 will end in December 2021 (see https://devguide.python.org/#status-of-python-branches). 2.1. The old code broke on values containing the equality symbol:
  • header = dict((x.decode().split("=") for x in raw_header))
  • header = dict((x.decode().split("=", 1) for x in raw_header))

For example: bootargs: board=AP152 console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd miboot=firmware0 uart_en=0 2.2 The AC2350 uses a different byte order (big-endian vs little-endian). Because of this, the checksum in the output file must be written in reverse order:

  • new_raw_crc32 = bytes.fromhex(crc32.calculate(data_without_crc32)[len("0x"):])
  • new_raw_crc32 = bytes.fromhex(crc32.calculate(data_without_crc32)[len("0x"):])[::-1]

For example: D0 9D 2B AD vs AD 2B 9D D0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/odedlaz/ax3600-files/issues/5#issuecomment-909974155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUJOT6IYHZBAO2M66NVHHTT7XE43ANCNFSM5C7HZYQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

odedlaz commented 3 years ago

@eisaev , I wasn't able to rebase since I wanted to introduce more changes. Can you please take a look at https://github.com/odedlaz/ax3600-files/commit/7a958c1387eaf336c323537317aceb1e33d2d995, https://github.com/odedlaz/ax3600-files/commit/99dcd48db1944b3afa8d0b9dc06a297177cb5083 & https://github.com/odedlaz/ax3600-files/commit/346c7a623897155d465f979d60aa1ec34caffbca?

@Neustradamus, I've merged the above to master. They should take care of the issues you raised. I'm closing this. Please open another issue if I missed something!

Thanks everyone of contributing!!!!

Neustradamus commented 2 years ago

Hello all,

Have you an idea if there will have a PR for have AX3600 compatibility in OpenWrt?

odedlaz commented 2 years ago

@Neustradamus , not sure I follow. can you elaborate?

Neustradamus commented 2 years ago

@odedlaz: A PR to add support of AX3600 in OpenWrt: