cpt_upgrader.py (9818:ebd7d3e04b5f) | cpt_upgrader.py (9956:6f2b525b8f16) |
---|---|
1#!/usr/bin/env python 2 | 1#!/usr/bin/env python 2 |
3# Copyright (c) 2012 ARM Limited | 3# Copyright (c) 2012-2013 ARM Limited |
4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating 9# to a hardware implementation of the functionality of the software 10# licensed hereunder. You may use the software subject to the license 11# terms below provided that you ensure that this notice is replicated --- 192 unchanged lines hidden (view full) --- 204 cpt.set(sec, 'lruSeq', '0') 205 206 if re.search('.*sys.*\.cpu.*\.itb$', sec): 207 cpt.set(sec, '_size', '0') 208 cpt.set(sec, 'lruSeq', '0') 209 else: 210 print "ISA is not x86" 211 | 4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating 9# to a hardware implementation of the functionality of the software 10# licensed hereunder. You may use the software subject to the license 11# terms below provided that you ensure that this notice is replicated --- 192 unchanged lines hidden (view full) --- 204 cpt.set(sec, 'lruSeq', '0') 205 206 if re.search('.*sys.*\.cpu.*\.itb$', sec): 207 cpt.set(sec, '_size', '0') 208 cpt.set(sec, 'lruSeq', '0') 209 else: 210 print "ISA is not x86" 211 |
212# Version 7 of the checkpoint adds support for the IDE dmaAbort flag 213def from_6(cpt): 214 # Update IDE disk devices with dmaAborted 215 for sec in cpt.sections(): 216 # curSector only exists in IDE devices, so key on that attribute 217 if cpt.has_option(sec, "curSector"): 218 cpt.set(sec, "dmaAborted", "false") 219 220 |
|
212migrations = [] 213migrations.append(from_0) 214migrations.append(from_1) 215migrations.append(from_2) 216migrations.append(from_3) 217migrations.append(from_4) 218migrations.append(from_5) | 221migrations = [] 222migrations.append(from_0) 223migrations.append(from_1) 224migrations.append(from_2) 225migrations.append(from_3) 226migrations.append(from_4) 227migrations.append(from_5) |
228migrations.append(from_6) |
|
219 220verbose_print = False 221 222def verboseprint(*args): 223 if not verbose_print: 224 return 225 for arg in args: 226 print arg, --- 42 unchanged lines hidden (view full) --- 269 verboseprint("\t...migrating to version %#x" % (v + 1)) 270 migrations[v](cpt) 271 cpt.set('root','cpt_ver', str(v + 1)) 272 273 # Write the old data back 274 verboseprint("\t...completed") 275 cpt.write(file(path, 'w')) 276 | 229 230verbose_print = False 231 232def verboseprint(*args): 233 if not verbose_print: 234 return 235 for arg in args: 236 print arg, --- 42 unchanged lines hidden (view full) --- 279 verboseprint("\t...migrating to version %#x" % (v + 1)) 280 migrations[v](cpt) 281 cpt.set('root','cpt_ver', str(v + 1)) 282 283 # Write the old data back 284 verboseprint("\t...completed") 285 cpt.write(file(path, 'w')) 286 |
277 | |
278if __name__ == '__main__': 279 from optparse import OptionParser 280 parser = OptionParser("usage: %prog [options] <filename or directory>") 281 parser.add_option("-r", "--recurse", action="store_true", 282 help="Recurse through all subdirectories modifying "\ 283 "each checkpoint that is found") 284 parser.add_option("-N", "--no-backup", action="store_false", 285 dest="backup", default=True, --- 37 unchanged lines hidden --- | 287if __name__ == '__main__': 288 from optparse import OptionParser 289 parser = OptionParser("usage: %prog [options] <filename or directory>") 290 parser.add_option("-r", "--recurse", action="store_true", 291 help="Recurse through all subdirectories modifying "\ 292 "each checkpoint that is found") 293 parser.add_option("-N", "--no-backup", action="store_false", 294 dest="backup", default=True, --- 37 unchanged lines hidden --- |