Change-Id: If17b129fd407acf05773230a368bb37939019777
Reviewed-on: http://photon-jenkins.eng.vmware.com/708
Tested-by: jenkins-photon <wangnan2015@hotmail.com>
Reviewed-by: suezzelur <anishs@vmware.com>
| ... | ... |
@@ -341,6 +341,7 @@ generate-dep-lists: |
| 341 | 341 |
done |
| 342 | 342 |
|
| 343 | 343 |
docker-image: |
| 344 |
+ sudo docker build --no-cache --tag photon-build ./support/dockerfiles/photon |
|
| 344 | 345 |
sudo docker run \ |
| 345 | 346 |
-it \ |
| 346 | 347 |
--rm \ |
| ... | ... |
@@ -349,7 +350,7 @@ docker-image: |
| 349 | 349 |
-e PHOTON_BUILD_NUMBER=$(PHOTON_BUILD_NUMBER) \ |
| 350 | 350 |
-e PHOTON_RELEASE_VERSION=$(PHOTON_RELEASE_VERSION) \ |
| 351 | 351 |
-v `pwd`:/workspace \ |
| 352 |
- vmware/build-photon \ |
|
| 352 |
+ photon-build \ |
|
| 353 | 353 |
./support/dockerfiles/photon/make-docker-image.sh tdnf |
| 354 | 354 |
|
| 355 | 355 |
install-docker-image: docker-image |
| ... | ... |
@@ -1,12 +1,12 @@ |
| 1 | 1 |
Summary: Photon release files |
| 2 | 2 |
Name: photon-release |
| 3 | 3 |
Version: 1.0 |
| 4 |
-Release: 3%{?dist}
|
|
| 4 |
+Release: 4%{?dist}
|
|
| 5 | 5 |
License: Apache License |
| 6 | 6 |
Group: System Environment/Base |
| 7 | 7 |
URL: https://vmware.github.io/photon/ |
| 8 |
-Source: %{name}-%{version}.2.tar.gz
|
|
| 9 |
-%define sha1 photon-release=4c03ec658315e25873e5e5f3e77c0006ddfeecc6 |
|
| 8 |
+Source: %{name}-%{version}.4.tar.gz
|
|
| 9 |
+%define sha1 photon-release=d67b149f28117f1ad30acb585f180f8fa951f679 |
|
| 10 | 10 |
Vendor: VMware, Inc. |
| 11 | 11 |
Distribution: Photon |
| 12 | 12 |
Provides: photon-release |
| ... | ... |
@@ -17,7 +17,7 @@ Requires: rpm |
| 17 | 17 |
Photon release files such as yum configs and other /etc/ release related files |
| 18 | 18 |
|
| 19 | 19 |
%prep |
| 20 |
-%setup -q -n %{name}-%{version}.2
|
|
| 20 |
+%setup -q -n %{name}-%{version}.4
|
|
| 21 | 21 |
|
| 22 | 22 |
%build |
| 23 | 23 |
|
| ... | ... |
@@ -25,13 +25,6 @@ Photon release files such as yum configs and other /etc/ release related files |
| 25 | 25 |
rm -rf $RPM_BUILD_ROOT |
| 26 | 26 |
install -d $RPM_BUILD_ROOT/etc |
| 27 | 27 |
install -d $RPM_BUILD_ROOT/usr/lib |
| 28 |
-install -d -m 755 $RPM_BUILD_ROOT/etc/yum.repos.d |
|
| 29 |
-for file in *repo ; do |
|
| 30 |
- install -m 644 $file $RPM_BUILD_ROOT/etc/yum.repos.d |
|
| 31 |
-done |
|
| 32 |
- |
|
| 33 |
-install -d -m 755 $RPM_BUILD_ROOT/etc/pki/rpm-gpg |
|
| 34 |
-install -m 644 VMWARE-RPM-GPG-KEY $RPM_BUILD_ROOT/etc/pki/rpm-gpg |
|
| 35 | 28 |
|
| 36 | 29 |
echo "VMware Photon Linux %{photon_release_version}" > %{buildroot}/etc/photon-release
|
| 37 | 30 |
echo "PHOTON_BUILD_NUMBER=%{photon_build_number}" >> %{buildroot}/etc/photon-release
|
| ... | ... |
@@ -66,22 +59,12 @@ Welcome to Photon 1.0 (x86_64) - Kernel %r (%t) |
| 66 | 66 |
EOF |
| 67 | 67 |
|
| 68 | 68 |
%post |
| 69 |
-# Remove __db* files to workaround BD version check bug in rpm |
|
| 70 |
-rm -f /var/lib/rpm/__db* |
|
| 71 |
-rpm --import /etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY |
|
| 72 | 69 |
|
| 73 | 70 |
%clean |
| 74 | 71 |
rm -rf $RPM_BUILD_ROOT |
| 75 | 72 |
|
| 76 | 73 |
%files |
| 77 | 74 |
%defattr(-,root,root,-) |
| 78 |
-%dir /etc/yum.repos.d |
|
| 79 |
-/etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY |
|
| 80 |
-%config(noreplace) /etc/yum.repos.d/photon-iso.repo |
|
| 81 |
-%config(noreplace) /etc/yum.repos.d/photon.repo |
|
| 82 |
-%config(noreplace) /etc/yum.repos.d/photon-updates.repo |
|
| 83 |
-%config(noreplace) /etc/yum.repos.d/lightwave.repo |
|
| 84 |
-%config(noreplace) /etc/yum.repos.d/photon-extras.repo |
|
| 85 | 75 |
%config(noreplace) /etc/photon-release |
| 86 | 76 |
%config(noreplace) /etc/lsb-release |
| 87 | 77 |
%config(noreplace) /usr/lib/os-release |
| ... | ... |
@@ -90,9 +73,11 @@ rm -rf $RPM_BUILD_ROOT |
| 90 | 90 |
%config(noreplace) /etc/issue.net |
| 91 | 91 |
|
| 92 | 92 |
%changelog |
| 93 |
+* Mon Apr 11 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0-4 |
|
| 94 |
+- Split up repo and gpg key files to photon-repos |
|
| 93 | 95 |
* Thu Mar 24 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0-3 |
| 94 | 96 |
- yum repo gpgkey to VMWARE-RPM-GPG-KEY. |
| 95 |
-* Tue Mar 23 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0-2 |
|
| 97 |
+* Wed Mar 23 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0-2 |
|
| 96 | 98 |
- Add revision to photon-release |
| 97 | 99 |
* Mon Jan 11 2016 Anish Swaminathan <anishs@vmware.com> 1.0-1 |
| 98 | 100 |
- Reset version to match with Photon version |
| 99 | 101 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,51 @@ |
| 0 |
+Summary: Photon repo files, gpg keys |
|
| 1 |
+Name: photon-repos |
|
| 2 |
+Version: 1.0 |
|
| 3 |
+Release: 1%{?dist}
|
|
| 4 |
+License: Apache License |
|
| 5 |
+Group: System Environment/Base |
|
| 6 |
+URL: https://vmware.github.io/photon/ |
|
| 7 |
+Source: %{name}-%{version}.tar.gz
|
|
| 8 |
+%define sha1 photon-repos=0be4c46922ad6f990e28e05fef75e2d1341aaf4a |
|
| 9 |
+Vendor: VMware, Inc. |
|
| 10 |
+Distribution: Photon |
|
| 11 |
+Provides: photon-repos |
|
| 12 |
+BuildArch: noarch |
|
| 13 |
+Requires: rpm |
|
| 14 |
+ |
|
| 15 |
+%description |
|
| 16 |
+Photon repo files and gpg keys |
|
| 17 |
+ |
|
| 18 |
+%prep |
|
| 19 |
+%setup -q -n %{name}-%{version}
|
|
| 20 |
+ |
|
| 21 |
+%build |
|
| 22 |
+ |
|
| 23 |
+%install |
|
| 24 |
+rm -rf $RPM_BUILD_ROOT |
|
| 25 |
+install -d -m 755 $RPM_BUILD_ROOT/etc/yum.repos.d |
|
| 26 |
+for file in *repo ; do |
|
| 27 |
+ install -m 644 $file $RPM_BUILD_ROOT/etc/yum.repos.d |
|
| 28 |
+done |
|
| 29 |
+ |
|
| 30 |
+install -d -m 755 $RPM_BUILD_ROOT/etc/pki/rpm-gpg |
|
| 31 |
+install -m 644 VMWARE-RPM-GPG-KEY $RPM_BUILD_ROOT/etc/pki/rpm-gpg |
|
| 32 |
+ |
|
| 33 |
+%post |
|
| 34 |
+ |
|
| 35 |
+%clean |
|
| 36 |
+rm -rf $RPM_BUILD_ROOT |
|
| 37 |
+ |
|
| 38 |
+%files |
|
| 39 |
+%defattr(-,root,root,-) |
|
| 40 |
+%dir /etc/yum.repos.d |
|
| 41 |
+/etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY |
|
| 42 |
+%config(noreplace) /etc/yum.repos.d/photon-iso.repo |
|
| 43 |
+%config(noreplace) /etc/yum.repos.d/photon.repo |
|
| 44 |
+%config(noreplace) /etc/yum.repos.d/photon-updates.repo |
|
| 45 |
+%config(noreplace) /etc/yum.repos.d/lightwave.repo |
|
| 46 |
+%config(noreplace) /etc/yum.repos.d/photon-extras.repo |
|
| 47 |
+ |
|
| 48 |
+%changelog |
|
| 49 |
+* Mon Apr 11 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0-1 |
|
| 50 |
+- Initial |
| ... | ... |
@@ -4,7 +4,7 @@ |
| 4 | 4 |
"findutils", "xz", "iproute2", "util-linux", "kmod", "linux", "ca-certificates", "curl", "iptables", "Linux-PAM", |
| 5 | 5 |
"systemd", "dbus", "file", "e2fsprogs", "rpm", |
| 6 | 6 |
"openssh", "gdbm", "python2", "python2-libs", "python-xml", |
| 7 |
- "photon-release", |
|
| 7 |
+ "photon-release", "photon-repos", |
|
| 8 | 8 |
"sed", "grep", "cpio", "gzip", "vim", "db", "tdnf", |
| 9 | 9 |
"open-vm-tools", |
| 10 | 10 |
"docker","bridge-utils", |
| ... | ... |
@@ -4,7 +4,7 @@ |
| 4 | 4 |
"findutils", "xz", "iproute2", "util-linux", "kmod", "linux-esx", "ca-certificates", "curl", "iptables", "Linux-PAM", |
| 5 | 5 |
"systemd", "dbus", "file", "e2fsprogs", "rpm", |
| 6 | 6 |
"openssh", "gdbm", "python2", "python2-libs", "python-xml", |
| 7 |
- "photon-release", |
|
| 7 |
+ "photon-release", "photon-repos", |
|
| 8 | 8 |
"sed", "grep", "cpio", "gzip", "vim", "db", "tdnf", |
| 9 | 9 |
"open-vm-tools", |
| 10 | 10 |
"docker","bridge-utils", |
| ... | ... |
@@ -38,7 +38,8 @@ cd ${BUILDROOT} || fail "${PRGNAME}: Change directory: ${BUILDROOT}: FAILURE"
|
| 38 | 38 |
if [[ $# -gt 0 ]] && [[ $1 == 'install' ]]; then |
| 39 | 39 |
mkdir -p ${BUILDROOT}/var/lib/rpm
|
| 40 | 40 |
rpm --root ${BUILDROOT} --initdb
|
| 41 |
- tdnf install filesystem --installroot ${BUILDROOT} --nogpgcheck --assumeyes
|
|
| 41 |
+ tdnf install filesystem photon-repos --installroot ${BUILDROOT} --nogpgcheck --assumeyes
|
|
| 42 |
+ rpm --root ${BUILDROOT} --import ${BUILDROOT}/etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
|
|
| 42 | 43 |
else |
| 43 | 44 |
RPMPKG="$(find RPMS -name 'filesystem-[0-9]*.rpm' -print)" |
| 44 | 45 |
[ -z ${RPMPKG} ] && fail " Filesystem rpm package missing: Can not continue"
|
| ... | ... |
@@ -17,17 +17,9 @@ TEMP_CHROOT=$(pwd)/temp_chroot |
| 17 | 17 |
ROOTFS_TAR_FILENAME=photon-rootfs-$PHOTON_RELEASE_VERSION-$PHOTON_BUILD_NUMBER.tar.bz2 |
| 18 | 18 |
STAGE_DIR=$(pwd)/stage |
| 19 | 19 |
|
| 20 |
-sudo createrepo $STAGE_DIR/RPMS |
|
| 20 |
+rm -rf /etc/yum.repos.d/* |
|
| 21 | 21 |
|
| 22 |
-cat > yum.conf <<- EOF |
|
| 23 |
- |
|
| 24 |
-[main] |
|
| 25 |
-cachedir=$(pwd)/temp_chroot/var/cache/yum |
|
| 26 |
-keepcache=1 |
|
| 27 |
-debuglevel=2 |
|
| 28 |
-logfile=$(pwd)/temp_chroot/var/log/yum.log |
|
| 29 |
-exactarch=1 |
|
| 30 |
-obsoletes=1 |
|
| 22 |
+cat > /etc/yum.repos.d/photon-local.repo <<- EOF |
|
| 31 | 23 |
|
| 32 | 24 |
[photon-local] |
| 33 | 25 |
name=VMware Photon Linux 1.0(x86_64) |
| ... | ... |
@@ -42,42 +34,21 @@ EOF |
| 42 | 42 |
rm -rf $TEMP_CHROOT |
| 43 | 43 |
mkdir $TEMP_CHROOT |
| 44 | 44 |
|
| 45 |
-# use host's yum to install in chroot |
|
| 46 |
-mkdir -p $TEMP_CHROOT/var/lib/rpm |
|
| 47 | 45 |
rpm --root $TEMP_CHROOT/ --initdb |
| 48 |
-yum -c yum.conf --disablerepo=* --enablerepo=photon-local --installroot=$TEMP_CHROOT install -y filesystem glibc |
|
| 49 |
-yum -c yum.conf --disablerepo=* --enablerepo=photon-local --installroot=$TEMP_CHROOT install -y tdnf vim bash coreutils photon-release $MAIN_PACKAGE |
|
| 50 |
-yum -c yum.conf --disablerepo=* --enablerepo=photon-local --installroot=$TEMP_CHROOT clean all |
|
| 51 |
- |
|
| 52 |
-cp $(pwd)/stage/RPMS/noarch/photon-release*.rpm $TEMP_CHROOT |
|
| 53 |
-cp /etc/resolv.conf $TEMP_CHROOT/etc/ |
|
| 54 |
- |
|
| 55 |
-# # reinstalling inside to make sure rpmdb is created for tdnf. |
|
| 56 |
-# # TODO find better solution. |
|
| 57 |
-chroot $TEMP_CHROOT bash -c \ |
|
| 58 |
- "rpm -Uvh --nodeps photon-release*.rpm; \ |
|
| 59 |
- tdnf install -y filesystem; \ |
|
| 60 |
- tdnf install -y glibc ; \ |
|
| 61 |
- tdnf install -y bash ; \ |
|
| 62 |
- tdnf install -y coreutils ; \ |
|
| 63 |
- tdnf install -y util-linux; \ |
|
| 64 |
- tdnf install -y tdnf ; \ |
|
| 65 |
- tdnf install -y findutils ; \ |
|
| 66 |
- tdnf install -y vim ; \ |
|
| 67 |
- tdnf install -y grep ; \ |
|
| 68 |
- tdnf install -y which ;" |
|
| 46 |
+tdnf upgrade -y tdnf |
|
| 47 |
+tdnf --installroot $TEMP_CHROOT/ install -y bash coreutils filesystem findutils glibc grep photon-release photon-repos tdnf util-linux vim which |
|
| 69 | 48 |
|
| 49 |
+rpm --root $TEMP_CHROOT/ --import $TEMP_CHROOT/etc/pki/rpm-gpg/* |
|
| 70 | 50 |
|
| 71 | 51 |
cd $TEMP_CHROOT |
| 72 | 52 |
# cleanup anything not needed inside rootfs |
| 73 |
-rm -f photon-release*.rpm |
|
| 74 | 53 |
rm -rf usr/src/ |
| 75 | 54 |
rm -rf home/* |
| 76 | 55 |
# rm -rf var/lib/yum/* |
| 77 | 56 |
rm -rf var/log/* |
| 78 | 57 |
|
| 79 | 58 |
#find var/cache/tdnf/photon/rpms -type f -name "*.rpm" -exec rm {} \;
|
| 80 |
- |
|
| 59 |
+tdnf install -y tar |
|
| 81 | 60 |
tar cpjf ../$ROOTFS_TAR_FILENAME . |
| 82 | 61 |
mkdir -p $STAGE_DIR |
| 83 | 62 |
mv ../$ROOTFS_TAR_FILENAME $STAGE_DIR/ |
| ... | ... |
@@ -85,5 +56,4 @@ cd .. |
| 85 | 85 |
|
| 86 | 86 |
# cleanup |
| 87 | 87 |
rm -rf $TEMP_CHROOT |
| 88 |
-rm yum.conf |
|
| 89 | 88 |
|