Generalize the logic for replacing selected packages by adding a
'remove' field in the json file, and use this in the installer to
replace the linux kernel package with linux-aws for AMI builds.
Also, while at it, add linux-aws to the list of packages to skip for
ARM64 builds.
Change-Id: I001fb1b65fa7b9bf612a9639620056778320582a
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4895
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
... | ... |
@@ -38,6 +38,11 @@ class PackageSelector(object): |
38 | 38 |
json_wrapper_package_list = JsonWrapper(os.path.join(output_data_path, install_option[1]["file"])) |
39 | 39 |
package_list_json = json_wrapper_package_list.read() |
40 | 40 |
package_list = package_list + package_list_json["packages"] |
41 |
+ |
|
42 |
+ if "remove" in install_option[1]: |
|
43 |
+ for package in install_option[1]["remove"]: |
|
44 |
+ package_list.remove(package) |
|
45 |
+ |
|
41 | 46 |
break |
42 | 47 |
return package_list |
43 | 48 |
|
... | ... |
@@ -244,11 +244,6 @@ if __name__ == '__main__': |
244 | 244 |
packages = [] |
245 | 245 |
packages = PackageSelector.get_packages_to_install(options_sorted, config['type'], options.output_data_path) |
246 | 246 |
|
247 |
- # Use the optimized linux-aws kernel for AMI images. |
|
248 |
- if options.vmdk_path and config['type'] == 'ami': |
|
249 |
- packages.remove('linux') |
|
250 |
- packages.append('linux-aws') |
|
251 |
- |
|
252 | 247 |
config['packages'] = packages |
253 | 248 |
|
254 | 249 |
if (os.path.isdir(options.working_directory)): |