Browse code

Remove tools_path from installer. Use {rpm,log}_path options.

YustasSwamp authored on 2015/06/25 05:59:25
Showing 6 changed files
... ...
@@ -40,7 +40,8 @@ iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES) $(PHOTON_TOOLCHAIN_MINIMAL)
40 40
 	@cd $(PHOTON_INSTALLER_DIR) && \
41 41
     $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon.iso \
42 42
                         -w $(PHOTON_STAGE)/photon_iso \
43
-                        -t $(PHOTON_STAGE) \
43
+                        -l $(PHOTON_STAGE)/LOGS \
44
+                        -r $(PHOTON_STAGE)/RPMS \
44 45
                         -p $(PHOTON_INSTALLER_PACKAGE_LIST) \
45 46
                         -f > \
46 47
         $(PHOTON_LOGS_DIR)/installer.log 2>&1
... ...
@@ -23,11 +23,10 @@ from window import Window
23 23
 from actionresult import ActionResult
24 24
 
25 25
 class Installer(object):
26
-    def __init__(self, install_config, maxy = 0, maxx = 0, iso_installer = False, tools_path = "../stage", rpm_path = "../stage/RPMS", log_path = "../stage/LOGS", ks_config = None):
26
+    def __init__(self, install_config, maxy = 0, maxx = 0, iso_installer = False, rpm_path = "../stage/RPMS", log_path = "../stage/LOGS", ks_config = None):
27 27
         self.install_config = install_config
28 28
         self.ks_config = ks_config
29 29
         self.iso_installer = iso_installer
30
-        self.tools_path = tools_path
31 30
         self.rpm_path = rpm_path
32 31
         self.log_path = log_path
33 32
         self.mount_command = "./mk-mount-disk.sh"
... ...
@@ -189,7 +188,7 @@ class Installer(object):
189 189
         self.copy_files()
190 190
         
191 191
         #Setup the filesystem basics
192
-        process = subprocess.Popen([self.prepare_command, '-w', self.photon_root, self.tools_path], stdout=self.output)
192
+        process = subprocess.Popen([self.prepare_command, '-w', self.photon_root], stdout=self.output)
193 193
         retval = process.wait()
194 194
 
195 195
     def finalize_system(self):
... ...
@@ -103,7 +103,7 @@ class IsoInstaller(object):
103 103
         root_password_reader = WindowStringReader(self.maxy, self.maxx, 10, 70, True,  'Set up root password',
104 104
             'Root password:', 
105 105
             2, self.install_config)
106
-        installer = Installer(self.install_config, self.maxy, self.maxx, True, tools_path=cd_path, rpm_path=os.path.join(cd_path, "RPMS"), log_path="/var/log", ks_config=ks_config)
106
+        installer = Installer(self.install_config, self.maxy, self.maxx, True, rpm_path=os.path.join(cd_path, "RPMS"), log_path="/var/log", ks_config=ks_config)
107 107
 
108 108
         # This represents the installer screen, the bool indicated if I can go back to this window or not
109 109
         items = []
... ...
@@ -28,6 +28,8 @@ fi
28 28
 
29 29
 RPMPKG=""
30 30
 RPMPKG=$(find ${RPMROOT} -name "$1-[0-9]*.rpm" -print)
31
+# TODO: sometimes we catch several items into RPMPKG.
32
+# In case we have several releases in rpm cache. Need to handle that.
31 33
 [ -z $RPMPKG ] && fail "installation error: rpm package not found\n"
32 34
 
33 35
 run_command "Installing: $1" "rpm --nodeps ${RPM_PARAMS} ${RPMPKG}" "${LOGFILE}"
... ...
@@ -17,13 +17,6 @@ source config.inc
17 17
 source function.inc
18 18
 PRGNAME=${0##*/}	# script name minus the path
19 19
 
20
-if [ $# -lt 1 ]; then
21
-   echo "Usage: $PRGNAME <tools path>"
22
-   exit 1
23
-fi
24
-
25
-TOOLS_PATH=$1
26
-
27 20
 LOGFILE=/var/log/"${PRGNAME}-${LOGFILE}"	#	set log file name
28 21
 #LOGFILE=/dev/null		#	uncomment to disable log file
29 22
 
... ...
@@ -87,7 +87,7 @@ if __name__ == '__main__':
87 87
     parser.add_option("-i", "--iso-path",  dest="iso_path")
88 88
     parser.add_option("-v", "--vmdk-path", dest="vmdk_path")
89 89
     parser.add_option("-w",  "--working-directory",  dest="working_directory", default="/mnt/photon-root")
90
-    parser.add_option("-t",  "--tools-path",  dest="tools_path", default="../stage")
90
+    parser.add_option("-l",  "--log-path",  dest="log_path", default="../stage/LOGS")
91 91
     parser.add_option("-r",  "--rpm-path",  dest="rpm_path", default="../stage/RPMS")
92 92
     parser.add_option("-f", "--force", action="store_true", dest="force", default=False)
93 93
     parser.add_option("-p", "--package-list-file", dest="package_list_file", default="package_list.json")
... ...
@@ -168,7 +168,7 @@ if __name__ == '__main__':
168 168
     config['working_directory'] = options.working_directory
169 169
 
170 170
     # Run the installer
171
-    package_installer = Installer(config, tools_path = options.tools_path, rpm_path = options.rpm_path, log_path = options.tools_path + "/LOGS")
171
+    package_installer = Installer(config, rpm_path = options.rpm_path, log_path = options.log_path)
172 172
     package_installer.install(None)
173 173
 
174 174
     # Making the iso if needed