1. 27 Jun, 2016 4 commits
  2. 12 Nov, 2015 4 commits
    • Maxime Ripard's avatar
      sparse: Rename the file and header · 3d4ef38d
      Maxime Ripard authored
      The Android sparse image format is currently supported through a file
      called aboot, which isn't really such a great name, since the sparse image
      format is only used for transferring data with fastboot.
      
      Rename the file and header to a file called "sparse", which also makes it
      consistent with the header defining the image structures.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      3d4ef38d
    • Maxime Ripard's avatar
      fastboot: Implement flashing session counter · 6c9e00ee
      Maxime Ripard authored
      The fastboot flash command that writes an image to a partition works in
      several steps:
      
      1 - Retrieve the maximum size the device can download through the
          "max-download-size" variable
      
      2 - Retrieve the partition type through the "partition-type:%s" variable,
          that indicates whether or not the partition needs to be erased (even
          though the fastboot client has minimal support for that)
      
      3a - If the image is smaller than what the device can handle, send the image
           and flash it.
      
      3b - If the image is larger than what the device can handle, create a
           sparse image, and split it in several chunks that would fit. Send the
           chunk, flash it, repeat until we have no more data to send.
      
      However, in the 3b case, the subsequent transfers have no particular
      identifiers, the protocol just assumes that you would resume the writes
      where you left it.
      
      While doing so works well, it also means that flashing two subsequent
      images on the same partition (for example because the user made a mistake)
      would not work withouth flashing another partition or rebooting the board,
      which is not really intuitive.
      
      Since we have always the same pattern, we can however maintain a counter
      that will be reset every time the client will retrieve max-download-size,
      and incremented after each buffer will be flashed, that will allow us to
      tell whether we should simply resume the flashing where we were, or start
      back at the beginning of the partition.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      6c9e00ee
    • Maxime Ripard's avatar
      sparse: Implement storage abstraction · a5d1e04a
      Maxime Ripard authored
      The current sparse image parser relies heavily on the MMC layer, and
      doesn't allow any other kind of storage medium to be used.
      
      Rework the parser to support any kind of storage medium, as long as there
      is an implementation for it.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      a5d1e04a
    • Maxime Ripard's avatar
      fastboot: Move fastboot response functions to fastboot core · 3c8f98f5
      Maxime Ripard authored
      The functions and a few define to generate a fastboot message to be sent
      back to the host were so far duplicated among the users.
      
      Move them all to a common place.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      3c8f98f5
  3. 16 Sep, 2014 1 commit