print >> sys.stderr, "Python 2.7 or newer is required."
sys.exit(1)
+import datetime
import errno
import os
import shutil
if fstab:
image_props["fs_type"] = fstab["/" + what].fs_type
+ # Use a fixed timestamp (01/01/2009) when packaging the image.
+ # Bug: 24377993
+ epoch = datetime.datetime.fromtimestamp(0)
+ timestamp = (datetime.datetime(2009, 1, 1) - epoch).total_seconds()
+ image_props["timestamp"] = int(timestamp)
+
if what == "system":
fs_config_prefix = ""
else:
print "creating userdata.img..."
+ # Use a fixed timestamp (01/01/2009) when packaging the image.
+ # Bug: 24377993
+ epoch = datetime.datetime.fromtimestamp(0)
+ timestamp = (datetime.datetime(2009, 1, 1) - epoch).total_seconds()
+ image_props["timestamp"] = int(timestamp)
+
# The name of the directory it is making an image out of matters to
# mkyaffs2image. So we create a temp dir, and within it we create an
# empty dir named "data", or a symlink to the DATA dir,
print "creating cache.img..."
+ # Use a fixed timestamp (01/01/2009) when packaging the image.
+ # Bug: 24377993
+ epoch = datetime.datetime.fromtimestamp(0)
+ timestamp = (datetime.datetime(2009, 1, 1) - epoch).total_seconds()
+ image_props["timestamp"] = int(timestamp)
+
# The name of the directory it is making an image out of matters to
# mkyaffs2image. So we create a temp dir, and within it we create an
# empty dir named "cache", and build the image from that.
Usage: build_image input_directory properties_file output_image_file
"""
-import datetime
import os
import os.path
import re
"""
d = {}
- # Use a fixed timestamp (01/01/2009) for all the files in an image.
- # Bug: 24377993
- epoch = datetime.datetime.fromtimestamp(0)
- timestamp = (datetime.datetime(2009, 1, 1) - epoch).total_seconds()
- d["timestamp"] = int(timestamp)
+ if "build.prop" in glob_dict:
+ bp = glob_dict["build.prop"]
+ if "ro.build.date.utc" in bp:
+ d["timestamp"] = bp["ro.build.date.utc"]
def copy_prop(src_p, dest_p):
if src_p in glob_dict: