Nu3001 / xdAuto

Primary repository to hold documentation
6 stars 1 forks source link

Missing privateKey.bin ? #7

Closed jhansche closed 8 years ago

jhansche commented 8 years ago
  running:  drmsigntool /var/folders/wc/rw59qq_x7ngbzvjr8yby50pr0000gn/T/tmp27a1MV build/target/product/security/privateKey.bin
Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 1032, in <module>
    main(sys.argv[1:])
  File "./build/tools/releasetools/ota_from_target_files", line 1000, in main
    WriteFullOTAPackage(input_zip, output_zip)
  File "./build/tools/releasetools/ota_from_target_files", line 459, in WriteFullOTAPackage
    OPTIONS.input_tmp, "RECOVERY")
  File "/Volumes/android/xdauto/build/tools/releasetools/common.py", line 350, in GetBootableImage
    info_dict))
  File "/Volumes/android/xdauto/build/tools/releasetools/common.py", line 320, in BuildBootableImage
    p3 = Run(sign_cmd)
  File "/Volumes/android/xdauto/build/tools/releasetools/common.py", line 68, in Run
    return subprocess.Popen(args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
make: *** [out/target/product/rk3188/rk3188-ota-eng.jhansche.zip] Error 1

This fails (in my case) because drmsigntool is a Linux binary (I don't understand why it ends up in out/host/darwin-x86/bin/drmsigntool if it isn't actually a darwin tool...?)

I tried to copy the files (drmsigntool, the tmp file, and the privateKey.bin file) to a linux host to get passed this, but the privateKey.bin file does not exist.

$ ./drmsigntool tmp27a1MV key.bin
src_path: tmp27a1MV, private_key_path: key.bin
can't open file key.bin!
no find private key, so not sign boot.img!

Is that file supposed to be part of the repo? If not, is it something we should be generating on our own (and if we should generate it, can we add that step to a make file)?

This is the very end of the build process, so hopefully once I can figure this out, I should be able to test installing it on my head unit, and then we can say that the ROM builds successfully on Mac OS X :X

jhansche commented 8 years ago

That was while running make otapackage

jhansche commented 8 years ago

Just to confirm, I spun up a linux VM to do the full build process, and even without my hacks of moving the files from OS X machine to a temp linux machine, I'm still seeing this error (so it does not appear to get auto-generated, and does not exist in the git repo):

building image from target_files RECOVERY...
  running:  mkbootfs -f /tmp/targetfiles-Y6bToh/META/recovery_filesystem_config.txt /tmp/targetfiles-Y6bToh/RECOVERY/RAMDISK
  running:  minigzip
  running:  mkbootimg --kernel /tmp/targetfiles-Y6bToh/RECOVERY/kernel --ramdisk /tmp/tmpqFMjIQ --output /tmp/tmpVefB6J
  running:  drmsigntool /tmp/tmpVefB6J build/target/product/security/privateKey.bin
src_path: /tmp/tmpVefB6J, private_key_path: build/target/product/security/privateKey.bin
can't open file build/target/product/security/privateKey.bin!
no find private key, so not sign boot.img!

Should build/target/product/security/privateKey.bin be in the git repo? Or should I generate a new one myself (and if so, how)?

jhansche commented 8 years ago

So, I guess I was just chasing a ghost... I thought that step was necessary, but apparently it's not. My linux VM caught up and finished the build, and the resulting ota zip file worked fine (renamed to update.zip).

The only issue I saw was that every time it rebooted, it re-applied the update -- because the SD card was still in the slot. After about 4 times doing the update in recovery, I ejected the SD card, then rebooted, and it seems like it worked fine.

Unfortunately, most of the other issues I was having appear to still be happening even with xdAuto :/ So I guess I'll open some additional issues to track those