(self, mounted_sparsebundle, package_report)
Writes information about the image to a plist file in the image.
Writes information about the image to a plist file in the image.
Writes information about the image to a plist file in the image .
def WriteImageInfo(self, mounted_sparsebundle, package_report):
    """Writes information about the image to a plist file in the image."""
    imageinfo = ('%s/etc/imageinfo.plist' % mounted_sparsebundle)

    cmd = ['defaults', 'write', imageinfo, 'ImageVersion',
           '-string', self.image_creation_time]
    (unused_stdout, stderr, rc) = RunProcess(cmd)
    if rc:
      print 'Failed to write ImageVersion: %s' % stderr

    cmd = ['defaults', 'write', imageinfo, 'ImageMethod',
           '-string', 'can_haz_image']
    (unused_stdout, stderr, rc) = RunProcess(cmd)
    if rc:
      print 'Failed to write ImageMethod: %s' % stderr

    for package in package_report:
      cmd = ['defaults', 'write', imageinfo, 'ImagePackages',
             '-array-add', package]
      (unused_stdout, stderr, rc) = RunProcess(cmd)
      if rc:
        print 'Failed to write ImagePackages: %s' % stderr

    # chmod to 0644, chown to root:wheel
    os.chmod(imageinfo, 0644)
    os.chown(imageinfo, 0, 0)
def WriteImageInfo ( self , mounted_sparsebundle , package_report ) : imageinfo = ( '%s/etc/imageinfo.plist' % mounted_sparsebundle ) cmd = [ 'defaults' , 'write' , imageinfo , 'ImageVersion' , '-string' , self . image_creation_time ] ( unused_stdout , stderr , rc ) = RunProcess ( cmd ) if rc : print 'Failed to write ImageVersion: %s' % stderr cmd = [ 'defaults' , 'write' , imageinfo , 'ImageMethod' , '-string' , 'can_haz_image' ] ( unused_stdout , stderr , rc ) = RunProcess ( cmd ) if rc : print 'Failed to write ImageMethod: %s' % stderr for package in package_report : cmd = [ 'defaults' , 'write' , imageinfo , 'ImagePackages' , '-array-add' , package ] ( unused_stdout , stderr , rc ) = RunProcess ( cmd ) if rc : print 'Failed to write ImagePackages: %s' % stderr # chmod to 0644, chown to root:wheel os . chmod ( imageinfo , 0644 ) os . chown ( imageinfo , 0 , 0 )