- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8
 
Upstreaming changes from https://chromium.googlesource.com/chromiumos/third_party/flashmap/ #4
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
          
     Open
      
      
            jettr
  wants to merge
  16
  commits into
  dhendrix:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
jettr:master
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    This adds a presubmit config file so we don't get annoying repo upload warnings for tabs and software license. BUG=none BRANCH=none TEST=tried uploading a change, didn't get nagged for tabs and license Change-Id: Ia46ae58c6281fb6cc7ac0864d45c613908cb2df4 Reviewed-on: https://gerrit.chromium.org/gerrit/45141 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Queue: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
fmap_find_area does not modify the fmap, let's use const pointers. BUG=none TEST=emerge flashmap Change-Id: Ie5c64c3df3b2ef44a2e2ca0dbef4dd3403d91d75 Reviewed-on: https://chromium-review.googlesource.com/479037 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
fmap.h is a C header file. We add `extern "C"` to let C++ code be able
to include it.
BUG=none
TEST=emerge flashmap
     successfully build a c++ program which includes fmap.h
Change-Id: I0317ddc9ce7182d69899d7756688ee7dcaded26a
Reviewed-on: https://chromium-review.googlesource.com/505677
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
    - Remove test functionality from fmap.py's main function and replace with appropriate unit tests in fmap_unittest.py - Bring over some formatting and lint fixes from factory/setup/fmap.py - Add *.pyc to .gitignore BUG=chromium:726356 TEST=ran unit tests Change-Id: I4cb99efa3d924483dfdff9be54f6c3fc10040f3f Reviewed-on: https://chromium-review.googlesource.com/516242 Commit-Ready: Drew Davenport <ddavenport@chromium.org> Tested-by: Drew Davenport <ddavenport@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
fmap.py is identical to the one in factory/setup/fmap.py except: - no test functionality in main function - module docstring and license Added some unit tests for the new functionality BUG=chromium:726356 TEST=ran unittests Change-Id: Ib67bd4260cf4e1cc08543b822521a4adcf0cbce6 Reviewed-on: https://chromium-review.googlesource.com/516382 Commit-Ready: Drew Davenport <ddavenport@chromium.org> Tested-by: Drew Davenport <ddavenport@chromium.org> Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Many projects started their initial builds without knowing that some
sections must be preserved when being updated. This may be solved by
adding section name to 'preserved' list in firmware updater (for
instance, CL:1239797), or include that section as sub area of
{RO,RW}_PRESERVE.
However, there are problems in both solution. For example, installing an
older image will run old updater, which will not preserve the new names.
Also, if there are multiple sections must be preserved (and not
contiguous - see CL:1493629) there will be problems.
Additionally, changing FMAP layout usually causes more problems.
As a result, adding the description in FMAP area would be the better
idea. The new FMAP_AREA_PRESERVE is a suggestion for updater to preserve
this section if possible. Programs constructing FMAP must define its own
way to add such attribute.
BUG=b:126637087,chromium:936768
TEST=sudo emerge flashmap
Change-Id: I61e80aa13efe36177b76b5a9d8d3a4b8bcbd9bac
Reviewed-on: https://chromium-review.googlesource.com/1493767
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
    Remove folks not on project/at Google. BUG=None TEST=None Change-Id: I6f4c124724a113b542427548d373877d07f05544 Signed-off-by: Kirtika Ruchandani <kirtika@google.com> Reviewed-on: https://chromium-review.googlesource.com/1630647 Commit-Ready: Kirtika Ruchandani <kirtika@chromium.org> Tested-by: Kirtika Ruchandani <kirtika@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
BUG=None TEST=None Exempt-From-Owner-Approval: updating OWNERS itself w/no existing approvers Change-Id: If529419e8004dc69dfd000b03d8ed830d61f48d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashmap/+/1716019 Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
These are expected to be run directly, so mark both of them executable so it's easier to run tests. BUG=chromium:982465 TEST=running both directly works Change-Id: Ib76c3d61a80c554ad03ed68065f9afa2c6ccb887 Reviewed-on: https://chromium-review.googlesource.com/1693881 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
These are fast so shouldn't be a problem to run. BUG=chromium:982465 TEST=`repo upload` runs these unittests Change-Id: Ib32e56e28ed0b349370d46553a032e99ff92791c Reviewed-on: https://chromium-review.googlesource.com/1693882 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
This makes the code easier to manage and provides automatic support for things like -h/--help. BUG=chromium:982465 TEST=`./fmap.py bin/example.bin` works Change-Id: I7a45d414cb2ed2d23bf65978b9dd06e05fc99cd7 Reviewed-on: https://chromium-review.googlesource.com/1693883 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
Dumping the structure as a single line makes it hard to read. Format it for use humans by default and add a --raw option for people who are using this tool in scripts. BUG=chromium:982465 TEST=`./fmap.py bin/example.bin` shows human formatted output TEST=`./fmap.py --raw bin/example.bin` shows one line Change-Id: I3232cdf104ae6edfbbc03e848166455710653f9d Reviewed-on: https://chromium-review.googlesource.com/1693884 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
`cros lint` flags a bunch of issues with these docstrings. Clean up the style to pass all the checks. BUG=chromium:982465 TEST=`cros lint` on these no longer complains about docstrings Change-Id: I7caf0275ce1441bb4031f7d8e9e0ac96bfdf9b05 Reviewed-on: https://chromium-review.googlesource.com/1693885 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
The assertEquals helper is deprecated in favor of assertEqual, so rename all the users to that. The testDecodeWithWrongName defines a decoded variable but doesn't do anything other than assign to it. We don't need that for this particular test (which is checking for assertions), so drop them. The testDecodeWithOffset function was duplicated (exact same name & test code), so delete one of the duplicates. BUG=chromium:982465 TEST=`cros lint` on this no longer complains TEST=`./fmap_unittest.py` still passes Change-Id: I59c9b3a9b95283ecae9948c6b7e13dd86d54a4c2 Reviewed-on: https://chromium-review.googlesource.com/1693886 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
The output of this function is arbitrary because it's based on the ordering of the dict keys of FMAP_FLAGS. This leads to the unittest sometimes passing & sometimes failing. Since this is meant for us humans, sort the tuple so it's stable and unittests are reliable. BUG=chromium:982465 TEST=`./fmap.py bin/example.bin` works Change-Id: Ida9e6768aa6662a400655c52bc2ba793197ab591 Reviewed-on: https://chromium-review.googlesource.com/1693887 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
We run the unittests in both python versions to maintain coverage, and we run things through `cros lint` during upload to help prevent regressions. We also switch the default to Python 3 to keep people on their toes. BUG=chromium:982465 TEST=running unittests against python2 & python3 pass TEST=`./fmap.py bin/example.bin` through python2 & python3 works Change-Id: I79f0ce59664ea42dfa18e45ccde0dffc0c18227d Reviewed-on: https://chromium-review.googlesource.com/1693888 Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
No description provided.