1. 04 Nov, 2019 2 commits
  2. 02 Nov, 2019 17 commits
  3. 01 Nov, 2019 12 commits
  4. 31 Oct, 2019 9 commits
    • Tom Rini's avatar
      azure: Update for python3 and current pytest · 5d80a1a9
      Tom Rini authored
      
      
      Similar to the rework for GitLab-CI and Travis-CI, rework the Azure
      Pipeline to use python3 and requirements.txt to install the necessary
      modules.
      Signed-off-by: Tom Rini's avatarTom Rini <trini@konsulko.com>
      5d80a1a9
    • Sam Protsenko's avatar
      cmd: avb: Support A/B slots · 965ec3ca
      Sam Protsenko authored and Tom Rini's avatar Tom Rini committed
      
      
      Add optional parameter to 'avb verify' sub-command, so that user is able
      to specify which slot to use, in case when user's partitions are
      slotted. If that parameter is omitted, the behavior of 'avb verify' will
      be the same as before, so user API is content.
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      Reviewed-by: default avatarIgor Opaniuk <igor.opaniuk@gmail.com>
      Acked-by: default avatarIgor Opaniuk <igor.opaniuk@gmail.com>
      965ec3ca
    • Sam Protsenko's avatar
      cmd: avb: Fix requested partitions list · bb43c278
      Sam Protsenko authored and Tom Rini's avatar Tom Rini committed
      The requested_partitions[] array should contain only boot partitions.
      Usually it's only 'boot' partition, as can be seen in [1]. Also, seems
      like the requested_partitions[] are only used when there is no 'vbmeta'
      partition [2], which is not a regular use-case.
      
      Make requested_partitions[] contain only 'boot' partition as it was
      supposed to be, and also make that array to be a local in
      do_avb_verify_part() function, as nobody else needs that.
      
      [1] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/test/avb_slot_verify_unittest.cc#108
      [2] https://android.googlesource.com/platform/external/avb/+/5fbb42a189aa/libavb/avb_slot_verify.c#1461
      
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      Reviewed-by: default avatarIgor Opaniuk <igor.opaniuk@gmail.com>
      bb43c278
    • Sam Protsenko's avatar
      libavb: Fix build warnings after updating the lib · 8f684b5a
      Sam Protsenko authored and Tom Rini's avatar Tom Rini committed
      
      
      After updating libavb to most recent version from AOSP/master, two new
      warnings appear:
      
      Warning #1:
      
          lib/libavb/avb_cmdline.c: In function 'avb_append_options':
          lib/libavb/avb_cmdline.c:365:15: warning: 'dm_verity_mode' may be
                                           used uninitialized in this function
                                           [-Wmaybe-uninitialized]
               new_ret = avb_replace(
                         ^~~~~~~~~~~~
                   slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode);
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          lib/libavb/avb_cmdline.c:374:8: warning: 'verity_mode' may be used
                                          uninitialized in this function
                                          [-Wmaybe-uninitialized]
             if (!cmdline_append_option(
                  ^~~~~~~~~~~~~~~~~~~~~~
                     slot_data, "androidboot.veritymode", verity_mode)) {
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Warning #2:
      
          lib/libavb/avb_slot_verify.c: In function 'avb_slot_verify':
          lib/libavb/avb_slot_verify.c:1349:23: warning: 'ret' may be used
                                                uninitialized in this function
                                                [-Wmaybe-uninitialized]
             AvbSlotVerifyResult ret;
                                 ^~~
      
      Fix those by providing default return values to affected functions.
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      8f684b5a
    • Sam Protsenko's avatar
      libavb: Update libavb to current AOSP master · 4d579a43
      Sam Protsenko authored and Tom Rini's avatar Tom Rini committed
      Update libavb to commit 5fbb42a189aa in AOSP/master, because new version
      has support for super partition [1], which we need for implementing
      Android dynamic partitions. All changes from previous patches for libavb
      in U-Boot are accounted for in this commit:
        - commit ecc6f6be ("libavb: Handle wrong hashtree_error_mode in
                                avb_append_options()")
        - commit 897a1d94 ("libavb: Update SPDX tag style")
        - commit d8f9d2af ("avb2.0: add Android Verified Boot 2.0 library")
      
      Tested on X15:
      
          ## Android Verified Boot 2.0 version 1.1.0
          read_is_device_unlocked not supported yet
          read_rollback_index not supported yet
          read_is_device_unlocked not supported yet
          Verification passed successfully
          AVB verification OK.
      
      Unit test passes:
      
          $ ./test/py/test.py --bd sandbox --build -k test_avb
      
            test/py/tests/test_android/test_avb.py ss..s.
      
      [1] https://android.googlesource.com/platform/external/avb/+/49936b4c0109411fdd38bd4ba3a32a01c40439a9
      
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      Reviewed-by: default avatarEugeniu Rosca <rosca.eugeniu@gmail.com>
      Acked-by: default avatarIgor Opaniuk <igor.opaniuk@gmail.com>
      4d579a43
    • Michal Sojka's avatar
      mkimage: Set correct FDT type and ramdisk architecture in FIT auto mode · 12e288a8
      Michal Sojka authored and Tom Rini's avatar Tom Rini committed
      
      
      When running the following command
      
          mkimage -f auto -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 \
                  -d zImage -b zynq-microzed.dtb -i initramfs.cpio image.ub
      
      the type of fdt subimage is the same as of the main kernel image and
      the architecture of the initramfs image is not set. Such an image is
      refused by U-Boot when booting. This commits sets the mentioned
      attributes, allowing to use the "-f auto" mode in this case instead of
      writing full .its file.
      
      Following is the diff of mkimage output without and with this commit:
      
       FIT description: Kernel Image image with one or more FDT blobs
       Created:         Thu Sep 12 23:23:16 2019
        Image 0 (kernel-1)
         Description:
         Created:      Thu Sep 12 23:23:16 2019
         Type:         Kernel Image
         Compression:  uncompressed
         Data Size:    4192744 Bytes = 4094.48 KiB = 4.00 MiB
         Architecture: ARM
         OS:           Linux
         Load Address: 0x00008000
         Entry Point:  0x00008000
        Image 1 (fdt-1)
         Description:  zynq-microzed
         Created:      Thu Sep 12 23:23:16 2019
      -  Type:         Kernel Image
      +  Type:         Flat Device Tree
         Compression:  uncompressed
         Data Size:    9398 Bytes = 9.18 KiB = 0.01 MiB
         Architecture: ARM
      -  OS:           Unknown OS
      -  Load Address: unavailable
      -  Entry Point:  unavailable
        Image 2 (ramdisk-1)
         Description:  unavailable
         Created:      Thu Sep 12 23:23:16 2019
         Type:         RAMDisk Image
         Compression:  Unknown Compression
         Data Size:    760672 Bytes = 742.84 KiB = 0.73 MiB
      -  Architecture: Unknown Architecture
      +  Architecture: ARM
         OS:           Linux
         Load Address: unavailable
         Entry Point:  unavailable
        Default Configuration: 'conf-1'
        Configuration 0 (conf-1)
         Description:  zynq-microzed
         Kernel:       kernel-1
         Init Ramdisk: ramdisk-1
         FDT:          fdt-1
         Loadables:    kernel-1
      Signed-off-by: default avatarMichal Sojka <michal.sojka@cvut.cz>
      12e288a8
    • Jean-Jacques Hiblot's avatar
      drivers: phy: Handle gracefully NULL pointers · 4e184298
      Jean-Jacques Hiblot authored and Tom Rini's avatar Tom Rini committed
      
      
      For some controllers PHYs can be optional. Handling NULL pointers without
      crashing nor failing, makes it easy to handle optional PHYs.
      Signed-off-by: default avatarJean-Jacques Hiblot <jjhiblot@ti.com>
      4e184298
    • Marek Szyprowski's avatar
      linux_compat: fix potential NULL pointer access · 2ad98ab8
      Marek Szyprowski authored and Tom Rini's avatar Tom Rini committed
      
      
      malloc_cache_aligned() might return zero, so fix potential NULL pointer
      access if __GFP_ZERO flag is set.
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: default avatarRalph Siemsen <ralph.siemsen@linaro.org>
      2ad98ab8
    • Simon South's avatar
      tiny-printf: Support vsnprintf() · 9b3fbb2b
      Simon South authored and Tom Rini's avatar Tom Rini committed
      
      
      Add a simple implementation of this function, to allow logging to be
      enabled in the SPL or TPL for systems that rely on the tiny printf()
      implementation.
      
      To keep the code size small,
      
      - The function is built only when logging is enabled, as it
        (currently) is not needed otherwise; and
      - Like the existing implementation of snprintf(), its buffer-size
        parameter is ignored.
      Signed-off-by: default avatarSimon South <simon@simonsouth.net>
      9b3fbb2b