|
| 1 | +From 997e619c91efb9fe70160ef2066bf93a82d058ab Mon Sep 17 00:00:00 2001 |
| 2 | +From: Piyush Gupta < [email protected]> |
| 3 | +Date: Fri, 27 Jan 2023 06:51:21 +0000 |
| 4 | +Subject: [PATCH] customIso: Use branch specific license text and EULA. |
| 5 | + |
| 6 | +Change-Id: I73f64c79a82267e8b7670ab42148a7e99db11b43 |
| 7 | +--- |
| 8 | + photon_installer/generate_initrd.sh | 11 +++++++++-- |
| 9 | + photon_installer/isoBuilder.py | 3 ++- |
| 10 | + 2 files changed, 11 insertions(+), 3 deletions(-) |
| 11 | + |
| 12 | +diff --git a/photon_installer/generate_initrd.sh b/photon_installer/generate_initrd.sh |
| 13 | +index d5eec35e..f823f27b 100755 |
| 14 | +--- a/photon_installer/generate_initrd.sh |
| 15 | ++++ b/photon_installer/generate_initrd.sh |
| 16 | +@@ -11,9 +11,16 @@ CUSTOM_PKG_LIST_FILE=$5 |
| 17 | + PACKAGE_LIST_FILE_BASE_NAME="build_install_options_custom.json" |
| 18 | + CUSTOM_PKG_LIST_FILE_BASE_NAME=$(basename "${CUSTOM_PKG_LIST_FILE}") |
| 19 | + INITRD=$WORKINGDIR/photon-chroot |
| 20 | ++LICENSE_TEXT="VMWARE $PHOTON_RELEASE_VER" |
| 21 | + |
| 22 | + mkdir -m 755 -p $INITRD |
| 23 | + |
| 24 | ++if ! eval "$(grep -m 1 -w 'BETA LICENSE AGREEMENT' $WORKINGDIR/EULA.txt)"; then |
| 25 | ++ LICENSE_TEXT+=" BETA" |
| 26 | ++fi |
| 27 | ++ |
| 28 | ++LICENSE_TEXT+=" LICENSE AGREEMENT" |
| 29 | ++ |
| 30 | + cat > ${WORKINGDIR}/photon-local.repo <<EOF |
| 31 | + [photon-local] |
| 32 | + name=VMware Photon Linux |
| 33 | +@@ -71,7 +78,7 @@ mv ${INITRD}/boot ${WORKINGDIR}/ |
| 34 | + |
| 35 | + mkdir -p $INITRD/installer |
| 36 | + cp $SCRIPT_PATH/sample_ui.cfg ${INITRD}/installer |
| 37 | +-cp $SCRIPT_PATH/EULA.txt ${INITRD}/installer |
| 38 | ++mv ${WORKINGDIR}/EULA.txt ${INITRD}/installer |
| 39 | + |
| 40 | + # TODO: change minimal to custom.json |
| 41 | + cat > ${INITRD}/installer/build_install_options_custom.json << EOF |
| 42 | +@@ -116,7 +123,7 @@ cat >> ${INITRD}/bin/bootphotoninstaller << EOF |
| 43 | + cd /installer |
| 44 | + ACTIVE_CONSOLE="\$(< /sys/devices/virtual/tty/console/active)" |
| 45 | + install() { |
| 46 | +- LANG=en_US.UTF-8 photon-installer -i iso -o $PACKAGE_LIST_FILE_BASE_NAME -e EULA.txt -t "VMWARE 4.0 LICENSE AGREEMENT" -v $PHOTON_RELEASE_VER && shutdown -r now |
| 47 | ++ LANG=en_US.UTF-8 photon-installer -i iso -o $PACKAGE_LIST_FILE_BASE_NAME -e EULA.txt -t "$LICENSE_TEXT" -v $PHOTON_RELEASE_VER && shutdown -r now |
| 48 | + } |
| 49 | + try_run_installer() { |
| 50 | + if [ "\$ACTIVE_CONSOLE" == "tty0" ]; then |
| 51 | +diff --git a/photon_installer/isoBuilder.py b/photon_installer/isoBuilder.py |
| 52 | +index b7167c65..5babef12 100755 |
| 53 | +--- a/photon_installer/isoBuilder.py |
| 54 | ++++ b/photon_installer/isoBuilder.py |
| 55 | +@@ -229,7 +229,8 @@ class IsoBuilder(object): |
| 56 | + # Download open source license for given branch and extract it in working dir. |
| 57 | + files_to_download = [f"https://github.com/vmware/photon/raw/{self.photon_release_version}/support/image-builder/iso/open_source_license.tar.gz", |
| 58 | + f"https://raw.githubusercontent.com/vmware/photon/{self.photon_release_version}/NOTICE-Apachev2", |
| 59 | +- f"https://raw.githubusercontent.com/vmware/photon/{self.photon_release_version}/NOTICE-GPL2.0"] |
| 60 | ++ f"https://raw.githubusercontent.com/vmware/photon/{self.photon_release_version}/NOTICE-GPL2.0", |
| 61 | ++ f"https://raw.githubusercontent.com/vmware/photon/{self.photon_release_version}/EULA.txt"] |
| 62 | + for file in files_to_download: |
| 63 | + self.logger.info(f"Downloading file: {file}") |
| 64 | + self.cmdUtil.wget(file, f'{self.working_dir}/{os.path.basename(file)}') |
| 65 | +-- |
| 66 | +2.23.3 |
| 67 | + |
0 commit comments