Browse code

Build only minimal packages if minimal-ISO is being created. Also create common folder for all json package files to be used by both installer and package builder.

Touseef Liaqat authored on 2015/06/28 19:54:51
Showing 21 changed files
... ...
@@ -14,8 +14,12 @@ include $(MAKEROOT)/makedefs.mk
14 14
 export PATH := $(SRCROOT)/tools/bin:$(PATH)
15 15
 
16 16
 ifdef PHOTON_CACHE_PATH
17
+PHOTON_PACKAGES_MICRO := packages-cached
18
+PHOTON_PACKAGES_MINIMAL := packages-cached
17 19
 PHOTON_PACKAGES := packages-cached
18 20
 else
21
+PHOTON_PACKAGES_MICRO := packages-micro
22
+PHOTON_PACKAGES_MINIMAL := packages-minimal
19 23
 PHOTON_PACKAGES := packages
20 24
 endif
21 25
 
... ...
@@ -40,27 +44,60 @@ clean-install clean-chroot
40 40
 
41 41
 all: iso
42 42
 
43
-minimal: check $(PHOTON_STAGE) $(PHOTON_PACKAGES)
44
-	@echo "Building Photon ISO..."
45
-	@cp -f $(PHOTON_INSTALLER_DIR)/build_install_options_minimal.json $(PHOTON_INSTALLER_DIR)/install_options.json
43
+micro: check $(PHOTON_STAGE) $(PHOTON_PACKAGES_MICRO)
44
+	@echo "Building Photon Micro ISO..."
45
+	@cd $(PHOTON_INSTALLER_DIR) && \
46
+        $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon-micro.iso \
47
+                -w $(PHOTON_STAGE)/photon_iso \
48
+                -l $(PHOTON_STAGE)/LOGS \
49
+                -r $(PHOTON_STAGE)/RPMS \
50
+                -p $(PHOTON_DATA_DIR)/build_install_options_micro.json \
51
+                -f > \
52
+                $(PHOTON_LOGS_DIR)/installer.log 2>&1
53
+
54
+packages-micro: check $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES)
55
+	@echo "Building all Micro RPMS..."
56
+	@cd $(PHOTON_PKG_BUILDER_DIR) && \
57
+        $(PHOTON_PACKAGE_BUILDER) -o full \
58
+                -s $(PHOTON_SPECS_DIR) \
59
+                -r $(PHOTON_RPMS_DIR) \
60
+                -x $(PHOTON_SRCS_DIR) \
61
+                -b $(PHOTON_CHROOT_PATH) \
62
+                -l $(PHOTON_LOGS_DIR) \
63
+                -p $(PHOTON_PUBLISH_RPMS_DIR) \
64
+                -j $(PHOTON_DATA_DIR)/build_install_options_micro.json
65
+
66
+minimal: check $(PHOTON_STAGE) $(PHOTON_PACKAGES_MINIMAL)
67
+	@echo "Building Photon Minimal ISO..."
46 68
 	@cd $(PHOTON_INSTALLER_DIR) && \
47 69
         $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon-minimal.iso \
48 70
                 -w $(PHOTON_STAGE)/photon_iso \
49 71
                 -l $(PHOTON_STAGE)/LOGS \
50 72
                 -r $(PHOTON_STAGE)/RPMS \
51
-                -p $(PHOTON_INSTALLER_DIR)/install_options.json \
73
+                -p $(PHOTON_DATA_DIR)/build_install_options_minimal.json \
52 74
                 -f > \
53 75
                 $(PHOTON_LOGS_DIR)/installer.log 2>&1
54 76
 
77
+packages-minimal: check $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES)
78
+	@echo "Building all RPMS..."
79
+	@cd $(PHOTON_PKG_BUILDER_DIR) && \
80
+        $(PHOTON_PACKAGE_BUILDER) -o full \
81
+                -s $(PHOTON_SPECS_DIR) \
82
+                -r $(PHOTON_RPMS_DIR) \
83
+                -x $(PHOTON_SRCS_DIR) \
84
+                -b $(PHOTON_CHROOT_PATH) \
85
+                -l $(PHOTON_LOGS_DIR) \
86
+                -p $(PHOTON_PUBLISH_RPMS_DIR) \
87
+                -j $(PHOTON_DATA_DIR)/build_install_options_minimal.json
88
+
55 89
 iso: check $(PHOTON_STAGE) $(PHOTON_PACKAGES)
56
-	@echo "Building Photon ISO..."
57
-	@cp -f $(PHOTON_INSTALLER_DIR)/build_install_options_all.json $(PHOTON_INSTALLER_DIR)/install_options.json
90
+	@echo "Building Photon FUll ISO..."
58 91
 	@cd $(PHOTON_INSTALLER_DIR) && \
59 92
         sudo $(PHOTON_INSTALLER) -i $(PHOTON_STAGE)/photon.iso \
60 93
                 -w $(PHOTON_STAGE)/photon_iso \
61 94
                 -l $(PHOTON_STAGE)/LOGS \
62 95
                 -r $(PHOTON_STAGE)/RPMS \
63
-                -p $(PHOTON_INSTALLER_DIR)/install_options.json \
96
+                -p $(PHOTON_DATA_DIR)/build_install_options_all.json \
64 97
                 -f > \
65 98
                 $(PHOTON_LOGS_DIR)/installer.log 2>&1
66 99
 
... ...
@@ -74,7 +111,7 @@ packages: check $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN)
74 74
                 -b $(PHOTON_CHROOT_PATH) \
75 75
                 -l $(PHOTON_LOGS_DIR) \
76 76
                 -p $(PHOTON_PUBLISH_RPMS_DIR) \
77
-                -j $(PHOTON_PACKAGE_LIST)
77
+                -j $(PHOTON_DATA_DIR)/build_install_options_all.json
78 78
 
79 79
 packages-cached:
80 80
 	@echo "Using cached RPMS..."
81 81
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+{
1
+    "iso_packages" : {
2
+        "order" : 0,
3
+        "type" : "iso",
4
+        "title" : "ISO Packages",
5
+        "file" : "packages_iso.json",
6
+        "visible" : false
7
+    },
8
+    "micro_packages" : {
9
+        "order" : 1,
10
+        "type" : "micro",
11
+        "title" : "1. Photon Micro",
12
+        "file" : "packages_micro.json",
13
+        "visible" : true
14
+
15
+    },
16
+    "minimal_packages" : {
17
+        "order" : 2,
18
+        "type" : "minimal",
19
+        "title" : "2. Photon Minimal",
20
+        "file" : "packages_minimal.json",
21
+        "visible" : true
22
+    },
23
+    "full_packages" : {
24
+        "order" : 3,
25
+        "type" : "full",
26
+        "title" : "3. Photon Full",
27
+        "file" : "packages_full.json",
28
+        "visible" : true
29
+    }
30
+}
31
+
32
+
0 33
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+{
1
+    "iso_packages" : {
2
+        "order" : 0,
3
+        "type" : "iso",
4
+        "title" : "ISO Packages",
5
+        "file" : "packages_iso.json",
6
+        "visible" : false
7
+    },
8
+    "micro_packages" : {
9
+        "order" : 1,
10
+        "type" : "micro",
11
+        "title" : "Photon Micro",
12
+        "file" : "packages_micro.json",
13
+        "visible" : true
14
+    }
15
+}
0 16
\ No newline at end of file
1 17
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+{
1
+    "iso_packages" : {
2
+        "order" : 0,
3
+        "type" : "iso",
4
+        "title" : "ISO Packages",
5
+        "file" : "packages_iso.json",
6
+        "visible" : false
7
+    },
8
+    "minimal_packages" : {
9
+        "order" : 1,
10
+        "type" : "minimal",
11
+        "title" : "Photon Minimal",
12
+        "file" : "packages_minimal.json",
13
+        "visible" : true
14
+    }
15
+}
0 16
\ No newline at end of file
1 17
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+{
1
+    "packages":["unzip", "gmp-devel", "sudo", "bzip2-devel", "XML-Parser", "intltool", "mercurial", "libsigc++", "boost", 
2
+                "libgomp-devel", "libstdc++-devel", "libgcc-devel", "gcc", "bison", "gdb", "libpipeline", "python2-devel", 
3
+                "python2-tools", "linux-api-headers","gawk","check", "libltdl", "libltdl-devel", "pcre-devel", "glib-devel", 
4
+                "glibc-devel", "glibc-lang", "zlib-devel", "gettext", "git", "git-lang", "autoconf", "perl", "perl-DBI","perl-Config-IniFiles",
5
+                "perl-DBIx-Simple", "perl-DBD-SQLite","perl-Exporter-Tiny","perl-JSON-XS","perl-List-MoreUtils","perl-Module-Install",
6
+                "perl-Module-ScanDeps","perl-Types-Serialiser","perl-WWW-Curl","perl-YAML-Tiny","perl-YAML","perl-common-sense","perl-libintl","tcsh",
7
+                "gobject-introspection", "gobject-introspection-devel", "gobject-introspection-python", "procps-ng-devel", 
8
+                "bash-lang", "kbd", "coreutils-lang", "libxslt", "docbook-xml", "docbook-xsl", "gtk-doc", "popt-devel", "texinfo", "tar", 
9
+                "kubernetes", "cyrus-sasl", "openldap", "binutils-devel", "python-iniparse", "psmisc", "etcd", "openssl-devel", 
10
+                "util-linux-lang", "db-docs", "linux-dev", "linux-docs", "mpc", "json-glib", "json-glib-devel", 
11
+                "automake", "libpcap", "tcpdump", "elfutils-libelf-devel", "elfutils", "elfutils-devel", "elfutils-devel-static", "elfutils-libelf-devel-static", 
12
+                "go", "grub-lang", "diffutils", "groff", "man-db", "mpfr-devel", "man-pages", 
13
+                "hawkey-devel", "python-hawkey", "libxml2-devel", "ruby", "readline-devel", "wget",
14
+                "Linux-PAM-lang", "make", "bindutils", "gperf", "lua-devel", "which", "less",
15
+                "cmake", "gpgme-devel", "parted", "vim", "xz-devel", "xerces-c-devel", "xml-security-c-devel", 
16
+                "nss-devel", "ncurses-devel", "tzdata", "itstool", "sed-lang", "gptfdisk", "ntp", "flex", "patch", "m4", "dracut", "dracut-tools", 
17
+                "libarchive", "libsoup", "asciidoc", "mkinitcpio",
18
+                "ostree", "tdnf-devel", "librepo-devel", "libhif", "libhif-devel", "rpm-ostree", "createrepo", "glibmm", "deltarpm", "cdrkit", "dparted", "libgsystem",
19
+                "rpm-ostree-toolbox","libsepol","libselinux","device-mapper-libs","device-mapper",
20
+                "acl","btrfs-progs","btrfs-progs-devel","device-mapper-devel","device-mapper-event","device-mapper-event-devel",
21
+                "device-mapper-event-libs","libacl","libacl-devel","libselinux-devel","libselinux-python","libselinux-utils","libsepol-devel",
22
+                "libaio","libaio-devel","thin-provisioning-tools","lvm2","lvm2-devel","lvm2-libs","lvm2-python-libs","lzo","lzo-devel","lzo-minilzo","swig",
23
+                "rpm-devel","pycurl","urlgrabber","yum-metadata-parser","yum", "rocket", "strace", "cracklib-python",
24
+                "haveged", "haveged-devel",
25
+                "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "zookeeper", "fuse"]
26
+}
27
+
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+{
1
+    "packages":["glibc", "zlib", "filesystem",
2
+                "binutils", "gmp", "mpfr", "libgcc", "libstdc++", 
3
+                "sed", "bzip2", "pkg-config", "readline", "ncurses", "bash",
4
+                "cracklib", "cracklib-dicts", "cracklib-python", "shadow", "procps-ng", 
5
+                "coreutils", "iana-etc", "grep", "bc", "libtool",
6
+                "inetutils", "findutils",
7
+                "xz", "grub", "iproute2", "kmod",
8
+                "util-linux", "e2fsprogs",
9
+                "libffi", "expat",
10
+                "linux", "cpio",
11
+                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
12
+                "elfutils-libelf", "sqlite-autoconf", "nspr", "nss", "popt", "lua", "rpm",
13
+                "gptfdisk", "tar", "gzip", "openssl", "python2", "python2-libs", "python-requests",
14
+                "pcre", "glib", "parted", "libsigc++", "XML-Parser", "glibmm", "dparted",
15
+                "libgsystem", "ostree"]
16
+}
17
+
18
+
0 19
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+{
1
+    "packages":["glibc","zlib", "filesystem",
2
+                "gmp", "mpfr", "libgcc", "libstdc++",
3
+                "bzip2", "pkg-config", "ncurses", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "e2fsprogs",
4
+                "iana-etc", "readline", "coreutils", "bash", "bc", "libtool",
5
+                "inetutils",
6
+                "xz", "grub", "iproute2", "kbd", "kmod", "libpipeline",
7
+                "util-linux",
8
+                "openssl", "libffi", "expat",
9
+                "linux", "curl",
10
+                "iptables", "ca-certificates",
11
+                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
12
+                "sqlite-autoconf", "elfutils-libelf", "elfutils-libelf-devel",
13
+                "nspr", "nss", "popt", "lua", "rpm", "openssh",
14
+                "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "pcre", "glib", "tdnf",
15
+                "photon-release"
16
+                ]
17
+}
18
+
19
+
0 20
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+{
1
+    "packages":["glibc", "zlib", "filesystem", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp", 
2
+                "pkg-config", "ncurses", "readline", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "iana-etc", "coreutils", "bc", "libtool", "inetutils",
3
+                "findutils", "xz", "grub", "iproute2", "util-linux", "openssl", "kmod", "linux", "ca-certificates", "curl", "iptables", "Linux-PAM",
4
+                "attr", "libcap", "systemd", "expat", "dbus", "file", "e2fsprogs", "elfutils-libelf", "lua", "popt", "sqlite-autoconf", "nspr", "nss", "rpm",
5
+                "openssh", "libffi", "gdbm", "python2", "python2-libs", "pcre", "glib", "libxml2",
6
+                "photon-release",
7
+                "sed", "grep", "cpio", "gzip", "nano", "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "tdnf",
8
+                "libdnet", "xerces-c", "xml-security-c", "libmspack", "open-vm-tools",
9
+                "docker","bridge-utils",
10
+                "libyaml", "PyYAML", "python-requests", "python-prettytable", "python-jsonpointer", "python-jsonpatch", "python-six", "python-configobj", "cloud-init",
11
+		         "krb5", "e2fsprogs-devel"]
12
+}
13
+
14
+
0 15
deleted file mode 100644
... ...
@@ -1,33 +0,0 @@
1
-{
2
-    "iso_packages" : {
3
-        "order" : 0,
4
-        "type" : "iso",
5
-        "title" : "ISO Packages",
6
-        "file" : "packages_iso.json",
7
-        "visible" : false
8
-    },
9
-    "micro_packages" : {
10
-        "order" : 1,
11
-        "type" : "micro",
12
-        "title" : "1. Photon Micro",
13
-        "file" : "packages_micro.json",
14
-        "visible" : true
15
-
16
-    },
17
-    "minimal_packages" : {
18
-        "order" : 2,
19
-        "type" : "minimal",
20
-        "title" : "2. Photon Minimal",
21
-        "file" : "packages_minimal.json",
22
-        "visible" : true
23
-    },
24
-    "full_packages" : {
25
-        "order" : 3,
26
-        "type" : "full",
27
-        "title" : "3. Photon Full",
28
-        "file" : "packages_full.json",
29
-        "visible" : true
30
-    }
31
-}
32
-
33
-
34 1
deleted file mode 100644
... ...
@@ -1,16 +0,0 @@
1
-{
2
-    "iso_packages" : {
3
-        "order" : 0,
4
-        "type" : "iso",
5
-        "title" : "ISO Packages",
6
-        "file" : "packages_iso.json",
7
-        "visible" : false
8
-    },
9
-    "minimal_packages" : {
10
-        "order" : 1,
11
-        "type" : "micro",
12
-        "title" : "Photon Minimal",
13
-        "file" : "packages_minimal.json",
14
-        "visible" : true
15
-    }
16
-}
17 1
\ No newline at end of file
... ...
@@ -4,6 +4,8 @@
4 4
 #
5 5
 #    Author: Mahmoud Bassiouny <mbassiouny@vmware.com>
6 6
 
7
+from optparse import OptionParser
8
+import os.path
7 9
 import curses
8 10
 import sys
9 11
 import subprocess
... ...
@@ -65,7 +67,7 @@ class IsoInstaller(object):
65 65
         print "Failed to mount the cd, exiting the installer, check the logs for more details"
66 66
         raise Exception("Can not mount the cd")
67 67
     
68
-    def __init__(self, stdscreen):
68
+    def __init__(self, stdscreen, options_file):
69 69
         self.screen = stdscreen
70 70
 
71 71
         # Init the colors
... ...
@@ -95,8 +97,7 @@ class IsoInstaller(object):
95 95
 
96 96
         license_agreement = License(self.maxy, self.maxx)
97 97
         select_disk = SelectDisk(self.maxy, self.maxx, self.install_config)
98
-        package_selector = PackageSelector(self.maxy, self.maxx, self.install_config)
99
-        custom_package_selector = CustomPackageSelector(self.maxy, self.maxx, self.install_config)
98
+        package_selector = PackageSelector(self.maxy, self.maxx, self.install_config, options_file)
100 99
         hostname_reader = WindowStringReader(self.maxy, self.maxx, 10, 70, False,  'Choose the hostname for your system',
101 100
             'Hostname:', 
102 101
             2, self.install_config)
... ...
@@ -112,7 +113,6 @@ class IsoInstaller(object):
112 112
                     (license_agreement.display, False),
113 113
                     (select_disk.display, True),
114 114
                     (package_selector.display, True),
115
-                    (custom_package_selector.display, False),
116 115
                     (hostname_reader.get_user_string, True),
117 116
                     (root_password_reader.get_user_string, True),
118 117
                  ]
... ...
@@ -135,4 +135,9 @@ class IsoInstaller(object):
135 135
                     index = 0
136 136
 
137 137
 if __name__ == '__main__':
138
-    curses.wrapper(IsoInstaller)
138
+    usage = "Usage: %prog [options]"
139
+    parser = OptionParser(usage)
140
+    parser.add_option("-j",  "--json-file", dest="options_file",  default="input.json")
141
+
142
+    (options,  args) = parser.parse_args()
143
+    curses.wrapper(IsoInstaller, options.options_file)
... ...
@@ -30,7 +30,8 @@ ISO_OUTPUT_NAME=$1
30 30
 RPMS_PATH=$2
31 31
 PACKAGE_LIST_FILE=$3
32 32
 RPM_LIST=$4
33
-
33
+PHOTON_COMMON_DIR=$(dirname "${PACKAGE_LIST_FILE}")
34
+PACKAGE_LIST_FILE_BASE_NAME=$(basename "${PACKAGE_LIST_FILE}")
34 35
 #- Step 3 Setting up the boot loader
35 36
 WORKINGDIR=${BUILDROOT}
36 37
 BUILDROOT=${BUILDROOT}/photon-chroot
... ...
@@ -42,9 +43,8 @@ find ${BUILDROOT} -name linux-[0-9]*.rpm | head -1 | xargs rpm2cpio | cpio -iv -
42 42
 
43 43
 rm -f ${BUILDROOT}/installer/*.pyc
44 44
 rm -rf ${BUILDROOT}/installer/BUILD_DVD
45
-# replace default package_list with specific one
46
-cp $PACKAGE_LIST_FILE ${BUILDROOT}/installer/package_list.json
47
-
45
+# Copy package list json files
46
+cp -rf $PHOTON_COMMON_DIR ${BUILDROOT}/installer/
48 47
 #ID in the initrd.gz now is PHOTON_VMWARE_CD . This is how we recognize that the cd is actually ours. touch this file there.
49 48
 touch ${WORKINGDIR}/PHOTON_VMWARE_CD
50 49
 
... ...
@@ -69,7 +69,7 @@ cp BUILD_DVD/fstab ${BUILDROOT}/etc/fstab
69 69
 cat >> ${BUILDROOT}/bin/bootphotoninstaller << EOF
70 70
 #!/bin/bash
71 71
 cd /installer
72
-./isoInstaller.py 2> /var/log/installer && shutdown -r now
72
+./isoInstaller.py --json-file=./data/$PACKAGE_LIST_FILE_BASE_NAME 2> /var/log/installer && shutdown -r now
73 73
 /bin/bash
74 74
 EOF
75 75
 
... ...
@@ -94,7 +94,10 @@ rm -rf ${BUILDROOT}/RPMS
94 94
 cd ${RPMS_PATH}
95 95
 mkdir ${WORKINGDIR}/RPMS
96 96
 for rpm_name in $RPM_LIST; do
97
-    cp --parent `find . -name "$rpm_name-[0-9]*" -type f` ${WORKINGDIR}/RPMS/;
97
+    FILENAME="`find . -name "$rpm_name-[0-9]*" -type f`"
98
+    if [ -n "$FILENAME" ]; then
99
+        cp --parent $FILENAME ${WORKINGDIR}/RPMS/;
100
+    fi
98 101
 done
99 102
 )
100 103
 
101 104
deleted file mode 100644
... ...
@@ -1,74 +0,0 @@
1
-{
2
-    "iso_packages":["glibc", "zlib", "filesystem",
3
-                "binutils", "gmp", "mpfr", "libgcc", "libstdc++", 
4
-                "sed", "bzip2", "pkg-config", "readline", "ncurses", "bash",
5
-                "cracklib", "cracklib-dicts", "cracklib-python", "shadow", "procps-ng", 
6
-                "coreutils", "iana-etc", "grep", "bc", "libtool",
7
-                "inetutils", "findutils",
8
-                "xz", "grub", "iproute2", "kmod",
9
-                "util-linux", "e2fsprogs",
10
-                "libffi", "expat",
11
-                "linux", "cpio",
12
-                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
13
-                "elfutils-libelf", "sqlite-autoconf", "nspr", "nss", "popt", "lua", "rpm",
14
-                "gptfdisk", "tar", "gzip", "openssl", "python2", "python2-libs", "python-requests",
15
-                "pcre", "glib", "parted", "libsigc++", "XML-Parser", "glibmm", "dparted",
16
-                "libgsystem", "ostree"],
17
-
18
-    "micro_packages":["glibc","zlib", "filesystem",
19
-                "gmp", "mpfr", "libgcc", "libstdc++",
20
-                "bzip2", "pkg-config", "ncurses", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "e2fsprogs",
21
-                "iana-etc", "readline", "coreutils", "bash", "bc", "libtool",
22
-                "inetutils",
23
-                "xz", "grub", "iproute2", "kbd", "kmod", "libpipeline",
24
-                "util-linux",
25
-                "openssl", "libffi", "expat",
26
-                "linux", "curl",
27
-                "iptables", "ca-certificates",
28
-                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
29
-                "sqlite-autoconf", "elfutils-libelf", "elfutils-libelf-devel",
30
-                "nspr", "nss", "popt", "lua", "rpm", "openssh",
31
-                "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "pcre", "glib", "tdnf",
32
-                "photon-release"
33
-                ],
34
-
35
-    "minimal_packages":["glibc", "zlib", "filesystem", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp", 
36
-                "pkg-config", "ncurses", "readline", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "iana-etc", "coreutils", "bc", "libtool", "inetutils",
37
-                "findutils", "xz", "grub", "iproute2", "util-linux", "openssl", "kmod", "linux", "ca-certificates", "curl", "iptables", "Linux-PAM",
38
-                "attr", "libcap", "systemd", "expat", "dbus", "file", "e2fsprogs", "elfutils-libelf", "lua", "popt", "sqlite-autoconf", "nspr", "nss", "rpm",
39
-                "openssh", "libffi", "gdbm", "python2", "python2-libs", "pcre", "glib", "libxml2",
40
-                "photon-release",
41
-                "sed", "grep", "cpio", "gzip", "nano", "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "tdnf",
42
-                "libdnet", "xerces-c", "xml-security-c", "libmspack", "open-vm-tools",
43
-                "docker","bridge-utils",
44
-                "libyaml", "PyYAML", "python-requests", "python-prettytable", "python-jsonpointer", "python-jsonpatch", "python-six", "python-configobj", "cloud-init",
45
-		"krb5", "e2fsprogs-devel"],
46
-
47
-    "optional_packages":["unzip", "gmp-devel", "sudo", "bzip2-devel", "XML-Parser", "intltool", "mercurial", "libsigc++", "boost", 
48
-                "libgomp-devel", "libstdc++-devel", "libgcc-devel", "gcc", "bison", "gdb", "libpipeline", "python2-devel", 
49
-                "python2-tools", "linux-api-headers","gawk","check", "libltdl", "libltdl-devel", "pcre-devel", "glib-devel", 
50
-                "glibc-devel", "glibc-lang", "zlib-devel", "gettext", "git", "git-lang", "autoconf", "perl", "perl-DBI","perl-Config-IniFiles",
51
-                "perl-DBIx-Simple", "perl-DBD-SQLite","perl-Exporter-Tiny","perl-JSON-XS","perl-List-MoreUtils","perl-Module-Install",
52
-                "perl-Module-ScanDeps","perl-Types-Serialiser","perl-WWW-Curl","perl-YAML-Tiny","perl-YAML","perl-common-sense","perl-libintl","tcsh",
53
-                "gobject-introspection", "gobject-introspection-devel", "gobject-introspection-python", "procps-ng-devel", 
54
-                "bash-lang", "kbd", "coreutils-lang", "libxslt", "docbook-xml", "docbook-xsl", "gtk-doc", "popt-devel", "texinfo", "tar", 
55
-                "kubernetes", "cyrus-sasl", "openldap", "binutils-devel", "python-iniparse", "psmisc", "etcd", "openssl-devel", 
56
-                "util-linux-lang", "db-docs", "linux-dev", "linux-docs", "mpc", "json-glib", "json-glib-devel", 
57
-                "automake", "libpcap", "tcpdump", "elfutils-libelf-devel", "elfutils", "elfutils-devel", "elfutils-devel-static", "elfutils-libelf-devel-static", 
58
-                "go", "grub-lang", "diffutils", "groff", "man-db", "mpfr-devel", "man-pages", 
59
-                "hawkey-devel", "python-hawkey", "busybox", "libxml2-devel", "ruby", "readline-devel", "wget", "cifs-utils", 
60
-                "Linux-PAM-lang", "make", "bindutils", "gperf", "lua-devel", "which", "less",  
61
-                "cmake", "gpgme-devel", "parted", "vim", "xz-devel", "xerces-c-devel", "xml-security-c-devel", 
62
-                "nss-devel", "ncurses-devel", "tzdata", "itstool", "sed-lang", "gptfdisk", "ntp", "flex", "patch", "m4", "dracut", "dracut-tools", 
63
-                "libarchive", "libsoup", "asciidoc", "mkinitcpio",
64
-                "ostree", "tdnf-devel", "librepo-devel", "libhif", "libhif-devel", "rpm-ostree", "createrepo", "glibmm", "deltarpm", "cdrkit", "dparted", "libgsystem",
65
-                "rpm-ostree-toolbox","libsepol","libselinux","device-mapper-libs","device-mapper",
66
-                "acl","btrfs-progs","btrfs-progs-devel","device-mapper-devel","device-mapper-event","device-mapper-event-devel",
67
-                "device-mapper-event-libs","libacl","libacl-devel","libselinux-devel","libselinux-python","libselinux-utils","libsepol-devel",
68
-                "libaio","libaio-devel","thin-provisioning-tools","lvm2","lvm2-devel","lvm2-libs","lvm2-python-libs","lzo","lzo-devel","lzo-minilzo","swig",
69
-                "rpm-devel","pycurl","urlgrabber","yum-metadata-parser","yum", "rocket", "strace", "cracklib-python",
70
-                "haveged", "haveged-devel",
71
-                "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "zookeeper", "fuse"]
72
-}
73
-
74
-
75 1
deleted file mode 100644
... ...
@@ -1,29 +0,0 @@
1
-{
2
-    "packages":["unzip", "gmp-devel", "sudo", "bzip2-devel", "XML-Parser", "intltool", "mercurial", "libsigc++", "boost", 
3
-                "libgomp-devel", "libstdc++-devel", "libgcc-devel", "gcc", "bison", "gdb", "libpipeline", "python2-devel", 
4
-                "python2-tools", "linux-api-headers","gawk","check", "libltdl", "libltdl-devel", "pcre-devel", "glib-devel", 
5
-                "glibc-devel", "glibc-lang", "zlib-devel", "gettext", "git", "git-lang", "autoconf", "perl", "perl-DBI","perl-Config-IniFiles",
6
-                "perl-DBIx-Simple", "perl-DBD-SQLite","perl-Exporter-Tiny","perl-JSON-XS","perl-List-MoreUtils","perl-Module-Install",
7
-                "perl-Module-ScanDeps","perl-Types-Serialiser","perl-WWW-Curl","perl-YAML-Tiny","perl-YAML","perl-common-sense","perl-libintl","tcsh",
8
-                "gobject-introspection", "gobject-introspection-devel", "gobject-introspection-python", "procps-ng-devel", 
9
-                "bash-lang", "kbd", "coreutils-lang", "libxslt", "docbook-xml", "docbook-xsl", "gtk-doc", "popt-devel", "texinfo", "tar", 
10
-                "kubernetes", "cyrus-sasl", "openldap", "binutils-devel", "python-iniparse", "psmisc", "etcd", "openssl-devel", 
11
-                "util-linux-lang", "db-docs", "linux-dev", "linux-docs", "mpc", "json-glib", "json-glib-devel", 
12
-                "automake", "libpcap", "tcpdump", "elfutils-libelf-devel", "elfutils", "elfutils-devel", "elfutils-devel-static", "elfutils-libelf-devel-static", 
13
-                "go", "grub-lang", "diffutils", "groff", "man-db", "mpfr-devel", "man-pages", 
14
-                "hawkey-devel", "python-hawkey", "busybox", "libxml2-devel", "ruby", "readline-devel", "wget", "cifs-utils", 
15
-                "Linux-PAM-lang", "make", "bindutils", "gperf", "lua-devel", "which", "less",  
16
-                "cmake", "gpgme-devel", "parted", "vim", "xz-devel", "xerces-c-devel", "xml-security-c-devel", 
17
-                "nss-devel", "ncurses-devel", "tzdata", "itstool", "sed-lang", "gptfdisk", "ntp", "flex", "patch", "m4", "dracut", "dracut-tools", 
18
-                "libarchive", "libsoup", "asciidoc", "mkinitcpio",
19
-                "ostree", "tdnf-devel", "librepo-devel", "libhif", "libhif-devel", "rpm-ostree", "createrepo", "glibmm", "deltarpm", "cdrkit", "dparted", "libgsystem",
20
-                "rpm-ostree-toolbox","libsepol","libselinux","device-mapper-libs","device-mapper",
21
-                "acl","btrfs-progs","btrfs-progs-devel","device-mapper-devel","device-mapper-event","device-mapper-event-devel",
22
-                "device-mapper-event-libs","libacl","libacl-devel","libselinux-devel","libselinux-python","libselinux-utils","libsepol-devel",
23
-                "libaio","libaio-devel","thin-provisioning-tools","lvm2","lvm2-devel","lvm2-libs","lvm2-python-libs","lzo","lzo-devel","lzo-minilzo","swig",
24
-                "rpm-devel","pycurl","urlgrabber","yum-metadata-parser","yum", "rocket", "strace", "cracklib-python",
25
-                "haveged", "haveged-devel",
26
-                "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "zookeeper", "fuse"]
27
-}
28
-
29
-
30 1
deleted file mode 100644
... ...
@@ -1,19 +0,0 @@
1
-{
2
-    "packages":["glibc", "zlib", "filesystem",
3
-                "binutils", "gmp", "mpfr", "libgcc", "libstdc++", 
4
-                "sed", "bzip2", "pkg-config", "readline", "ncurses", "bash",
5
-                "cracklib", "cracklib-dicts", "cracklib-python", "shadow", "procps-ng", 
6
-                "coreutils", "iana-etc", "grep", "bc", "libtool",
7
-                "inetutils", "findutils",
8
-                "xz", "grub", "iproute2", "kmod",
9
-                "util-linux", "e2fsprogs",
10
-                "libffi", "expat",
11
-                "linux", "cpio",
12
-                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
13
-                "elfutils-libelf", "sqlite-autoconf", "nspr", "nss", "popt", "lua", "rpm",
14
-                "gptfdisk", "tar", "gzip", "openssl", "python2", "python2-libs", "python-requests",
15
-                "pcre", "glib", "parted", "libsigc++", "XML-Parser", "glibmm", "dparted",
16
-                "libgsystem", "ostree"]
17
-}
18
-
19
-
20 1
deleted file mode 100644
... ...
@@ -1,20 +0,0 @@
1
-{
2
-    "packages":["glibc","zlib", "filesystem",
3
-                "gmp", "mpfr", "libgcc", "libstdc++",
4
-                "bzip2", "pkg-config", "ncurses", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "e2fsprogs",
5
-                "iana-etc", "readline", "coreutils", "bash", "bc", "libtool",
6
-                "inetutils",
7
-                "xz", "grub", "iproute2", "kbd", "kmod", "libpipeline",
8
-                "util-linux",
9
-                "openssl", "libffi", "expat",
10
-                "linux", "curl",
11
-                "iptables", "ca-certificates",
12
-                "Linux-PAM", "attr", "libcap", "systemd", "dbus",
13
-                "sqlite-autoconf", "elfutils-libelf", "elfutils-libelf-devel",
14
-                "nspr", "nss", "popt", "lua", "rpm", "openssh",
15
-                "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "pcre", "glib", "tdnf",
16
-                "photon-release"
17
-                ]
18
-}
19
-
20
-
21 1
deleted file mode 100644
... ...
@@ -1,15 +0,0 @@
1
-{
2
-    "packages":["glibc", "zlib", "filesystem", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp", 
3
-                "pkg-config", "ncurses", "readline", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow", "procps-ng", "iana-etc", "coreutils", "bc", "libtool", "inetutils",
4
-                "findutils", "xz", "grub", "iproute2", "util-linux", "openssl", "kmod", "linux", "ca-certificates", "curl", "iptables", "Linux-PAM",
5
-                "attr", "libcap", "systemd", "expat", "dbus", "file", "e2fsprogs", "elfutils-libelf", "lua", "popt", "sqlite-autoconf", "nspr", "nss", "rpm",
6
-                "openssh", "libffi", "gdbm", "python2", "python2-libs", "pcre", "glib", "libxml2",
7
-                "photon-release",
8
-                "sed", "grep", "cpio", "gzip", "nano", "db", "libsolv", "libgpg-error", "hawkey", "libassuan", "gpgme", "librepo", "tdnf",
9
-                "libdnet", "xerces-c", "xml-security-c", "libmspack", "open-vm-tools",
10
-                "docker","bridge-utils",
11
-                "libyaml", "PyYAML", "python-requests", "python-prettytable", "python-jsonpointer", "python-jsonpatch", "python-six", "python-configobj", "cloud-init",
12
-		         "krb5", "e2fsprogs-devel"]
13
-}
14
-
15
-
... ...
@@ -5,6 +5,7 @@
5 5
 #    Author: Mahmoud Bassiouny <mbassiouny@vmware.com>
6 6
 
7 7
 import json
8
+import os
8 9
 import curses
9 10
 from sets import Set
10 11
 from jsonwrapper import JsonWrapper
... ...
@@ -13,7 +14,7 @@ from window import Window
13 13
 from actionresult import ActionResult
14 14
 
15 15
 class PackageSelector(object):
16
-    def __init__(self,  maxy, maxx, install_config):
16
+    def __init__(self,  maxy, maxx, install_config, options_file):
17 17
         self.install_config = install_config
18 18
         self.maxx = maxx
19 19
         self.maxy = maxy
... ...
@@ -25,12 +26,13 @@ class PackageSelector(object):
25 25
 
26 26
         self.menu_starty = self.win_starty + 3
27 27
 
28
-        self.load_package_list()
28
+        self.load_package_list(options_file)
29 29
 
30 30
         self.window = Window(self.win_height, self.win_width, self.maxy, self.maxx, 'Select Installation', True, self.package_menu)
31 31
 
32
-    def load_package_list(self):
33
-        json_wrapper_option_list = JsonWrapper("install_options.json")
32
+    def load_package_list(self, options_file):
33
+        base_path = os.path.dirname(options_file)
34
+        json_wrapper_option_list = JsonWrapper(options_file)
34 35
         option_list_json = json_wrapper_option_list.read()
35 36
         options_sorted = sorted(option_list_json.items(), key=lambda item: item[1]['order'])
36 37
 
... ...
@@ -38,7 +40,8 @@ class PackageSelector(object):
38 38
 
39 39
         for install_option in options_sorted:
40 40
             if install_option[1]["visible"] == True:
41
-                json_wrapper_package_list = JsonWrapper(install_option[1]["file"])
41
+                file_path = os.path.join(base_path, install_option[1]["file"])
42
+                json_wrapper_package_list = JsonWrapper(file_path)
42 43
                 package_list_json = json_wrapper_package_list.read()
43 44
                 self.package_menu_items.append((install_option[1]["title"], self.exit_function, [install_option[1]["type"], package_list_json["packages"]] ))
44 45
 
... ...
@@ -77,15 +77,18 @@ def create_vmdk_and_partition(config, vmdk_path):
77 77
         elif line.startswith("ROOT_PARTITION="):
78 78
             partitions_data['root'] = line.replace("ROOT_PARTITION=", "").strip()
79 79
             count += 1
80
-    
80
+
81 81
     return partitions_data, count == 2
82
+
82 83
 def create_rpm_list_to_copy_in_iso(build_install_option):
84
+    base_path = os.path.dirname(build_install_option)
83 85
     json_wrapper_option_list = JsonWrapper(build_install_option)
84 86
     option_list_json = json_wrapper_option_list.read()
85 87
     options_sorted = sorted(option_list_json.items(), key=lambda item: item[1]['order'])
86 88
     packages = []
87 89
     for install_option in options_sorted:
88
-        json_wrapper_package_list = JsonWrapper(install_option[1]["file"])
90
+        file_path = os.path.join(base_path, install_option[1]["file"])
91
+        json_wrapper_package_list = JsonWrapper(file_path)
89 92
         package_list_json = json_wrapper_package_list.read()
90 93
         packages = packages + package_list_json["packages"]
91 94
     return packages
... ...
@@ -100,7 +103,7 @@ if __name__ == '__main__':
100 100
     parser.add_option("-l",  "--log-path",  dest="log_path", default="../stage/LOGS")
101 101
     parser.add_option("-r",  "--rpm-path",  dest="rpm_path", default="../stage/RPMS")
102 102
     parser.add_option("-f", "--force", action="store_true", dest="force", default=False)
103
-    parser.add_option("-p", "--package-list-file", dest="package_list_file", default="package_list.json")
103
+    parser.add_option("-p", "--package-list-file", dest="package_list_file", default="../common/data/build_install_options_all.json")
104 104
     
105 105
     (options,  args) = parser.parse_args()
106 106
     
... ...
@@ -143,26 +146,20 @@ if __name__ == '__main__':
143 143
         else:
144 144
             config['password'] = crypt.crypt(config['password']['text'], "$6$" + "".join([random.choice(string.ascii_letters + string.digits) for _ in range(16)]))
145 145
 
146
-
147 146
     # Check the installation type
148
-    package_list_iso = JsonWrapper("packages_iso.json").read()
149
-    package_list_micro = JsonWrapper("packages_micro.json").read()
150
-    package_list_minimal = JsonWrapper("packages_minimal.json").read()
151
-    package_list_full = JsonWrapper("packages_full.json").read()
152
-
153
-
147
+    json_wrapper_option_list = JsonWrapper(options.package_list_file)
148
+    option_list_json = json_wrapper_option_list.read()
149
+    options_sorted = sorted(option_list_json.items(), key=lambda item: item[1]['order'])
150
+    packages = []
151
+    base_path = os.path.dirname(options.package_list_file)
152
+    for install_option in options_sorted:
153
+        print install_option
154
+        if (config['iso_system'] == True and install_option[1]['type'] == "iso") or (install_option[1]['type'] == config['type']):
155
+            json_wrapper_package_list = JsonWrapper(os.path.join(base_path, install_option[1]["file"]))
156
+            package_list_json = json_wrapper_package_list.read()
157
+            packages = package_list_json["packages"]
158
+            break
154 159
 
155
-    if config['iso_system']:
156
-        packages = package_list_iso["packages"]
157
-    elif config['type'] == 'micro':
158
-        packages = package_list_micro["packages"]
159
-    elif config['type'] == 'minimal':
160
-        packages = package_list_minimal["packages"]
161
-    elif config['type'] == 'full':
162
-        packages = package_list_minimal["packages"] + package_list_full["packages"]
163
-    else:
164
-        #TODO: error
165
-        packages = []
166 160
     config['packages'] = packages
167 161
 
168 162
     # Cleanup the working directory
... ...
@@ -22,6 +22,8 @@ PHOTON_STAGE?=$(SRCROOT)/stage
22 22
 PHOTON_LOGS_DIR=$(PHOTON_STAGE)/LOGS
23 23
 PHOTON_RPMS_DIR=$(PHOTON_STAGE)/RPMS
24 24
 PHOTON_SPECS_DIR?=$(SRCROOT)/SPECS
25
+PHOTON_COMMON_DIR?=$(SRCROOT)/common
26
+PHOTON_DATA_DIR?=$(PHOTON_COMMON_DIR)/data
25 27
 PHOTON_SRCS_DIR=$(PHOTON_STAGE)/SOURCES
26 28
 PHOTON_PUBLISH_RPMS_DIR=$(PHOTON_STAGE)/PUBLISHRPMS
27 29
 
... ...
@@ -120,10 +120,8 @@ def buildAPackage(package):
120 120
     pkgManager.buildPackages(listPackages)
121 121
 
122 122
 def buildPackagesFromGivenJSONFile(inputJSONFile,buildOption,logger):
123
-    jsonData=open(inputJSONFile)
124
-    jsonObj = json.load(jsonData)
125
-    jsonData.close()
126
-    listPackages=jsonObj[buildOption]
123
+    listPackages = get_all_package_names(inputJSONFile)
124
+
127 125
     listPackagesToBuild=[]
128 126
     for pkg in listPackages:
129 127
         p =  pkg.encode('utf-8')
... ...
@@ -133,6 +131,22 @@ def buildPackagesFromGivenJSONFile(inputJSONFile,buildOption,logger):
133 133
     pkgManager = PackageManager()
134 134
     pkgManager.buildPackages(listPackagesToBuild)
135 135
     
136
- 
136
+def get_all_package_names(build_install_option):
137
+    base_path = os.path.dirname(build_install_option)
138
+    jsonData = open(build_install_option)
139
+    option_list_json = json.load(jsonData)
140
+    jsonData.close()
141
+    options_sorted = sorted(option_list_json.items(), key=lambda item: item[1]['order'])
142
+    packages = []
143
+
144
+    for install_option in options_sorted:
145
+        filename = os.path.join(base_path, install_option[1]["file"])
146
+        jsonData=open(filename)
147
+        package_list_json = json.load(jsonData)
148
+        jsonData.close()
149
+        packages = packages + package_list_json["packages"]
150
+
151
+    return packages
152
+
137 153
 if __name__=="__main__":
138 154
     main()