@ -134,11 +134,11 @@ sb save hostfs 0 %(loadables2_addr)x %(loadables2_out)s %(loadables2_size)x
reset
'''
def debug_stdout ( stdout ) :
def debug_stdout ( stdout ) :
if DEBUG :
print stdout
def make_fname ( leaf ) :
def make_fname ( leaf ) :
""" Make a temporary filename
Args :
@ -150,7 +150,7 @@ def make_fname(leaf):
return os . path . join ( base_dir , leaf )
def filesize ( fname ) :
def filesize ( fname ) :
""" Get the size of a file
Args :
@ -160,7 +160,7 @@ def filesize(fname):
"""
return os . stat ( fname ) . st_size
def read_file ( fname ) :
def read_file ( fname ) :
""" Read the contents of a file
Args :
@ -171,7 +171,7 @@ def read_file(fname):
with open ( fname , ' r ' ) as fd :
return fd . read ( )
def make_dtb ( ) :
def make_dtb ( ) :
""" Make a sample .dts file and compile it to a .dtb
Returns :
@ -184,7 +184,7 @@ def make_dtb():
command . Output ( ' dtc ' , src , ' -O ' , ' dtb ' , ' -o ' , dtb )
return dtb
def make_its ( params ) :
def make_its ( params ) :
""" Make a sample .its file with parameters embedded
Args :
@ -197,7 +197,7 @@ def make_its(params):
print >> fd , base_its % params
return its
def make_fit ( mkimage , params ) :
def make_fit ( mkimage , params ) :
""" Make a sample .fit file ready for loading
This creates a . its script with the selected parameters and uses mkimage to
@ -216,7 +216,7 @@ def make_fit(mkimage, params):
print >> fd , base_fdt
return fit
def make_kernel ( filename , text ) :
def make_kernel ( filename , text ) :
""" Make a sample kernel with test data
Args :
@ -232,7 +232,7 @@ def make_kernel(filename, text):
print >> fd , data
return fname
def make_ramdisk ( filename , text ) :
def make_ramdisk ( filename , text ) :
""" Make a sample ramdisk with test data
Returns :
@ -246,7 +246,7 @@ def make_ramdisk(filename, text):
print >> fd , data
return fname
def find_matching ( text , match ) :
def find_matching ( text , match ) :
""" Find a match in a line of text, and return the unmatched line portion
This is used to extract a part of a line from some text . The match string
@ -285,7 +285,7 @@ def find_matching(text, match):
print text
raise ValueError ( ' Test aborted ' )
def set_test ( name ) :
def set_test ( name ) :
""" Set the name of the current test and print a message
Args :
@ -296,7 +296,7 @@ def set_test(name):
test_name = name
print name
def fail ( msg , stdout ) :
def fail ( msg , stdout ) :
""" Raise an error with a helpful failure message
Args :
@ -305,7 +305,7 @@ def fail(msg, stdout):
print stdout
raise ValueError ( " Test ' %s ' failed: %s " % ( test_name , msg ) )
def run_fit_test ( mkimage , u_boot ) :
def run_fit_test ( mkimage , u_boot ) :
""" Basic sanity check of FIT loading in U-Boot
TODO : Almost everything :