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

Making new package from DDD binary not working #19

Open
Maddy-Hatter opened this issue May 6, 2024 · 1 comment
Open

Making new package from DDD binary not working #19

Maddy-Hatter opened this issue May 6, 2024 · 1 comment

Comments

@Maddy-Hatter
Copy link

Hello!
Got the following issue while trying to make packages for my Goggles V2 using Docker on Windows
I put the firmware of the version I need in /firmware and ran the command from documentation. Any ideas how to solve?
Thanks in advance.
The output:

PS D:\MyDocs\GitHub\butter\packager> docker run -v ${PWD}\firmwares:/app/firmwares -v ${PWD}\packages:/app/packages fpvwtf/butter-packager
mkdir -p tmp/
cd tmp/ && node ../extractor.js ../firmwares/V01.02.0020_gl170_dji_system.bin ../packages/
gl170
tar -xvf ../firmwares/V01.02.0020_gl170_dji_system.bin -C V01.02.0020_gl170_dji_system
gl170.cfg.sig
gl170_2803_v03.00.01.34_20190919.pro.fw.sig
gl170_2805_v10.00.20.61_20210820.pro.fw.sig
decrypting .sig file: ../../tmp/V01.02.0020_gl170_dji_system/gl170_2805_v10.00.20.61_20210820.pro.fw.sig
cwd is /app/packages/gl170_01.02.0020_recovery
python /app/deps/dji-firmware-tools/dji_imah_fwsig.py -vv -f -k UFIE-2020-04 -u -i ../../tmp/V01.02.0020_gl170_dji_system/gl170_2805_v10.00.20.61_20210820.pro.fw.sig
../../tmp/V01.02.0020_gl170_dji_system/gl170_2805_v10.00.20.61_20210820.pro.fw.sig: Warning: 'PRAK' matches multiple keys; using first, 'PRAK-2018-01'
../../tmp/V01.02.0020_gl170_dji_system/gl170_2805_v10.00.20.61_20210820.pro.fw.sig: Key choices: PRAK-2018-01, PRAK-2020-01, PRAK-2019-09, PRAK-2017-12, PRAK-2017-08, PRAK-2017-01
../../tmp/V01.02.0020_gl170_dji_system/gl170_2805_v10.00.20.61_20210820.pro.fw.sig: Warning: Image file head signature verification failed. Continuing anyway.
Decryption successful
set -e
    python /app/deps/sdat2img/sdat2img.py system.transfer.list  system.new.dat  system.img.raw
    img2simg system.img.raw system.img
    rm system.img.raw
set -e
    python /app/deps/sdat2img/sdat2img.py vendor.transfer.list  vendor.new.dat  vendor.img.raw
    img2simg vendor.img.raw vendor.img
    rm vendor.img.raw
set -e
    sudo rm -rf mount
    mkdir -p mount
    rm -rf upgrade_raw.img

    mkdir -p mount/part_a
    mkdir -p mount/part_b
    mkdir -p mount/debugimgs
    ln -s /blackbox/upgrade/part_a  mount/backup
    ln -s /blackbox/upgrade/part_b  mount/signimgs
    cp /app/tmp/V01.02.0020_gl170_dji_system/gl170.cfg.sig mount/part_a/
    cp /app/tmp/V01.02.0020_gl170_dji_system/gl170.cfg.sig mount/part_b/
    mke2fs -d mount/ -b 4096 -T ext4 upgrade_raw.img 128000
    tune2fs -c0 -i0 -O ^metadata_csum upgrade_raw.img
    #cp upgrade_raw.img upgrade.img
    img2simg upgrade_raw.img upgrade.img
    rm upgrade_raw.img
mke2fs 1.46.5 (30-Dec-2021)
set_inode_xattr: Operation not supported while listing attributes of "mount/"
populate_fs2: Operation not supported while copying xattrs on root directory
mke2fs: Operation not supported while populating file system
node:child_process:960
    throw err;
    ^

Error: Command failed: set -e
    sudo rm -rf mount
    mkdir -p mount
    rm -rf upgrade_raw.img

    mkdir -p mount/part_a
    mkdir -p mount/part_b
    mkdir -p mount/debugimgs
    ln -s /blackbox/upgrade/part_a  mount/backup
    ln -s /blackbox/upgrade/part_b  mount/signimgs
    cp /app/tmp/V01.02.0020_gl170_dji_system/gl170.cfg.sig mount/part_a/
    cp /app/tmp/V01.02.0020_gl170_dji_system/gl170.cfg.sig mount/part_b/
    mke2fs -d mount/ -b 4096 -T ext4 upgrade_raw.img 128000
    tune2fs -c0 -i0 -O ^metadata_csum upgrade_raw.img
    #cp upgrade_raw.img upgrade.img
    img2simg upgrade_raw.img upgrade.img
    rm upgrade_raw.img
mke2fs 1.46.5 (30-Dec-2021)
set_inode_xattr: Operation not supported while listing attributes of "mount/"
populate_fs2: Operation not supported while copying xattrs on root directory
mke2fs: Operation not supported while populating file system

    at checkExecSyncError (node:child_process:885:11)
    at execSync (node:child_process:957:15)
    at exec (/app/extractor.js:44:12)
    at Object.<anonymous> (/app/extractor.js:132:5)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
    at Module.load (node:internal/modules/cjs/loader:1125:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(409) [Uint8Array] [
       67, 114, 101,  97, 116, 105, 110, 103,  32, 114, 101, 103,
      117, 108,  97, 114,  32, 102, 105, 108, 101,  32, 117, 112,
      103, 114,  97, 100, 101,  95, 114,  97, 119,  46, 105, 109,
      103,  10,  67, 114, 101,  97, 116, 105, 110, 103,  32, 102,
      105, 108, 101, 115, 121, 115, 116, 101, 109,  32, 119, 105,
      116, 104,  32,  49,  50,  56,  48,  48,  48,  32,  52, 107,
       32,  98, 108, 111,  99, 107, 115,  32,  97, 110, 100,  32,
       51,  50,  48,  48,  48,  32, 105, 110, 111, 100, 101, 115,
       10,  70, 105, 108,
      ... 309 more items
    ],
    Buffer(244) [Uint8Array] [
      109, 107, 101,  50, 102, 115,  32,  49,  46,  52,  54,  46,
       53,  32,  40,  51,  48,  45,  68, 101,  99,  45,  50,  48,
       50,  49,  41,  10, 115, 101, 116,  95, 105, 110, 111, 100,
      101,  95, 120,  97, 116, 116, 114,  58,  32,  79, 112, 101,
      114,  97, 116, 105, 111, 110,  32, 110, 111, 116,  32, 115,
      117, 112, 112, 111, 114, 116, 101, 100,  32, 119, 104, 105,
      108, 101,  32, 108, 105, 115, 116, 105, 110, 103,  32,  97,
      116, 116, 114, 105,  98, 117, 116, 101, 115,  32, 111, 102,
       32,  34, 109, 111,
      ... 144 more items
    ]
  ],
  pid: 33,
  stdout: Buffer(409) [Uint8Array] [
     67, 114, 101,  97, 116, 105, 110, 103,  32, 114, 101, 103,
    117, 108,  97, 114,  32, 102, 105, 108, 101,  32, 117, 112,
    103, 114,  97, 100, 101,  95, 114,  97, 119,  46, 105, 109,
    103,  10,  67, 114, 101,  97, 116, 105, 110, 103,  32, 102,
    105, 108, 101, 115, 121, 115, 116, 101, 109,  32, 119, 105,
    116, 104,  32,  49,  50,  56,  48,  48,  48,  32,  52, 107,
     32,  98, 108, 111,  99, 107, 115,  32,  97, 110, 100,  32,
     51,  50,  48,  48,  48,  32, 105, 110, 111, 100, 101, 115,
     10,  70, 105, 108,
    ... 309 more items
  ],
  stderr: Buffer(244) [Uint8Array] [
    109, 107, 101,  50, 102, 115,  32,  49,  46,  52,  54,  46,
     53,  32,  40,  51,  48,  45,  68, 101,  99,  45,  50,  48,
     50,  49,  41,  10, 115, 101, 116,  95, 105, 110, 111, 100,
    101,  95, 120,  97, 116, 116, 114,  58,  32,  79, 112, 101,
    114,  97, 116, 105, 111, 110,  32, 110, 111, 116,  32, 115,
    117, 112, 112, 111, 114, 116, 101, 100,  32, 119, 104, 105,
    108, 101,  32, 108, 105, 115, 116, 105, 110, 103,  32,  97,
    116, 116, 114, 105,  98, 117, 116, 101, 115,  32, 111, 102,
     32,  34, 109, 111,
    ... 144 more items
  ]
}

Node.js v20.1.0
make: *** [Makefile:36: packages/V01.02.0020_gl170_dji_system_recovery] Error 1
@Maddy-Hatter Maddy-Hatter changed the title Making new package from DDD binary notworking Making new package from DDD binary not working May 6, 2024
@j005u
Copy link
Contributor

j005u commented May 6, 2024

I did less testing using a Windows filesystem and command line than I did from inside WSL and using the WSL virtual ext4 filesystem.

I think the issue might be related to trying to create an ext4 file system out of a Windows mount, which confuses things somewhere along the way.

You could:

  • Try moving moving your input and output folders inside a WSL linux users home directory, rather than the Windows drive and calling docker from WSL
  • Remove the contents of this if statement here which would result in the upgrade partition image not being created. This isn't necessary strictly speaking, it's only needed so the goggles software knows it's V01.02.0020. You'll also need to delete the appropriate line from the partitions file that's created in the resulting output butter package

Sorry this is kinda yank, but with DJI ceasing to release new firmwares for the old platforms I don't see much of a point in putting effort into polishing these scripts.

Why do you need V01.02.0020 anyway? V01.07.0000 has all the compatibility and no known downsides afaik?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants