GrapheneOS-Archive / legacy_bugtracker

See the new issue tracker for GrapheneOS at https://github.com/GrapheneOS/os_issue_tracker.
112 stars 11 forks source link

Another build error at the final stages #839

Closed Rudd-O closed 6 years ago

Rudd-O commented 6 years ago

Seems it cannot find the verity key? But I know it's there in the build at least.

+ return 0
+ rm -rf 'out/release-*'
+ KEY_DIR=keys/marlin
+ OUT=out/release-marlin-2018.01.25.19
+ mkdir -p out/release-marlin-2018.01.25.19
+ source device/common/clear-factory-images-variables.sh
++ unset BOOTLOADER
++ unset BOOTLOADERFILE
++ unset BOOTLOADERSRC
++ unset BUILD
++ unset CDMARADIO
++ unset CDMARADIOFILE
++ unset DEVICE
++ unset ERASE
++ unset PRODUCT
++ unset RADIO
++ unset RADIOFILE
++ unset RADIOSRC
++ unset RADIOFILE
++ unset SLEEPDURATION
++ unset SRCPREFIX
++ unset UNLOCKBOOTLOADER
++ unset VERSION
++ unset TWINBOOTLOADERS
++ unset XLOADER
++ unset XLOADERSRC
+ [[ marlin == bullhead ]]
+ [[ marlin == angler ]]
+ [[ marlin == marlin ]]
++ get_radio_image bootloader google_devices/marlin
++ grep -Po 'require version-bootloader=\K.+' vendor/google_devices/marlin/vendor-board-info.txt
++ tr '[:upper:]' '[:lower:]'
+ BOOTLOADER=8996-012001-1711091153
++ get_radio_image baseband google_devices/marlin
++ grep -Po 'require version-baseband=\K.+' vendor/google_devices/marlin/vendor-board-info.txt
++ tr '[:upper:]' '[:lower:]'
+ RADIO=8996-130091-1710201747
+ PREFIX=aosp_
+ BUILD=2018.01.25.19
++ grep -Po 'export BUILD_ID=\K.+' build/core/build_id.mk
++ tr '[:upper:]' '[:lower:]'
+ VERSION=opm1.171019.012
+ DEVICE=marlin
+ PRODUCT=marlin
+ TARGET_FILES=marlin-target_files-2018.01.25.19.zip
+ [[ marlin != hikey* ]]
+ [[ marlin != taimen ]]
+ [[ marlin != walleye ]]
+ VERITY_SWITCHES=(--replace_verity_public_key "$KEY_DIR/verity_key.pub" --replace_verity_private_key "$KEY_DIR/verity" --replace_verity_keyid "$KEY_DIR/verity.x509.pem")
+ [[ marlin == bullhead ]]
+ build/tools/releasetools/sign_target_files_apks -o -d keys/marlin --replace_verity_public_key keys/marlin/verity_key.pub --replace_verity_private_key keys/marlin/verity --replace_verity_keyid keys/marlin/verity.x509.pem out/target/product/marlin/obj/PACKAGING/target_files_intermediates/aosp_marlin-target_files-2018.01.25.19.zip out/release-marlin-2018.01.25.19/marlin-target_files-2018.01.25.19.zip
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
rewriting BOOT/RAMDISK/default.prop:
rewriting BOOT/RAMDISK/prop.default:
  replace:  ro.bootimage.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.bootimage.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
  replace:  ro.build.display.id=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 test-keys
     with:  ro.build.display.id=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19
  replace:  ro.build.tags=test-keys
     with:  ro.build.tags=release-keys
  replace:  ro.build.description=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 test-keys
     with:  ro.build.description=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 release-keys
  replace:  ro.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
  replace:  ro.vendor.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.vendor.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
rewriting ROOT/default.prop:
    signing: BasicDreams.apk                       (keys/marlin/releasekey)
    signing: Bluetooth.apk                         (keys/marlin/platform)
    signing: BluetoothMidiService.apk              (keys/marlin/platform)
    signing: BookmarkProvider.apk                  (keys/marlin/releasekey)
    signing: BuiltInPrintService.apk               (keys/marlin/releasekey)
    signing: Camera2.apk                           (keys/marlin/releasekey)
    signing: CaptivePortalLogin.apk                (keys/marlin/platform)
    signing: CarrierDefaultApp.apk                 (keys/marlin/platform)
    signing: CertInstaller.apk                     (keys/marlin/platform)
    signing: CompanionDeviceManager.apk            (keys/marlin/releasekey)
NOT signing: CtsShimPrebuilt.apk
    signing: DeskClock.apk                         (keys/marlin/releasekey)
    signing: DownloadProviderUi.apk                (keys/marlin/media)
    signing: EasterEgg.apk                         (keys/marlin/platform)
    signing: Email.apk                             (keys/marlin/releasekey)
    signing: Etar-Calendar.apk                     (keys/marlin/releasekey)
    signing: ExactCalculator.apk                   (keys/marlin/releasekey)
    signing: ExtShared.apk                         (keys/marlin/platform)
    signing: F-Droid.apk                           (keys/marlin/releasekey)
    signing: Gallery2.apk                          (keys/marlin/releasekey)
    signing: HTMLViewer.apk                        (keys/marlin/releasekey)
    signing: KeyChain.apk                          (keys/marlin/platform)
    signing: LatinIME.apk                          (keys/marlin/shared)
    signing: LiveWallpapersPicker.apk              (keys/marlin/platform)
    signing: Music.apk                             (keys/marlin/releasekey)
    signing: NfcNci.apk                            (keys/marlin/platform)
    signing: OpenWnn.apk                           (keys/marlin/releasekey)
    signing: PacProcessor.apk                      (keys/marlin/platform)
    signing: PdfViewer.apk                         (keys/marlin/releasekey)
    signing: PhotoTable.apk                        (keys/marlin/releasekey)
    signing: PicoTts.apk                           (keys/marlin/releasekey)
    signing: PresencePolling.apk                   (keys/marlin/platform)
    signing: PrintRecommendationService.apk        (keys/marlin/releasekey)
    signing: PrintSpooler.apk                      (keys/marlin/releasekey)
    signing: QuickSearchBox.apk                    (keys/marlin/shared)
    signing: RcsService.apk                        (keys/marlin/platform)
    signing: SafetyRegulatoryInfo.apk              (keys/marlin/releasekey)
    signing: Silence.apk                           (keys/marlin/releasekey)
    signing: Stk.apk                  Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
             (keys/marlin/platform)
    signing: UserDictionaryProvider.apk            (keys/marlin/shared)
    signing: WAPPushManager.apk                    (keys/marlin/releasekey)
    signing: WallpaperBackup.apk                   (keys/marlin/platform)
    signing: WallpaperPicker.apk                   (keys/marlin/releasekey)
    signing: chromium.apk                          (keys/marlin/releasekey)
    signing: offline-calendar.apk                  (keys/marlin/releasekey)
    signing: privacy-friendly-netmonitor.apk       (keys/marlin/releasekey)
rewriting SYSTEM/build.prop:
  replace:  ro.build.display.id=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 test-keys
     with:  ro.build.display.id=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19
  replace:  ro.build.tags=test-keys
     with:  ro.build.tags=release-keys
  replace:  ro.build.description=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 test-keys
     with:  ro.build.description=aosp_marlin-eng 8.1.0 OPM1.171019.012 2018.01.25.19 release-keys
  replace:  ro.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
rewriting SYSTEM/etc/prop.default:
  replace:  ro.bootimage.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.bootimage.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
rewriting SYSTEM/etc/selinux/plat_mac_permissions.xml with new keys.
    signing: framework-res.apk                     (keys/marlin/platform)
    signing: BackupRestoreConfirmation.apk         (keys/marlin/platform)
    signing: BlockedNumberProvider.apk             (keys/marlin/shared)
    signing: CNEService.apk                        (keys/marlin/platform)
    signing: CalendarProvider.apk                  (keys/marlin/releasekey)
    signing: CallLogBackup.apk                     (keys/marlin/shared)
    signing: CarrierConfig.apk                     (keys/marlin/platform)
    signing: CellBroadcastReceiver.apk             (keys/marlin/platform)
    signing: Contacts.apk                          (keys/marlin/shared)
    signing: ContactsProvider.apk                  (keys/marlin/shared)
NOT signing: CtsShimPrivPrebuilt.apk
    signing: DefaultContainerService.apk           (keys/marlin/platform)
    signing: Dialer.apk                            (keys/marlin/shared)
    signing: DocumentsUI.apk                       (keys/marlin/platform)
    signing: DownloadProvider.apk                  (keys/marlin/media)
    signing: EmergencyInfo.apk                     (keys/marlin/platform)
    signing: ExtServices.apk                       (keys/marlin/platform)
    signing: ExternalStorageProvider.apk           (keys/marlin/platform)
    signing: FDroidPrivilegedExtension.apk         (keys/marlin/releasekey)
    signing: FusedLocation.apk                     (keys/marlin/platform)
    signing: InputDevices.apk                      (keys/marlin/platform)
    signing: Launcher3.apk                         (keys/marlin/releasekey)
    signing: ManagedProvisioning.apk               (keys/marlin/platform)
    signing: MediaProvider.apk                     (keys/marlin/media)
    signing: MmsService.apk                        (keys/marlin/platform)
    signing: MtpDocumentsProvider.apk              (keys/marlin/media)
    signing: MusicFX.apk                           (keys/marlin/releasekey)
    signing: OneTimeInitializer.apk                (keys/marlin/releasekey)
    signing: PackageInstaller.apk                  (keys/marlin/platform)
    signing: Provision.apk                         (keys/marlin/platform)
    signing: ProxyHandler.apk                      (keys/marlin/platform)
    signing: Settings.apk                          (keys/marlin/platform)
    signing: SettingsProvider.apk                  (keys/marlin/platform)
    signing: SharedStorageBackup.apk               (keys/marlin/platform)
    signing: Shell.Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
apk                             (keys/marlin/platform)
    signing: StatementService.apk                  (keys/marlin/releasekey)
    signing: StorageManager.apk                    (keys/marlin/releasekey)
    signing: SystemUI.apk                          (keys/marlin/platform)
    signing: Tag.apk                               (keys/marlin/releasekey)
    signing: TeleService.apk                       (keys/marlin/platform)
    signing: Telecom.apk                           (keys/marlin/platform)
    signing: TelephonyProvider.apk                 (keys/marlin/platform)
    signing: VpnDialogs.apk                        (keys/marlin/platform)
    signing: WallpaperCropper.apk                  (keys/marlin/platform)
    signing: qcrilmsgtunnel.apk                    (keys/marlin/platform)
    signing: QAS_DVC_MSP.apk                       (keys/marlin/platform)
    signing: QtiTelephonyService.apk               (keys/marlin/platform)
    signing: RCSBootstraputil.apk                  (keys/marlin/platform)
    signing: SSRestartDetector.apk                 (keys/marlin/platform)
    signing: SecureExtAuthService.apk              (keys/marlin/platform)
    signing: TimeService.apk                       (keys/marlin/platform)
    signing: atfwd.apk                             (keys/marlin/platform)
    signing: colorservice.apk                      (keys/marlin/platform)
    signing: datastatusnotification.apk            (keys/marlin/platform)
    signing: embms.apk                             (keys/marlin/platform)
    signing: fastdormancy.apk                      (keys/marlin/platform)
    signing: ims.apk                               (keys/marlin/platform)
    signing: imssettings.apk                       (keys/marlin/platform)
    signing: radioconfig.apk                       (keys/marlin/platform)
    signing: shutdownlistener.apk                  (keys/marlin/platform)
    signing: vzw_msdc_api.apk                      (keys/marlin/platform)
rewriting VENDOR/build.prop:
  replace:  ro.vendor.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/test-keys
     with:  ro.vendor.build.fingerprint=Android/aosp_marlin/marlin:8.1.0/OPM1.171019.012/2018.01.25.19:eng/release-keys
rewriting VENDOR/etc/selinux/nonplat_mac_permissions.xml with new keys.
    signing: PixelThemeOverlay.apk                 (keys/marlin/platform)
    signing: SysuiDarkThemeOverlay.apk             (keys/marlin/platform)
    signing: framework-res__auto_generated_rro.apk (keys/marlin/platform)
META/otakeys.txt has no keys; using keys/marlin/releasekey.x509.pem for OTA package verification.
Using keys/marlin/releasekey.x509.pem for payload verification.
Replacing verity private key with keys/marlin/verity
Replacing verity public key with keys/marlin/verity_key.pub

++++ boot ++++

building image from target_files BOOT...

++++ system ++++

creating system.img...
Running:  mkuserimg_mke2fs.sh -s /tmp/tmpLtf1kG /tmp/system-_9oD5K.img ext4 / 2147483648 -T 1230768000 -C /tmp/root_fs_config697Z7w.txt -B /tmp/system-yIGr9f.map -L / -U 324e47d2-eee6-5011-a137-965e22be1dc8 -S 904674ae-21eb-5022-bf95-2006c440aa1c /tmp/targetfiles-HGOZiM/META/file_contexts.bin
MKE2FS_CONFIG=./system/extras/ext4_utils/mke2fs.conf E2FSPROGS_FAKE_TIME=1230768000 mke2fs -L / -U 324e47d2-eee6-5011-a137-965e22be1dc8 -E android_sparse,hash_seed=904674ae-21eb-5022-bf95-2006c440aa1c -t ext4 -b 4096 /tmp/system-_9oD5K.img 524288
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 324e47d2-eee6-5011-a137-965e22be1dc8
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912

Allocating group tables:  0/16     done                            
Writing inode tables:  0/16     done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:  0/16     done

E2FSPROGS_FAKE_TIME=1230768000 e2fsdroid -T 1230768000 -C /tmp/root_fs_config697Z7w.txt -B /tmp/system-yIGr9f.map -S /tmp/targetfiles-HGOZiM/META/file_contexts.bin -f /tmp/tmpLtf1kG -a / /tmp/system-_9oD5K.img
failed to find [/verity_key] in canned fs_config
loaded 2901 fs_config entries
Traceback (most recent call last):
  File "build/tools/releasetools/sign_target_files_apks", line 831, in <module>
    common.Cleanup()
  File "/tmp/android-build-root/src/build/make/tools/releasetools/common.py", line 938, in Cleanup
    os.remove(i)
OSError: [Errno 2] No such file or directory: '/tmp/system-_9oD5K.img'
+ exit 1
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

I will attach the full log soon.

Rudd-O commented 6 years ago

Here is the full log. consoleText.txt

Rudd-O commented 6 years ago

There is no verity_key file inside keys/marlin after the execution of generate_verity_key:

open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("keys/marlin/verity.x509.pem", O_RDONLY) = 3
open("keys/marlin/verity_key.pub", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
+++ exited with 0 +++
[user@buildslave-copperhead src]$ ls keys/marlin/
media.pk8  media.x509.pem  platform.pk8  platform.x509.pem  releasekey.pk8  releasekey.x509.pem  shared.pk8  shared.x509.pem  verity_key.pub  verity.pk8  verity.x509.pem

Strace output shows that only verity_key.pub is created when generate_verity_key is run.

Rudd-O commented 6 years ago

Build log that was successful a few months ago:

++++ system ++++

creating system.img...
Running:  build_verity_tree -s 2147483648
16912384
Running:  system/extras/verity/build_verity_metadata.py size 2147483648
32768
Running:  fec -s 2164428800
17117184
Running:  build_verity_tree -s 2130452480
16781312
Running:  system/extras/verity/build_verity_metadata.py size 2130452480
32768
Running:  fec -s 2147266560
16986112
Running:  build_verity_tree -s 2121936896
16715776
Running:  system/extras/verity/build_verity_metadata.py size 2121936896
32768
Running:  fec -s 2138685440
16912384
Running:  build_verity_tree -s 2117677056
16683008
Running:  system/extras/verity/build_verity_metadata.py size 2117677056
32768
Running:  fec -s 2134392832
16879616
Running:  build_verity_tree -s 2115547136
16666624
Running:  system/extras/verity/build_verity_metadata.py size 2115547136
32768
Running:  fec -s 2132246528
16863232
Running:  build_verity_tree -s 2114482176
16658432
Running:  system/extras/verity/build_verity_metadata.py size 2114482176
32768
Running:  fec -s 2131173376
16855040
Running:  build_verity_tree -s 2113949696
16654336
Running:  system/extras/verity/build_verity_metadata.py size 2113949696
32768
Running:  fec -s 2130636800
16855040
Running:  build_verity_tree -s 2113683456
16650240
Running:  system/extras/verity/build_verity_metadata.py size 2113683456
32768
Running:  fec -s 2130366464
16846848
Running:  build_verity_tree -s 2113818624
16650240
Running:  system/extras/verity/build_verity_metadata.py size 2113818624
32768
Running:  fec -s 2130501632
16846848
Running:  build_verity_tree -s 2113884160
16650240
Running:  system/extras/verity/build_verity_metadata.py size 2113884160
32768
Running:  fec -s 2130567168
16846848
Running:  build_verity_tree -s 2113916928
16650240
Running:  system/extras/verity/build_verity_metadata.py size 2113916928
32768
Running:  fec -s 2130599936
16846848
Running:  build_verity_tree -s 2113933312
16654336
Running:  system/extras/verity/build_verity_metadata.py size 2113933312
32768
Running:  fec -s 2130620416
16855040
Running:  build_verity_tree -s 2113941504
16654336
Running:  system/extras/verity/build_verity_metadata.py size 2113941504
32768
Running:  fec -s 2130628608
16855040
Running:  build_verity_tree -s 2113945600
16654336
Running:  system/extras/verity/build_verity_metadata.py size 2113945600
32768
Running:  fec -s 2130632704
16855040
Running:  mkuserimg_mke2fs.sh -s /tmp/tmpgTZl2D /tmp/system-398kur.img ext4 / 2113941504 -T 1230768000 -C /tmp/root_fs_configSTK7_I.txt -B /tmp/system-iOql_c.map -L / /tmp/targetfiles-2aOYw1/META/file_contexts.bin
mke2fs -L / -E android_sparse -t ext4 -b 4096 /tmp/system-398kur.img 516099
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 516099 4k blocks and 129024 inodes
Filesystem UUID: 7d250937-2c8c-4b02-8b6f-f7ea7fc9781f
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912

Allocating group tables:  0/16     done                            
Writing inode tables:  0/16     done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information:  0/16     done

e2fsdroid -T 1230768000 -C /tmp/root_fs_configSTK7_I.txt -B /tmp/system-iOql_c.map -S /tmp/targetfiles-2aOYw1/META/file_contexts.bin -f /tmp/tmpgTZl2D -a / /tmp/system-398kur.img
loaded 2790 fs_config entries
Running:  build_verity_tree -A aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /tmp/system-398kur.img /tmp/tmpPDfXCR_verity_images/verity.img
08fa6abdfcf2c5542eeea21e9bd12ba950a20f5d868863ac189d2dc1c3716058 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7
Running:  system/extras/verity/build_verity_metadata.py build 2113941504 /tmp/tmpPDfXCR_verity_images/verity_metadata.img 08fa6abdfcf2c5542eeea21e9bd12ba950a20f5d868863ac189d2dc1c3716058 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /dev/block/platform/soc/624000.ufshc/by-name/system verity_signer keys/marlin/verity.pk8
['verity_signer', '/tmp/tmphBAbjq.table', 'keys/marlin/verity.pk8', '/tmp/tmpdjzuXJ.sig']
appending /tmp/tmpPDfXCR_verity_images/verity_metadata.img to /tmp/tmpPDfXCR_verity_images/verity.img
Running:  fec -e -p 0 /tmp/system-398kur.img /tmp/tmpPDfXCR_verity_images/verity.img /tmp/tmpPDfXCR_verity_images/verity_fec.img
encoding RS(255, 253) to '/tmp/tmpPDfXCR_verity_images/verity_fec.img' for input files:
    1: '/tmp/system-398kur.img'
    2: '/tmp/tmpPDfXCR_verity_images/verity.img'
appending /tmp/tmpPDfXCR_verity_images/verity_fec.img to /tmp/tmpPDfXCR_verity_images/verity.img
Running:  append2simg /tmp/system-398kur.img /tmp/tmpPDfXCR_verity_images/verity.img

Running:  simg2img /tmp/system-398kur.img /tmp/unsparse_system-398kur.img

Running:  e2fsck -f -n /tmp/unsparse_system-398kur.img
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: 2799/129024 files (0.6% non-contiguous), 322094/516099 blocks
Rudd-O commented 6 years ago

Same build snippet that failed this time around:

++++ system ++++

creating system.img...
Running:  mkuserimg_mke2fs.sh -s /tmp/tmpLtf1kG /tmp/system-_9oD5K.img ext4 / 2147483648 -T 1230768000 -C /tmp/root_fs_config697Z7w.txt -B /tmp/system-yIGr9f.map -L / -U 324e47d2-eee6-5011-a137-965e22be1dc8 -S 904674ae-21eb-5022-bf95-2006c440aa1c /tmp/targetfiles-HGOZiM/META/file_contexts.bin
MKE2FS_CONFIG=./system/extras/ext4_utils/mke2fs.conf E2FSPROGS_FAKE_TIME=1230768000 mke2fs -L / -U 324e47d2-eee6-5011-a137-965e22be1dc8 -E android_sparse,hash_seed=904674ae-21eb-5022-bf95-2006c440aa1c -t ext4 -b 4096 /tmp/system-_9oD5K.img 524288
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 324e47d2-eee6-5011-a137-965e22be1dc8
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912

Allocating group tables:  0/16     done                            
Writing inode tables:  0/16     done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:  0/16     done

E2FSPROGS_FAKE_TIME=1230768000 e2fsdroid -T 1230768000 -C /tmp/root_fs_config697Z7w.txt -B /tmp/system-yIGr9f.map -S /tmp/targetfiles-HGOZiM/META/file_contexts.bin -f /tmp/tmpLtf1kG -a / /tmp/system-_9oD5K.img
failed to find [/verity_key] in canned fs_config
loaded 2901 fs_config entries
Traceback (most recent call last):
  File "build/tools/releasetools/sign_target_files_apks", line 831, in <module>
    common.Cleanup()
  File "/tmp/android-build-root/src/build/make/tools/releasetools/common.py", line 938, in Cleanup
    os.remove(i)
OSError: [Errno 2] No such file or directory: '/tmp/system-_9oD5K.img'
+ exit 1
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

There appears to have been a failure of cleanup as well. But, here's the deal, apparently, the exception that would be hit in this code for that program:

if __name__ == '__main__':
  try:
    main(sys.argv[1:])
  except common.ExternalError, e:
    print
    print "   ERROR: %s" % (e,)
    print
    sys.exit(1)
  finally:
    common.Cleanup()

See that? The " ERROR: " does NOT appear at any point in the execution of the program, as if there was no build error (there may very well be tho).

Rudd-O commented 6 years ago

Strace execution of program shows verity_key to be in the damn root image:

META/otakeys.txt has no keys; using keys/marlin/releasekey.x509.pem for OTA package verification.
Using keys/marlin/releasekey.x509.pem for payload verification.
Replacing verity private key with keys/marlin/verity
Replacing verity public key with keys/marlin/verity_key.pub

++++ boot ++++
--
unlink("/tmp/tmpSQjdRI/dsp")            = 0
lstat("/tmp/tmpSQjdRI/init.rc", {st_mode=S_IFREG|0644, st_size=29114, ...}) = 0
unlink("/tmp/tmpSQjdRI/init.rc")        = 0
lstat("/tmp/tmpSQjdRI/verity_key", {st_mode=S_IFREG|0644, st_size=524, ...}) = 0
unlink("/tmp/tmpSQjdRI/verity_key")     = 0
lstat("/tmp/tmpSQjdRI/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
lstat("/tmp/tmpSQjdRI/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
open("/tmp/tmpSQjdRI/config", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
--
unlink("/tmp/targetfiles-gFts_2/ROOT/dsp") = 0
lstat("/tmp/targetfiles-gFts_2/ROOT/init.rc", {st_mode=S_IFREG|0644, st_size=29114, ...}) = 0
unlink("/tmp/targetfiles-gFts_2/ROOT/init.rc") = 0
lstat("/tmp/targetfiles-gFts_2/ROOT/verity_key", {st_mode=S_IFREG|0644, st_size=524, ...}) = 0
unlink("/tmp/targetfiles-gFts_2/ROOT/verity_key") = 0
lstat("/tmp/targetfiles-gFts_2/ROOT/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
lstat("/tmp/targetfiles-gFts_2/ROOT/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
open("/tmp/targetfiles-gFts_2/ROOT/config", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4
--
stat("/tmp/system-v3pk5k.img", 0x7ffdc9e38980) = -1 ENOENT (No such file or directory)
unlink("/tmp/system-v3pk5k.img")        = -1 ENOENT (No such file or directory)
ts_2/META/file_contexts.bin -f /tmp/tmpSQjdRI -a / /tmp/system-v3pk5k.img
failed to find [/verity_key] in canned fs_config
loaded 2901 fs_config entries
Traceback (most recent call last):
  File "build/tools/releasetools/sign_target_files_apks", line 831, in <module>
Rudd-O commented 6 years ago

Userdebug / user builds work fine. This only fails on eng builds. Release.sh does not seem to work with eng builds. I'm pissed off that nothing mentions this in the Google Android documentation — basically you have to know someone who knows someone, or else you're shit out of luck. The fuck — this makes autotools look nice.

thestinger commented 6 years ago

Well, script/ is entirely our stuff. Google doesn't really document how to do proper signing at all especially on the Pixel and Pixel 2.

Eliminater commented 6 years ago

do you find the culprit ?

thestinger commented 6 years ago

You probably shouldn't be building this anymore as a whole anyway even with the security patches merged in since Android 9.0 is available.