diff options
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 49e6345ce4..4a5638fb60 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -1100,16 +1100,25 @@ class BBCooker: | |||
| 1100 | 1100 | ||
| 1101 | self.configuration.server_register_idlecallback(buildTargetsIdle, rq) | 1101 | self.configuration.server_register_idlecallback(buildTargetsIdle, rq) |
| 1102 | 1102 | ||
| 1103 | def generateNewImage(self, image, base_image, package_queue): | 1103 | def generateNewImage(self, image, base_image, package_queue, timestamp): |
| 1104 | ''' | 1104 | ''' |
| 1105 | Create a new image with a "require" base_image statement | 1105 | Create a new image with a "require"/"inherit" base_image statement |
| 1106 | ''' | 1106 | ''' |
| 1107 | image_name = os.path.splitext(image)[0] | 1107 | if timestamp: |
| 1108 | timestr = time.strftime("-%Y%m%d-%H%M%S") | 1108 | image_name = os.path.splitext(image)[0] |
| 1109 | dest = image_name + str(timestr) + ".bb" | 1109 | timestr = time.strftime("-%Y%m%d-%H%M%S") |
| 1110 | dest = image_name + str(timestr) + ".bb" | ||
| 1111 | else: | ||
| 1112 | if not image.endswith(".bb"): | ||
| 1113 | dest = image + ".bb" | ||
| 1114 | else: | ||
| 1115 | dest = image | ||
| 1110 | 1116 | ||
| 1111 | with open(dest, "w") as imagefile: | 1117 | with open(dest, "w") as imagefile: |
| 1112 | imagefile.write("require " + base_image + "\n") | 1118 | if base_image is None: |
| 1119 | imagefile.write("inherit image\n") | ||
| 1120 | else: | ||
| 1121 | imagefile.write("require " + base_image + "\n") | ||
| 1113 | package_install = "PACKAGE_INSTALL_forcevariable = \"" | 1122 | package_install = "PACKAGE_INSTALL_forcevariable = \"" |
| 1114 | for package in package_queue: | 1123 | for package in package_queue: |
| 1115 | package_install += str(package) + " " | 1124 | package_install += str(package) + " " |
| @@ -1117,7 +1126,8 @@ class BBCooker: | |||
| 1117 | imagefile.write(package_install) | 1126 | imagefile.write(package_install) |
| 1118 | 1127 | ||
| 1119 | self.state = state.initial | 1128 | self.state = state.initial |
| 1120 | return timestr | 1129 | if timestamp: |
| 1130 | return timestr | ||
| 1121 | 1131 | ||
| 1122 | def updateCache(self): | 1132 | def updateCache(self): |
| 1123 | if self.state == state.running: | 1133 | if self.state == state.running: |
