Change-Id: I1b8323522ac44613542569fd592d18ec1bb2082e
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1975
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>
| ... | ... |
@@ -73,6 +73,7 @@ micro-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES_MICRO) |
| 73 | 73 |
-r $(PHOTON_STAGE)/RPMS \ |
| 74 | 74 |
-p $(PHOTON_GENERATED_DATA_DIR)/$(MICRO_PACKAGE_LIST_FILE) \ |
| 75 | 75 |
-o $(PHOTON_STAGE)/common/data \ |
| 76 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 76 | 77 |
-s $(PHOTON_DATA_DIR) \ |
| 77 | 78 |
-f > \ |
| 78 | 79 |
$(PHOTON_LOGS_DIR)/installer.log 2>&1 |
| ... | ... |
@@ -107,6 +108,7 @@ minimal-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES_MINIMAL) |
| 107 | 107 |
-r $(PHOTON_STAGE)/RPMS \ |
| 108 | 108 |
-p $(PHOTON_GENERATED_DATA_DIR)/$(MINIMAL_PACKAGE_LIST_FILE) \ |
| 109 | 109 |
-o $(PHOTON_STAGE)/common/data \ |
| 110 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 110 | 111 |
-s $(PHOTON_DATA_DIR) \ |
| 111 | 112 |
-f > \ |
| 112 | 113 |
$(PHOTON_LOGS_DIR)/installer.log 2>&1 |
| ... | ... |
@@ -135,6 +137,7 @@ live-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES_MINIMAL) minimal-iso |
| 135 | 135 |
-r $(PHOTON_STAGE)/RPMS \ |
| 136 | 136 |
-p $(PHOTON_GENERATED_DATA_DIR)/build_install_options_livecd.json \ |
| 137 | 137 |
-o $(PHOTON_STAGE)/common/data \ |
| 138 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 138 | 139 |
-s $(PHOTON_DATA_DIR) \ |
| 139 | 140 |
-f > \ |
| 140 | 141 |
$(PHOTON_LOGS_DIR)/installer.log 2>&1 |
| ... | ... |
@@ -167,6 +170,7 @@ iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES) ostree-repo |
| 167 | 167 |
-x $(PHOTON_STAGE)/SRPMS \ |
| 168 | 168 |
-p $(PHOTON_GENERATED_DATA_DIR)/$(FULL_PACKAGE_LIST_FILE) \ |
| 169 | 169 |
-o $(PHOTON_STAGE)/common/data \ |
| 170 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 170 | 171 |
-s $(PHOTON_DATA_DIR) \ |
| 171 | 172 |
-f > \ |
| 172 | 173 |
$(PHOTON_LOGS_DIR)/installer.log 2>&1 |
| ... | ... |
@@ -182,6 +186,7 @@ custom-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES) |
| 182 | 182 |
-x $(PHOTON_STAGE)/SRPMS \ |
| 183 | 183 |
-p $(PHOTON_GENERATED_DATA_DIR)/build_install_options_custom.json \ |
| 184 | 184 |
-o $(PHOTON_STAGE)/common/data \ |
| 185 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 185 | 186 |
-s $(PHOTON_DATA_DIR) \ |
| 186 | 187 |
-f > \ |
| 187 | 188 |
$(PHOTON_LOGS_DIR)/installer.log 2>&1 |
| ... | ... |
@@ -197,6 +202,7 @@ src-iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES) |
| 197 | 197 |
-x $(PHOTON_STAGE)/SRPMS \ |
| 198 | 198 |
-p $(PHOTON_GENERATED_DATA_DIR)/$(FULL_PACKAGE_LIST_FILE) \ |
| 199 | 199 |
-o $(PHOTON_STAGE)/common/data \ |
| 200 |
+ -d $(PHOTON_STAGE)/pkg_info.json \ |
|
| 200 | 201 |
-s $(PHOTON_DATA_DIR) \ |
| 201 | 202 |
-f > \ |
| 202 | 203 |
$(PHOTON_LOGS_DIR)/sourceiso-installer.log 2>&1 |
| ... | ... |
@@ -117,14 +117,14 @@ fi |
| 117 | 117 |
mkdir -p ${BUILDROOT}/mnt/photon-root/photon-chroot
|
| 118 | 118 |
rm -rf ${BUILDROOT}/RPMS
|
| 119 | 119 |
|
| 120 |
+run_command " echo ${RPMS_PATH}" "echo ${RPMS_PATH}" "${LOGFILE}"
|
|
| 120 | 121 |
#cp -r ${RPMS_PATH} ${WORKINGDIR}/
|
| 121 | 122 |
( |
| 122 | 123 |
cd ${RPMS_PATH}
|
| 123 | 124 |
mkdir ${WORKINGDIR}/RPMS
|
| 124 | 125 |
for rpm_name in $RPM_LIST; do |
| 125 |
- FILENAME="`find . -name "$rpm_name-[0-9]*" -or -name "$rpm_name-[a-z][0-9]*" -or -name "$rpm_name-debuginfo*" -type f`" |
|
| 126 |
- if [ -n "$FILENAME" ]; then |
|
| 127 |
- cp --parent $FILENAME ${WORKINGDIR}/RPMS/;
|
|
| 126 |
+ if [ -f "$rpm_name" ]; then |
|
| 127 |
+ cp --parent $rpm_name ${WORKINGDIR}/RPMS/;
|
|
| 128 | 128 |
fi |
| 129 | 129 |
done |
| 130 | 130 |
) |
| 131 | 131 |
deleted file mode 100755 |
| ... | ... |
@@ -1,45 +0,0 @@ |
| 1 |
-#!/bin/bash |
|
| 2 |
-################################################# |
|
| 3 |
-# Title: mk-src-iso # |
|
| 4 |
-# Date: 2016-02-19 # |
|
| 5 |
-# Version: 1.0 # |
|
| 6 |
-# Author: dthaluru@vmware.com # |
|
| 7 |
-# Options: # |
|
| 8 |
-################################################# |
|
| 9 |
-# Overview |
|
| 10 |
-# Generates a photon source iso |
|
| 11 |
-# End |
|
| 12 |
-# |
|
| 13 |
- |
|
| 14 |
-set +x # disable hashall |
|
| 15 |
-PRGNAME=${0##*/} # script name minus the path
|
|
| 16 |
-source config.inc # configuration parameters |
|
| 17 |
-source function.inc # commonn functions |
|
| 18 |
-LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}" # set log file name
|
|
| 19 |
- |
|
| 20 |
- |
|
| 21 |
-# Grab the name of the iso file |
|
| 22 |
-if [ $# -lt 2 ] |
|
| 23 |
-then |
|
| 24 |
- echo "Usage : " $0 " <output-iso-with-path> <srpms-path> <pkg-list-path>" |
|
| 25 |
- exit 1 |
|
| 26 |
-fi |
|
| 27 |
-ISO_OUTPUT_NAME=$1 |
|
| 28 |
-SRPMS_PATH=$2 |
|
| 29 |
-SRPM_LIST=$3 |
|
| 30 |
- |
|
| 31 |
-WORKINGDIR=${BUILDROOT}
|
|
| 32 |
-rm -r ${WORKINGDIR}/*
|
|
| 33 |
-( |
|
| 34 |
-cd ${SRPMS_PATH}
|
|
| 35 |
-mkdir ${WORKINGDIR}/SRPMS
|
|
| 36 |
-for srpm_name in $SRPM_LIST; do |
|
| 37 |
- FILENAME="`find . -name "$srpm_name-[0-9]*" -type f`" |
|
| 38 |
- if [ -n "$FILENAME" ]; then |
|
| 39 |
- cp --parent $FILENAME ${WORKINGDIR}/SRPMS/;
|
|
| 40 |
- fi |
|
| 41 |
-done |
|
| 42 |
-) |
|
| 43 |
- |
|
| 44 |
-mkisofs -r -o $ISO_OUTPUT_NAME $WORKINGDIR/ |
|
| 45 |
- |
| ... | ... |
@@ -87,7 +87,13 @@ def create_vmdk_and_partition(config, vmdk_path): |
| 87 | 87 |
|
| 88 | 88 |
return partitions_data, count == 2 |
| 89 | 89 |
|
| 90 |
-def create_rpm_list_to_copy_in_iso(build_install_option, output_data_path): |
|
| 90 |
+def get_file_name_with_last_folder(filename): |
|
| 91 |
+ basename = os.path.basename(filename) |
|
| 92 |
+ dirname = os.path.dirname(filename) |
|
| 93 |
+ lastfolder = os.path.basename(dirname) |
|
| 94 |
+ name = os.path.join(lastfolder, basename) |
|
| 95 |
+ return name |
|
| 96 |
+def create_pkg_list_to_copy_to_iso(build_install_option, output_data_path): |
|
| 91 | 97 |
json_wrapper_option_list = JsonWrapper(build_install_option) |
| 92 | 98 |
option_list_json = json_wrapper_option_list.read() |
| 93 | 99 |
options_sorted = option_list_json.items() |
| ... | ... |
@@ -100,6 +106,31 @@ def create_rpm_list_to_copy_in_iso(build_install_option, output_data_path): |
| 100 | 100 |
packages = packages + package_list_json["packages"] |
| 101 | 101 |
return packages |
| 102 | 102 |
|
| 103 |
+ #copy_flags 1: add the rpm file for the package |
|
| 104 |
+ # 2: add debuginfo rpm file for the package. |
|
| 105 |
+ # 4: add src rpm file for the package |
|
| 106 |
+def create_rpm_list_to_be_copied_to_iso(pkg_to_rpm_map_file, build_install_option, copy_flags, output_data_path): |
|
| 107 |
+ packages = [] |
|
| 108 |
+ if build_install_option is None: |
|
| 109 |
+ packages = [] |
|
| 110 |
+ else: |
|
| 111 |
+ packages = create_pkg_list_to_copy_to_iso(build_install_option, output_data_path) |
|
| 112 |
+ |
|
| 113 |
+ rpm_list = [] |
|
| 114 |
+ json_pkg_to_rpm_map = JsonWrapper(pkg_to_rpm_map_file) |
|
| 115 |
+ pkg_to_rpm_map = json_pkg_to_rpm_map.read() |
|
| 116 |
+ for k in pkg_to_rpm_map: |
|
| 117 |
+ if build_install_option is None or k in packages: |
|
| 118 |
+ if not pkg_to_rpm_map[k]['rpm'] is None and bool(copy_flags & 1): |
|
| 119 |
+ filename = pkg_to_rpm_map[k]['rpm'] |
|
| 120 |
+ rpm_list.append(get_file_name_with_last_folder(filename)) |
|
| 121 |
+ if not pkg_to_rpm_map[k]['debugrpm'] is None and bool(copy_flags & 2): |
|
| 122 |
+ filename = pkg_to_rpm_map[k]['debugrpm'] |
|
| 123 |
+ rpm_list.append(get_file_name_with_last_folder(filename)) |
|
| 124 |
+ if not pkg_to_rpm_map[k]['sourcerpm'] is None and bool(copy_flags & 4): |
|
| 125 |
+ rpm_list.append(pkg_to_rpm_map[k]['sourcerpm']) |
|
| 126 |
+ return rpm_list |
|
| 127 |
+ |
|
| 103 | 128 |
def create_additional_file_list_to_copy_in_iso(base_path, build_install_option): |
| 104 | 129 |
json_wrapper_option_list = JsonWrapper(build_install_option) |
| 105 | 130 |
option_list_json = json_wrapper_option_list.read() |
| ... | ... |
@@ -121,6 +152,22 @@ def get_live_cd_status_string(build_install_option): |
| 121 | 121 |
return "true" |
| 122 | 122 |
return "false" |
| 123 | 123 |
|
| 124 |
+def make_src_iso(working_directory, src_iso_path, rpm_list): |
|
| 125 |
+ if os.path.isdir(working_directory): |
|
| 126 |
+ process = subprocess.Popen(['rm', '-rf', working_directory]) |
|
| 127 |
+ retval = process.wait() |
|
| 128 |
+ process = subprocess.Popen(['mkdir', '-p', os.path.join(working_directory, "SRPMS")]) |
|
| 129 |
+ retval = process.wait() |
|
| 130 |
+ for aaa in rpm_list: |
|
| 131 |
+ if os.path.isfile(aaa): |
|
| 132 |
+ process = subprocess.Popen(['cp', aaa, os.path.join(working_directory, "SRPMS")]) |
|
| 133 |
+ retval = process.wait() |
|
| 134 |
+ process = subprocess.Popen(['mkisofs', '-r', '-o', src_iso_path, working_directory]) |
|
| 135 |
+ retval = process.wait() |
|
| 136 |
+ process = subprocess.Popen(['rm', '-rf', options.working_directory]) |
|
| 137 |
+ retval = process.wait() |
|
| 138 |
+ |
|
| 139 |
+ |
|
| 124 | 140 |
if __name__ == '__main__': |
| 125 | 141 |
usage = "Usage: %prog [options] <config file> <tools path>" |
| 126 | 142 |
parser = OptionParser(usage) |
| ... | ... |
@@ -138,120 +185,108 @@ if __name__ == '__main__': |
| 138 | 138 |
parser.add_option("-m", "--stage-path", dest="stage_path", default="../stage")
|
| 139 | 139 |
parser.add_option("-c", "--dracut-configuration", dest="dracut_configuration_file", default="../common/data/dracut_configuration.json")
|
| 140 | 140 |
parser.add_option("-s", "--json-data-path", dest="json_data_path", default="../stage/common/data/")
|
| 141 |
+ parser.add_option("-d", "--pkg-to_rpm-map-file", dest="pkg_to_rpm_map_file", default="../stage/pkg_info.json")
|
|
| 141 | 142 |
|
| 142 | 143 |
(options, args) = parser.parse_args() |
| 143 |
- if options.iso_path or options.src_iso_path: |
|
| 144 |
- # Check the arguments |
|
| 145 |
- if (len(args)) != 0: |
|
| 146 |
- parser.error("Incorrect arguments")
|
|
| 147 |
- config = {}
|
|
| 148 |
- config['iso_system'] = True |
|
| 149 |
- config['vmdk_install'] = False |
|
| 150 |
- |
|
| 151 |
- elif options.vmdk_path: |
|
| 152 |
- # Check the arguments |
|
| 153 |
- if (len(args)) != 1: |
|
| 154 |
- parser.error("Incorrect arguments")
|
|
| 155 |
- |
|
| 156 |
- # Read the conf file |
|
| 157 |
- config = (JsonWrapper(args[0])).read() |
|
| 158 |
- config['disk'], success = create_vmdk_and_partition(config, options.vmdk_path) |
|
| 159 |
- if not success: |
|
| 160 |
- print "Unexpected failure, please check the logs" |
|
| 161 |
- sys.exit(1) |
|
| 162 |
- |
|
| 163 |
- config['initrd_dir'] = "/boot" |
|
| 164 |
- |
|
| 165 |
- config['iso_system'] = False |
|
| 166 |
- config['vmdk_install'] = True |
|
| 167 |
- |
|
| 168 |
- else: |
|
| 169 |
- # Check the arguments |
|
| 170 |
- if (len(args)) != 1: |
|
| 171 |
- parser.error("Incorrect arguments")
|
|
| 144 |
+ # Cleanup the working directory |
|
| 145 |
+ if not options.force: |
|
| 146 |
+ proceed = query_yes_no("This will remove everything under {0}. Are you sure?".format(options.working_directory))
|
|
| 147 |
+ if not proceed: |
|
| 148 |
+ sys.exit(0) |
|
| 172 | 149 |
|
| 173 |
- # Read the conf file |
|
| 174 |
- config = (JsonWrapper(args[0])).read() |
|
| 150 |
+ if options.src_iso_path: |
|
| 151 |
+ rpm_list = create_rpm_list_to_be_copied_to_iso(options.pkg_to_rpm_map_file, options.package_list_file, 4, options.output_data_path) |
|
| 152 |
+ make_src_iso(options.working_directory, options.src_iso_path, rpm_list) |
|
| 175 | 153 |
|
| 176 |
- config['iso_system'] = False |
|
| 177 |
- config['vmdk_install'] = False |
|
| 154 |
+ else: |
|
| 155 |
+ if options.iso_path: |
|
| 156 |
+ # Check the arguments |
|
| 157 |
+ if (len(args)) != 0: |
|
| 158 |
+ parser.error("Incorrect arguments")
|
|
| 159 |
+ config = {}
|
|
| 160 |
+ config['iso_system'] = True |
|
| 161 |
+ config['vmdk_install'] = False |
|
| 162 |
+ config['type'] = 'iso' |
|
| 163 |
+ |
|
| 164 |
+ elif options.vmdk_path: |
|
| 165 |
+ # Check the arguments |
|
| 166 |
+ if (len(args)) != 1: |
|
| 167 |
+ parser.error("Incorrect arguments")
|
|
| 168 |
+ |
|
| 169 |
+ # Read the conf file |
|
| 170 |
+ config = (JsonWrapper(args[0])).read() |
|
| 171 |
+ config['disk'], success = create_vmdk_and_partition(config, options.vmdk_path) |
|
| 172 |
+ if not success: |
|
| 173 |
+ print "Unexpected failure, please check the logs" |
|
| 174 |
+ sys.exit(1) |
|
| 175 |
+ |
|
| 176 |
+ config['initrd_dir'] = "/boot" |
|
| 177 |
+ |
|
| 178 |
+ config['iso_system'] = False |
|
| 179 |
+ config['vmdk_install'] = True |
|
| 178 | 180 |
|
| 179 |
- if 'password' in config: |
|
| 180 |
- # crypt the password if needed |
|
| 181 |
- if config['password']['crypted']: |
|
| 182 |
- config['password'] = config['password']['text'] |
|
| 183 | 181 |
else: |
| 184 |
- config['password'] = crypt.crypt(config['password']['text'], "$6$" + "".join([random.choice(string.ascii_letters + string.digits) for _ in range(16)])) |
|
| 182 |
+ # Check the arguments |
|
| 183 |
+ if (len(args)) != 1: |
|
| 184 |
+ parser.error("Incorrect arguments")
|
|
| 185 | 185 |
|
| 186 |
- # Check the installation type |
|
| 187 |
- json_wrapper_option_list = JsonWrapper(options.package_list_file) |
|
| 188 |
- option_list_json = json_wrapper_option_list.read() |
|
| 189 |
- options_sorted = option_list_json.items() |
|
| 190 |
- base_path = os.path.dirname(options.package_list_file) |
|
| 186 |
+ # Read the conf file |
|
| 187 |
+ config = (JsonWrapper(args[0])).read() |
|
| 191 | 188 |
|
| 192 |
- packages = [] |
|
| 193 |
- additional_files_to_copy_from_stage_to_iso = [] |
|
| 194 |
- if config['iso_system'] == True: |
|
| 195 |
- for install_option in options_sorted: |
|
| 196 |
- if install_option[0] == "iso": |
|
| 197 |
- json_wrapper_package_list = JsonWrapper(os.path.join(base_path, install_option[1]["file"])) |
|
| 198 |
- package_list_json = json_wrapper_package_list.read() |
|
| 199 |
- packages = package_list_json["packages"] |
|
| 200 |
- else: |
|
| 201 |
- packages = PackageSelector.get_packages_to_install(options_sorted, config['type'], options.output_data_path) |
|
| 189 |
+ config['iso_system'] = False |
|
| 190 |
+ config['vmdk_install'] = False |
|
| 202 | 191 |
|
| 203 |
- config['packages'] = packages |
|
| 192 |
+ if 'password' in config: |
|
| 193 |
+ # crypt the password if needed |
|
| 194 |
+ if config['password']['crypted']: |
|
| 195 |
+ config['password'] = config['password']['text'] |
|
| 196 |
+ else: |
|
| 197 |
+ config['password'] = crypt.crypt(config['password']['text'], "$6$" + "".join([random.choice(string.ascii_letters + string.digits) for _ in range(16)])) |
|
| 204 | 198 |
|
| 205 |
- if options.iso_path: |
|
| 206 |
- if os.path.isfile(options.dracut_configuration_file): |
|
| 207 |
- json_wrapper_package_list = JsonWrapper(options.dracut_configuration_file) |
|
| 208 |
- dracut_configuration_list_json = json_wrapper_package_list.read() |
|
| 209 |
- config["dracut_configuration"]=dracut_configuration_list_json["dracut_configuration"] |
|
| 199 |
+ # Check the installation type |
|
| 200 |
+ json_wrapper_option_list = JsonWrapper(options.package_list_file) |
|
| 201 |
+ option_list_json = json_wrapper_option_list.read() |
|
| 202 |
+ options_sorted = option_list_json.items() |
|
| 210 | 203 |
|
| 211 |
- # Cleanup the working directory |
|
| 212 |
- if not options.force: |
|
| 213 |
- proceed = query_yes_no("This will remove everything under {0}. Are you sure?".format(options.working_directory))
|
|
| 214 |
- if not proceed: |
|
| 215 |
- sys.exit(0) |
|
| 204 |
+ packages = [] |
|
| 205 |
+ packages = PackageSelector.get_packages_to_install(options_sorted, config['type'], options.output_data_path) |
|
| 216 | 206 |
|
| 217 |
- if (os.path.isdir(options.working_directory)): |
|
| 218 |
- process = subprocess.Popen(['rm', '-rf', options.working_directory]) |
|
| 219 |
- retval = process.wait() |
|
| 220 |
- else: |
|
| 221 |
- process = subprocess.Popen(['mkdir', '-p', options.working_directory]) |
|
| 222 |
- retval = process.wait() |
|
| 207 |
+ config['packages'] = packages |
|
| 223 | 208 |
|
| 224 |
- process = subprocess.Popen(['mkdir', '-p', os.path.join(options.working_directory, "photon-chroot")]) |
|
| 225 |
- retval = process.wait() |
|
| 209 |
+ if options.iso_path: |
|
| 210 |
+ if os.path.isfile(options.dracut_configuration_file): |
|
| 211 |
+ json_wrapper_package_list = JsonWrapper(options.dracut_configuration_file) |
|
| 212 |
+ dracut_configuration_list_json = json_wrapper_package_list.read() |
|
| 213 |
+ config["dracut_configuration"]=dracut_configuration_list_json["dracut_configuration"] |
|
| 226 | 214 |
|
| 227 |
- config['working_directory'] = options.working_directory |
|
| 228 | 215 |
|
| 229 |
- # Run the installer |
|
| 230 |
- package_installer = Installer(config, rpm_path = options.rpm_path, log_path = options.log_path) |
|
| 231 |
- package_installer.install(None) |
|
| 216 |
+ if (os.path.isdir(options.working_directory)): |
|
| 217 |
+ process = subprocess.Popen(['rm', '-rf', options.working_directory]) |
|
| 218 |
+ retval = process.wait() |
|
| 232 | 219 |
|
| 233 |
- # Making the iso if needed |
|
| 234 |
- if options.iso_path: |
|
| 235 |
- rpm_list = " ".join(create_rpm_list_to_copy_in_iso(options.package_list_file, options.output_data_path)) |
|
| 236 |
- files_to_copy = " ".join(create_additional_file_list_to_copy_in_iso(os.path.abspath(options.stage_path), options.package_list_file)) |
|
| 237 |
- live_cd = get_live_cd_status_string(options.package_list_file) |
|
| 238 |
- process = subprocess.Popen(['./mk-install-iso.sh', '-w', options.working_directory, options.iso_path, options.rpm_path, options.package_list_file, rpm_list, options.stage_path, files_to_copy, live_cd, options.json_data_path]) |
|
| 220 |
+ process = subprocess.Popen(['mkdir', '-p', os.path.join(options.working_directory, "photon-chroot")]) |
|
| 239 | 221 |
retval = process.wait() |
| 240 | 222 |
|
| 241 |
- if options.src_iso_path: |
|
| 242 |
- rpm_list = " ".join(create_rpm_list_to_copy_in_iso(options.package_list_file, options.output_data_path)) |
|
| 243 |
- process = subprocess.Popen(['./mk-src-iso.sh', '-w', options.working_directory, options.src_iso_path, options.srpm_path, rpm_list]) |
|
| 244 |
- retval = process.wait() |
|
| 245 |
- list_rpms = rpm_list.split(" ")
|
|
| 246 |
- list_rpms = list(set(list_rpms)) |
|
| 247 |
- list_rpms.sort() |
|
| 248 |
- |
|
| 249 |
- # Cleaning up for vmdk |
|
| 250 |
- if 'vmdk_install' in config and config['vmdk_install']: |
|
| 251 |
- process = subprocess.Popen(['./mk-clean-vmdk.sh', config['disk']['disk']]) |
|
| 252 |
- process.wait() |
|
| 253 |
- |
|
| 254 |
- #Clean up the working directories |
|
| 255 |
- if (options.iso_path or options.vmdk_path or options.src_iso_path): |
|
| 256 |
- process = subprocess.Popen(['rm', '-rf', options.working_directory]) |
|
| 257 |
- retval = process.wait() |
|
| 223 |
+ config['working_directory'] = options.working_directory |
|
| 224 |
+ |
|
| 225 |
+ # Run the installer |
|
| 226 |
+ package_installer = Installer(config, rpm_path = options.rpm_path, log_path = options.log_path) |
|
| 227 |
+ package_installer.install(None) |
|
| 228 |
+ |
|
| 229 |
+ # Making the iso if needed |
|
| 230 |
+ if options.iso_path: |
|
| 231 |
+ rpm_list = " ".join(create_rpm_list_to_be_copied_to_iso(options.pkg_to_rpm_map_file, options.package_list_file, 3, options.output_data_path)) |
|
| 232 |
+ files_to_copy = " ".join(create_additional_file_list_to_copy_in_iso(os.path.abspath(options.stage_path), options.package_list_file)) |
|
| 233 |
+ live_cd = get_live_cd_status_string(options.package_list_file) |
|
| 234 |
+ process = subprocess.Popen(['./mk-install-iso.sh', '-w', options.working_directory, options.iso_path, options.rpm_path, options.package_list_file, rpm_list, options.stage_path, files_to_copy, live_cd, options.json_data_path]) |
|
| 235 |
+ retval = process.wait() |
|
| 236 |
+ |
|
| 237 |
+ # Cleaning up for vmdk |
|
| 238 |
+ if 'vmdk_install' in config and config['vmdk_install']: |
|
| 239 |
+ process = subprocess.Popen(['./mk-clean-vmdk.sh', config['disk']['disk']]) |
|
| 240 |
+ process.wait() |
|
| 241 |
+ |
|
| 242 |
+ #Clean up the working directories |
|
| 243 |
+ if (options.iso_path or options.vmdk_path): |
|
| 244 |
+ process = subprocess.Popen(['rm', '-rf', options.working_directory]) |
|
| 245 |
+ retval = process.wait() |