Retire repository
Fuel (from openstack namespace) and fuel-ccp (in x namespace) repositories are unused and ready to retire. This change removes all content from the repository and adds the usual README file to point out that the repository is retired following the process from https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project See also http://lists.openstack.org/pipermail/openstack-discuss/2019-December/011647.html Depends-On: https://review.opendev.org/699362 Change-Id: I274ce8f03b58ad770221219c197336055e263d38
This commit is contained in:
parent
64476145da
commit
32ca1f64ab
26
.gitignore
vendored
26
.gitignore
vendored
@ -1,26 +0,0 @@
|
||||
*.pyc
|
||||
*.sqlite
|
||||
|
||||
*.gem
|
||||
|
||||
# vim swap files
|
||||
.*.swp
|
||||
|
||||
# services' runtime files
|
||||
*.log
|
||||
*.pid
|
||||
|
||||
# Vagrant housekeeping file
|
||||
/.vagrant
|
||||
|
||||
/build
|
||||
/local_mirror
|
||||
nosetests.xml
|
||||
nailgun.log
|
||||
lock
|
||||
|
||||
.idea
|
||||
.DS_Store
|
||||
|
||||
Nailgun.egg-info
|
||||
repomd.xml*
|
@ -1,13 +0,0 @@
|
||||
diff --git a/debmirror b/debmirror
|
||||
index 0c2543c..f2fdd61 100755
|
||||
--- a/debmirror
|
||||
+++ b/debmirror
|
||||
@@ -2116,7 +2116,7 @@ sub name_release {
|
||||
|
||||
if ($origin eq "none") {
|
||||
$codename = $dist_raw;
|
||||
- } elsif ($origin eq "Ubuntu" or $origin eq "Canonical") {
|
||||
+ } elsif ($origin eq "Ubuntu" or $origin eq "Canonical" or $origin eq "Mirantis") {
|
||||
if ($suite) {
|
||||
say("Ubuntu Release file: using Suite ($suite).");
|
||||
$codename = $suite;
|
176
LICENSE
176
LICENSE
@ -1,176 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
67
MAINTAINERS
67
MAINTAINERS
@ -1,67 +0,0 @@
|
||||
---
|
||||
description:
|
||||
For Fuel team structure and contribution policy, see [1].
|
||||
|
||||
This is repository level MAINTAINERS file. All contributions to this
|
||||
repository must be approved by one or more Core Reviewers [2].
|
||||
If you are contributing to files (or create new directories) in
|
||||
root folder of this repository, please contact Core Reviewers for
|
||||
review and merge requests.
|
||||
|
||||
If you are contributing to subfolders of this repository, please
|
||||
check 'maintainers' section of this file in order to find maintainers
|
||||
for those specific modules.
|
||||
|
||||
It is mandatory to get +1 from one or more maintainers before asking
|
||||
Core Reviewers for review/merge in order to decrease a load on Core Reviewers [3].
|
||||
Exceptions are when maintainers are actually cores, or when maintainers
|
||||
are not available for some reason (e.g. on vacation).
|
||||
|
||||
[1] https://specs.openstack.org/openstack/fuel-specs/policy/team-structure
|
||||
[2] https://review.openstack.org/#/admin/groups/659,members
|
||||
[3] http://lists.openstack.org/pipermail/openstack-dev/2015-August/072406.html
|
||||
|
||||
Please keep this file in YAML format in order to allow helper scripts
|
||||
to read this as a configuration data.
|
||||
|
||||
maintainers:
|
||||
|
||||
- ./:
|
||||
|
||||
- name: Alexei Sheplyakov
|
||||
email: asheplyakov@mirantis.com
|
||||
IRC: asheplyakov
|
||||
|
||||
- name: Sergey Kulanov
|
||||
email: skulanov@mirantis.com
|
||||
IRC: sergk
|
||||
|
||||
- name: Vitaly Parakhin
|
||||
email: vparakhin@mirantis.com
|
||||
IRC: brain461
|
||||
|
||||
- specs/:
|
||||
|
||||
- name: Mikhail Ivanov
|
||||
email: mivanov@mirantis.com
|
||||
IRC: mivanov
|
||||
|
||||
- name: Artem Silenkov
|
||||
email: asilenkov@mirantis.com
|
||||
IRC: asilenkov
|
||||
|
||||
- name: Alexander Tsamutali
|
||||
email: atsamutali@mirantis.com
|
||||
IRC: astsmtl
|
||||
|
||||
- name: Daniil Trishkin
|
||||
email: dtrishkin@mirantis.com
|
||||
IRC: dtrishkin
|
||||
|
||||
- name: Ivan Udovichenko
|
||||
email: iudovichenko@mirantis.com
|
||||
IRC: tlbr
|
||||
|
||||
- name: Igor Yozhikov
|
||||
email: iyozhikov@mirantis.com
|
||||
IRC: IgorYozhikov
|
75
Makefile
75
Makefile
@ -1,75 +0,0 @@
|
||||
.PHONY: all clean help deep_clean
|
||||
|
||||
help:
|
||||
@echo 'Build directives (can be overrided by environment variables'
|
||||
@echo 'or by command line parameters):'
|
||||
@echo ' SOURCE_DIR: $(SOURCE_DIR)'
|
||||
@echo ' BUILD_DIR: $(BUILD_DIR)'
|
||||
@echo ' LOCAL_MIRROR: $(LOCAL_MIRROR)'
|
||||
@echo ' YUM_REPOS: $(YUM_REPOS)'
|
||||
@echo ' MIRROR_CENTOS: $(MIRROR_CENTOS)'
|
||||
@echo ' EXTRA_RPM_REPOS: $(EXTRA_RPM_REPOS)'
|
||||
@echo ' EXTRA_DEB_REPOS: $(EXTRA_DEB_REPOS)'
|
||||
@echo ' ISO_DIR/ISO_NAME: $(ISO_PATH)'
|
||||
@echo ' ENV_NAME: $(ENV_NAME)'
|
||||
@echo ' KSYAML: $(KSYAML)'
|
||||
@echo
|
||||
@echo 'Available targets:'
|
||||
@echo ' all - build product'
|
||||
@echo ' iso - build iso image'
|
||||
@echo ' clean - remove build directory and resetting .done flags'
|
||||
@echo ' deep_clean - clean + removing $(LOCAL_MIRROR) directory'
|
||||
@echo
|
||||
@echo 'To build system using one of the proprietary mirrors use '
|
||||
@echo 'the following commands:'
|
||||
@echo
|
||||
@echo 'Saratov office (default):'
|
||||
@echo 'make iso'
|
||||
@echo
|
||||
@echo 'Moscow office:'
|
||||
@echo 'make iso USE_MIRROR=msk'
|
||||
@echo
|
||||
@echo 'Custom location:'
|
||||
@echo 'make iso YUM_REPOS=proprietary MIRROR_CENTOS=http://<your_mirror>/centos'
|
||||
@echo
|
||||
@echo 'Extra RPM repos:'
|
||||
@echo 'make iso EXTRA_RPM_REPOS="<repo1_name>,http://<repo1> <repo2_name>,ftp://<repo2>"'
|
||||
@echo
|
||||
@echo 'Extra DEB repos:'
|
||||
@echo 'make iso EXTRA_DEB_REPOS="http://<repo1>/ubuntu /|ftp://<repo2> precise main"'
|
||||
@echo
|
||||
|
||||
# Path to the sources.
|
||||
# Default value: directory with Makefile
|
||||
SOURCE_DIR?=$(dir $(lastword $(MAKEFILE_LIST)))
|
||||
SOURCE_DIR:=$(abspath $(SOURCE_DIR))
|
||||
|
||||
all: iso
|
||||
|
||||
clean:
|
||||
sudo rm -rf $(BUILD_DIR)
|
||||
deep_clean: clean
|
||||
sudo rm -rf $(LOCAL_MIRROR)
|
||||
|
||||
vbox-scripts:
|
||||
echo "Target is deprecated. Virtualbox scripts have been moved to http://git.openstack.org/openstack/fuel-virtualbox.git"
|
||||
|
||||
# Common configuration file.
|
||||
include $(SOURCE_DIR)/config.mk
|
||||
|
||||
.PHONY: current-version
|
||||
current-version: $(BUILD_DIR)/current_version
|
||||
$(BUILD_DIR)/current_version: $(call depv,CURRENT_VERSION)
|
||||
echo $(CURRENT_VERSION) > $@
|
||||
|
||||
# Macroses for make
|
||||
include $(SOURCE_DIR)/rules.mk
|
||||
|
||||
# Sandbox macroses.
|
||||
include $(SOURCE_DIR)/sandbox.mk
|
||||
|
||||
# Modules
|
||||
include $(SOURCE_DIR)/repos.mk
|
||||
include $(SOURCE_DIR)/mirror/module.mk
|
||||
include $(SOURCE_DIR)/packages/module.mk
|
||||
include $(SOURCE_DIR)/iso/module.mk
|
41
README.md
41
README.md
@ -1,41 +0,0 @@
|
||||
Team and repository tags
|
||||
========================
|
||||
|
||||
[![Team and repository tags](http://governance.openstack.org/badges/fuel-main.svg)](http://governance.openstack.org/reference/tags/index.html)
|
||||
|
||||
<!-- Change things from this point on -->
|
||||
|
||||
FUEL
|
||||
====
|
||||
|
||||
This git repository contains Fuel ISO build scripts.
|
||||
|
||||
Directory structure:
|
||||
- ```fuel-bootstrap-image```
|
||||
Scripts which allow us to build Ubuntu based bootstrap ramdisk on the
|
||||
Fuel master node in runtime. The status of this ramdisk is experimental.
|
||||
- ```iso```
|
||||
Scripts that are used for building Fuel ISO.
|
||||
- ```mirror```
|
||||
Scripts to build local mirrors that are used for building chroot environments, bootstrap and
|
||||
target images, etc.
|
||||
- ```packages```
|
||||
Scripts that are used for building Fuel RPM and DEB packages.
|
||||
- ```specs```
|
||||
RPM spec for fuel and fuel-release packages.
|
||||
- ```utils```
|
||||
Auxiliary scripts. (being deprecated)
|
||||
- ```Makefile```
|
||||
It is the main GNU Make file which includes all other necessary GNU Make files.
|
||||
- ```config.mk```
|
||||
The file where the whole build process is parametrized.
|
||||
- ```prepare-build-env.sh```
|
||||
The script installs all necessary packages that are needed for the build process. Currently
|
||||
only Ubuntu 14.04 is supported.
|
||||
- ```repos.mk```
|
||||
The script which downloads git repositories that are needed for the build process.
|
||||
- ```requirements-rpm.txt```
|
||||
This file is used when building local RPM mirror. All RPM packages that are needed for Fuel
|
||||
are listed here.
|
||||
- ```sandbox.mk```
|
||||
The script that is used for building chroot environments.
|
10
README.rst
Normal file
10
README.rst
Normal file
@ -0,0 +1,10 @@
|
||||
This project is no longer maintained.
|
||||
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
For any further questions, please email
|
||||
openstack-discuss@lists.openstack.org or join #openstack-dev on
|
||||
Freenode.
|
202
config.mk
202
config.mk
@ -1,202 +0,0 @@
|
||||
#
|
||||
# Build directives. Can be overrided by environment variables.
|
||||
#
|
||||
|
||||
# Base path for build and mirror directories.
|
||||
# Default value: current directory
|
||||
TOP_DIR?=$(PWD)
|
||||
TOP_DIR:=$(abspath $(TOP_DIR))
|
||||
# Working build directory
|
||||
BUILD_DIR?=$(TOP_DIR)/build
|
||||
BUILD_DIR:=$(abspath $(BUILD_DIR))
|
||||
# Path for build artifacts
|
||||
ARTS_DIR?=$(BUILD_DIR)/artifacts
|
||||
ARTS_DIR:=$(abspath $(ARTS_DIR))
|
||||
# Path for cache of downloaded packages
|
||||
LOCAL_MIRROR?=$(TOP_DIR)/local_mirror
|
||||
LOCAL_MIRROR:=$(abspath $(LOCAL_MIRROR))
|
||||
|
||||
PRODUCT_VERSION?=10.0
|
||||
|
||||
# This variable is used for naming of auxillary objects
|
||||
# related to product: repositories, mirrors etc
|
||||
PRODUCT_NAME:=mos
|
||||
|
||||
CURRENT_VERSION:=$(PRODUCT_VERSION)
|
||||
|
||||
PACKAGE_VERSION?=10.0.0
|
||||
FUEL_LIBRARY_VERSION?=10.0
|
||||
|
||||
# Artifacts names
|
||||
ISO_NAME?=fuel-$(PRODUCT_VERSION)
|
||||
|
||||
# Where we put artifacts
|
||||
ISO_PATH:=$(ARTS_DIR)/$(ISO_NAME).iso
|
||||
|
||||
MASTER_IP?=10.20.0.2
|
||||
MASTER_DNS?=10.20.0.1
|
||||
MASTER_NETMASK?=255.255.255.0
|
||||
MASTER_GW?=10.20.0.1
|
||||
|
||||
CENTOS_MAJOR?=7
|
||||
CENTOS_RELEASE:=$(CENTOS_MAJOR)
|
||||
CENTOS_ARCH:=x86_64
|
||||
|
||||
UBUNTU_RELEASE?=xenial
|
||||
UBUNTU_MAJOR?=16
|
||||
UBUNTU_MINOR?=04
|
||||
UBUNTU_RELEASE_NUMBER:=$(UBUNTU_MAJOR).$(UBUNTU_MINOR)
|
||||
UBUNTU_KERNEL_FLAVOR?=lts-xenial
|
||||
UBUNTU_NETBOOT_FLAVOR?=netboot
|
||||
UBUNTU_ARCH:=amd64
|
||||
UBUNTU_IMAGE_RELEASE:=$(UBUNTU_MAJOR)$(UBUNTU_MINOR)
|
||||
SEPARATE_IMAGES?=/boot,ext2 /,ext4
|
||||
|
||||
# Rebuld packages locally (do not use upstream versions)
|
||||
BUILD_PACKAGES?=1
|
||||
|
||||
# by default we are not allowed to downgrade rpm packages,
|
||||
# setting this flag to 0 will cause to use repo priorities only (!)
|
||||
DENY_RPM_DOWNGRADE?=1
|
||||
|
||||
# Do not compress javascript and css files
|
||||
NO_UI_OPTIMIZE:=0
|
||||
|
||||
# Repos and versions
|
||||
FUELLIB_COMMIT?=master
|
||||
NAILGUN_COMMIT?=master
|
||||
PYTHON_FUELCLIENT_COMMIT?=master
|
||||
FUEL_AGENT_COMMIT?=master
|
||||
FUEL_NAILGUN_AGENT_COMMIT?=master
|
||||
ASTUTE_COMMIT?=master
|
||||
OSTF_COMMIT?=master
|
||||
FUEL_MIRROR_COMMIT?=master
|
||||
FUELMENU_COMMIT?=master
|
||||
SHOTGUN_COMMIT?=master
|
||||
NETWORKCHECKER_COMMIT?=master
|
||||
FUELUPGRADE_COMMIT?=master
|
||||
FUEL_UI_COMMIT?=master
|
||||
|
||||
FUELLIB_REPO?=https://github.com/openstack/fuel-library.git
|
||||
NAILGUN_REPO?=https://github.com/openstack/fuel-web.git
|
||||
PYTHON_FUELCLIENT_REPO?=https://github.com/openstack/python-fuelclient.git
|
||||
FUEL_AGENT_REPO?=https://github.com/openstack/fuel-agent.git
|
||||
FUEL_NAILGUN_AGENT_REPO?=https://github.com/openstack/fuel-nailgun-agent.git
|
||||
ASTUTE_REPO?=https://github.com/openstack/fuel-astute.git
|
||||
OSTF_REPO?=https://github.com/openstack/fuel-ostf.git
|
||||
FUELMENU_REPO?=https://github.com/openstack/fuel-menu.git
|
||||
SHOTGUN_REPO?=https://github.com/openstack/shotgun.git
|
||||
NETWORKCHECKER_REPO?=https://github.com/openstack/network-checker.git
|
||||
FUEL_UI_REPO?=https://github.com/openstack/fuel-ui.git
|
||||
|
||||
# Gerrit URLs and commits
|
||||
FUELLIB_GERRIT_URL?=https://review.openstack.org/openstack/fuel-library
|
||||
NAILGUN_GERRIT_URL?=https://review.openstack.org/openstack/fuel-web
|
||||
PYTHON_FUELCLIENT_GERRIT_URL?=https://review.openstack.org/openstack/python-fuelclient
|
||||
FUEL_AGENT_GERRIT_URL?=https://review.openstack.org/openstack/fuel-agent
|
||||
FUEL_NAILGUN_AGENT_GERRIT_URL?=https://review.openstack.org/openstack/fuel-nailgun-agent
|
||||
ASTUTE_GERRIT_URL?=https://review.openstack.org/openstack/fuel-astute
|
||||
OSTF_GERRIT_URL?=https://review.openstack.org/openstack/fuel-ostf
|
||||
FUELMENU_GERRIT_URL?=https://review.openstack.org/openstack/fuel-menu
|
||||
SHOTGUN_GERRIT_URL?=https://review.openstack.org/openstack/shotgun
|
||||
NETWORKCHECKER_GERRIT_URL?=https://review.openstack.org/openstack/network-checker
|
||||
FUEL_UI_GERRIT_URL?=https://review.openstack.org/openstack/fuel-ui
|
||||
|
||||
FUELLIB_GERRIT_COMMIT?=none
|
||||
NAILGUN_GERRIT_COMMIT?=none
|
||||
PYTHON_FUELCLIENT_GERRIT_COMMIT?=none
|
||||
FUEL_AGENT_GERRIT_COMMIT?=none
|
||||
FUEL_NAILGUN_AGENT_GERRIT_COMMIT?=none
|
||||
ASTUTE_GERRIT_COMMIT?=none
|
||||
OSTF_GERRIT_COMMIT?=none
|
||||
FUELMAIN_GERRIT_COMMIT?=none
|
||||
FUELMENU_GERRIT_COMMIT?=none
|
||||
SHOTGUN_GERRIT_COMMIT?=none
|
||||
NETWORKCHECKER_GERRIT_COMMIT?=none
|
||||
FUEL_UI_GERRIT_COMMIT?=none
|
||||
|
||||
LOCAL_MIRROR_CENTOS:=$(LOCAL_MIRROR)/centos
|
||||
LOCAL_MIRROR_CENTOS_OS_BASEURL:=$(LOCAL_MIRROR_CENTOS)/os/$(CENTOS_ARCH)
|
||||
LOCAL_MIRROR_MOS_CENTOS:=$(LOCAL_MIRROR)/mos-centos
|
||||
LOCAL_MIRROR_MOS_CENTOS_OS_BASEURL:=$(LOCAL_MIRROR_MOS_CENTOS)
|
||||
LOCAL_MIRROR_UBUNTU:=$(LOCAL_MIRROR)/ubuntu
|
||||
LOCAL_MIRROR_UBUNTU_OS_BASEURL:=$(LOCAL_MIRROR_UBUNTU)
|
||||
|
||||
# Use mirror.fuel-infra.org mirror by default. Other possible values are
|
||||
# 'usa', 'cz'
|
||||
ifeq ($(USE_MIRROR),usa)
|
||||
MIRROR_FUEL?=http://mirror.seed-us1.fuel-infra.org/mos-repos/centos/$(PRODUCT_NAME)$(PRODUCT_VERSION)-centos$(CENTOS_MAJOR)/os/x86_64/
|
||||
MIRROR_UBUNTU?=mirror.seed-us1.fuel-infra.org
|
||||
MIRROR_MOS_UBUNTU?=$(MIRROR_UBUNTU)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MIRROR),cz)
|
||||
MIRROR_FUEL?=http://mirror.seed-cz1.fuel-infra.org/mos-repos/centos/$(PRODUCT_NAME)$(PRODUCT_VERSION)-centos$(CENTOS_MAJOR)/os/x86_64/
|
||||
MIRROR_UBUNTU?=mirror.seed-cz1.fuel-infra.org
|
||||
MIRROR_MOS_UBUNTU?=$(MIRROR_UBUNTU)
|
||||
endif
|
||||
|
||||
# Which repositories to use for making local centos mirror.
|
||||
# Possible values you can find out from mirror/centos/yum_repos.mk file.
|
||||
# The actual name will be constracted prepending "yum_repo_" prefix.
|
||||
# Example: YUM_REPOS?=official epel => yum_repo_official and yum_repo_epel
|
||||
# will be used.
|
||||
YUM_REPOS?=official extras fuel
|
||||
MIRROR_CENTOS?=http://mirror.centos.org/centos/$(CENTOS_MAJOR)
|
||||
MIRROR_CENTOS_KERNEL?=$(MIRROR_CENTOS)
|
||||
SANDBOX_MIRROR_CENTOS_UPSTREAM?=$(MIRROR_CENTOS)
|
||||
SANDBOX_MIRROR_EPEL?=http://mirror.yandex.ru/epel
|
||||
MIRROR_UBUNTU_METHOD?=http
|
||||
MIRROR_UBUNTU?=mirror.fuel-infra.org
|
||||
MIRROR_UBUNTU_ROOT?=/pkgs/ubuntu/
|
||||
MIRROR_UBUNTU_SUITE?=$(UBUNTU_RELEASE)
|
||||
MIRROR_UBUNTU_SECTION?=main universe multiverse restricted
|
||||
MIRROR_MOS_UBUNTU_METHOD?=http
|
||||
MIRROR_MOS_UBUNTU?=mirror.fuel-infra.org
|
||||
MIRROR_MOS_UBUNTU_ROOT?=/mos-repos/ubuntu/$(PRODUCT_VERSION)
|
||||
MIRROR_MOS_UBUNTU_SUITE?=$(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
MIRROR_MOS_UBUNTU_SECTION?=main restricted
|
||||
|
||||
# MIRROR_FUEL affects build process only if YUM_REPOS variable contains 'fuel'.
|
||||
# Otherwise it is ignored entirely.
|
||||
MIRROR_FUEL?=http://mirror.fuel-infra.org/mos-repos/centos/$(PRODUCT_NAME)$(PRODUCT_VERSION)-centos$(CENTOS_MAJOR)/os/x86_64/
|
||||
|
||||
# Additional CentOS repos.
|
||||
# Each repo must be comma separated tuple with repo-name and repo-path.
|
||||
# Repos must be separated by space.
|
||||
# Example: EXTRA_RPM_REPOS="lolo,http://my.cool.repo/rpm,priority bar,ftp://repo.foo,priority"
|
||||
EXTRA_RPM_REPOS?="proposed,http://mirror.fuel-infra.org/mos-repos/centos/$(PRODUCT_NAME)$(PRODUCT_VERSION)-centos$(CENTOS_MAJOR)/snapshots/proposed-latest/x86_64/"
|
||||
|
||||
# define RPM repo which contains fuel rpm-build-dep packages, in format
|
||||
# EXTRA_RPM_BUILDDEP_REPO=http://my.cool.repo/rpm
|
||||
EXTRA_RPM_BUILDDEP_REPO?="http://mirror.fuel-infra.org/mos-repos/centos/$(PRODUCT_NAME)$(PRODUCT_VERSION)-centos$(CENTOS_MAJOR)/snapshots/proposed-latest/x86_64/"
|
||||
|
||||
comma:=,
|
||||
|
||||
# Path to yaml configuration file to build ISO ks.cfg
|
||||
KSYAML?=$(SOURCE_DIR)/iso/ks.yaml
|
||||
|
||||
# Copy local /etc/ssl certs inside SANDBOX, which used for build deb mirror and packages.
|
||||
# This option should be enabled, in case you have to pass https repos for Ubuntu.
|
||||
SANDBOX_COPY_CERTS?=0
|
||||
|
||||
# Development option only:
|
||||
# Please don’t change them if you don’t know what they do ##
|
||||
|
||||
# Work-around for: LP1482667
|
||||
# If not empty, will try to download prepared upstream puppet modules source,
|
||||
# which used like requirements for build fuel-library package.
|
||||
# List of modules, which SHOULD be passed via this file can be found:
|
||||
# https://github.com/openstack/fuel-library/blob/master/deployment/Puppetfile
|
||||
#
|
||||
# Usage example:
|
||||
# USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES?=http://127.0.0.1/files/upstream_modules.tar.gz
|
||||
# Content example:
|
||||
# upstream_modules.tar.gz:\
|
||||
# \apt/metadata.json
|
||||
# \concat/metadata.json
|
||||
USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES?=
|
||||
|
||||
# proxy configuration in format:
|
||||
# PROXY_CONFIG="http_proxy=http://proxy_ip_address:proxy_port https_proxy=https://proxy_ip_address:proxy_port no_proxy=localhost"
|
||||
PROXY_CONFIG?=
|
@ -1,30 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1
|
||||
|
||||
mQENBFWt8ogBCACtT/j4WMGuhEI486Vv9zVV0GWGefHE5hBlgJSjSgrExLFqQ2Fo
|
||||
ScaABCfvzUeuXHNoh/c2eLjx3YE6oFrdiw5tam0NFlZMM+PSufciTxQz8vrXHGx7
|
||||
VB5rg2TXKoqOv9cW690FsRAeOtKTtBxZvYVTLEPn2GJW09Xy9CBa+n23XBHTBvKs
|
||||
j3hxkn25Oy70Wgxk/BJqpynXGno+NzuAnIbb+f+X7i6fiXwrvtp5zOYOJeUwS+fU
|
||||
IM/mXbetOd/sHtJqc9NUYpTip4nElEqAYRCsXDTbuMNdzSr8VlSMM8b61mBGelLH
|
||||
XJe+EPP+Logc5KXO8adoGgWhqlbD6n7w+ynHABEBAAG0LmZ1ZWwtaW5mcmEgKEV4
|
||||
YW1wbGUga2V5KSA8ZGV2b3BzQG1pcmFudGlzLmNvbT6JATgEEwECACIFAlWt8ogC
|
||||
GwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJELzlzEYfoisIkuQIAJl0cFJ5
|
||||
BSKMXHhRYf0BeDzhdh3pmcOXs/jSznTIxB4OE5OdwrMgKyoIkSIP8AEttvB+BuOv
|
||||
BHmhTL7kvRhP5xiKdbCwmDtoERoaqxhRRbZJcJ+pHvl7mkEu8Gj2KZe2lfE4Z6ZF
|
||||
6q00Gx9HYfse1+VgUR5ymh41nZCvRTNEnYBp1RQcPogiLy2rYvZbxYnUtg4jaD7D
|
||||
vuuEQwrfEHdKFUlWBCIVbl+e3K6ZSniOcqqyHK72/HI0SYuZpGfCzzw5deODcjWm
|
||||
Gz4nZr41cB3eHXkfmG3ngdhmb2MpVr83u+JebOovjzusf71oIdZBTFNYsZNSVKrn
|
||||
l0rrRuDIMHbQMuS5AQ0EVa3yiAEIALZqdLGXSGZAgUXl7zhPH5wnIQtdo6iMIovZ
|
||||
zQNW95RDT2nm/3YddiRy6FuOTbaHXw07D4ZUl4dGVHzEwBllhULxcHV3OOdQ3gVp
|
||||
4mBAZ8kv0EelzqPfDQWR2Cq0hi7IJ4Q4ePpZhQFiasz8qbV7D7CYbZdDAmQKxqAk
|
||||
0XYOjbB3jzB2r6MHflAKmJzTp3+NAE9bDLAwXa0ot2THDbpPdB4R6pxpD6Y3jweW
|
||||
uLUCnIfvyIBwhHobaU28pw/BA+0dkC9jnLnoO+TrzB9YD5839Lc3ctrdPBLiFPMG
|
||||
wdfAVRCyfgLjOyULqjTudx1Mo+Dgz9+xrcTFoehI7UYoZnraEKkAEQEAAYkBHwQY
|
||||
AQIACQUCVa3yiAIbDAAKCRC85cxGH6IrCPH5B/0Uc+OhMSCkRos1Yv5tA4bsEcjt
|
||||
8+sJ2S6pUqCbZxmXpzKspKpnjp3DJjmQKDB2q4UPDVElVDMMdBlstTx1RRZDf8yk
|
||||
nDvRBSzawk7Xhfloro8N2Lxv6gWhhMvHUYItyO6KMbAZuZ2M1I1/OFHG/f//7oPM
|
||||
0QpNbihf+GqE/dWRz9ZDz+xlSFli6AR/3ldq7N6gkCsEFdi3j6ZDf0qLsZpazPUI
|
||||
wiCC/aAYLkRDtTJV1G6EsWijmOTNNlCEFS/XDLQ3N2Ev/1sgAO0AlBMdXqSnqUI1
|
||||
1h/eSKCiGmkwFWlCf/4HnJVP7QpSeRPLyw785Fvt3p9vT+64isZ0ZK6cpcj8
|
||||
=0aQD
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -1,8 +0,0 @@
|
||||
[mos$fuelver-base]
|
||||
name=mos$fuelver-base
|
||||
#baseurl=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/os/x86_64/
|
||||
mirrorlist=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/mos-mirrors-os.txt
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/fuel-gpg/RPM-GPG-KEY-mos
|
||||
skip_if_unavailable=1
|
@ -1,8 +0,0 @@
|
||||
[mos$fuelver-security]
|
||||
name=mos$fuelver-security
|
||||
#baseurl=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/security/x86_64/
|
||||
mirrorlist=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/mos-mirrors-security.txt
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/fuel-gpg/RPM-GPG-KEY-mos
|
||||
skip_if_unavailable=1
|
@ -1,8 +0,0 @@
|
||||
[mos$fuelver-updates]
|
||||
name=mos$fuelver-updates
|
||||
#baseurl=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/updates/x86_64/
|
||||
mirrorlist=http://mirror.fuel-infra.org/mos-repos/centos/mos$fuelver-centos$releasever/mos-mirrors-updates.txt
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/fuel-gpg/RPM-GPG-KEY-mos
|
||||
skip_if_unavailable=1
|
@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import argparse
|
||||
import yaml
|
||||
|
||||
|
||||
def generate_yum_repos_config(repositories):
|
||||
config = ""
|
||||
for repo in repositories:
|
||||
config += """
|
||||
[{name}]
|
||||
name={name}
|
||||
baseurl={uri}
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
priority={priority}
|
||||
skip_if_unavailable=1
|
||||
""".format(**repo)
|
||||
return config
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'--repositories-file', dest='repositories_file', action='store',
|
||||
type=str, help='file where repositories are defined', required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
'--output-file', dest='outfile', action='store',
|
||||
type=str, help='file where to write yum config', required=True
|
||||
)
|
||||
params, other_params = parser.parse_known_args()
|
||||
|
||||
with open(params.repositories_file) as f:
|
||||
repositories = yaml.safe_load(f)
|
||||
|
||||
with open(params.outfile, 'wt') as f:
|
||||
f.write(generate_yum_repos_config(repositories))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,4 +0,0 @@
|
||||
1323560292.885204
|
||||
6.3
|
||||
x86_64
|
||||
1
|
@ -1,20 +0,0 @@
|
||||
[general]
|
||||
family = CentOS
|
||||
timestamp = 1323560005.81
|
||||
variant =
|
||||
totaldiscs = 1
|
||||
version = 6.3
|
||||
discnum = 1
|
||||
packagedir =
|
||||
arch = x86_64
|
||||
|
||||
[images-x86_64]
|
||||
kernel = images/pxeboot/vmlinuz
|
||||
initrd = images/pxeboot/initrd.img
|
||||
|
||||
[images-xen]
|
||||
kernel = images/pxeboot/vmlinuz
|
||||
initrd = images/pxeboot/initrd.img
|
||||
|
||||
[stage2]
|
||||
mainimage = LiveOS/squashfs.img
|
@ -1,592 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# LANG variable is a workaround for puppet-3.4.2 bug. See LP#1312758 for details
|
||||
export LANG=en_US.UTF8
|
||||
|
||||
wwwdir="/var/www/nailgun"
|
||||
|
||||
mkdir -p /var/log/puppet
|
||||
mkdir -p ${wwwdir}/targetimages
|
||||
|
||||
LOGFILE=${LOGFILE:-/var/log/puppet/bootstrap_admin_node.log}
|
||||
|
||||
exec > >(tee -i "${LOGFILE}")
|
||||
exec 2>&1
|
||||
|
||||
# LP#1535419: Hide too verbose kernel messages to prevent tty being
|
||||
# filled with spam.
|
||||
sysctl -w kernel.printk='4 1 1 7'
|
||||
|
||||
VBOX_BLACKLIST_MODULES="i2c_piix4 intel_rapl"
|
||||
|
||||
# The following packages need to be installed prior to installing any other ones
|
||||
# fuel-release package should be installed at the end of all bootstrap packages
|
||||
# since it introduces online mirrors which might be unavailable in isolated envs
|
||||
BOOTSTRAP_PACKAGES="yum-plugin-priorities yum-utils fuel-release"
|
||||
|
||||
FUEL_PACKAGES=" \
|
||||
augeas \
|
||||
authconfig \
|
||||
bind-utils \
|
||||
bridge-utils \
|
||||
daemonize \
|
||||
dhcp \
|
||||
docker \
|
||||
fuel \
|
||||
fuel-bootstrap-cli \
|
||||
fuel-openstack-metadata \
|
||||
fuel-utils \
|
||||
fuel-ui \
|
||||
gdisk \
|
||||
lrzip \
|
||||
lsof \
|
||||
mlocate \
|
||||
nmap-ncat \
|
||||
ntp \
|
||||
ntpdate \
|
||||
puppet \
|
||||
python-pypcap \
|
||||
python-timmy \
|
||||
rsync \
|
||||
rubygem-netaddr \
|
||||
rubygem-openstack \
|
||||
send2syslog \
|
||||
strace \
|
||||
sysstat \
|
||||
system-config-firewall-base \
|
||||
tcpdump \
|
||||
telnet \
|
||||
vim \
|
||||
virt-what \
|
||||
wget \
|
||||
"
|
||||
|
||||
ASTUTE_YAML='/etc/fuel/astute.yaml'
|
||||
BOOTSTRAP_NODE_CONFIG="/etc/fuel/bootstrap_admin_node.conf"
|
||||
CUSTOM_REPOS="/root/default_deb_repos.yaml"
|
||||
bs_build_log='/var/log/fuel-bootstrap-image-build.log'
|
||||
bs_status=0
|
||||
# Backup network configs to this folder. Folder will be created only if
|
||||
# backup process actually will be.
|
||||
bup_folder="/var/bootstrap_admin_node_bup_$(date +%Y-%m-%d-%H-%M-%S)/"
|
||||
### Long messages inside code makes them more complicated to read...
|
||||
# bootstrap messages
|
||||
# FIXME fix help links
|
||||
bs_skip_message="WARNING: Ubuntu bootstrap build has been skipped. \
|
||||
Please build and activate bootstrap manually with CLI command \
|
||||
\`fuel-bootstrap build --activate\`. \
|
||||
While you don't activate any bootstrap - new nodes cannot be discovered \
|
||||
and added to cluster. \
|
||||
For more information please visit \
|
||||
http://docs.openstack.org/developer/fuel-docs/userdocs/fuel-install-guide/bootstrap/\
|
||||
bootstrap_troubleshoot.html"
|
||||
bs_error_message="WARNING: Failed to build the bootstrap image, see $bs_build_log \
|
||||
for details. Perhaps your Internet connection is broken. Please fix the \
|
||||
problem and run \`fuel-bootstrap build --activate\`. \
|
||||
While you don\'t activate any bootstrap - new nodes cannot be discovered \
|
||||
and added to cluster. \
|
||||
For more information please visit \
|
||||
http://docs.openstack.org/developer/fuel-docs/userdocs/fuel-install-guide/bootstrap/\
|
||||
bootstrap_troubleshoot.html"
|
||||
bs_progress_message="There is no active bootstrap. Bootstrap image building \
|
||||
is in progress. Usually it takes 15-20 minutes. It depends on your internet \
|
||||
connection and hardware performance. After bootstrap image becomes available, \
|
||||
reboot nodes that failed to be discovered."
|
||||
bs_done_message="Default bootstrap image building done. Now you can boot new \
|
||||
nodes over PXE, they will be discovered and become available for installing \
|
||||
OpenStack on them"
|
||||
# Update issues messages
|
||||
update_warn_message="There is an issue connecting to update repository of \
|
||||
your distributions of OpenStack. \
|
||||
Please fix your connection prior to applying any updates. \
|
||||
Once the connection is fixed, we recommend reviewing and applying \
|
||||
maintenance updates for your distribution of OpenStack."
|
||||
update_done_message="We recommend reviewing and applying maintenance updates \
|
||||
for your distribution of OpenStack."
|
||||
fuelmenu_fail_message="Fuelmenu was not able to generate '/etc/fuel/astute.yaml' file! \
|
||||
Please, restart it manualy using 'fuelmenu' command."
|
||||
fuelclient_fail_message="Fuel CLI credentials are invalid. Update \
|
||||
/etc/fuel/astute.yaml FUEL_ACCESS/password and ~/.config/fuel/fuel_client.yaml\
|
||||
in order to proceed with deployment."
|
||||
function countdown() {
|
||||
local i
|
||||
sleep 1
|
||||
for ((i=$1-1; i>=1; i--)); do
|
||||
printf '\b\b\b\b%04d' "$i"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
function fail() {
|
||||
MSG="ERROR: Fuel node deployment FAILED! Check ${LOGFILE} for details"
|
||||
# LP: #1551658 - Ensure data will be flushed on disk
|
||||
sed -i -u "\$a${MSG}" "${LOGFILE}"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
function get_ethernet_interfaces() {
|
||||
# Get list of all ethernet interfaces, non-virtual, not a wireless
|
||||
for DEV in /sys/class/net/* ; do
|
||||
# Take only links into account, skip files
|
||||
if test ! -L $DEV ; then
|
||||
continue
|
||||
fi
|
||||
DEVPATH=$(readlink -f $DEV)
|
||||
# Avoid virtual devices like loopback, tunnels, bonding, vlans ...
|
||||
case $DEVPATH in
|
||||
*/virtual/*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
IF=${DEVPATH##*/}
|
||||
# Check ethernet only
|
||||
case "`cat $DEV/type`" in
|
||||
1)
|
||||
# TYPE=1 is ethernet, may also be wireless, bond, tunnel ...
|
||||
# Virtual lo, bound, vlan, tunneling has been skipped before
|
||||
if test -d $DEV/wireless -o -L $DEV/phy80211 ;
|
||||
then
|
||||
continue
|
||||
else
|
||||
# Catch ethernet non-virtual device
|
||||
echo $IF
|
||||
fi
|
||||
;;
|
||||
*) continue
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Get value of a key from ifcfg-* files
|
||||
# Usage:
|
||||
# get_ifcfg_value NAME /etc/sysconfig/network-scripts/ifcfg-eth0
|
||||
function get_ifcfg_value {
|
||||
local key=$1
|
||||
local path=$2
|
||||
local value=''
|
||||
if [[ -f ${path} ]]; then
|
||||
value=$(awk -F\= "\$1==\"${key}\" {print \$2}" ${path})
|
||||
value=${value//\"/}
|
||||
fi
|
||||
echo ${value}
|
||||
}
|
||||
|
||||
# Get IP address from interface name
|
||||
function get_interface_ip {
|
||||
local interface=$1
|
||||
echo $(ip -4 -o a s ${interface} | sed 's:/:\ :;s:\s\+:\ :g' | cut -d ' ' -f 4)
|
||||
}
|
||||
|
||||
# Workaround to fix dracut network configuration approach:
|
||||
# Bring down all network interfaces which have the same IP
|
||||
# address statically configured as 'primary' interface
|
||||
function ifdown_ethernet_interfaces {
|
||||
local adminif_ipaddr
|
||||
local if_name
|
||||
local if_ipaddr
|
||||
local path
|
||||
|
||||
adminif_ipaddr=$(get_interface_ip $ADMIN_INTERFACE)
|
||||
if [[ -z "${adminif_ipaddr}" ]]; then
|
||||
return
|
||||
fi
|
||||
for if_name in $(get_ethernet_interfaces); do
|
||||
if [[ "${if_name}" == "${ADMIN_INTERFACE}" ]]; then
|
||||
continue
|
||||
fi
|
||||
if_ipaddr=$(get_interface_ip $if_name)
|
||||
if [[ "${if_ipaddr}" == "${adminif_ipaddr}" ]]; then
|
||||
echo "Interface '${if_name}' uses the same ip '${if_ipaddr}' as admin interface '${ADMIN_INTERFACE}', removing ..."
|
||||
ifdown ${if_name}
|
||||
mkdir -p "${bup_folder}"
|
||||
path="/etc/sysconfig/network-scripts/ifcfg-${if_name}"
|
||||
if [[ -f ${path} ]]; then
|
||||
mv -f "${path}" "${bup_folder}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Check if interface name is valid by checking that
|
||||
# a config file with NAME equal to given name exists.
|
||||
function ifname_valid {
|
||||
local adminif_name=$1
|
||||
local if_name
|
||||
local if_config
|
||||
for if_config in $(find /etc/sysconfig/network-scripts -name 'ifcfg-*' ! -name 'ifcfg-lo'); do
|
||||
if_name=$(get_ifcfg_value NAME $if_config)
|
||||
if [[ "${if_name}" == "${adminif_name}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# switch selinux to permissive mode
|
||||
setenforce 0
|
||||
sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config || :
|
||||
|
||||
yum makecache
|
||||
echo $BOOTSTRAP_PACKAGES | xargs -n1 yum install -y
|
||||
# /etc/fuel_release is provided by 'fuel-release' package
|
||||
FUEL_RELEASE=$(cat /etc/fuel_release)
|
||||
|
||||
# Disable online base MOS repo if we run an ISO installation
|
||||
[ -f /etc/fuel_build_id ] && yum-config-manager --disable mos${FUEL_RELEASE}* --save
|
||||
|
||||
echo $FUEL_PACKAGES | xargs -n1 yum install -y
|
||||
# /etc/fuel_openstack_version is provided by 'fuel-openstack-metadata' package
|
||||
OPENSTACK_VERSION=$(cat /etc/fuel_openstack_version)
|
||||
|
||||
|
||||
touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml
|
||||
|
||||
# Be sure, that network devices have been initialized
|
||||
udevadm trigger --subsystem-match=net
|
||||
udevadm settle
|
||||
|
||||
# Import bootstrap_admin_node.conf if exists
|
||||
if [ -f "${BOOTSTRAP_NODE_CONFIG}" ]; then
|
||||
source "${BOOTSTRAP_NODE_CONFIG}"
|
||||
fi
|
||||
|
||||
# Set defaults to unset / empty variables
|
||||
# Although eth0 is not always valid it's a good well-known default
|
||||
# If there is no such interface it will fail to pass ifname_valid
|
||||
# check and will be replaced.
|
||||
OLD_ADMIN_INTERFACE=${ADMIN_INTERFACE}
|
||||
ADMIN_INTERFACE=${ADMIN_INTERFACE:-'eth0'}
|
||||
showmenu=${showmenu:-'yes'}
|
||||
|
||||
# Now check that ADMIN_INTERFACE points to a valid interface
|
||||
# If it doesn't fallback to getting the first interface name
|
||||
# from a list of all available interfaces sorted alphabetically
|
||||
if ! ifname_valid $ADMIN_INTERFACE; then
|
||||
# Take the very first ethernet interface as an admin interface
|
||||
ADMIN_INTERFACE=$(get_ethernet_interfaces | sort -V | head -1)
|
||||
fi
|
||||
|
||||
if [[ "${OLD_ADMIN_INTERFACE}" != "${ADMIN_INTERFACE}" ]]; then
|
||||
echo "Saving ADMIN_INTERFACE value"
|
||||
sed -i "s/^ADMIN_INTERFACE=.*/ADMIN_INTERFACE=${ADMIN_INTERFACE}/g" \
|
||||
${BOOTSTRAP_NODE_CONFIG}
|
||||
fi
|
||||
|
||||
echo "Applying admin interface '$ADMIN_INTERFACE'"
|
||||
export ADMIN_INTERFACE
|
||||
|
||||
echo "Bringing down ALL network interfaces except '${ADMIN_INTERFACE}'"
|
||||
ifdown_ethernet_interfaces
|
||||
systemctl restart network
|
||||
|
||||
echo "Applying default Fuel settings..."
|
||||
set -x
|
||||
|
||||
# Set correct docker volume group
|
||||
echo "VG=docker" >> /etc/sysconfig/docker-storage-setup
|
||||
|
||||
# Disable create iptables rules by docker
|
||||
echo "DOCKER_NETWORK_OPTIONS=--iptables=false" > /etc/sysconfig/docker-network
|
||||
|
||||
# Disable subscription-manager plugins
|
||||
sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/product-id.conf || :
|
||||
sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf || :
|
||||
|
||||
# Disable GSSAPI in ssh server config
|
||||
sed -i -e "/^\s*GSSAPICleanupCredentials yes/d" -e "/^\s*GSSAPIAuthentication yes/d" /etc/ssh/sshd_config
|
||||
|
||||
# Enable MOTD banner in sshd
|
||||
sed -i -e "s/^\s*PrintMotd no/PrintMotd yes/g" /etc/ssh/sshd_config
|
||||
|
||||
# Add note regarding local repos creation to MOTD
|
||||
cat >> /etc/motd << EOF
|
||||
|
||||
All environments use online repositories by default.
|
||||
Use the python-packetary package to create local repositories:
|
||||
|
||||
yum install python-packetary
|
||||
packetary --help
|
||||
|
||||
Use python-fuelclient package to modify default repository settings:
|
||||
|
||||
yum install python-fuelclient (installed by default)
|
||||
fuel2 --help
|
||||
|
||||
EOF
|
||||
|
||||
# Generate Fuel UUID
|
||||
[ ! -f "/etc/fuel/fuel-uuid" ] && uuidgen > /etc/fuel/fuel-uuid || :
|
||||
|
||||
echo "tos orphan 7" >> /etc/ntp.conf && systemctl restart ntpd
|
||||
|
||||
# Disabling splash
|
||||
sed -i --follow-symlinks -e '/^\slinux16/ s/rhgb/debug/' /boot/grub2/grub.cfg
|
||||
|
||||
# Copying default bash settings to the root directory
|
||||
cp -f /etc/skel/.bash* /root/
|
||||
|
||||
# Blacklist and try to unload kernel modules that create errors on VirtualBox
|
||||
if (virt-what | fgrep -q "virtualbox") ; then
|
||||
for module in $VBOX_BLACKLIST_MODULES; do
|
||||
echo "blacklist ${module}" > /etc/modprobe.d/blacklist-${module}.conf
|
||||
rmmod ${module} || :
|
||||
done
|
||||
fi
|
||||
|
||||
# change default repo path in fuel-menu before starting any deployment steps
|
||||
if [ -f "${CUSTOM_REPOS}" ]; then
|
||||
fix_default_repos.py fuelmenu --repositories-file "${CUSTOM_REPOS}" || fail
|
||||
fi
|
||||
|
||||
# setup stringify_facts for the puppet
|
||||
augtool set /files/etc/puppet/puppet.conf/main/stringify_facts false
|
||||
|
||||
fuelmenu --save-only --iface=$ADMIN_INTERFACE || fail
|
||||
set +x
|
||||
echo "Done!"
|
||||
|
||||
if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
|
||||
fuelmenu || fail
|
||||
else
|
||||
# Give user 15 seconds to enter fuelmenu or else continue
|
||||
echo
|
||||
echo -n "Press a key to enter Fuel Setup (or press ESC to skip)... 15"
|
||||
countdown 15 & pid=$!
|
||||
if ! read -s -n 1 -t 15 key; then
|
||||
echo -e "\nSkipping Fuel Setup..."
|
||||
else
|
||||
{ kill "$pid"; wait $!; } 2>/dev/null
|
||||
case "$key" in
|
||||
$'\e') echo "Skipping Fuel Setup.."
|
||||
;;
|
||||
*) echo -e "\nEntering Fuel Setup..."
|
||||
fuelmenu || fail
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enable online base MOS repos (security, updates) if we run an ISO installation
|
||||
[ -f /etc/fuel_build_id ] && \
|
||||
yum-config-manager --enable mos${FUEL_RELEASE}-security mos${FUEL_RELEASE}-updates --save
|
||||
|
||||
if [ ! -f "${ASTUTE_YAML}" ]; then
|
||||
echo ${fuelmenu_fail_message}
|
||||
fail
|
||||
fi
|
||||
|
||||
# Replace local repository for building bootstrap with online one
|
||||
# and create symlink for backward compatibility
|
||||
# if we run deployment on a pre-provisioned server
|
||||
if [ ! -f /etc/fuel_build_id ]; then
|
||||
sed -i "s|127.0.0.1:8080/ubuntu/x86_64|mirror.fuel-infra.org/mos-repos/ubuntu/${FUEL_RELEASE}|g" "${ASTUTE_YAML}"
|
||||
ln -s ${wwwdir}/${OPENSTACK_VERSION}/ubuntu ${wwwdir}/ubuntu
|
||||
fi
|
||||
|
||||
# Enable sshd
|
||||
systemctl enable sshd
|
||||
systemctl start sshd
|
||||
|
||||
# Enable iptables
|
||||
systemctl enable iptables.service
|
||||
systemctl start iptables.service
|
||||
|
||||
if [ "$wait_for_external_config" == "yes" ]; then
|
||||
wait_timeout=3000
|
||||
pidfile=/var/lock/wait_for_external_config
|
||||
echo -n "Waiting for external configuration (or press ESC to skip)...
|
||||
$wait_timeout"
|
||||
countdown $wait_timeout & countdown_pid=$!
|
||||
exec -a wait_for_external_config sleep $wait_timeout & wait_pid=$!
|
||||
echo $wait_pid > $pidfile
|
||||
while ps -p $countdown_pid &> /dev/null && ps -p $wait_pid &>/dev/null; do
|
||||
read -s -n 1 -t 2 key
|
||||
case "$key" in
|
||||
$'\e') echo -e "\b\b\b\b abort on user input"
|
||||
break
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
{ kill $countdown_pid $wait_pid & wait $!; }
|
||||
rm -f $pidfile
|
||||
fi
|
||||
|
||||
# Prepare custom /etc/issue logon banner and script for changing IP in it
|
||||
# We can have several interface naming schemes applied and several interface
|
||||
# UI will listen on
|
||||
ipstr=""
|
||||
NL=$'\n'
|
||||
for ip in `ip -o -4 addr show | awk '/e[nt][hopsx]/ { split($4, arr, /\//); print arr[1] }'`; do
|
||||
ipstr="${ipstr}https://${ip}:8443${NL}"
|
||||
done
|
||||
cat > /etc/issue <<EOF
|
||||
#########################################
|
||||
# Welcome to the Fuel server #
|
||||
#########################################
|
||||
Server is running on \m platform
|
||||
|
||||
Fuel UI is available on:
|
||||
$ipstr
|
||||
Default administrator login: root
|
||||
Default administrator password: r00tme
|
||||
|
||||
Default Fuel UI login: admin
|
||||
Default Fuel UI password: admin
|
||||
|
||||
Please change root password on first login.
|
||||
|
||||
EOF
|
||||
|
||||
#Reread /etc/sysconfig/network to inform puppet of changes
|
||||
. /etc/sysconfig/network
|
||||
hostname "$HOSTNAME"
|
||||
|
||||
# XXX: ssh keys which should be included into the bootstrap image are
|
||||
# generated during containers deployment. However cobbler checkfs for
|
||||
# a kernel and initramfs when creating a profile, which poses chicken
|
||||
# and egg problem. Fortunately cobbler is pretty happy with empty files
|
||||
# so it's easy to break the loop.
|
||||
make_ubuntu_bootstrap_stub () {
|
||||
local bootstrap_dir="${wwwdir}/bootstraps/active_bootstrap"
|
||||
local bootstrap_stub_dir="${wwwdir}/bootstraps/bootstrap_stub"
|
||||
mkdir -p ${bootstrap_stub_dir}
|
||||
for item in vmlinuz initrd.img; do
|
||||
touch "${bootstrap_stub_dir}/$item"
|
||||
done
|
||||
ln -s ${bootstrap_stub_dir} ${bootstrap_dir} || true
|
||||
}
|
||||
|
||||
get_bootstrap_flavor () {
|
||||
python <<-EOF
|
||||
from yaml import safe_load
|
||||
with open("$ASTUTE_YAML", 'r') as f:
|
||||
conf = safe_load(f).get('BOOTSTRAP', {})
|
||||
print(conf.get('flavor', 'ubuntu').lower())
|
||||
EOF
|
||||
}
|
||||
|
||||
get_bootstrap_skip () {
|
||||
python <<-EOF
|
||||
from yaml import safe_load
|
||||
with open("$ASTUTE_YAML", 'r') as f:
|
||||
conf = safe_load(f).get('BOOTSTRAP', {})
|
||||
print(conf.get('skip_default_img_build', False))
|
||||
EOF
|
||||
}
|
||||
|
||||
set_ui_bootstrap_error () {
|
||||
# This notify can't be closed or removed by user.
|
||||
# For remove notify - send empty string.
|
||||
local message=$1
|
||||
python <<-EOF
|
||||
from fuel_bootstrap.utils import notifier
|
||||
notifier.notify_webui('${message}')
|
||||
EOF
|
||||
}
|
||||
|
||||
# Actually build the bootstrap image
|
||||
build_ubuntu_bootstrap () {
|
||||
local ret=1
|
||||
echo ${bs_progress_message} >&2
|
||||
set_ui_bootstrap_error "${bs_progress_message}" >&2
|
||||
if fuel-bootstrap -v --debug build --activate >>"$bs_build_log" 2>&1; then
|
||||
ret=0
|
||||
fuel notify --topic "done" --send "${bs_done_message}"
|
||||
else
|
||||
ret=1
|
||||
set_ui_bootstrap_error "${bs_error_message}" >&2
|
||||
fi
|
||||
# perform hard-return from func
|
||||
# this part will update input $1 variable
|
||||
local __resultvar=$1
|
||||
eval $__resultvar="'${ret}'"
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Create empty files to make cobbler happy
|
||||
# (even if we don't use Ubuntu based bootstrap)
|
||||
make_ubuntu_bootstrap_stub
|
||||
|
||||
service docker start
|
||||
|
||||
old_sysctl_vm_value=$(sysctl -n vm.min_free_kbytes)
|
||||
if [ ${old_sysctl_vm_value} -lt 65535 ]; then
|
||||
echo "Set vm.min_free_kbytes..."
|
||||
sysctl -w vm.min_free_kbytes=65535
|
||||
fi
|
||||
|
||||
if [ ${old_sysctl_vm_value} -lt 65535 ]; then
|
||||
echo "Restore sysctl vm.min_free_kbytes value..."
|
||||
sysctl -w vm.min_free_kbytes=${old_sysctl_vm_value}
|
||||
fi
|
||||
|
||||
# Ensure fuelclient can authenticate
|
||||
output=$(fuel token 2>&1)
|
||||
if echo "$output" | grep -q "Unauthorized"; then
|
||||
echo $fuelclient_fail_message
|
||||
fail
|
||||
fi
|
||||
|
||||
# apply puppet
|
||||
/etc/puppet/modules/fuel/examples/deploy.sh || fail
|
||||
# Update default repo path
|
||||
if [ -f "${CUSTOM_REPOS}" ]; then
|
||||
fix_default_repos.py fuel \
|
||||
--repositories-file "${CUSTOM_REPOS}" \
|
||||
--release-version "${OPENSTACK_VERSION}" || fail
|
||||
fi
|
||||
|
||||
# Sync time
|
||||
systemctl stop ntpd
|
||||
systemctl start ntpdate || echo "Failed to synchronize time with 'ntpdate'"
|
||||
systemctl start ntpd
|
||||
|
||||
bash /etc/rc.local
|
||||
|
||||
if [ "`get_bootstrap_skip`" = "False" ]; then
|
||||
build_ubuntu_bootstrap bs_status || true
|
||||
else
|
||||
fuel notify --topic "warning" --send "${bs_skip_message}"
|
||||
bs_status=2
|
||||
fi
|
||||
|
||||
#Check if repo is accessible
|
||||
echo "Checking for access to updates repository/mirrorlist..."
|
||||
repourl=$(yum repolist all -v | awk '{if ($1 ~ "baseurl|mirrors" && $3 ~ "updates") print $3}' | head -1)
|
||||
if urlaccesscheck check "$repourl" ; then
|
||||
UPDATE_ISSUES=0
|
||||
else
|
||||
UPDATE_ISSUES=1
|
||||
fi
|
||||
|
||||
if [ $UPDATE_ISSUES -eq 1 ]; then
|
||||
message=${update_warn_message}
|
||||
level="warning"
|
||||
else
|
||||
message=${update_done_message}
|
||||
level="done"
|
||||
fi
|
||||
echo
|
||||
echo "*************************************************"
|
||||
echo -e "${message}"
|
||||
echo "*************************************************"
|
||||
fuel notify --topic "${level}" --send $(echo "${message}" | tr '\r\n' ' ') 2>&1
|
||||
|
||||
# Perform bootstrap messaging to stdout
|
||||
case ${bs_status} in
|
||||
1)
|
||||
echo -e "${bs_error_message}"
|
||||
echo "*************************************************"
|
||||
;;
|
||||
2)
|
||||
echo -e "${bs_skip_message}"
|
||||
echo "*************************************************"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Fuel node deployment complete!"
|
||||
# Sleep for agetty autologon
|
||||
sleep 3
|
@ -1,206 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
import six
|
||||
import yaml
|
||||
|
||||
from fuelclient import objects
|
||||
|
||||
|
||||
FUELMENU_DEFAULT_SETTINGS_PATH = \
|
||||
"/usr/lib/python2.7/site-packages/fuelmenu/settings.yaml"
|
||||
|
||||
|
||||
def is_subdict(dict1, dict2):
|
||||
"""Checks that dict1 is subdict of dict2.
|
||||
|
||||
>>> is_subdict({"a": 1}, {'a': 1, 'b': 1})
|
||||
True
|
||||
|
||||
:param dict1: the candidate
|
||||
:param dict2: the super dict
|
||||
:return: True if all keys from dict1 are present
|
||||
and has same value in dict2 otherwise False
|
||||
"""
|
||||
for k, v in six.iteritems(dict1):
|
||||
if k not in dict2 or dict2[k] != v:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def lists_merge(main, patch, key):
|
||||
"""Merges the list of dicts with same keys.
|
||||
|
||||
>>> lists_merge([{"a": 1, "c": 2}], [{"a": 1, "c": 3}], key="a")
|
||||
[{'a': 1, 'c': 3}]
|
||||
|
||||
:param main: the main list
|
||||
:type main: list
|
||||
:param patch: the list of additional elements
|
||||
:type patch: list
|
||||
:param key: the key for compare
|
||||
"""
|
||||
main_idx = dict(
|
||||
(x[key], i) for i, x in enumerate(main)
|
||||
)
|
||||
|
||||
patch_idx = dict(
|
||||
(x[key], i) for i, x in enumerate(patch)
|
||||
)
|
||||
|
||||
for k in sorted(patch_idx):
|
||||
if k in main_idx:
|
||||
main[main_idx[k]].update(patch[patch_idx[k]])
|
||||
else:
|
||||
main.append(patch[patch_idx[k]])
|
||||
return main
|
||||
|
||||
|
||||
def update_release_repos(repositories,
|
||||
release_match,
|
||||
replace_repos=False):
|
||||
"""Applies repositories for existing default settings.
|
||||
:param repositories: the meta information of repositories
|
||||
:param release_match: The pattern to check Fuel Release
|
||||
"""
|
||||
releases = six.moves.filter(
|
||||
lambda x: is_subdict(release_match, x.data),
|
||||
objects.Release.get_all()
|
||||
)
|
||||
for release in releases:
|
||||
modified = _update_repository_settings(
|
||||
release.data["attributes_metadata"],
|
||||
repositories,
|
||||
replace_repos=replace_repos)
|
||||
if modified:
|
||||
release.data["attributes_metadata"] = modified
|
||||
print "Try to update the Release '%s'" % release.data['name']
|
||||
release.connection.put_request(
|
||||
release.instance_api_path.format(release.id),
|
||||
release.data
|
||||
)
|
||||
|
||||
|
||||
def _update_repository_settings(settings,
|
||||
repositories,
|
||||
replace_repos=False):
|
||||
"""Updates repository settings.
|
||||
:param settings: the target settings
|
||||
:param repositories: the meta of repositories
|
||||
"""
|
||||
editable = settings["editable"]
|
||||
if 'repo_setup' not in editable:
|
||||
return
|
||||
|
||||
repos_attr = editable["repo_setup"]["repos"]
|
||||
if replace_repos:
|
||||
repos_attr['value'] = repositories
|
||||
else:
|
||||
lists_merge(repos_attr['value'], repositories, "name")
|
||||
|
||||
settings["editable"]["repo_setup"]["repos"] = repos_attr
|
||||
|
||||
return settings
|
||||
|
||||
|
||||
def fix_fuel_repos(address, port, user, password,
|
||||
release_version, release_os, repositories):
|
||||
os.environ["SERVER_ADDRESS"] = address
|
||||
os.environ["LISTEN_PORT"] = port
|
||||
os.environ["KEYSTONE_USER"] = user
|
||||
os.environ["KEYSTONE_PASS"] = password
|
||||
|
||||
release_match = {
|
||||
"version": release_version,
|
||||
"operating_system": release_os
|
||||
}
|
||||
|
||||
update_release_repos(repositories, release_match)
|
||||
|
||||
|
||||
def fix_fuelmenu_repos(repositories, replace_repos=False):
|
||||
print "Try to update default fuelmenu settings"
|
||||
with open(FUELMENU_DEFAULT_SETTINGS_PATH) as f:
|
||||
settings = yaml.safe_load(f)
|
||||
if replace_repos:
|
||||
settings["BOOTSTRAP"]["repos"] = repositories
|
||||
else:
|
||||
lists_merge(settings["BOOTSTRAP"]["repos"], repositories, "name")
|
||||
with open(FUELMENU_DEFAULT_SETTINGS_PATH, "w") as f:
|
||||
f.write(yaml.safe_dump(settings, default_flow_style=False))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(
|
||||
dest="action", help='actions'
|
||||
)
|
||||
fuel_parser = subparsers.add_parser(
|
||||
'fuel', help='fix fuel repos'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'--release-version', dest='release_version', action='store',
|
||||
type=str, help='release version', default='newton-10.0'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'--release-os', dest='release_os', action='store',
|
||||
type=str, help='release operating system', default='Ubuntu'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'--repositories-file', dest='repositories_file', action='store',
|
||||
type=str, help='file where repositories are defined', required=True
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'-a', '--address', dest='address', action='store', type=str,
|
||||
help='fuel address', default='127.0.0.1'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'-p', '--port', dest='port', action='store', type=str,
|
||||
help='fuel port', default='8000'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'--user', dest='user', action='store', type=str,
|
||||
help='fuel user', default='admin'
|
||||
)
|
||||
fuel_parser.add_argument(
|
||||
'--password', dest='password', action='store', type=str,
|
||||
help='fuel password', default='admin'
|
||||
)
|
||||
fuelmenu_parser = subparsers.add_parser(
|
||||
'fuelmenu', help='fix fuelmenu repos'
|
||||
)
|
||||
fuelmenu_parser.add_argument(
|
||||
'--repositories-file', dest='repositories_file', action='store',
|
||||
type=str, help='file where repositories are defined', required=True
|
||||
)
|
||||
params, other_params = parser.parse_known_args()
|
||||
|
||||
with open(params.repositories_file) as f:
|
||||
repositories = yaml.safe_load(f)
|
||||
|
||||
if params.action == 'fuel':
|
||||
fix_fuel_repos(params.address, params.port,
|
||||
params.user, params.password,
|
||||
params.release_version, params.release_os,
|
||||
repositories)
|
||||
else:
|
||||
fix_fuelmenu_repos(repositories)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,27 +0,0 @@
|
||||
default vesamenu.c32
|
||||
#prompt 1
|
||||
timeout 300
|
||||
|
||||
display boot.msg
|
||||
|
||||
menu background splash.jpg
|
||||
menu title Welcome to Fuel Installer (version: will_be_substituted_with_PRODUCT_VERSION)
|
||||
menu color border 0 #ffffffff #00000000
|
||||
menu color sel 7 #ffffffff #ff000000
|
||||
menu color title 0 #ffffffff #00000000
|
||||
menu color tabmsg 0 #ffffffff #00000000
|
||||
menu color unsel 0 #ffffffff #00000000
|
||||
menu color hotsel 0 #ff000000 #ffffffff
|
||||
menu color hotkey 7 #ffffffff #ff000000
|
||||
menu color scrollbar 0 #ffffffff #00000000
|
||||
|
||||
label nailgun
|
||||
menu label ^1. Fuel Install (Static IP)
|
||||
menu default
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img net.ifnames=0 biosdevname=0 inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:eth0:off::: nameserver=10.20.0.1
|
||||
|
||||
label nailgunifname
|
||||
menu label ^2. Fuel Advanced Install (Static IP)
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:adminif:off::: nameserver=10.20.0.1 ifname=adminif:XX:XX:XX:XX:XX:XX
|
Binary file not shown.
Before Width: | Height: | Size: 138 KiB |
85
iso/ks.py
85
iso/ks.py
@ -1,85 +0,0 @@
|
||||
# Copyright 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
import os
|
||||
import argparse
|
||||
import yaml
|
||||
|
||||
from jinja2 import FileSystemLoader
|
||||
from jinja2 import Environment
|
||||
|
||||
|
||||
class KickstartFile(object):
|
||||
def __init__(self, template_file, config_file=None, config_data=None):
|
||||
self.config = {}
|
||||
|
||||
if config_file:
|
||||
with open(config_file, "r") as f:
|
||||
self.config.update(yaml.safe_load(f.read()))
|
||||
|
||||
if config_data:
|
||||
self.config.update(yaml.safe_load(config_data))
|
||||
|
||||
self.env = Environment(
|
||||
loader=FileSystemLoader(
|
||||
os.path.dirname(os.path.abspath(template_file))
|
||||
)
|
||||
)
|
||||
self.template = self.env.get_template(
|
||||
os.path.basename(os.path.abspath(template_file))
|
||||
)
|
||||
|
||||
def render(self):
|
||||
return self.template.render(self.config)
|
||||
|
||||
def render2file(self, filename):
|
||||
with open(filename, "w") as f:
|
||||
f.write(self.render())
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
description = """
|
||||
This script builds kickstart file to using jinja2 template system.
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser(epilog=description)
|
||||
parser.add_argument(
|
||||
'-t', '--template-file', dest='template_file', action='store',
|
||||
type=str, help='kickstart template file', required=True
|
||||
)
|
||||
parser.add_argument(
|
||||
'-c', '--config-file', dest='config_file', action='store', type=str,
|
||||
help='yaml config file', required=False, default=None
|
||||
)
|
||||
parser.add_argument(
|
||||
'-u', '--config-data', dest='config_data', action='store', type=str,
|
||||
help='yaml config input', default='{}'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-o', '--output', dest='output', action='store', type=str,
|
||||
help='where to output templating result', default='-'
|
||||
)
|
||||
params, other_params = parser.parse_known_args()
|
||||
|
||||
ks = KickstartFile(
|
||||
template_file=params.template_file,
|
||||
config_file=params.config_file,
|
||||
config_data=params.config_data
|
||||
)
|
||||
|
||||
if params.output == '-':
|
||||
print ks.render()
|
||||
else:
|
||||
ks.render2file(params.output)
|
531
iso/ks.template
531
iso/ks.template
@ -1,531 +0,0 @@
|
||||
install
|
||||
text
|
||||
repo --name=mos --baseurl=file:///run/install/repo/mos-centos
|
||||
repo --name=extra --baseurl=file:///run/install/repo/extra-repos/proposed
|
||||
%include /tmp/source.ks
|
||||
{{reboot}}
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
rootpw r00tme
|
||||
timezone --utc Etc/UTC
|
||||
firewall --disabled
|
||||
selinux --permissive
|
||||
# ignore unsupported hardware warning
|
||||
unsupported_hardware
|
||||
# SKIP CONFIGURING X
|
||||
skipx
|
||||
# NEVER ever place zerombr here, it breaks automated installation
|
||||
%include /tmp/bootloader.ks
|
||||
%include /tmp/partition.ks
|
||||
%include /tmp/post_partition.ks
|
||||
# This eliminates a security risk where an attacker
|
||||
# could SSH into Fuel Admin node before a user has an
|
||||
# opportunity to change the root password.
|
||||
services --disabled=sshd
|
||||
|
||||
%packages --nobase
|
||||
@Core
|
||||
-firewalld
|
||||
-postfix
|
||||
-tuned
|
||||
%end
|
||||
|
||||
|
||||
# PREINSTALL SECTION
|
||||
# HERE ARE COMMANDS THAT WILL BE LAUNCHED BEFORE
|
||||
# INSTALLATION PROCESS ITSELF
|
||||
%pre
|
||||
#!/bin/sh
|
||||
|
||||
# hard drives
|
||||
drives=""
|
||||
removable_drives=""
|
||||
for drv in `ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`; do
|
||||
if !(blkid | grep -q "${drv}.*Fuel"); then
|
||||
if (grep -q 0 /sys/block/${drv}/removable); then
|
||||
drives="${drives} ${drv}"
|
||||
else
|
||||
removable_drives="${removable_drives} ${drv}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'`
|
||||
|
||||
installdrive=${installdrive:-undefined}
|
||||
forceformat=${forceformat:-no}
|
||||
for I in $(cat /proc/cmdline); do
|
||||
case "$I" in
|
||||
*=*)
|
||||
if ! [[ "${I}" =~ "." ]]; then eval "$I"; fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
set ${drives} ${removable_drives}
|
||||
numdrives=`echo $#`
|
||||
|
||||
tgtdrive="${installdrive}"
|
||||
|
||||
function confirm_format {
|
||||
check_drive="$1"
|
||||
local confirm_format="no"
|
||||
|
||||
if [[ "$forceformat" == "yes" ]] ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if parted -s /dev/$check_drive print &>/dev/null ; then
|
||||
echo
|
||||
echo "$check_drive drive contains partition table:"
|
||||
parted -s /dev/$check_drive print
|
||||
echo
|
||||
read -p "Are you sure you want to erase ALL data on disk $check_drive? (y/N)" confirm_format
|
||||
if [[ "$confirm_format" == "y" ]] || [[ "$confirm_format" == "Y" ]] || [[ "$forceformat" == "yes" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
format_confirmed="no"
|
||||
|
||||
if [ $numdrives -lt 1 ]; then
|
||||
exec < /dev/tty3 > /dev/tty3 2>&1
|
||||
chvt 3
|
||||
clear
|
||||
echo
|
||||
echo '********************************************************************'
|
||||
echo '* E R R O R *'
|
||||
echo '* *'
|
||||
echo '* There is no suitable media available for installation. *'
|
||||
echo '* Please attach a drive and try again. *'
|
||||
echo '* *'
|
||||
echo '********************************************************************'
|
||||
echo
|
||||
read -p "Press Enter to shut down the system: " _
|
||||
poweroff
|
||||
fi
|
||||
|
||||
if [ ${numdrives} -gt 1 ] || [ `echo ${drives} | wc -w` -eq 0 ] ; then
|
||||
exec < /dev/tty3 > /dev/tty3 2>&1
|
||||
chvt 3
|
||||
while [ "${tgtdrive}" = "undefined" ]; do
|
||||
clear
|
||||
echo
|
||||
echo '********************************************************************************'
|
||||
echo '* W A R N I N G *'
|
||||
echo '* *'
|
||||
echo '* Which of the detected hard drives do you want to be used as *'
|
||||
echo '* the installation target? *'
|
||||
echo '* *'
|
||||
echo '********************************************************************************'
|
||||
echo
|
||||
echo "Possible choices"
|
||||
echo "Persistent drives: ${drives}"
|
||||
echo "Removable drives: ${removable_drives}"
|
||||
echo
|
||||
if [ `echo ${drives} | wc -w` -eq 1 ] ; then
|
||||
read -t 30 -p "Choose hard drive: " tgtdrive || tgtdrive=$default_drive
|
||||
else
|
||||
read -p "Choose hard drive: " tgtdrive
|
||||
fi
|
||||
match="no"
|
||||
for drive in ${drives[@]} ${removable_drives[@]}; do
|
||||
if [[ "$drive" == "$tgtdrive" ]] && match="yes" ; then
|
||||
if confirm_format $tgtdrive ; then
|
||||
format_confirmed="yes"
|
||||
break
|
||||
else
|
||||
tgtdrive="undefined"
|
||||
read -p "You may select another disk. Press Enter to continue." _
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ "$match" == "no" ]]; then
|
||||
tgtdrive="undefined"
|
||||
read -p "Invalid choice. Press Enter to continue." _
|
||||
fi
|
||||
done
|
||||
clear
|
||||
chvt 1
|
||||
else
|
||||
tgtdrive=`echo ${drives} | sed -e "s/^\s*//" -e "s/\s*$//"`
|
||||
fi
|
||||
|
||||
if [ "$format_confirmed" != "yes" ] ; then
|
||||
exec < /dev/tty3 > /dev/tty3 2>&1
|
||||
chvt 3
|
||||
if ! confirm_format $tgtdrive ; then
|
||||
clear
|
||||
echo
|
||||
echo '********************************************************************'
|
||||
echo '* E R R O R *'
|
||||
echo '* *'
|
||||
echo '* Disk $tgtdrive contains active partition(s). *'
|
||||
echo '* Installation cannot continue without confirmation. *'
|
||||
echo '* *'
|
||||
echo '********************************************************************'
|
||||
echo
|
||||
read -p "Press Enter to restart: " _
|
||||
reboot
|
||||
fi
|
||||
chvt 1
|
||||
fi
|
||||
|
||||
# verify tgtdrive is at least 50GB
|
||||
tgtdrivesize=$(( $(cat "/sys/class/block/${tgtdrive}/size") / 2 / 1024 ))
|
||||
if [ $tgtdrivesize -lt 51200 ]; then
|
||||
exec < /dev/tty3 > /dev/tty3 2>&1
|
||||
chvt 3
|
||||
clear
|
||||
echo
|
||||
echo '********************************************************************'
|
||||
echo '* E R R O R *'
|
||||
echo '* *'
|
||||
echo '* Your disk is under 50GB in size. Installation cannot continue. *'
|
||||
echo '* Restart installation with a larger disk. *'
|
||||
echo '* *'
|
||||
echo '********************************************************************'
|
||||
echo
|
||||
read -p "Press Enter to restart: " _
|
||||
reboot
|
||||
fi
|
||||
|
||||
# paths in /dev have "/" instead of "!" for cciss devices
|
||||
tgtdrive=$(echo $tgtdrive | sed -e 's/!/\//')
|
||||
|
||||
# source
|
||||
iso_volume_id=will_be_substituted_with_ISO_VOLUME_ID
|
||||
|
||||
cdrom_device=
|
||||
if [ -e /proc/sys/dev/cdrom/info ]; then
|
||||
cdrom_device=$(cat /proc/sys/dev/cdrom/info | awk '/drive name:/{print $3}')
|
||||
fi
|
||||
|
||||
if [ -e /dev/disk/by-label/${iso_volume_id} ]; then
|
||||
real_device=$(readlink -e /dev/disk/by-label/${iso_volume_id})
|
||||
if [ "${real_device}" == "/dev/${cdrom_device}" ]; then
|
||||
echo "cdrom" > /tmp/source.ks
|
||||
else
|
||||
echo "harddrive --partition=LABEL=${iso_volume_id} --dir=/" > /tmp/source.ks
|
||||
fi
|
||||
else
|
||||
echo "cdrom" > /tmp/source.ks
|
||||
fi
|
||||
|
||||
vgdisplay -c | cut -d':' -f1 | xargs vgremove -ff
|
||||
dd if=/dev/zero of=/dev/${tgtdrive} bs=10M count=10
|
||||
sleep 3
|
||||
hdparm -z /dev/${tgtdrive}
|
||||
parted -s /dev/${tgtdrive} mklabel gpt
|
||||
parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 0% 24
|
||||
parted -s /dev/${tgtdrive} set 1 bios_grub on
|
||||
parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary fat16 24 224
|
||||
parted -s /dev/${tgtdrive} set 2 boot on
|
||||
parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 224 424
|
||||
sleep 3
|
||||
hdparm -z /dev/${tgtdrive}
|
||||
|
||||
# partition
|
||||
|
||||
# This adds support for the p seperator required for cciss devices
|
||||
if echo ${tgtdrive} | grep -q -e cciss ; then
|
||||
bootdev=${tgtdrive}p
|
||||
else
|
||||
bootdev=${tgtdrive}
|
||||
fi
|
||||
|
||||
cat << EOF > /tmp/partition.ks
|
||||
part /boot --onpart=/dev/${bootdev}3
|
||||
part /boot/efi --onpart=/dev/${bootdev}2
|
||||
part pv.001 --ondisk=${tgtdrive} --size=25000 --grow
|
||||
part pv.002 --ondisk=${tgtdrive} --size=10000
|
||||
volgroup os pv.001
|
||||
volgroup docker pv.002
|
||||
logvol swap --vgname=os --recommended --name=swap
|
||||
logvol / --vgname=os --size=10000 --name=root --fstype=ext4
|
||||
logvol /var --vgname=os --grow --percent 40 --name=var --fstype=ext4
|
||||
logvol /var/log --vgname=os --grow --percent 60 --name=varlog --fstype=ext4
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
# bootloader
|
||||
echo "bootloader --driveorder=${tgtdrive} --append=' biosdevname=0 crashkernel=none'" > /tmp/bootloader.ks
|
||||
|
||||
# Anaconda can not install grub 0.97 on disks which are >4T.
|
||||
# The reason is that grub does not support such large geometries
|
||||
# and it simply thinks that the cylinder number has negative value.
|
||||
# Here we just set geometry manually so that grub thinks that disk
|
||||
# size is equal to 1G.
|
||||
# 130 cylinders * (16065 * 512 = 8225280 bytes) = 1G
|
||||
echo "%post --nochroot --log=/mnt/sysimage/root/anaconda-post-partition.log" > /tmp/post_partition.ks
|
||||
echo "echo \"device (hd0) /dev/${tgtdrive}\" >> /tmp/grub.script" >> /tmp/post_partition.ks
|
||||
echo "echo \"geometry (hd0) 130 255 63\" >> /tmp/grub.script" >> /tmp/post_partition.ks
|
||||
echo "echo \"root (hd0,2)\" >> /tmp/grub.script" >> /tmp/post_partition.ks
|
||||
echo "echo \"install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf\" >> /tmp/grub.script" >> /tmp/post_partition.ks
|
||||
echo "echo quit >> /tmp/grub.script" >> /tmp/post_partition.ks
|
||||
echo "cat /tmp/grub.script | chroot /mnt/sysimage /sbin/grub --no-floppy --batch" >> /tmp/post_partition.ks
|
||||
echo "%end" >> /tmp/post_partition.ks
|
||||
%end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# POSTINSTALL SECTIONS
|
||||
# HERE ARE COMMANDS THAT WILL BE LAUNCHED JUST AFTER
|
||||
# INSTALLATION ITSELF COMPLETED
|
||||
|
||||
|
||||
# Parse /proc/cmdline and save for next steps
|
||||
%post --log=/root/anaconda-parse-cmdline.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
# Parse cmdline to alter keys which contains dot in their names
|
||||
# Such keys can't be used as variables in bash,
|
||||
# so every dot is replaced with double underscore.
|
||||
# Double underscore needed to avoid possible naming collisions.
|
||||
for item in $(cat /proc/cmdline); do
|
||||
if [[ "${item}" =~ '=' ]]; then
|
||||
key="${item%%=*}"
|
||||
value="${item#*=}"
|
||||
else
|
||||
key="${item}"
|
||||
value='yes'
|
||||
fi
|
||||
key="${key//\./__}"
|
||||
value="${value:-'yes'}"
|
||||
echo "${key}=${value}" >> /root/anaconda.cmdline.vars
|
||||
done
|
||||
|
||||
source /root/anaconda.cmdline.vars
|
||||
|
||||
if [[ ! -z $ifname ]]; then
|
||||
echo "adminif=$(udevadm info --query=property -p /sys/class/net/${ifname%%:*} | \
|
||||
awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
|
||||
fi
|
||||
|
||||
# Add self entry to /etc/hosts
|
||||
ipaddr=$(echo $ip | cut -d: -f1)
|
||||
hostname=$(echo $ip | cut -d: -f5)
|
||||
# Use default hostname if missing from parameters
|
||||
[ -z "$hostname" ] && hostname="fuel.domain.tld"
|
||||
short=$(echo $hostname | cut -d. -f1)
|
||||
echo -e "${ipaddr} ${hostname} ${short}" >> /etc/hosts
|
||||
%end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Mount installation media in chroot
|
||||
%post --nochroot --log=/mnt/sysimage/root/anaconda-post-before-chroot.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
source "/mnt/sysimage/root/anaconda.cmdline.vars"
|
||||
|
||||
SOURCE="/mnt/sysimage/tmp/source"
|
||||
|
||||
mkdir -p "${SOURCE}"
|
||||
|
||||
case "${repo}" in
|
||||
nfs:*)
|
||||
nfs_url="${repo#nfs:}"
|
||||
mount -t nfs "${nfs_url}" "${SOURCE}"
|
||||
;;
|
||||
*)
|
||||
if [ -d "/mnt/source" ]; then
|
||||
mount -o bind "/mnt/source" "${SOURCE}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# If not mounted, try to bind /run/install/repo since
|
||||
# anaconda shoud mount installation repo to that folder.
|
||||
if ! mountpoint -q "${SOURCE}"; then
|
||||
if [ -d '/run/install/repo' ] && mountpoint -q '/run/install/repo'; then
|
||||
mount -o bind '/run/install/repo' "${SOURCE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# If still not mounted, try to mount from LABEL / UUID.
|
||||
# It was moved from next phase here to keep all mounting stuff
|
||||
# in one place. All other scripts should use SOURCE variable
|
||||
# for access to dist files.
|
||||
|
||||
iso_volume_id=will_be_substituted_with_ISO_VOLUME_ID
|
||||
FS="/mnt/sysimage/tmp/fs"
|
||||
|
||||
if ! mountpoint -q "${SOURCE}"; then
|
||||
if [ -e "/dev/disk/by-label/${iso_volume_id}" ]; then
|
||||
mount "/dev/disk/by-label/${iso_volume_id}" "${SOURCE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Sleep to capture full log
|
||||
sleep 1
|
||||
%end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%post --log=/root/anaconda-post-configure-repos.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
SOURCE=/tmp/source
|
||||
|
||||
# this file is provided by fuel-openstack-metadata package
|
||||
OPENSTACK_VERSION=`rpm2cpio ${SOURCE}/mos-centos/Packages/fuel-openstack-metadata*.rpm | \
|
||||
cpio -i --to-stdout ./etc/fuel_openstack_version 2>/dev/null`
|
||||
|
||||
# build identifiers
|
||||
test -e ${SOURCE}/fuel_build_number && cp ${SOURCE}/fuel_build_number /etc/fuel_build_number
|
||||
test -e ${SOURCE}/fuel_build_id && cp ${SOURCE}/fuel_build_id /etc/fuel_build_id
|
||||
|
||||
# Copy repos config
|
||||
test -e ${SOURCE}/default_deb_repos.yaml && cp ${SOURCE}/default_deb_repos.yaml /root/default_deb_repos.yaml
|
||||
|
||||
# ----------------------
|
||||
# UNPACKING REPOSITORIES
|
||||
# ----------------------
|
||||
|
||||
wwwdir="/var/www/nailgun"
|
||||
repodir="${wwwdir}/${OPENSTACK_VERSION}"
|
||||
|
||||
# Copying Centos files
|
||||
mkdir -p ${repodir}/centos/x86_64
|
||||
mkdir -p ${repodir}/mos-centos/x86_64
|
||||
cp -r ${SOURCE}/images ${repodir}/centos/x86_64
|
||||
cp -r ${SOURCE}/isolinux ${repodir}/centos/x86_64
|
||||
cp -r ${SOURCE}/repodata ${repodir}/centos/x86_64
|
||||
cp -r ${SOURCE}/Packages ${repodir}/centos/x86_64
|
||||
cp -r ${SOURCE}/mos-centos/repodata ${repodir}/mos-centos/x86_64
|
||||
cp -r ${SOURCE}/mos-centos/Packages ${repodir}/mos-centos/x86_64
|
||||
cp -r ${SOURCE}/extra-repos ${repodir}/
|
||||
cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
|
||||
|
||||
# Copying Ubuntu files
|
||||
mkdir -p ${repodir}/ubuntu/x86_64/images
|
||||
cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
|
||||
cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
|
||||
|
||||
# make links for backward compatibility
|
||||
ln -s ${repodir}/centos ${wwwdir}/centos
|
||||
ln -s ${repodir}/ubuntu ${wwwdir}/ubuntu
|
||||
#Make a symlink for mos-centos in /var/www/nailgun in iso/ks.template
|
||||
ln -s ${repodir}/mos-centos ${wwwdir}/mos-centos
|
||||
ln -s ${repodir}/extra-repos ${wwwdir}/extra-repos
|
||||
|
||||
# Prepare local repository specification
|
||||
rm /etc/yum.repos.d/CentOS*.repo
|
||||
cp ${SOURCE}/extra-repos/extra.repo /etc/yum.repos.d/
|
||||
cat > /etc/yum.repos.d/nailgun.repo << EOF
|
||||
[nailgun]
|
||||
name=Nailgun Local Repo
|
||||
baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/centos/x86_64
|
||||
gpgcheck=0
|
||||
[mos]
|
||||
name=MOS Local Repo
|
||||
baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/mos-centos/x86_64
|
||||
gpgcheck=0
|
||||
EOF
|
||||
%end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%post --log=/root/anaconda-post-configure-sysconfig.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
source "/root/anaconda.cmdline.vars"
|
||||
SOURCE=/tmp/source
|
||||
FS=/tmp/fs
|
||||
|
||||
# Prepare bootstrap_admin_node config
|
||||
mkdir -p /etc/fuel
|
||||
cat > /etc/fuel/bootstrap_admin_node.conf << EOF
|
||||
#Set to yes to run Fuel Setup
|
||||
#Set to no to accept default settings
|
||||
ADMIN_INTERFACE=${adminif}
|
||||
showmenu=${showmenu:-yes}
|
||||
wait_for_external_config=${wait_for_external_config:-no}
|
||||
EOF
|
||||
|
||||
# Unmounting source
|
||||
umount -f ${SOURCE} || true
|
||||
rm -rf ${SOURCE}
|
||||
|
||||
umount -f ${FS} || true
|
||||
rm -rf ${FS}
|
||||
|
||||
%end
|
||||
|
||||
|
||||
|
||||
%post --log=/root/anaconda-post-install-extrapackages.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
MASTER_NODE_EXTRA_PACKAGES=""
|
||||
source "/root/anaconda.cmdline.vars"
|
||||
|
||||
if [ -n "${MASTER_NODE_EXTRA_PACKAGES}" ]; then
|
||||
for pkg in ${MASTER_NODE_EXTRA_PACKAGES}; do
|
||||
yum -y install ${pkg}
|
||||
done
|
||||
fi
|
||||
|
||||
%end
|
||||
|
||||
%post --log=/root/anaconda-post-configure-autologon.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
# Enable once root autologin for initial setup
|
||||
mkdir -p /etc/systemd/system/getty@tty1.service.d/
|
||||
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF'
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear %I 115200 linux
|
||||
EOF
|
||||
|
||||
# Exec bootstrap_admin_node.sh if autologin enabled
|
||||
cat >> /root/.bashrc << 'EOF'
|
||||
if [[ "$(tty)" == "/dev/tty1" && -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ]]; then
|
||||
rm -Rf "/etc/systemd/system/getty@tty1.service.d"
|
||||
/bin/systemctl daemon-reload
|
||||
yum makecache
|
||||
yum install -y fuel-setup
|
||||
if [ -x /usr/sbin/bootstrap_admin_node.sh ]; then
|
||||
exec /usr/sbin/bootstrap_admin_node.sh
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
%end
|
||||
|
||||
|
||||
%post --nochroot --log=/mnt/sysimage/root/anaconda-post-interface-settings.log
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
source "/mnt/sysimage/root/anaconda.cmdline.vars"
|
||||
|
||||
if [[ ! -z $adminif ]]; then
|
||||
rm -f /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${ifname%%:*}
|
||||
sed "s/${ifname%%:*}/${adminif}/g" \
|
||||
/etc/sysconfig/network-scripts/ifcfg-${ifname%%:*} > \
|
||||
/mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${adminif}
|
||||
fi
|
||||
%end
|
@ -1 +0,0 @@
|
||||
reboot: reboot --eject
|
199
iso/module.mk
199
iso/module.mk
@ -1,199 +0,0 @@
|
||||
.PHONY: all iso listing
|
||||
.DELETE_ON_ERROR: $(ISO_PATH)
|
||||
|
||||
all: iso listing
|
||||
|
||||
ISOROOT:=$(BUILD_DIR)/iso/isoroot
|
||||
|
||||
iso: $(ISO_PATH)
|
||||
|
||||
listing: $(BUILD_DIR)/iso/isoroot.done $(BUILD_DIR)/mirror/build.done
|
||||
-find $(BUILD_DIR)/iso/isoroot \
|
||||
-regextype posix-egrep \
|
||||
-regex '.*(fuel|astute|network-checker|nailgun|packetary|shotgun).*\.rpm' | \
|
||||
while read package_file; do \
|
||||
echo; \
|
||||
echo $$(basename $$package_file); \
|
||||
rpm -q --changelog -p $$package_file | head -12; \
|
||||
done > $(BUILD_DIR)/listing-package-changelog.txt
|
||||
|
||||
###################
|
||||
# BUILD IDENTIFIERS
|
||||
###################
|
||||
|
||||
ifdef BUILD_NUMBER
|
||||
$(BUILD_DIR)/iso/isoroot.done: $(ISOROOT)/fuel_build_number
|
||||
$(ISOROOT)/fuel_build_number:
|
||||
echo "$(BUILD_NUMBER)" > $@
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/iso/isoroot.done: $(ISOROOT)/fuel_build_id
|
||||
$(ISOROOT)/fuel_build_id:
|
||||
echo "$(BUILD_ID)" > $@
|
||||
|
||||
##############
|
||||
# CUSTOM REPOS
|
||||
##############
|
||||
|
||||
define default_deb_repos
|
||||
- name: mos
|
||||
suite: $(MIRROR_MOS_UBUNTU_SUITE)
|
||||
endef
|
||||
|
||||
# if we are not building packages and sync repos only, we MUST use
|
||||
# the same suit as we use during debmirroring
|
||||
ifeq ($(BUILD_PACKAGES),0)
|
||||
$(BUILD_DIR)/iso/isoroot.done: $(ISOROOT)/default_deb_repos.yaml
|
||||
endif
|
||||
$(ISOROOT)/default_deb_repos.yaml: export default_deb_repos_content:=$(default_deb_repos)
|
||||
$(ISOROOT)/default_deb_repos.yaml:
|
||||
/bin/echo -e "$${default_deb_repos_content}\n" > $@
|
||||
|
||||
###############
|
||||
# CENTOS MIRROR
|
||||
###############
|
||||
$(BUILD_DIR)/iso/isoroot-centos.done: \
|
||||
$(BUILD_DIR)/mirror/build.done \
|
||||
$(BUILD_DIR)/mirror/make-changelog.done \
|
||||
$(BUILD_DIR)/packages/build.done \
|
||||
$(BUILD_DIR)/iso/isoroot-dotfiles.done
|
||||
mkdir -p $(ISOROOT)
|
||||
rsync -rp $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/ $(ISOROOT)
|
||||
rsync -rp $(LOCAL_MIRROR_MOS_CENTOS) $(ISOROOT)
|
||||
rsync -rp $(LOCAL_MIRROR)/extra-repos $(ISOROOT)
|
||||
rsync -rp $(LOCAL_MIRROR)/centos-packages.changelog $(ISOROOT)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
###############
|
||||
# UBUNTU MIRROR
|
||||
###############
|
||||
$(BUILD_DIR)/iso/isoroot-ubuntu.done: \
|
||||
$(BUILD_DIR)/mirror/build.done \
|
||||
$(BUILD_DIR)/mirror/make-changelog.done \
|
||||
$(BUILD_DIR)/packages/build.done \
|
||||
$(BUILD_DIR)/iso/isoroot-dotfiles.done
|
||||
mkdir -p $(ISOROOT)/ubuntu
|
||||
rsync -rp $(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/ $(ISOROOT)/ubuntu/
|
||||
rsync -rp $(LOCAL_MIRROR)/ubuntu-packages.changelog $(ISOROOT)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
########################
|
||||
# Extra files
|
||||
########################
|
||||
|
||||
$(BUILD_DIR)/iso/isoroot-dotfiles.done: \
|
||||
$(ISOROOT)/.discinfo \
|
||||
$(ISOROOT)/.treeinfo
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/iso/isoroot-files.done: \
|
||||
$(BUILD_DIR)/iso/isoroot-dotfiles.done \
|
||||
$(ISOROOT)/isolinux/isolinux.cfg \
|
||||
$(ISOROOT)/isolinux/splash.jpg \
|
||||
$(ISOROOT)/ks.cfg
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(ISOROOT)/.discinfo: $(SOURCE_DIR)/iso/.discinfo ; $(ACTION.COPY)
|
||||
$(ISOROOT)/.treeinfo: $(SOURCE_DIR)/iso/.treeinfo ; $(ACTION.COPY)
|
||||
|
||||
$(ISOROOT)/ks.yaml:
|
||||
@mkdir -p $(@D)
|
||||
cp $(KSYAML) $@
|
||||
|
||||
$(ISOROOT)/isolinux/isolinux.cfg: $(SOURCE_DIR)/iso/isolinux/isolinux.cfg ; $(ACTION.COPY)
|
||||
$(ISOROOT)/isolinux/splash.jpg: $(SOURCE_DIR)/iso/isolinux/splash.jpg ; $(ACTION.COPY)
|
||||
$(ISOROOT)/ks.cfg: $(SOURCE_DIR)/iso/ks.template $(SOURCE_DIR)/iso/ks.py $(ISOROOT)/ks.yaml
|
||||
python $(SOURCE_DIR)/iso/ks.py \
|
||||
-t $(SOURCE_DIR)/iso/ks.template \
|
||||
-c $(ISOROOT)/ks.yaml \
|
||||
-o $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
|
||||
########################
|
||||
# Iso image root file system.
|
||||
########################
|
||||
|
||||
$(BUILD_DIR)/iso/isoroot.done: \
|
||||
$(BUILD_DIR)/iso/isoroot-centos.done \
|
||||
$(BUILD_DIR)/iso/isoroot-ubuntu.done \
|
||||
$(BUILD_DIR)/iso/isoroot-files.done
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
########################
|
||||
# Building CD and USB stick images
|
||||
########################
|
||||
|
||||
# ISO_VOLUME_ID can't have whitespaces or other non-alphanumeric characters 'as is'.
|
||||
# They must be represented as \xNN, where NN is the hexadecimal representation of the character.
|
||||
# For example, \x20 is a white space (" ").
|
||||
# This is the limitation of kickstart boot options.
|
||||
|
||||
ISO_VOLUME_ID:=OpenStack_Fuel
|
||||
ISO_VOLUME_PREP:="Fuel team"
|
||||
|
||||
# keep in mind that mkisofs touches some files inside directory
|
||||
# from which it builds iso image
|
||||
# that is why we need to make isoroot.done dependent on some files
|
||||
# and then copy these files into another directory
|
||||
$(ISO_PATH): $(BUILD_DIR)/iso/isoroot.done
|
||||
rm -f $@
|
||||
mkdir -p $(BUILD_DIR)/iso/isoroot-mkisofs $(@D)
|
||||
rsync -a --delete $(ISOROOT)/ $(BUILD_DIR)/iso/isoroot-mkisofs
|
||||
sudo sed -r -i -e "s/ip=[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/ip=$(MASTER_IP)/" $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e "s/dns1=[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/dns1=$(MASTER_DNS)/" $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e "s/netmask=[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/netmask=$(MASTER_NETMASK)/" $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e "s/gw=[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/gw=$(MASTER_GW)/" $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e "s/will_be_substituted_with_PRODUCT_VERSION/$(PRODUCT_VERSION)/" $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e 's/will_be_substituted_with_ISO_VOLUME_ID/$(ISO_VOLUME_ID)/g' $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/isolinux.cfg
|
||||
sudo sed -r -i -e 's/will_be_substituted_with_ISO_VOLUME_ID/$(ISO_VOLUME_ID)/g' $(BUILD_DIR)/iso/isoroot-mkisofs/ks.cfg
|
||||
|
||||
|
||||
mkdir -p $(BUILD_DIR)/iso/efi_tmp/efi_image
|
||||
# We need to have a partition which will be pointed from ISO as efi partition
|
||||
# vmlinuz + initrd + bootloader + conffile = about 38MB. 100M should be enough ^_^
|
||||
dd bs=1M count=100 if=/dev/zero of=$(BUILD_DIR)/iso/efi_tmp/efiboot.img
|
||||
# UEFI standard say to us that EFI partition should be some FAT-related filesystem
|
||||
mkfs.vfat -n EFI $(BUILD_DIR)/iso/efi_tmp/efiboot.img
|
||||
sudo umount -l $(BUILD_DIR)/iso/efi_tmp/efi_image || true
|
||||
sudo mount $(BUILD_DIR)/iso/efi_tmp/efiboot.img $(BUILD_DIR)/iso/efi_tmp/efi_image
|
||||
|
||||
# This needs to be edited in place due to some strange implementations of UEFI
|
||||
# For example, Tianocore OVMF will not use efiboot.img. Instead, it looks for
|
||||
# bootloader and it conffiles in /EFI/BOOT/* on main ISO partition (with ISO9660 fs)
|
||||
echo > $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo "default=0" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
#echo "splashimage=/EFI/BOOT/splash.xpm.gz" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo "timeout 300" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo "hiddenmenu" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo "title DVD Fuel Install (Static IP)" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
# efiboot.img is a partition with filesystem now and /vmlinuz there will be pointed
|
||||
# to root of it
|
||||
echo " kernel /vmlinuz biosdevname=0 ks=cdrom:/ks.cfg ip=$(MASTER_IP) gw=$(MASTER_GW) dns1=$(MASTER_DNS) netmask=$(MASTER_NETMASK) hostname=fuel.domain.tld showmenu=yes" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo " initrd /initrd.img" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo "title USB Fuel Install (Static IP)" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo " kernel /vmlinuz biosdevname=0 repo=hd:LABEL=\"$(ISO_VOLUME_ID)\":/ ks=hd:LABEL=\"$(ISO_VOLUME_ID)\":/ks.cfg ip=$(MASTER_IP) gw=$(MASTER_GW) dns1=$(MASTER_DNS) netmask=$(MASTER_NETMASK) hostname=fuel.domain.tld showmenu=yes" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
echo " initrd /initrd.img" >> $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf
|
||||
|
||||
# But many UEFI implementations will use our efiboot.img and if we want to boot from it,
|
||||
# we also need to place kernel and initrd there (and bootloader and conffile to it too)
|
||||
sudo cp -f $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/vmlinuz $(BUILD_DIR)/iso/efi_tmp/efi_image/
|
||||
sudo cp -f $(BUILD_DIR)/iso/isoroot-mkisofs/isolinux/initrd.img $(BUILD_DIR)/iso/efi_tmp/efi_image/
|
||||
sudo mkdir -p $(BUILD_DIR)/iso/efi_tmp/efi_image/EFI/BOOT/
|
||||
sudo cp -f $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.conf $(BUILD_DIR)/iso/efi_tmp/efi_image/EFI/BOOT/
|
||||
sudo cp -f $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/BOOTX64.EFI $(BUILD_DIR)/iso/efi_tmp/efi_image/EFI/BOOT/
|
||||
#sudo cp -f $(BUILD_DIR)/iso/isoroot-mkisofs/EFI/BOOT/splash.xpm.gz $(BUILD_DIR)/iso/efi_tmp/efi_image/EFI/BOOT/
|
||||
sudo umount $(BUILD_DIR)/iso/efi_tmp/efi_image
|
||||
cp -f $(BUILD_DIR)/iso/efi_tmp/efiboot.img $(BUILD_DIR)/iso/isoroot-mkisofs/images/
|
||||
sudo rm -rf $(BUILD_DIR)/iso/efi_tmp/
|
||||
|
||||
xorriso -as mkisofs \
|
||||
-V $(ISO_VOLUME_ID) -p $(ISO_VOLUME_PREP) \
|
||||
-J -R \
|
||||
-graft-points \
|
||||
-b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
|
||||
-eltorito-alt-boot -e images/efiboot.img -no-emul-boot \
|
||||
-isohybrid-gpt-basdat \
|
||||
-o $@ $(BUILD_DIR)/iso/isoroot-mkisofs
|
||||
implantisomd5 $@
|
@ -1,46 +0,0 @@
|
||||
ISOLINUX_FILES:=boot.msg grub.conf initrd.img isolinux.bin memtest vesamenu.c32 vmlinuz
|
||||
IMAGES_FILES:=efiboot.img boot.iso
|
||||
LIVEOS_FILES:=squashfs.img
|
||||
PXEBOOT_FILES:=initrd.img vmlinuz
|
||||
EFI_FILES:=BOOTX64.EFI MokManager.efi grub.cfg grubx64.efi
|
||||
|
||||
MIRROR_CENTOS_KERNEL?=$(MIRROR_CENTOS)
|
||||
MIRROR_CENTOS_KERNEL_BASEURL?=$(MIRROR_CENTOS_KERNEL)/os/$(CENTOS_ARCH)
|
||||
|
||||
# centos isolinux files
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/isolinux/,$(ISOLINUX_FILES)):
|
||||
@mkdir -p $(@D)
|
||||
wget -nv -O $@.tmp $(MIRROR_CENTOS_KERNEL_BASEURL)/isolinux/$(@F)
|
||||
mv $@.tmp $@
|
||||
|
||||
# centos EFI boot images
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/EFI/BOOT/,$(EFI_FILES)):
|
||||
@mkdir -p $(@D)
|
||||
wget -nv -O $@.tmp $(MIRROR_CENTOS_KERNEL_BASEURL)/EFI/BOOT/$(@F)
|
||||
mv $@.tmp $@
|
||||
|
||||
# centos boot images
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/images/,$(IMAGES_FILES)):
|
||||
@mkdir -p $(@D)
|
||||
wget -nv -O $@.tmp $(MIRROR_CENTOS_KERNEL_BASEURL)/images/$(@F)
|
||||
mv $@.tmp $@
|
||||
|
||||
# centos pxeboot images
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/images/pxeboot/,$(PXEBOOT_FILES)):
|
||||
@mkdir -p $(@D)
|
||||
wget -nv -O $@.tmp $(MIRROR_CENTOS_KERNEL_BASEURL)/images/pxeboot/$(@F)
|
||||
mv $@.tmp $@
|
||||
|
||||
# centos liveos images
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/LiveOS/,$(LIVEOS_FILES)):
|
||||
@mkdir -p $(@D)
|
||||
wget -nv -O $@.tmp $(MIRROR_CENTOS_KERNEL_BASEURL)/LiveOS/$(@F)
|
||||
mv $@.tmp $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/boot.done: \
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/images/,$(IMAGES_FILES)) \
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/EFI/BOOT/,$(EFI_FILES)) \
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/isolinux/,$(ISOLINUX_FILES)) \
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/images/pxeboot/,$(PXEBOOT_FILES)) \
|
||||
$(addprefix $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/LiveOS/,$(LIVEOS_FILES))
|
||||
$(ACTION.TOUCH)
|
@ -1,35 +0,0 @@
|
||||
extra_centos_empty_installroot:=$(BUILD_DIR)/mirror/centos/dummy_extra_installroot
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos-download.done: $(BUILD_DIR)/mirror/centos/yum-config.done
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos-download.done:
|
||||
mkdir -p $(LOCAL_MIRROR)/extra-repos
|
||||
$(foreach repo,$(EXTRA_RPM_REPOS),$(call extra_repo_download,$(repo));)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(LOCAL_MIRROR)/extra-repos/extra.repo: $(call depv,EXTRA_RPM_REPOS)
|
||||
$(LOCAL_MIRROR)/extra-repos/extra.repo: \
|
||||
export fuelnode_repos:=$(foreach repo,$(EXTRA_RPM_REPOS),\n$(call create_fuelnode_repo,$(repo))\n)
|
||||
$(LOCAL_MIRROR)/extra-repos/extra.repo:
|
||||
mkdir -p $(@D)
|
||||
/bin/echo -e "$${fuelnode_repos}" > $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos.done: $(LOCAL_MIRROR)/extra-repos/extra.repo
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos.done: $(BUILD_DIR)/mirror/centos/extra-repos-download.done
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos.done:
|
||||
$(foreach repo,$(EXTRA_RPM_REPOS),$(call extra_repo_metadata,$(repo));)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
define extra_repo_download
|
||||
mkdir -p "$(extra_centos_empty_installroot)/cache" ;
|
||||
set -ex ; env TMPDIR="$(extra_centos_empty_installroot)/cache" \
|
||||
TMP="$(extra_centos_empty_installroot)/cache" \
|
||||
reposync --downloadcomps --plugins --delete --arch=$(CENTOS_ARCH) \
|
||||
--cachedir="$(extra_centos_empty_installroot)/cache" \
|
||||
-c $(BUILD_DIR)/mirror/centos/etc/yum.conf --repoid=$(call get_repo_name,$1) \
|
||||
-p $(LOCAL_MIRROR)/extra-repos/
|
||||
endef
|
||||
|
||||
define extra_repo_metadata
|
||||
set -ex ; createrepo -g $(LOCAL_MIRROR)/extra-repos/$(call get_repo_name,$1)/comps.xml \
|
||||
-o $(LOCAL_MIRROR)/extra-repos/$(call get_repo_name,$1)/ $(LOCAL_MIRROR)/extra-repos/$(call get_repo_name,$1)/
|
||||
endef
|
@ -1,23 +0,0 @@
|
||||
# This module downloads required upstream rpm packages and creates rpm repository.
|
||||
include $(SOURCE_DIR)/mirror/centos/repo.mk
|
||||
# This module downloads centos installation images.
|
||||
include $(SOURCE_DIR)/mirror/centos/boot.mk
|
||||
# This module downloads MOS rpm repository
|
||||
include $(SOURCE_DIR)/mirror/centos/mos-repo.mk
|
||||
# This module downloads extra rpm repositories
|
||||
include $(SOURCE_DIR)/mirror/centos/extra-repos.mk
|
||||
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/build.done: \
|
||||
$(BUILD_DIR)/mirror/centos/repo.done \
|
||||
$(BUILD_DIR)/mirror/centos/boot.done \
|
||||
$(BUILD_DIR)/mirror/centos/mos-repo.done \
|
||||
$(BUILD_DIR)/mirror/centos/extra-repos.done
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
mirror-centos: $(BUILD_DIR)/mirror/centos/build.done
|
||||
repo-centos: $(BUILD_DIR)/mirror/centos/repo.done
|
||||
repo-mos-centos: $(BUILD_DIR)/mirror/centos/mos-repo.done
|
||||
extra-repos-centos: $(BUILD_DIR)/mirror/centos/extra-repos.done
|
||||
|
||||
.PHONY: mirror-centos repo-centos repo-mos-centos extra-repos-centos
|
@ -1,18 +0,0 @@
|
||||
mos_centos_empty_installroot:=$(BUILD_DIR)/mirror/centos/dummy_mos_installroot
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/mos-download.done: $(BUILD_DIR)/mirror/centos/yum-config.done
|
||||
mkdir -p $(@D)
|
||||
mkdir -p $(LOCAL_MIRROR_MOS_CENTOS)
|
||||
mkdir -p "$(mos_centos_empty_installroot)/cache"
|
||||
set -ex ; env TMPDIR="$(mos_centos_empty_installroot)/cache" \
|
||||
TMP="$(mos_centos_empty_installroot)/cache" \
|
||||
reposync --norepopath --downloadcomps --plugins --delete --arch=$(CENTOS_ARCH) \
|
||||
--cachedir="$(mos_centos_empty_installroot)/cache" \
|
||||
-c $(BUILD_DIR)/mirror/centos/etc/yum.conf --repoid=fuel -p $(LOCAL_MIRROR_MOS_CENTOS)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/mos-repo.done: $(BUILD_DIR)/mirror/centos/mos-download.done
|
||||
createrepo -g $(LOCAL_MIRROR_MOS_CENTOS)/comps.xml \
|
||||
-o $(LOCAL_MIRROR_MOS_CENTOS)/ $(LOCAL_MIRROR_MOS_CENTOS)/
|
||||
$(ACTION.TOUCH)
|
||||
|
@ -1,190 +0,0 @@
|
||||
include $(SOURCE_DIR)/mirror/centos/yum_repos.mk
|
||||
|
||||
.PHONY: show-yum-urls-centos show-yum-urls-centos-full show-yum-repos-centos
|
||||
|
||||
MIRROR_CENTOS_OS_BASEURL?=$(MIRROR_CENTOS)/os/$(CENTOS_ARCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.conf: $(call depv,yum_conf)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.conf: export contents:=$(yum_conf)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.conf:
|
||||
mkdir -p $(@D)
|
||||
/bin/echo -e "$${contents}" > $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum-plugins/priorities.py: \
|
||||
$(SOURCE_DIR)/mirror/centos/yum-priorities-plugin.py
|
||||
mkdir -p $(@D)
|
||||
cp $(SOURCE_DIR)/mirror/centos/yum-priorities-plugin.py $@
|
||||
|
||||
# DENY_RPM_DOWNGRADE=0 - Disable full_match flag for yum priorities plugin.
|
||||
# This means that we choose package candidate not by full match
|
||||
# of version, realase and arch. This may lead to downgrading of
|
||||
# packages (actually this is what we may want sometimes for
|
||||
# testing purposes). Please use priorities plugin carefully
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum/pluginconf.d/priorities.conf:
|
||||
mkdir -p $(@D)
|
||||
/bin/echo -e "[main]\nenabled=1\ncheck_obsoletes=1\nfull_match=$(DENY_RPM_DOWNGRADE)" > $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/base.repo: $(call depv,YUM_REPOS)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/base.repo: \
|
||||
export contents:=$(foreach repo,$(YUM_REPOS),\n$(yum_repo_$(repo))\n)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/base.repo:
|
||||
@mkdir -p $(@D)
|
||||
/bin/echo -e "$${contents}" > $@
|
||||
|
||||
$(BUILD_DIR)/bin/yumdownloader: $(SOURCE_DIR)/mirror/centos/yumdownloader-deps.patch
|
||||
mkdir -p $(@D)
|
||||
cp -a /usr/bin/yumdownloader $(BUILD_DIR)/yumdownloader
|
||||
( cd $(BUILD_DIR) && patch -p0 ) < $<
|
||||
cp -a $(BUILD_DIR)/yumdownloader $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/extra.repo: $(call depv,EXTRA_RPM_REPOS)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/extra.repo: \
|
||||
export contents:=$(foreach repo,$(EXTRA_RPM_REPOS),\n$(call create_extra_repo,$(repo))\n)
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/extra.repo:
|
||||
@mkdir -p $(@D)
|
||||
/bin/echo -e "$${contents}" > $@
|
||||
|
||||
centos_empty_installroot:=$(BUILD_DIR)/mirror/centos/dummy_installroot
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/yum-config.done: \
|
||||
$(BUILD_DIR)/bin/yumdownloader \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.conf \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/base.repo \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/extra.repo \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum-plugins/priorities.py \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum/pluginconf.d/priorities.conf
|
||||
rm -rf $(centos_empty_installroot)
|
||||
mkdir -p $(centos_empty_installroot)/cache
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/yum.done: $(BUILD_DIR)/mirror/centos/rpm-download.done
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/rpm-download.done: $(BUILD_DIR)/mirror/centos/urls.list
|
||||
dst="$(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages"; \
|
||||
mkdir -p "$$dst" && \
|
||||
xargs -n1 -P4 wget -Nnv -P "$$dst" < $<
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
# BUILD_PACKAGES=0 - apply patch for requirements rpm, since we need fuel-packages
|
||||
ifeq ($(BUILD_PACKAGES),0)
|
||||
$(BUILD_DIR)/requirements-rpm.txt: \
|
||||
$(SOURCE_DIR)/requirements-rpm.txt \
|
||||
$(SOURCE_DIR)/requirements-fuel-rpm.txt
|
||||
cat $^ | sort -u > $@.tmp
|
||||
mv $@.tmp $@
|
||||
else
|
||||
$(BUILD_DIR)/requirements-rpm.txt: $(SOURCE_DIR)/requirements-rpm.txt
|
||||
$(ACTION.COPY)
|
||||
endif
|
||||
|
||||
# Strip the comments and sort the list alphabetically
|
||||
$(BUILD_DIR)/mirror/centos/requirements-rpm-0.txt: $(BUILD_DIR)/requirements-rpm.txt
|
||||
mkdir -p $(@D) && \
|
||||
grep -v -e '^#' $< > $@.tmp && \
|
||||
sort -u < $@.tmp > $@.pre && \
|
||||
mv $@.pre $@
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/urls.list: $(BUILD_DIR)/mirror/centos/requirements-rpm-0.txt \
|
||||
$(BUILD_DIR)/mirror/centos/yum-config.done
|
||||
touch "$(BUILD_DIR)/mirror/centos/conflicting-packages-0.lst"
|
||||
# 1st pass - find out which packages conflict
|
||||
# 2nd pass - get the URLs of non-conflicting packages
|
||||
# 3rd pass (under the else clause) - process the conflicting rpms one by one
|
||||
count=0; \
|
||||
while true; do \
|
||||
if [ $$count -gt 1 ]; then \
|
||||
echo "Unable to resolve packages dependencies" >&2; \
|
||||
cat $(BUILD_DIR)/mirror/centos/yumdownloader-1.out >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
requirements_rpm="$(BUILD_DIR)/mirror/centos/requirements-rpm-$${count}.txt"; \
|
||||
requirements_rpm_next="$(BUILD_DIR)/mirror/centos/requirements-rpm-$$((count+1)).txt"; \
|
||||
out="$(BUILD_DIR)/mirror/centos/yumdownloader-$${count}.out"; \
|
||||
log="$(BUILD_DIR)/mirror/centos/yumdownloader-$${count}.log"; \
|
||||
conflict_lst="$(BUILD_DIR)/mirror/centos/conflicting-packages-$${count}.lst"; \
|
||||
conflict_lst_next="$(BUILD_DIR)/mirror/centos/conflicting-packages-$$((count+1)).lst"; \
|
||||
if ! env \
|
||||
TMPDIR="$(centos_empty_installroot)/cache" \
|
||||
TMP="$(centos_empty_installroot)/cache" \
|
||||
$(BUILD_DIR)/bin/yumdownloader -q --urls \
|
||||
--archlist=$(CENTOS_ARCH) \
|
||||
--installroot="$(centos_empty_installroot)" \
|
||||
-c $(BUILD_DIR)/mirror/centos/etc/yum.conf \
|
||||
--resolve \
|
||||
`cat $${requirements_rpm}` > "$$out" 2>"$$log"; then \
|
||||
sed -rne 's/^([a-zA-Z0-9_-]+)\s+conflicts with\s+(.+)$$/\1/p' < "$$out" > "$${conflict_lst_next}.pre" && \
|
||||
# Package X can declare conflict with package Y; but package Y is not obliged \
|
||||
# to declare a conflict with package X. yum will report that X conflicts with Y. \
|
||||
# We need to figure out that Y conflicts with X on our own. \
|
||||
sed -rne 's/^([a-zA-Z0-9_-]+)\s+conflicts with\s+(.+)$$/\2/p' < "$$out" > "$${conflict_lst_next}.more" && \
|
||||
while read nvra; do \
|
||||
nvr="$${nvra%.*}"; nv="$${nvr%-*}"; n="$${nv%-*}"; echo $$n; \
|
||||
done < "$${conflict_lst_next}.more" >> "$${conflict_lst_next}.pre" && \
|
||||
cat "$${conflict_lst_next}.pre" "$$conflict_lst" | sort -u > "$$conflict_lst_next" && \
|
||||
comm -23 "$$requirements_rpm" "$$conflict_lst_next" > "$${requirements_rpm}.new.pre" && \
|
||||
sort -u < "$${requirements_rpm}.new.pre" > "$${requirements_rpm_next}"; \
|
||||
else \
|
||||
conflicting_pkgs_urls="$(BUILD_DIR)/mirror/centos/urls_conflicting.lst"; \
|
||||
nonconflicting_pkgs="$$requirements_rpm"; \
|
||||
# Now process conflicting packages one by one. There is a small problem: \
|
||||
# in the original requirements-rpm.txt quite a number of packages are \
|
||||
# pinned to specific versions. These pins should be taken into account \
|
||||
# to avoid having several versions of the same package. For instance, \
|
||||
# zabbix-web-* depends on httpd, so the latest version of httpd gets \
|
||||
# installed along with the one listed in the requirements-rpm.txt. \
|
||||
# Therefore add the set of all nonconflicting packages to the package \
|
||||
# being processed to take into account version pins. \
|
||||
for pkg in `cat $$conflict_lst`; do \
|
||||
if ! env \
|
||||
TMPDIR="$(centos_empty_installroot)/cache" \
|
||||
TMP="$(centos_empty_installroot)/cache" \
|
||||
$(BUILD_DIR)/bin/yumdownloader -q --urls \
|
||||
--archlist=$(CENTOS_ARCH) \
|
||||
--installroot="$(centos_empty_installroot)" \
|
||||
-c "$(BUILD_DIR)/mirror/centos/etc/yum.conf" \
|
||||
--resolve $$pkg `cat $$nonconflicting_pkgs`; then \
|
||||
echo "Failed to resolve package $$pkg" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done > "$$conflicting_pkgs_urls" && \
|
||||
cat "$$out" "$$conflicting_pkgs_urls" > "$@.out" && \
|
||||
break; \
|
||||
fi; \
|
||||
count=$$((count+1)); \
|
||||
done
|
||||
# yumdownloader -q prints logs to stdout, filter them out
|
||||
sed -rne '/\.rpm$$/ {p}' < $@.out > $@.pre
|
||||
sort -u < $@.pre > $@.tmp
|
||||
mv $@.tmp $@.full
|
||||
grep "$(MIRROR_CENTOS)" $@.full > $@
|
||||
|
||||
show-yum-urls-centos: $(BUILD_DIR)/mirror/centos/urls.list
|
||||
cat $<
|
||||
|
||||
show-yum-urls-centos-full: $(BUILD_DIR)/mirror/centos/urls.list
|
||||
cat $(BUILD_DIR)/mirror/centos/urls.list.full
|
||||
|
||||
show-yum-repos-centos: \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/base.repo \
|
||||
$(BUILD_DIR)/mirror/centos/etc/yum.repos.d/extra.repo
|
||||
cat $^
|
||||
|
||||
$(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml: \
|
||||
export COMPSXML=$(shell wget -nv -qO- $(MIRROR_CENTOS_OS_BASEURL)/repodata/repomd.xml | grep -m 1 '$(@F)' | awk -F'"' '{ print $$2 }')
|
||||
$(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml:
|
||||
@mkdir -p $(@D)
|
||||
if ( echo $${COMPSXML} | grep -q '\.gz$$' ); then \
|
||||
wget -nv -O $@.gz $(MIRROR_CENTOS_OS_BASEURL)/$${COMPSXML}; \
|
||||
gunzip $@.gz; \
|
||||
else \
|
||||
wget -nv -O $@ $(MIRROR_CENTOS_OS_BASEURL)/$${COMPSXML}; \
|
||||
fi
|
||||
|
||||
$(BUILD_DIR)/mirror/centos/repo.done: \
|
||||
$(BUILD_DIR)/mirror/centos/yum.done \
|
||||
| $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml
|
||||
createrepo -g $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml \
|
||||
-o $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/ $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/
|
||||
$(ACTION.TOUCH)
|
@ -1,226 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# yum-plugin-priorities 0.0.7
|
||||
#
|
||||
# Copyright (c) 2006-2007 Daniel de Kok
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# This plugins is inspired by the protectbase plugin, and enables/disables
|
||||
# packages based on a repository priority.
|
||||
#
|
||||
# You can install this plugin by copying it to /usr/lib/yum-plugins. To
|
||||
# enable this plugin, make sure that you have 'plugins=1' in /etc/yum.conf,
|
||||
# and create the file /etc/yum/pluginconf.d/priorities.conf with the
|
||||
# following content:
|
||||
#
|
||||
# [main]
|
||||
# enabled=1
|
||||
#
|
||||
# If you also want the plugin to protect high-priority repositories against
|
||||
# obsoletes in low-priority repositories, enable the 'check_obsoletes' bool:
|
||||
#
|
||||
# check_obsoletes=1
|
||||
#
|
||||
# By default, this plugin excludes packages from lower priority repositories
|
||||
# based on the package name. If you want to exclude packages based only the
|
||||
# package name and architecture, enable the 'only_samearch' bool:
|
||||
#
|
||||
# only_samearch=1
|
||||
#
|
||||
# If you want to be able to set package as the fully qualified package name
|
||||
# including architecture and package version, enable 'full_match' bool:
|
||||
#
|
||||
# full_match=1
|
||||
#
|
||||
# If full_match is enabled then check_obsoletes will be forced to disable
|
||||
#
|
||||
# You can add priorities to repositories, by adding the line:
|
||||
#
|
||||
# priority=N
|
||||
#
|
||||
# to the repository entry, where N is an integer number. The default
|
||||
# priority for repositories is 99. The repositories with the lowest
|
||||
# number have the highest priority.
|
||||
#
|
||||
# Please report errors to Daniel de Kok <danieldk@pobox.com>
|
||||
|
||||
from yum.constants import *
|
||||
from yum.plugins import TYPE_CORE
|
||||
from yum import config
|
||||
import yum
|
||||
|
||||
check_obsoletes = False
|
||||
only_samearch = False
|
||||
full_match = False
|
||||
|
||||
requires_api_version = '2.1'
|
||||
plugin_type = (TYPE_CORE,)
|
||||
|
||||
|
||||
def config_hook(conduit):
|
||||
global check_obsoletes
|
||||
global only_samearch
|
||||
global full_match
|
||||
|
||||
# Plugin configuration
|
||||
check_obsoletes = conduit.confBool('main', 'check_obsoletes',
|
||||
default=False)
|
||||
only_samearch = conduit.confBool('main', 'only_samearch', default=False)
|
||||
full_match = conduit.confBool('main', 'full_match', default=False)
|
||||
|
||||
if full_match:
|
||||
check_obsoletes = False
|
||||
|
||||
# Repo priorities
|
||||
if yum.__version__ >= '2.5.0':
|
||||
# New style : yum >= 2.5
|
||||
config.RepoConf.priority = config.IntOption(99)
|
||||
else:
|
||||
# Old add extra options style
|
||||
conduit.registerOpt('priority', PLUG_OPT_INT, PLUG_OPT_WHERE_REPO, 99)
|
||||
|
||||
# Command-line options.
|
||||
parser = conduit.getOptParser()
|
||||
if parser:
|
||||
if hasattr(parser, 'plugin_option_group'):
|
||||
parser = parser.plugin_option_group
|
||||
parser.add_option(
|
||||
'', '--samearch-priorities', dest='samearch', action='store_true',
|
||||
default=False,
|
||||
help="Priority-exclude packages based on name + arch")
|
||||
|
||||
|
||||
def _all_repo_priorities_same(allrepos):
|
||||
""" Are all repos at the same priority """
|
||||
first = None
|
||||
for repo in allrepos:
|
||||
if first is None:
|
||||
first = repo.priority
|
||||
elif first != repo.priority:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def exclude_hook(conduit):
|
||||
global only_samearch
|
||||
global check_obsoletes
|
||||
global full_match
|
||||
|
||||
allrepos = conduit.getRepos().listEnabled()
|
||||
|
||||
# If they haven't done anything, don't do any work
|
||||
if _all_repo_priorities_same(allrepos):
|
||||
return
|
||||
|
||||
# Check whether the user specified the --samearch option.
|
||||
opts, commands = conduit.getCmdLine()
|
||||
if opts and opts.samearch:
|
||||
only_samearch = True
|
||||
|
||||
cnt = 0
|
||||
if check_obsoletes and not conduit._base.conf.obsoletes:
|
||||
check_obsoletes = False
|
||||
if check_obsoletes:
|
||||
obsoletes = conduit._base.up.rawobsoletes
|
||||
|
||||
# Build a dictionary with package priorities. Either with arch or
|
||||
# archless, based on the user's settings.
|
||||
if only_samearch:
|
||||
pkg_priorities = dict()
|
||||
if check_obsoletes or not only_samearch:
|
||||
pkg_priorities_archless = dict()
|
||||
for repo in allrepos:
|
||||
if repo.enabled:
|
||||
if only_samearch:
|
||||
repopkgs = _pkglist_to_dict(conduit.getPackages(repo),
|
||||
repo.priority, True)
|
||||
_mergeprioritydicts(pkg_priorities, repopkgs)
|
||||
|
||||
if check_obsoletes or not only_samearch:
|
||||
repopkgs_archless = _pkglist_to_dict(
|
||||
conduit.getPackages(repo), repo.priority)
|
||||
_mergeprioritydicts(pkg_priorities_archless, repopkgs_archless)
|
||||
|
||||
# Eliminate packages that have a low priority
|
||||
for repo in allrepos:
|
||||
if repo.enabled:
|
||||
for po in conduit.getPackages(repo):
|
||||
delPackage = False
|
||||
|
||||
if full_match:
|
||||
pname = str(po)
|
||||
else:
|
||||
pname = po.name
|
||||
|
||||
if only_samearch:
|
||||
key = "%s.%s" % (pname, po.arch)
|
||||
if (key in pkg_priorities and
|
||||
pkg_priorities[key] < repo.priority):
|
||||
delPackage = True
|
||||
else:
|
||||
key = "%s" % pname
|
||||
if (key in pkg_priorities_archless and
|
||||
pkg_priorities_archless[key] < repo.priority):
|
||||
delPackage = True
|
||||
|
||||
if delPackage:
|
||||
conduit.delPackage(po)
|
||||
cnt += 1
|
||||
conduit.info(3, " --> %s from %s excluded "
|
||||
"(priority)" % (po, po.repoid))
|
||||
|
||||
# If this packages obsoletes other packages, check whether
|
||||
# one of the obsoleted packages is not available through
|
||||
# a repo with a higher priority. If so, remove this package.
|
||||
if check_obsoletes:
|
||||
if po.pkgtup in obsoletes:
|
||||
obsolete_pkgs = obsoletes[po.pkgtup]
|
||||
for obsolete_pkg in obsolete_pkgs:
|
||||
pkg_name = obsolete_pkg[0]
|
||||
if (pkg_name in pkg_priorities_archless
|
||||
and pkg_priorities_archless[pkg_name] <
|
||||
repo.priority):
|
||||
conduit.delPackage(po)
|
||||
cnt += 1
|
||||
conduit.info(
|
||||
3, " --> %s from %s excluded "
|
||||
"(priority)" % (po, po.repoid))
|
||||
break
|
||||
if cnt:
|
||||
conduit.info(2, '%d packages excluded due to repository '
|
||||
'priority protections' % cnt)
|
||||
if check_obsoletes:
|
||||
# Atm. the update object doesn't get updated when we manually exclude
|
||||
# things ... so delete it. This needs to be re-written.
|
||||
conduit._base.up = None
|
||||
|
||||
|
||||
def _pkglist_to_dict(pl, priority, addArch=False):
|
||||
global full_match
|
||||
out = dict()
|
||||
for p in pl:
|
||||
if full_match:
|
||||
pname = str(p)
|
||||
else:
|
||||
pname = p.name
|
||||
if addArch:
|
||||
key = "%s.%s" % (pname, p.arch)
|
||||
out[key] = priority
|
||||
else:
|
||||
out[pname] = priority
|
||||
return out
|
||||
|
||||
|
||||
def _mergeprioritydicts(dict1, dict2):
|
||||
for package in dict2.keys():
|
||||
if package not in dict1 or dict2[package] < dict1[package]:
|
||||
dict1[package] = dict2[package]
|
@ -1,144 +0,0 @@
|
||||
|
||||
# Problem: --archlist=x86_64 really means "x86_64 and i686". Therefore yum
|
||||
# tries to resolve dependencies of i686 packages. Sometimes this fails due
|
||||
# to an upgraded x86_64 only package available in the fuel repo. For
|
||||
# instance, when yum is asked to download dmraid package it tries to resolve
|
||||
# the dependencies of i686 version. This fails since the upgraded
|
||||
# device-mapper-libs package (from the fuel repo) is x86_64 only:
|
||||
# Package: device-mapper-libs-1.02.79-8.el6.i686 (base)
|
||||
# Requires: device-mapper = 1.02.79-8.el6
|
||||
# Available: device-mapper-1.02.79-8.el6.x86_64 (base)
|
||||
# device-mapper = 1.02.79-8.el6
|
||||
# Installing: device-mapper-1.02.90-2.mira1.x86_64 (fuel)
|
||||
# device-mapper = 1.02.90-2.mira1
|
||||
# The obvious solution is to exclude i686 packages. However syslinux
|
||||
# package depends on i686 package syslinux-nonlinux (which contians
|
||||
# the binaries that run in the syslinux environment). Since excluding
|
||||
# packages by regexp is impossible (only glob patterns are supported)
|
||||
# base and updates repos are "cloned". Those "cloned" repos contain
|
||||
# a few whitelisted i686 packages (for now only syslinux).
|
||||
# Note: these packages should be also excluded from base and updates.
|
||||
x86_rpm_packages_whitelist:=syslinux*
|
||||
|
||||
define yum_conf
|
||||
[main]
|
||||
cachedir=$(BUILD_DIR)/mirror/centos/cache
|
||||
keepcache=0
|
||||
debuglevel=6
|
||||
logfile=$(BUILD_DIR)/mirror/centos/yum.log
|
||||
exclude=ntp-dev*
|
||||
exactarch=1
|
||||
obsoletes=1
|
||||
gpgcheck=0
|
||||
plugins=1
|
||||
pluginpath=$(BUILD_DIR)/mirror/centos/etc/yum-plugins
|
||||
pluginconfpath=$(BUILD_DIR)/mirror/centos/etc/yum/pluginconf.d
|
||||
reposdir=$(BUILD_DIR)/mirror/centos/etc/yum.repos.d
|
||||
sslverify=False
|
||||
endef
|
||||
|
||||
define yum_repo_official
|
||||
[base]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Base
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=os
|
||||
baseurl=$(MIRROR_CENTOS)/os/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
exclude=*i686 $(x86_rpm_packages_whitelist)
|
||||
priority=90
|
||||
|
||||
[updates]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Updates
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=updates
|
||||
baseurl=$(MIRROR_CENTOS)/updates/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
exclude=*i686 $(x86_rpm_packages_whitelist)
|
||||
priority=90
|
||||
|
||||
[base_i686_whitelisted]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Base
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=os
|
||||
baseurl=$(MIRROR_CENTOS)/os/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
includepkgs=$(x86_rpm_packages_whitelist)
|
||||
priority=90
|
||||
|
||||
[updates_i686_whitelisted]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Updates
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=updates
|
||||
baseurl=$(MIRROR_CENTOS)/updates/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
includepkgs=$(x86_rpm_packages_whitelist)
|
||||
priority=90
|
||||
endef
|
||||
|
||||
define yum_repo_extras
|
||||
[extras]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Extras
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=extras
|
||||
baseurl=$(MIRROR_CENTOS)/extras/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
exclude=*i686
|
||||
priority=90
|
||||
|
||||
[centosplus]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Plus
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=centosplus
|
||||
baseurl=$(MIRROR_CENTOS)/centosplus/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=0
|
||||
priority=90
|
||||
|
||||
[contrib]
|
||||
name=CentOS-$(CENTOS_RELEASE) - Contrib
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$(CENTOS_RELEASE)&arch=$(CENTOS_ARCH)&repo=contrib
|
||||
baseurl=$(MIRROR_CENTOS)/contrib/$(CENTOS_ARCH)
|
||||
gpgcheck=0
|
||||
enabled=0
|
||||
priority=90
|
||||
endef
|
||||
|
||||
define yum_repo_fuel
|
||||
[fuel]
|
||||
name=Fuel Packages
|
||||
baseurl=$(MIRROR_FUEL)
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
priority=20
|
||||
exclude=*debuginfo*
|
||||
endef
|
||||
|
||||
# Accept EXTRA_RPM_REPOS in a form of a list of: name,url,priority
|
||||
# Accept EXTRA_RPM_REPOS in a form of list of (default priority=10): name,url
|
||||
get_repo_name=$(shell echo $1 | cut -d ',' -f 1)
|
||||
get_repo_url=$(shell echo $1 | cut -d ',' -f2)
|
||||
get_repo_priority=$(shell val=`echo $1 | cut -d ',' -f3`; echo $${val:-10})
|
||||
|
||||
# It's a callable object.
|
||||
# Usage: $(call create_extra_repo,repo)
|
||||
# where:
|
||||
# repo=repo_name,http://path_to_the_repo,repo_priority
|
||||
# repo_priority is a number from 1 to 99
|
||||
define create_extra_repo
|
||||
[$(call get_repo_name,$1)]
|
||||
name = Repo "$(call get_repo_name,$1)"
|
||||
baseurl = $(call get_repo_url,$1)
|
||||
gpgcheck = 0
|
||||
enabled = 1
|
||||
priority = $(call get_repo_priority,$1)
|
||||
exclude=*debuginfo*
|
||||
endef
|
||||
|
||||
define create_fuelnode_repo
|
||||
[$(call get_repo_name,$1)]
|
||||
name = Repo "$(call get_repo_name,$1)"
|
||||
baseurl = file:///var/www/nailgun/extra-repos/$(call get_repo_name,$1)
|
||||
gpgcheck = 0
|
||||
enabled = 1
|
||||
priority = $(call get_repo_priority,$1)
|
||||
endef
|
||||
|
@ -1,25 +0,0 @@
|
||||
--- yumdownloader.orig 2013-11-15 00:01:02.000000000 +0400
|
||||
+++ yumdownloader 2015-05-21 12:48:25.877327687 +0300
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
if not installable: # doing one at a time, apart from groups
|
||||
self.logger.error('No Match for argument %s' % pkg)
|
||||
- continue
|
||||
+ sys.exit(1)
|
||||
for newpkg in installable:
|
||||
toActOn.extend(_best_convert_pkg2srcpkgs(self, opts, newpkg))
|
||||
if toActOn:
|
||||
@@ -208,7 +208,12 @@
|
||||
self.tsInfo.addInstall(po)
|
||||
self.localPackages.append(po)
|
||||
# Resolve dependencies
|
||||
- self.resolveDeps()
|
||||
+ result, errmsgs = self.resolveDeps()
|
||||
+ if result == 1:
|
||||
+ self.logger.error('Dependency resolution failed')
|
||||
+ for msg in errmsgs:
|
||||
+ self.logger.error(msg)
|
||||
+ sys.exit(1)
|
||||
# Add newly added packages to the toDownload list
|
||||
for pkg in self.tsInfo.getMembers():
|
||||
if not pkg in toDownload:
|
@ -1,22 +0,0 @@
|
||||
.PHONY: mirror clean clean-mirror make-changelog
|
||||
|
||||
mirror: $(BUILD_DIR)/mirror/build.done
|
||||
make-changelog: $(BUILD_DIR)/mirror/make-changelog.done
|
||||
|
||||
clean: clean-mirror
|
||||
|
||||
clean-mirror:
|
||||
sudo rm -rf $(BUILD_DIR)/mirror
|
||||
|
||||
include $(SOURCE_DIR)/mirror/centos/module.mk
|
||||
include $(SOURCE_DIR)/mirror/ubuntu/module.mk
|
||||
|
||||
$(BUILD_DIR)/mirror/build.done: \
|
||||
$(BUILD_DIR)/mirror/centos/build.done \
|
||||
$(BUILD_DIR)/mirror/ubuntu/build.done
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/make-changelog.done: $(BUILD_DIR)/mirror/build.done
|
||||
sudo bash -c "export LOCAL_MIRROR=$(LOCAL_MIRROR); \
|
||||
$(SOURCE_DIR)/report-changelog.sh"
|
||||
$(ACTION.TOUCH)
|
@ -1,100 +0,0 @@
|
||||
.PHONY: mirror-ubuntu repo-ubuntu
|
||||
|
||||
mirror-ubuntu: $(BUILD_DIR)/mirror/ubuntu/mirror.done
|
||||
repo-ubuntu: $(BUILD_DIR)/mirror/ubuntu/repo.done
|
||||
|
||||
define reprepro_dist_conf
|
||||
Origin: Mirantis
|
||||
Label: $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Suite: $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Codename: $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Description: Mirantis OpenStack mirror
|
||||
Architectures: $(UBUNTU_ARCH)
|
||||
Components: main restricted
|
||||
DebIndices: Packages Release . .gz .bz2
|
||||
Update: - $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
endef
|
||||
|
||||
define reprepro_updates_conf
|
||||
Suite: $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Name: $(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Method: file:$(LOCAL_MIRROR_UBUNTU)
|
||||
Components: main
|
||||
Architectures: $(UBUNTU_ARCH)
|
||||
VerifyRelease: blindtrust
|
||||
endef
|
||||
|
||||
define do_debmirror
|
||||
set -ex; ./debmirror --progress --checksums --nocleanup \
|
||||
--nosource --ignore-release-gpg --rsync-extra=none \
|
||||
--exclude-deb-section='^debug$$' \
|
||||
--method=$(MIRROR_MOS_UBUNTU_METHOD) \
|
||||
--host=$(MIRROR_MOS_UBUNTU) \
|
||||
--root=$(MIRROR_MOS_UBUNTU_ROOT) \
|
||||
--dist=$(MIRROR_MOS_UBUNTU_SUITE)$1 \
|
||||
--section=$(subst $(space),$(comma),$(MIRROR_MOS_UBUNTU_SECTION)) \
|
||||
--arch=$(UBUNTU_ARCH) \
|
||||
$(LOCAL_MIRROR_UBUNTU)/
|
||||
endef
|
||||
|
||||
# Two operation modes:
|
||||
# USE_MIRROR=none - mirroring mode, rsync full mirror from internal build server
|
||||
# USE_MIRROR=<any_other_value> - ISO building mode, get repository for current product release only
|
||||
$(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
|
||||
ifneq ($(BUILD_PACKAGES),0)
|
||||
$(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/repo.done
|
||||
endif
|
||||
|
||||
REPREPRO_CONF_DIR:=$(BUILD_DIR)/mirror/ubuntu/reprepro/conf
|
||||
|
||||
define config_reprepro
|
||||
#Generate reprepro distributions config
|
||||
cat > $(REPREPRO_CONF_DIR)/distributions << EOF
|
||||
$(reprepro_dist_conf)
|
||||
EOF
|
||||
#Generate reprepro updates config
|
||||
cat > $(REPREPRO_CONF_DIR)/updates << EOF
|
||||
$(reprepro_updates_conf)
|
||||
EOF
|
||||
endef
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done: export config_reprepro:=$(config_reprepro)
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done:
|
||||
mkdir -p $(REPREPRO_CONF_DIR)
|
||||
sh -c "$${config_reprepro}"
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/prepare_debmirror.done:
|
||||
cp /usr/bin/debmirror .
|
||||
patch -p1 ./debmirror < ./00-debmirror.patch
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro.done: \
|
||||
$(BUILD_DIR)/mirror/ubuntu/mirror.done \
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done
|
||||
# Import existing Ubuntu repository
|
||||
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(REPREPRO_CONF_DIR) -V includedeb $(PRODUCT_NAME)$(PRODUCT_VERSION) pool/*/*/*/*.deb
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/repo.done: \
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done \
|
||||
$(BUILD_DIR)/mirror/ubuntu/reprepro.done
|
||||
# FIXME(aglarendil): do not touch upstream repo. instead - build new repo
|
||||
# Import newly built packages
|
||||
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(REPREPRO_CONF_DIR) -V includedeb $(PRODUCT_NAME)$(PRODUCT_VERSION) $(BUILD_DIR)/packages/deb/packages/*.deb
|
||||
# Clean up reprepro data
|
||||
rm -rf $(LOCAL_MIRROR_UBUNTU)/db
|
||||
rm -rf $(LOCAL_MIRROR_UBUNTU)/lists
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/mirror.done: \
|
||||
$(BUILD_DIR)/mirror/ubuntu/prepare_debmirror.done
|
||||
mkdir -p $(LOCAL_MIRROR_UBUNTU)
|
||||
$(call do_debmirror)
|
||||
-$(call do_debmirror,-proposed)
|
||||
-$(call do_debmirror,-updates)
|
||||
-$(call do_debmirror,-security)
|
||||
-$(call do_debmirror,-holdback)
|
||||
-$(call do_debmirror,-hotfix)
|
||||
rm -rf $(LOCAL_MIRROR_UBUNTU)/.temp $(LOCAL_MIRROR_UBUNTU)/project
|
||||
$(ACTION.TOUCH)
|
@ -1,14 +0,0 @@
|
||||
use Parse::DebControl;
|
||||
|
||||
$parser = new Parse::DebControl;
|
||||
|
||||
%options = (
|
||||
type => 'debian/control',
|
||||
stripComments => 'true',
|
||||
);
|
||||
|
||||
$data = $parser->parse_file($ARGV[0], \%options);
|
||||
foreach my $a (@$data) {
|
||||
next if exists $a->{"Source"};
|
||||
print ${a}->{"Package"}."\n";
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
.PHONY: clean clean-deb
|
||||
|
||||
clean: clean-deb
|
||||
|
||||
clean-deb:
|
||||
-mount | grep '$(BUILD_DIR)/packages/deb' | while read entry; do \
|
||||
set -- $$entry; \
|
||||
mntpt="$$3"; \
|
||||
sudo umount $$mntpt; \
|
||||
done
|
||||
sudo rm -rf $(BUILD_DIR)/packages/deb
|
||||
|
||||
$(BUILD_DIR)/packages/deb/buildd.tar.gz: SANDBOX_DEB_PKGS:=wget bzip2 apt-utils build-essential fakeroot devscripts equivs debhelper python-setuptools python-pbr
|
||||
$(BUILD_DIR)/packages/deb/buildd.tar.gz: SANDBOX_UBUNTU:=$(BUILD_DIR)/packages/deb/chroot
|
||||
$(BUILD_DIR)/packages/deb/buildd.tar.gz: export SANDBOX_UBUNTU_UP:=$(SANDBOX_UBUNTU_UP)
|
||||
$(BUILD_DIR)/packages/deb/buildd.tar.gz: export SANDBOX_UBUNTU_DOWN:=$(SANDBOX_UBUNTU_DOWN)
|
||||
$(BUILD_DIR)/packages/deb/buildd.tar.gz: $(BUILD_DIR)/mirror/ubuntu/reprepro.done
|
||||
sh -c "$${SANDBOX_UBUNTU_UP}"
|
||||
sh -c "$${SANDBOX_UBUNTU_DOWN}"
|
||||
sudo rm -f $(SANDBOX_UBUNTU)/var/cache/apt/archives/*.deb
|
||||
sudo tar czf $@.tmp -C $(SANDBOX_UBUNTU) .
|
||||
mv $@.tmp $@
|
||||
|
||||
# Usage:
|
||||
# (eval (call build_deb,package_name))
|
||||
define build_deb
|
||||
$1-deb: $(BUILD_DIR)/packages/deb/$1.done
|
||||
$(BUILD_DIR)/packages/deb/build.done: $(BUILD_DIR)/packages/deb/$1.done
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/$1.done
|
||||
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/mirror/ubuntu/reprepro.done
|
||||
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/packages/source_$1.done
|
||||
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/packages/deb/buildd.tar.gz
|
||||
$(BUILD_DIR)/packages/deb/$1.done: SANDBOX_UBUNTU:=$(BUILD_DIR)/packages/deb/SANDBOX/$1
|
||||
$(BUILD_DIR)/packages/deb/$1.done: export SANDBOX_UBUNTU_UP:=$$(SANDBOX_UBUNTU_UP)
|
||||
$(BUILD_DIR)/packages/deb/$1.done: export SANDBOX_UBUNTU_DOWN:=$$(SANDBOX_UBUNTU_DOWN)
|
||||
$(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/repos/repos.done
|
||||
mkdir -p $(BUILD_DIR)/packages/deb/packages $(BUILD_DIR)/packages/deb/sources
|
||||
mkdir -p $$(SANDBOX_UBUNTU)/tmp/$1/
|
||||
if [ ! -e "$$(SANDBOX_UBUNTU)/etc/debian_version" ]; then \
|
||||
sudo tar xaf $(BUILD_DIR)/packages/deb/buildd.tar.gz -C $$(SANDBOX_UBUNTU); \
|
||||
fi
|
||||
sudo tar zxf $(BUILD_DIR)/packages/sources/$1/$1-$(PACKAGE_VERSION).tar.gz -C $$(SANDBOX_UBUNTU)/tmp/$1/
|
||||
|
||||
DEBFULLNAME=`awk -F'=' '/DEBFULLNAME/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
DEBEMAIL=`awk -F'=' '/DEBEMAIL/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
sudo -E dch -c $$(SANDBOX_UBUNTU)/tmp/$1/debian/changelog -D $(UBUNTU_RELEASE) -b --force-distribution \
|
||||
-v $(PACKAGE_VERSION)-`awk -F'=' '/DEBRELEASE/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
"`awk -F'=' '/DEBMSG/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version`"
|
||||
sudo chroot $$(SANDBOX_UBUNTU) /bin/sh -c "mk-build-deps --install --remove --tool 'apt-get --yes --no-remove --no-install-recommends' /tmp/$1/debian/control"
|
||||
sudo chroot $$(SANDBOX_UBUNTU) /bin/sh -c "cd /tmp/$1 ; DEB_BUILD_OPTIONS=nocheck debuild -us -uc -b -d"
|
||||
cp $$(SANDBOX_UBUNTU)/tmp/*.deb $(BUILD_DIR)/packages/deb/packages
|
||||
sudo sh -c "$$$${SANDBOX_UBUNTU_DOWN}"
|
||||
$$(ACTION.TOUCH)
|
||||
endef
|
||||
|
||||
define remove_deb
|
||||
#FIXME(aglarendil): do not touch upstream repo. instead - build new repo
|
||||
mkdir -p $(BUILD_DIR)/packages/deb
|
||||
perl $(SOURCE_DIR)/packages/deb/genpkgnames.pl $(BUILD_DIR)/repos/$1/debian/control > $(BUILD_DIR)/packages/deb/$1.cleanup.list
|
||||
cd $(LOCAL_MIRROR_UBUNTU) && cat $(BUILD_DIR)/packages/deb/$1.cleanup.list | \
|
||||
xargs -n1 -I{} reprepro --confdir=$(REPREPRO_CONF_DIR) remove $(PRODUCT_NAME)$(PRODUCT_VERSION) {} $(NEWLINE)
|
||||
endef
|
||||
|
||||
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/repocleanup.done
|
||||
$(BUILD_DIR)/packages/deb/repocleanup.done: $(BUILD_DIR)/mirror/ubuntu/reprepro.done
|
||||
$(BUILD_DIR)/packages/deb/repocleanup.done: $(packages_list:%=$(BUILD_DIR)/packages/source_%.done)
|
||||
$(foreach pkg,$(fuel_debian_packages),$(call remove_deb,$(pkg)))
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/packages/deb/build.done:
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
fuel_debian_packages:=fuel-nailgun \
|
||||
astute \
|
||||
fuel-agent \
|
||||
fuel-library$(FUEL_LIBRARY_VERSION) \
|
||||
nailgun-agent \
|
||||
network-checker
|
||||
|
||||
$(eval $(foreach pkg,$(fuel_debian_packages),$(call build_deb,$(pkg))$(NEWLINE)))
|
@ -1,108 +0,0 @@
|
||||
# Usage:
|
||||
# (eval (call prepare_file_source,package_name,file_name,source_path,optional_prerequisite))
|
||||
# Note: dependencies for deb targets are also specified here to make
|
||||
# sure the source is ready before the build is started.
|
||||
define prepare_file_source
|
||||
ifeq ($4,)
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: $(BUILD_DIR)/repos/repos.done
|
||||
else
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: $4
|
||||
endif
|
||||
$(BUILD_DIR)/packages/source_$1.done: $(BUILD_DIR)/packages/sources/$1/$2
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: $(call find-files,$3)
|
||||
mkdir -p $(BUILD_DIR)/packages/sources/$1
|
||||
cp $3 $(BUILD_DIR)/packages/sources/$1/$2
|
||||
endef
|
||||
|
||||
# Prepare sources + rpm_changelog + version file in format:
|
||||
#
|
||||
# VERSION=$(PRODUCT_VERSION)
|
||||
# RPMRELEASE=1.mos${commit_num}
|
||||
# DEBRELEASE=1~u16.04+mos${commit_num}
|
||||
# DEBFULLNAME=Commit Author
|
||||
# DEBEMAIL=Commit Author email address
|
||||
# DEBMSG={commit_sha} {Commit message}
|
||||
define prepare_git_source
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: $(BUILD_DIR)/repos/repos.done
|
||||
$(BUILD_DIR)/packages/source_$1.done: $(BUILD_DIR)/packages/sources/$1/$2
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: VERSIONFILE:=$(BUILD_DIR)/packages/sources/$1/version
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: CHANGELOGFILE:=$(BUILD_DIR)/packages/sources/$1/changelog
|
||||
$(BUILD_DIR)/packages/sources/$1/$2:
|
||||
mkdir -p $(BUILD_DIR)/packages/sources/$1
|
||||
cd $3 && git archive --format tar --worktree-attributes $4 > $(BUILD_DIR)/packages/sources/$1/$1.tar
|
||||
echo VERSION=$(PACKAGE_VERSION) > $$(VERSIONFILE)
|
||||
echo RPMRELEASE=1.mos`git -C $3 rev-list --no-merges $4 --count` >> $$(VERSIONFILE)
|
||||
echo "%changelog\n* `LC_TIME=C date +\"%a %b %d %Y\"` `git -C $3 log -1 --pretty=format:%an` \
|
||||
<`git -C $3 log -1 --pretty=format:%ae`> - $(PACKAGE_VERSION)-1.mos`git -C $3 rev-list --no-merges $4 --count`" > $$(CHANGELOGFILE)
|
||||
echo "`git -C $3 log -10 --pretty='- %h %s'`" >> $$(CHANGELOGFILE)
|
||||
echo DEBRELEASE=1~u16.04+mos`git -C $3 rev-list --no-merges $4 --count` >> $$(VERSIONFILE)
|
||||
echo DEBFULLNAME=`git -C $3 log -1 --pretty=format:%an` >> $$(VERSIONFILE)
|
||||
echo DEBEMAIL=`git -C $3 log -1 --pretty=format:%ae` >> $$(VERSIONFILE)
|
||||
echo DEBMSG=`git -C $3 rev-parse --short HEAD` `git -C $3 log -1 --pretty=%s` >> $$(VERSIONFILE)
|
||||
cd $(BUILD_DIR)/packages/sources/$1 && tar -rf $1.tar version
|
||||
ifneq ($(USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES),)
|
||||
if [ "$1" = "fuel-library$(FUEL_LIBRARY_VERSION)" ]; then cd $(BUILD_DIR)/packages/sources/$1 && tar -rf $1.tar upstream_modules.tar.gz; fi
|
||||
endif
|
||||
cd $(BUILD_DIR)/packages/sources/$1 && gzip -9 $1.tar && mv $1.tar.gz $2
|
||||
endef
|
||||
|
||||
# fuel-library offline build hook
|
||||
ifneq ($(USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES),)
|
||||
$(BUILD_DIR)/packages/sources/fuel-library$(FUEL_LIBRARY_VERSION)/upstream_modules.tar.gz:
|
||||
@mkdir -p $(@D)
|
||||
wget -nv $(USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES) -O $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
$(BUILD_DIR)/packages/source_fuel-library$(FUEL_LIBRARY_VERSION).done: \
|
||||
$(BUILD_DIR)/packages/sources/fuel-library$(FUEL_LIBRARY_VERSION)/upstream_modules.tar.gz
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/packages/source_%.done:
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
#NAILGUN_PKGS
|
||||
$(eval $(call prepare_git_source,fuel-nailgun,fuel-nailgun-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-nailgun,HEAD,$(NAILGUN_GERRIT_COMMIT)))
|
||||
#FUEL_OSTF_PKGS
|
||||
$(eval $(call prepare_git_source,fuel-ostf,fuel-ostf-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-ostf,HEAD,$(OSTF_GERRIT_COMMIT)))
|
||||
#ASTUTE_PKGS
|
||||
$(eval $(call prepare_git_source,astute,astute-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/astute,HEAD,$(ASTUTE_GERRIT_COMMIT)))
|
||||
#FUELLIB_PKGS
|
||||
$(eval $(call prepare_git_source,fuel-library$(FUEL_LIBRARY_VERSION),fuel-library$(FUEL_LIBRARY_VERSION)-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-library$(FUEL_LIBRARY_VERSION),HEAD,$(FUELLIB_GERRIT_COMMIT)))
|
||||
#FUEL_PYTHON_PKGS
|
||||
$(eval $(call prepare_git_source,python-fuelclient,python-fuelclient-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/python-fuelclient,HEAD,$(PYTHON_FUELCLIENT_GERRIT_COMMIT)))
|
||||
#FUEL_AGENT_PKGS
|
||||
$(eval $(call prepare_git_source,fuel-agent,fuel-agent-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-agent,HEAD,$(FUEL_AGENT_GERRIT_COMMIT)))
|
||||
#FUEL_NAILGUN_AGENT_PKGS
|
||||
$(eval $(call prepare_git_source,nailgun-agent,nailgun-agent-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/nailgun-agent,HEAD,$(FUEL_NAILGUN_AGENT_GERRIT_COMMIT)))
|
||||
#FUEL-IMAGE PKGS
|
||||
$(eval $(call prepare_git_source,fuel-main,fuel-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-main,HEAD,$(FUELMAIN_GERRIT_COMMIT)))
|
||||
#FUEL-MENU PKGS
|
||||
$(eval $(call prepare_git_source,fuelmenu,fuelmenu-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuelmenu,HEAD,$(FUELMENU_GERRIT_COMMIT)))
|
||||
#FUEL-UI PKGS
|
||||
$(eval $(call prepare_git_source,fuel-ui,fuel-ui-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/fuel-ui,HEAD,$(FUEL_UI_GERRIT_COMMIT)))
|
||||
#SHOTGUN PKGS
|
||||
$(eval $(call prepare_git_source,shotgun,shotgun-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/shotgun,HEAD,$(SHOTGUN_GERRIT_COMMIT)))
|
||||
#NETWORK-CHECKER PKGS
|
||||
$(eval $(call prepare_git_source,network-checker,network-checker-$(PACKAGE_VERSION).tar.gz,$(BUILD_DIR)/repos/network-checker,HEAD,$(NETWORKCHECKER_GERRIT_COMMIT)))
|
||||
|
||||
include $(SOURCE_DIR)/packages/rpm/module.mk
|
||||
include $(SOURCE_DIR)/packages/deb/module.mk
|
||||
|
||||
.PHONY: packages packages-deb packages-rpm
|
||||
|
||||
ifneq ($(BUILD_PACKAGES),0)
|
||||
$(BUILD_DIR)/packages/build.done: \
|
||||
$(BUILD_DIR)/packages/rpm/build.done \
|
||||
$(BUILD_DIR)/packages/deb/build.done
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/packages/build.done:
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
packages: $(BUILD_DIR)/packages/build.done
|
||||
packages-rpm: $(BUILD_DIR)/packages/rpm/build.done
|
||||
packages-deb: $(BUILD_DIR)/packages/deb/build.done
|
||||
|
||||
.PHONY: sources
|
||||
|
||||
sources: $(packages_list:%=$(BUILD_DIR)/packages/source_%.done)
|
@ -1,6 +0,0 @@
|
||||
import rpm
|
||||
import sys
|
||||
specfile = sys.argv[1]
|
||||
spec = rpm.spec(specfile)
|
||||
for pkg in spec.packages:
|
||||
print pkg.header.format('%{name}')
|
@ -1,109 +0,0 @@
|
||||
.PHONY: clean clean-rpm
|
||||
|
||||
clean: clean-rpm
|
||||
|
||||
clean-rpm:
|
||||
-mount | grep '$(BUILD_DIR)/packages/rpm/SANDBOX' | while read entry; do \
|
||||
set -- $$entry; \
|
||||
mntpt="$$3"; \
|
||||
sudo umount $$mntpt; \
|
||||
done
|
||||
sudo rm -rf $(BUILD_DIR)/packages/rpm
|
||||
|
||||
RPM_SOURCES:=$(BUILD_DIR)/packages/rpm/SOURCES
|
||||
|
||||
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: SANDBOX_PACKAGES:=@buildsys-build yum yum-utils
|
||||
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: SANDBOX:=$(BUILD_DIR)/packages/rpm/SANDBOX/buildd
|
||||
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: export SANDBOX_UP:=$(SANDBOX_UP)
|
||||
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: export SANDBOX_DOWN:=$(SANDBOX_DOWN)
|
||||
$(BUILD_DIR)/packages/rpm/buildd.tar.gz: $(BUILD_DIR)/mirror/centos/repo.done \
|
||||
$(BUILD_DIR)/mirror/centos/mos-repo.done
|
||||
sh -c "$${SANDBOX_UP}"
|
||||
sh -c "$${SANDBOX_DOWN}"
|
||||
sudo tar czf $@.tmp -C $(SANDBOX) .
|
||||
mv $@.tmp $@
|
||||
|
||||
|
||||
# Usage:
|
||||
# (eval (call build_rpm,package_name))
|
||||
define build_rpm
|
||||
$(BUILD_DIR)/packages/rpm/repo$2.done: $(BUILD_DIR)/packages/rpm/$1.done
|
||||
$(BUILD_DIR)/packages/rpm/repo$2.done: $(BUILD_DIR)/packages/rpm/$1-repocleanup.done
|
||||
|
||||
# You can use package name as a target, for example: make ruby21-rubygem-astute
|
||||
# It will build astute rpm package
|
||||
$1-rpm: $(BUILD_DIR)/packages/rpm/$1.done
|
||||
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: SANDBOX:=$(BUILD_DIR)/packages/rpm/SANDBOX/$1
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: export SANDBOX_DOWN:=$$(SANDBOX_DOWN)
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/packages/source_$1.done
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/packages/rpm/buildd.tar.gz
|
||||
|
||||
ifneq (late,$(findstring late,$2))
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: SPECFILE:=$(BUILD_DIR)/repos/$1/specs/$1.spec
|
||||
$(BUILD_DIR)/repos/$1/specs/$1.spec: $(BUILD_DIR)/repos/repos.done
|
||||
$(BUILD_DIR)/repos/$1/specs/$1.spec: $(BUILD_DIR)/repos/$1.done
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: $(BUILD_DIR)/repos/$1/specs/$1.spec
|
||||
else
|
||||
$(BUILD_DIR)/packages/rpm/$1.done: SPECFILE:=$(SOURCE_DIR)/packages/rpm/specs/$1.spec
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/packages/rpm/$1.done:
|
||||
mkdir -p $(BUILD_DIR)/packages/rpm/RPMS/x86_64
|
||||
mkdir -p $$(SANDBOX) && \
|
||||
sudo tar xzf $(BUILD_DIR)/packages/rpm/buildd.tar.gz -C $$(SANDBOX) && \
|
||||
sudo chroot $$(SANDBOX) bash -c "(mkdir -p /tmp/user/0)"
|
||||
sudo mount --bind /proc $$(SANDBOX)/proc && \
|
||||
sudo mount --bind /dev $$(SANDBOX)/dev && \
|
||||
sudo mount --bind $$(LOCAL_MIRROR) $$(SANDBOX)/mirrors && \
|
||||
mkdir -p $$(SANDBOX)/tmp/SOURCES && \
|
||||
sudo cp -r $(BUILD_DIR)/packages/sources/$1/* $$(SANDBOX)/tmp/SOURCES
|
||||
-test -f $(BUILD_DIR)/packages/sources/$1/changelog && cat $(BUILD_DIR)/packages/sources/$1/changelog >> $$(SPECFILE)
|
||||
sudo cp $$(SPECFILE) $$(SANDBOX)/tmp && \
|
||||
sudo chroot $$(SANDBOX) yum-builddep -y /tmp/$1.spec
|
||||
test -f $$(SANDBOX)/tmp/SOURCES/version && \
|
||||
sudo chroot $$(SANDBOX) rpmbuild --nodeps --define "_topdir /tmp" --define "release `awk -F'=' '/RPMRELEASE/ {print $$$$2}' $$(SANDBOX)/tmp/SOURCES/version`" -ba /tmp/$1.spec || \
|
||||
sudo chroot $$(SANDBOX) rpmbuild --nodeps --define "_topdir /tmp" -ba /tmp/$1.spec
|
||||
cp $$(SANDBOX)/tmp/RPMS/*/*.rpm $(BUILD_DIR)/packages/rpm/RPMS/x86_64
|
||||
sudo sh -c "$$$${SANDBOX_DOWN}"
|
||||
$$(ACTION.TOUCH)
|
||||
|
||||
ifneq (late,$(findstring late,$2))
|
||||
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: SPECFILE:=$(BUILD_DIR)/repos/$1/specs/$1.spec
|
||||
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: $(BUILD_DIR)/packages/source_$1.done
|
||||
else
|
||||
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: SPECFILE:=$(SOURCE_DIR)/packages/rpm/specs/$1.spec
|
||||
endif
|
||||
$(BUILD_DIR)/packages/rpm/$1-repocleanup.done: $(BUILD_DIR)/mirror/centos/mos-repo.done
|
||||
python $(SOURCE_DIR)/packages/rpm/genpkgnames.py $$(SPECFILE) | xargs -I{} sudo find $(LOCAL_MIRROR_MOS_CENTOS_OS_BASEURL)/Packages -type f -regex '.*/{}-[^-]+-[^-]+' -delete
|
||||
$$(ACTION.TOUCH)
|
||||
endef
|
||||
|
||||
|
||||
packages_list:=\
|
||||
astute \
|
||||
fuel-agent \
|
||||
fuel-library$(FUEL_LIBRARY_VERSION) \
|
||||
fuel-main \
|
||||
fuel-nailgun \
|
||||
fuel-ostf \
|
||||
fuel-ui \
|
||||
fuelmenu \
|
||||
nailgun-agent \
|
||||
network-checker \
|
||||
python-fuelclient \
|
||||
shotgun
|
||||
|
||||
$(eval $(foreach pkg,$(packages_list),$(call build_rpm,$(pkg))$(NEWLINE)))
|
||||
|
||||
$(BUILD_DIR)/packages/rpm/repo.done:
|
||||
find $(BUILD_DIR)/packages/rpm/RPMS -name '*.rpm' -exec cp -u {} $(LOCAL_MIRROR_MOS_CENTOS_OS_BASEURL)/Packages \;
|
||||
createrepo -g $(LOCAL_MIRROR_MOS_CENTOS)/comps.xml \
|
||||
-o $(LOCAL_MIRROR_MOS_CENTOS_OS_BASEURL) $(LOCAL_MIRROR_MOS_CENTOS_OS_BASEURL)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/packages/rpm/build.done:
|
||||
ifeq (1,$(strip $(BUILD_PACKAGES)))
|
||||
$(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done
|
||||
endif
|
||||
$(ACTION.TOUCH)
|
@ -1,57 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
# Copyright 2014 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# This script will install all the required packages necessary for
|
||||
# building a Fuel ISO.
|
||||
|
||||
# Check that HTTPS transport is available to APT
|
||||
if [ ! -e /usr/lib/apt/methods/https ]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y apt-transport-https
|
||||
fi
|
||||
|
||||
# Install software
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install \
|
||||
build-essential \
|
||||
createrepo \
|
||||
debmirror \
|
||||
debootstrap \
|
||||
devscripts \
|
||||
dosfstools \
|
||||
extlinux \
|
||||
git \
|
||||
isomd5sum \
|
||||
libparse-debcontrol-perl \
|
||||
lrzip \
|
||||
python-jinja2 \
|
||||
python-yaml \
|
||||
reprepro \
|
||||
rpm \
|
||||
syslinux \
|
||||
unzip \
|
||||
xorriso \
|
||||
yum \
|
||||
yum-utils
|
||||
|
||||
# Add account to sudoers
|
||||
echo "Updating /etc/sudoers.d/fuel-iso"
|
||||
cat << EOF | sudo tee /etc/sudoers.d/fuel-iso
|
||||
Defaults env_keep += "http_proxy https_proxy no_proxy"
|
||||
${USER} ALL=(ALL) NOPASSWD:ALL
|
||||
EOF
|
||||
|
||||
echo "Dependency check completed, please proceed with 'make iso' command"
|
@ -1,28 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
CENTOS_CHANGELOG=${LOCAL_MIRROR}/centos-packages.changelog
|
||||
UBUNTU_CHANGELOG=${LOCAL_MIRROR}/ubuntu-packages.changelog
|
||||
[ -f ${CENTOS_CHANGELOG} ] && rm ${CENTOS_CHANGELOG}
|
||||
for packagename in `find ${LOCAL_MIRROR} -name \*.rpm | sort -u`; do
|
||||
echo ${packagename##*/} >> ${CENTOS_CHANGELOG}
|
||||
rpm -qp --changelog ${packagename} 2>/dev/null | sed -e '/^$/,$d' >> ${CENTOS_CHANGELOG}
|
||||
echo '' >> ${CENTOS_CHANGELOG}
|
||||
done
|
||||
|
||||
[ -f ${UBUNTU_CHANGELOG} ] && rm ${UBUNTU_CHANGELOG}
|
||||
for packagename in `find ${LOCAL_MIRROR} -name \*.deb | sort -u`; do
|
||||
pkgname=${packagename##*/}
|
||||
DATAFILE=`ar t $packagename | grep ^data`
|
||||
case ${DATAFILE##*.} in
|
||||
bz2) ZFLAG='--bzip2' ;;
|
||||
gz) ZFLAG='-z' ;;
|
||||
xz) ZFLAG='-J' ;;
|
||||
lzma) ZFLAG='--lzma' ;;
|
||||
*) echo "Unknown data tarball format for package $packagename"; continue ;;
|
||||
esac
|
||||
CHANGELOGFILE=`ar p $packagename $DATAFILE | tar $ZFLAG -tvf - | grep '/usr/share/doc/' | grep "/changelog\.Debian\.gz" || :`
|
||||
CHANGELOGFILE=${CHANGELOGFILE##* }
|
||||
if [[ ${CHANGELOGFILE:0:2} == './' ]]; then
|
||||
ar p $packagename $DATAFILE | tar $ZFLAG -xO $CHANGELOGFILE | gzip -cd | sed -n '1,/--/ p' >> ${UBUNTU_CHANGELOG}
|
||||
echo '' >> ${UBUNTU_CHANGELOG}
|
||||
fi
|
||||
done
|
56
repos.mk
56
repos.mk
@ -1,56 +0,0 @@
|
||||
.PHONY: repos clean-repos
|
||||
|
||||
clean-repos:
|
||||
rm -rf $(BUILD_DIR)/repos
|
||||
|
||||
repos: $(BUILD_DIR)/repos/repos.done
|
||||
|
||||
fuel_components_repos:=
|
||||
# Usage:
|
||||
# (eval (call build_repo,repo_name,repo_uri,sha))
|
||||
define build_repo
|
||||
$(BUILD_DIR)/repos/$1/%: $(BUILD_DIR)/repos/$1.done
|
||||
$(BUILD_DIR)/repos/repos.done: $(BUILD_DIR)/repos/$1.done
|
||||
fuel_components_repos:=$(fuel_components_repos) $1
|
||||
|
||||
$(BUILD_DIR)/repos/$1.done:
|
||||
# Clone repo and checkout required commit
|
||||
mkdir -p $(BUILD_DIR)/repos
|
||||
rm -rf $(BUILD_DIR)/repos/$1
|
||||
|
||||
#Clone everything and checkout to branch (or hash)
|
||||
git clone $2 $(BUILD_DIR)/repos/$1 && (cd $(BUILD_DIR)/repos/$1 && git checkout -q $3)
|
||||
|
||||
# Pull gerrit commits if given
|
||||
$(foreach var,$(filter-out none,$5),
|
||||
( cd $(BUILD_DIR)/repos/$1 && git fetch $4 $(var) && git cherry-pick FETCH_HEAD ) ;
|
||||
)
|
||||
touch $$@
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call build_repo,fuel-nailgun,$(NAILGUN_REPO),$(NAILGUN_COMMIT),$(NAILGUN_GERRIT_URL),$(NAILGUN_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,python-fuelclient,$(PYTHON_FUELCLIENT_REPO),$(PYTHON_FUELCLIENT_COMMIT),$(PYTHON_FUELCLIENT_GERRIT_URL),$(PYTHON_FUELCLIENT_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,fuel-agent,$(FUEL_AGENT_REPO),$(FUEL_AGENT_COMMIT),$(FUEL_AGENT_GERRIT_URL),$(FUEL_AGENT_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,nailgun-agent,$(FUEL_NAILGUN_AGENT_REPO),$(FUEL_NAILGUN_AGENT_COMMIT),$(FUEL_NAILGUN_AGENT_GERRIT_URL),$(FUEL_NAILGUN_AGENT_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,astute,$(ASTUTE_REPO),$(ASTUTE_COMMIT),$(ASTUTE_GERRIT_URL),$(ASTUTE_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,fuel-library,$(FUELLIB_REPO),$(FUELLIB_COMMIT),$(FUELLIB_GERRIT_URL),$(FUELLIB_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,fuel-ostf,$(OSTF_REPO),$(OSTF_COMMIT),$(OSTF_GERRIT_URL),$(OSTF_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,fuelmenu,$(FUELMENU_REPO),$(FUELMENU_COMMIT),$(FUELMENU_GERRIT_URL),$(FUELMENU_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,shotgun,$(SHOTGUN_REPO),$(SHOTGUN_COMMIT),$(SHOTGUN_GERRIT_URL),$(SHOTGUN_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,network-checker,$(NETWORKCHECKER_REPO),$(NETWORKCHECKER_COMMIT),$(NETWORKCHECKER_GERRIT_URL),$(NETWORKCHECKER_GERRIT_COMMIT)))
|
||||
$(eval $(call build_repo,fuel-ui,$(FUEL_UI_REPO),$(FUEL_UI_COMMIT),$(FUEL_UI_GERRIT_URL),$(FUEL_UI_GERRIT_COMMIT)))
|
||||
|
||||
$(BUILD_DIR)/repos/fuel-main.done:
|
||||
ln -s $(SOURCE_DIR) $(BUILD_DIR)/repos/fuel-main
|
||||
$(ACTION.TOUCH)
|
||||
$(BUILD_DIR)/repos/repos.done: $(BUILD_DIR)/repos/fuel-main.done $(BUILD_DIR)/repos/fuel-library$(FUEL_LIBRARY_VERSION).done
|
||||
|
||||
#FIXME(aglarendil): make repos generation uniform
|
||||
|
||||
$(BUILD_DIR)/repos/fuel-library$(FUEL_LIBRARY_VERSION).done: $(BUILD_DIR)/repos/fuel-library.done
|
||||
ln -s $(BUILD_DIR)/repos/fuel-library $(BUILD_DIR)/repos/fuel-library$(FUEL_LIBRARY_VERSION)
|
||||
$(ACTION.TOUCH)
|
||||
|
||||
$(BUILD_DIR)/repos/repos.done:
|
||||
$(ACTION.TOUCH)
|
@ -1,26 +0,0 @@
|
||||
fencing-agent
|
||||
fuel
|
||||
fuel-agent
|
||||
fuel-bootstrap-cli
|
||||
fuel-ha-utils
|
||||
fuel-library
|
||||
fuelmenu
|
||||
fuel-migrate
|
||||
fuel-misc
|
||||
fuel-nailgun
|
||||
fuel-notify
|
||||
fuel-openstack-metadata
|
||||
fuel-ostf
|
||||
fuel-rabbit-fence
|
||||
fuel-release
|
||||
fuel-umm
|
||||
ironic-fa-bootstrap-configs
|
||||
nailgun-agent
|
||||
nailgun-mcagents
|
||||
network-checker
|
||||
python-fuelclient
|
||||
python-packetary
|
||||
python-timmy
|
||||
rubygem-astute
|
||||
send2syslog
|
||||
shotgun
|
@ -1,276 +0,0 @@
|
||||
apr-util
|
||||
atop
|
||||
augeas
|
||||
augeas-libs
|
||||
bakefile
|
||||
@Base
|
||||
bash
|
||||
bind
|
||||
bzip2
|
||||
cloud-init
|
||||
cloud-utils
|
||||
cobbler
|
||||
cobbler-web
|
||||
@Core
|
||||
createrepo
|
||||
cronie
|
||||
cronie-anacron
|
||||
crontabs
|
||||
Cython
|
||||
daemonize
|
||||
debootstrap
|
||||
deltarpm
|
||||
dhcp
|
||||
dnsmasq
|
||||
docker
|
||||
dpkg
|
||||
dpkg-dev
|
||||
dpkg-devel
|
||||
erlang
|
||||
ethtool
|
||||
euca2ools
|
||||
fabric
|
||||
fence-agents-all
|
||||
gdisk
|
||||
genisoimage
|
||||
GeoIP
|
||||
git
|
||||
gperftools
|
||||
grub2
|
||||
grub2-efi
|
||||
grub2-efi-modules
|
||||
grub2-tools
|
||||
gv
|
||||
httpd
|
||||
iproute
|
||||
iptables
|
||||
ipxe-roms
|
||||
kernel
|
||||
kernel-devel
|
||||
kernel-headers
|
||||
leveldb
|
||||
libevent-devel
|
||||
libiscsi
|
||||
libmlx4
|
||||
libunwind
|
||||
libusbx
|
||||
libvirt-client
|
||||
libvirt-python
|
||||
libyaml
|
||||
linux-firmware
|
||||
logrotate
|
||||
lrzip
|
||||
lshw
|
||||
lvm2
|
||||
mailcap
|
||||
mcollective
|
||||
mdadm
|
||||
mod_wsgi
|
||||
monit
|
||||
mtools
|
||||
MySQL-python
|
||||
mysql-wsrep-5.6
|
||||
nginx
|
||||
nmap-ncat
|
||||
nodejs-nailgun
|
||||
openssh-clients
|
||||
openssl-devel
|
||||
openstack-keystone
|
||||
openstack-selinux
|
||||
os-client-config
|
||||
postgresql
|
||||
postgresql-devel
|
||||
postgresql-libs
|
||||
postgresql-server
|
||||
puppet
|
||||
pydot-ng
|
||||
pyparsing
|
||||
python-alembic
|
||||
python-amqp
|
||||
python-amqplib
|
||||
python-anyjson
|
||||
python-appdirs
|
||||
python-babel
|
||||
python-backports
|
||||
python-backports-ssl_match_hostname
|
||||
python-boto
|
||||
python-ceilometerclient
|
||||
python-chardet
|
||||
python-cheetah
|
||||
python-cinderclient
|
||||
python-cliff
|
||||
python-cliff-tablib
|
||||
python-cmd2
|
||||
python-coverage
|
||||
python-crypto
|
||||
python-daemon
|
||||
python-daemonize
|
||||
python-decorator
|
||||
python-django
|
||||
python-docker-py
|
||||
python-dogpile-cache
|
||||
python-dogpile-core
|
||||
python-ecdsa
|
||||
python-editor
|
||||
python-empy
|
||||
python-ethtool
|
||||
python-eventlet
|
||||
python-flask
|
||||
python-futures
|
||||
python-fysom
|
||||
python-gevent
|
||||
python-greenlet
|
||||
python-heatclient
|
||||
python-httplib2
|
||||
python-imgcreate
|
||||
python-ipaddr
|
||||
python-ironicclient
|
||||
python-iso8601
|
||||
python-itsdangerous
|
||||
python-jinja2
|
||||
python-jsonpatch
|
||||
python-jsonpointer
|
||||
python-jsonschema
|
||||
python-keyring
|
||||
python-keystoneclient
|
||||
python-keystonemiddleware
|
||||
python-kombu
|
||||
python-ldappool
|
||||
python-logutils
|
||||
python-lxml
|
||||
python-mako
|
||||
python-markdown
|
||||
python-markupsafe
|
||||
python-memcached
|
||||
python-migrate
|
||||
python-muranoclient
|
||||
python-netaddr
|
||||
python-netifaces
|
||||
python-networkx-core
|
||||
python-neutronclient
|
||||
python-nose
|
||||
python-novaclient
|
||||
python-oauthlib
|
||||
python-openstackclient
|
||||
python-oslo-config
|
||||
python-oslo-db
|
||||
python-oslo-i18n
|
||||
python-oslo-messaging
|
||||
python-oslo-serialization
|
||||
python-oslo-sphinx
|
||||
python-oslo-utils
|
||||
python-paramiko
|
||||
python-passlib
|
||||
python-paste
|
||||
python-paste-deploy
|
||||
python-pbr
|
||||
python-pecan
|
||||
python-pip
|
||||
python-ply
|
||||
python-posix_ipc
|
||||
python-psycopg2
|
||||
python-pycadf
|
||||
python-pygments
|
||||
python-pypcap
|
||||
python-repoze-lru
|
||||
python-requests
|
||||
python-rhsm
|
||||
python-routes
|
||||
python-saharaclient
|
||||
python-setuptools
|
||||
python-simplegeneric
|
||||
python-simplejson
|
||||
python-singledispatch
|
||||
python-six
|
||||
python-sqlalchemy
|
||||
python-stevedore
|
||||
python-suds
|
||||
python-swiftclient
|
||||
python-tablib
|
||||
python-testresources
|
||||
python-unicodecsv
|
||||
python-unittest2
|
||||
python-urllib3
|
||||
python-urwid
|
||||
python-warlock
|
||||
python-webob
|
||||
python-webpy
|
||||
python-websocket-client
|
||||
python-websockify
|
||||
python-webtest
|
||||
python-werkzeug
|
||||
python-wsgilog
|
||||
python-wsgiref
|
||||
python-yaql
|
||||
pytz
|
||||
PyYAML
|
||||
qemu-img
|
||||
rabbitmq-server
|
||||
rpm
|
||||
rpm-build
|
||||
rsync
|
||||
ruby
|
||||
ruby-augeas
|
||||
ruby-devel
|
||||
rubygem-activesupport
|
||||
rubygem-amq-protocol
|
||||
rubygem-bunny
|
||||
rubygem-cstruct
|
||||
rubygem-extlib
|
||||
rubygem-ffi
|
||||
rubygem-ffi-yajl
|
||||
rubygem-httpclient
|
||||
rubygem-i18n
|
||||
rubygem-inifile
|
||||
rubygem-ipaddress
|
||||
rubygem-json
|
||||
rubygem-librarian-puppet-simple
|
||||
rubygem-mcollective-client
|
||||
rubygem-mime-types
|
||||
rubygem-minitest
|
||||
rubygem-mixlib-cli
|
||||
rubygem-mixlib-config
|
||||
rubygem-mixlib-shellout
|
||||
rubygem-netaddr
|
||||
rubygem-net-ssh
|
||||
rubygem-net-ssh-gateway
|
||||
rubygem-net-ssh-multi
|
||||
rubygem-ohai
|
||||
rubygem-openstack
|
||||
rubygem-raemon
|
||||
rubygem-rdoc
|
||||
rubygem-rest-client
|
||||
rubygem-rethtool
|
||||
rubygems
|
||||
rubygem-stomp
|
||||
rubygem-symboltable
|
||||
rubygem-systemu
|
||||
rubygem-thread_safe
|
||||
rubygem-tzinfo
|
||||
rubygem-wmi-lite
|
||||
rubygem-yajl-ruby
|
||||
ruby-libs
|
||||
ruby-shadow
|
||||
scapy
|
||||
screen
|
||||
seabios
|
||||
selinux-policy
|
||||
send2syslog
|
||||
snappy
|
||||
socat
|
||||
sudo
|
||||
supervisor
|
||||
syslinux
|
||||
sysstat
|
||||
tar
|
||||
tftp-server
|
||||
tmux
|
||||
uwsgi
|
||||
uwsgi-plugin-common
|
||||
uwsgi-plugin-python
|
||||
vim
|
||||
vim-minimal
|
||||
wxGTK
|
||||
xinetd
|
||||
yum
|
||||
yum-plugin-priorities
|
46
rules.mk
46
rules.mk
@ -1,46 +0,0 @@
|
||||
define ACTION.COPY
|
||||
@mkdir -p $(@D)
|
||||
cp $< $@
|
||||
endef
|
||||
|
||||
define ACTION.TOUCH
|
||||
@mkdir -p $(@D)
|
||||
touch $@
|
||||
endef
|
||||
|
||||
# This macros is to make targets dependent on variables
|
||||
# It writes variable value into temporary file varname.tmp,
|
||||
# then it compares temporary file with the varname.dep file.
|
||||
# If there is a difference between them, varname.dep will be updated
|
||||
# and the target which depends on it will be rebuilt.
|
||||
# Example:
|
||||
# target: $(call depv,varname)
|
||||
DEPV_DIR:=$(BUILD_DIR)/depv
|
||||
define depv
|
||||
$(shell mkdir -p $(DEPV_DIR))
|
||||
$(shell echo "$($1)" > $(DEPV_DIR)/$1.tmp)
|
||||
$(shell diff >/dev/null 2>&1 $(DEPV_DIR)/$1.tmp $(DEPV_DIR)/$1.dep \
|
||||
|| mv $(DEPV_DIR)/$1.tmp $(DEPV_DIR)/$1.dep)
|
||||
$(DEPV_DIR)/$1.dep
|
||||
endef
|
||||
|
||||
define NEWLINE
|
||||
|
||||
|
||||
endef
|
||||
|
||||
$(BUILD_DIR)/%/.dir:
|
||||
mkdir -p $(@D)
|
||||
@touch $@
|
||||
|
||||
assert-variable=$(if $($1),,$(error Variable $1 need to be defined))
|
||||
find-files=$(shell test -e $1 && find $1 -type f 2> /dev/null)
|
||||
|
||||
# uppercase conversion routine
|
||||
# usage: UPPER_VAR = $(call uc,$(VAR))
|
||||
uc = $(shell echo $(1) | tr a-z A-Z)
|
||||
|
||||
comma:=,
|
||||
|
||||
space:=
|
||||
space+=
|
268
sandbox.mk
268
sandbox.mk
@ -1,268 +0,0 @@
|
||||
.PHONY: show-ubuntu-sandbox-repos show-centos-sandbox-repos
|
||||
|
||||
define yum_local_repo
|
||||
[upstream-local-mirror]
|
||||
name=Local upstream mirror
|
||||
baseurl=file:///mirrors/centos/os/x86_64
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
priority=10
|
||||
endef
|
||||
|
||||
define yum_local_mos_repo
|
||||
[mos-local-mirror]
|
||||
name=Local mirror
|
||||
baseurl=file:///mirrors/mos-centos
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
priority=10
|
||||
endef
|
||||
|
||||
define yum_upstream_repo
|
||||
[upstream]
|
||||
name=Upstream mirror
|
||||
baseurl=$(SANDBOX_MIRROR_CENTOS_UPSTREAM)/os/$(CENTOS_ARCH)/
|
||||
gpgcheck=0
|
||||
priority=1
|
||||
sslverify=False
|
||||
|
||||
[upstream-updates]
|
||||
name=Upstream mirror
|
||||
baseurl=$(SANDBOX_MIRROR_CENTOS_UPSTREAM)/updates/$(CENTOS_ARCH)/
|
||||
gpgcheck=0
|
||||
priority=1
|
||||
sslverify=False
|
||||
endef
|
||||
|
||||
define yum_epel_repo
|
||||
[epel]
|
||||
name=epel mirror
|
||||
baseurl=$(SANDBOX_MIRROR_EPEL)/$(CENTOS_MAJOR)/$(CENTOS_ARCH)/
|
||||
gpgcheck=0
|
||||
priority=3
|
||||
endef
|
||||
|
||||
ifdef EXTRA_RPM_BUILDDEP_REPO
|
||||
define yum_extra_build_repo
|
||||
[extra_build]
|
||||
name=Extra Build
|
||||
baseurl=$(EXTRA_RPM_BUILDDEP_REPO)
|
||||
gpgcheck=0
|
||||
priority=2
|
||||
endef
|
||||
endif
|
||||
|
||||
define sandbox_yum_conf
|
||||
[main]
|
||||
cachedir=/tmp/cache
|
||||
keepcache=0
|
||||
debuglevel=2
|
||||
logfile=/tmp/yum.log
|
||||
exclude=*.i686.rpm
|
||||
exactarch=1
|
||||
obsoletes=1
|
||||
gpgcheck=0
|
||||
plugins=1
|
||||
pluginpath=/etc/yum-plugins
|
||||
pluginconfpath=/etc/yum/pluginconf.d
|
||||
reposdir=/etc/yum.repos.d
|
||||
sslverify=False
|
||||
endef
|
||||
|
||||
define external_sandbox_yum_conf
|
||||
[main]
|
||||
cachedir=$(SANDBOX)/cache
|
||||
keepcache=0
|
||||
debuglevel=2
|
||||
logfile=$(SANDBOX)/yum.log
|
||||
exclude=*.i686.rpm
|
||||
exactarch=1
|
||||
obsoletes=1
|
||||
gpgcheck=0
|
||||
plugins=1
|
||||
pluginpath=$(SANDBOX)/etc/yum-plugins
|
||||
pluginconfpath=$(SANDBOX)/etc/yum/pluginconf.d
|
||||
reposdir=$(SANDBOX)/etc/yum.repos.d
|
||||
sslverify=False
|
||||
endef
|
||||
|
||||
SANDBOX_PACKAGES:=bash yum
|
||||
|
||||
define SANDBOX_UP
|
||||
echo "Starting SANDBOX up"
|
||||
mkdir -p $(SANDBOX)/etc/yum.repos.d
|
||||
cat > $(SANDBOX)/etc/yum.conf <<EOF
|
||||
$(sandbox_yum_conf)
|
||||
EOF
|
||||
# this conf is used outside chroot in order to install yum
|
||||
cat > $(SANDBOX)/etc/external.yum.conf <<EOF
|
||||
$(external_sandbox_yum_conf)
|
||||
EOF
|
||||
|
||||
cp /etc/resolv.conf $(SANDBOX)/etc/resolv.conf
|
||||
cp /etc/hosts $(SANDBOX)/etc/hosts
|
||||
cat > $(SANDBOX)/etc/yum.repos.d/base.repo <<EOF
|
||||
$(yum_upstream_repo)
|
||||
$(yum_epel_repo)
|
||||
EOF
|
||||
mkdir -p $(SANDBOX)/etc/yum/pluginconf.d/
|
||||
mkdir -p $(SANDBOX)/etc/yum-plugins/
|
||||
mkdir -p $(SANDBOX)/mirrors
|
||||
cp $(SOURCE_DIR)/mirror/centos/yum-priorities-plugin.py $(SANDBOX)/etc/yum-plugins/priorities.py
|
||||
cat > $(SANDBOX)/etc/yum/pluginconf.d/priorities.conf << EOF
|
||||
[main]
|
||||
enabled=1
|
||||
check_obsoletes=1
|
||||
full_match=1
|
||||
EOF
|
||||
sudo rpm -i --root=$(SANDBOX) `find $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -name "centos-release*rpm" | head -1` || \
|
||||
echo "centos-release already installed"
|
||||
sudo rm -vf $(SANDBOX)/etc/yum.repos.d/Cent*
|
||||
sudo /bin/sh -c 'export TMPDIR=$(SANDBOX)/tmp/yum TMP=$(SANDBOX)/tmp/yum; yum -c $(SANDBOX)/etc/external.yum.conf --installroot=$(SANDBOX) -y --nogpgcheck install yum'
|
||||
echo 'Rebuilding RPM DB'
|
||||
sudo rpm --root=$(SANDBOX) --rebuilddb
|
||||
echo 'Installing packages for Sandbox'
|
||||
mount | grep -q $(SANDBOX)/mirrors || sudo mount --bind $(LOCAL_MIRROR) $(SANDBOX)/mirrors
|
||||
mount | grep -q $(SANDBOX)/proc || sudo mount --bind /proc $(SANDBOX)/proc
|
||||
mount | grep -q $(SANDBOX)/dev || sudo mount --bind /dev $(SANDBOX)/dev
|
||||
# after installing yum, let's add MOS repos from mounted /mirrors
|
||||
cat > $(SANDBOX)/etc/yum.repos.d/base.repo <<EOF
|
||||
$(yum_upstream_repo)
|
||||
$(yum_epel_repo)
|
||||
$(yum_local_repo)
|
||||
$(yum_local_mos_repo)
|
||||
$(yum_extra_build_repo)
|
||||
EOF
|
||||
echo $(SANDBOX_PACKAGES) | xargs -n1 | xargs -I_package sudo sh -c 'rm -vf $(SANDBOX)/etc/yum.repos.d/Cent*; chroot $(SANDBOX) yum -y --nogpgcheck install _package'
|
||||
# clean all repos except the MOS + upsream + our epel
|
||||
sudo rm -vf $(SANDBOX)/etc/yum.repos.d/epel*
|
||||
sudo rm -vf $(SANDBOX)/etc/yum.repos.d/Cent*
|
||||
endef
|
||||
|
||||
define SANDBOX_DOWN
|
||||
sudo umount $(SANDBOX)/proc || true
|
||||
sudo umount $(SANDBOX)/dev || true
|
||||
sudo umount $(SANDBOX)/mirrors || true
|
||||
endef
|
||||
|
||||
define apt_sources_list
|
||||
#Upstream Ubuntu mirrors
|
||||
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT) $(MIRROR_UBUNTU_SUITE) $(MIRROR_UBUNTU_SECTION)
|
||||
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT) $(MIRROR_UBUNTU_SUITE)-updates $(MIRROR_UBUNTU_SECTION)
|
||||
deb $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT) $(MIRROR_UBUNTU_SUITE)-security $(MIRROR_UBUNTU_SECTION)
|
||||
# MOS repos
|
||||
deb $(MIRROR_MOS_UBUNTU_METHOD)://$(MIRROR_MOS_UBUNTU)$(MIRROR_MOS_UBUNTU_ROOT) $(MIRROR_MOS_UBUNTU_SUITE) $(MIRROR_MOS_UBUNTU_SECTION)
|
||||
deb $(MIRROR_MOS_UBUNTU_METHOD)://$(MIRROR_MOS_UBUNTU)$(MIRROR_MOS_UBUNTU_ROOT) $(MIRROR_MOS_UBUNTU_SUITE)-security $(MIRROR_MOS_UBUNTU_SECTION)
|
||||
deb $(MIRROR_MOS_UBUNTU_METHOD)://$(MIRROR_MOS_UBUNTU)$(MIRROR_MOS_UBUNTU_ROOT) $(MIRROR_MOS_UBUNTU_SUITE)-proposed $(MIRROR_MOS_UBUNTU_SECTION)
|
||||
deb $(MIRROR_MOS_UBUNTU_METHOD)://$(MIRROR_MOS_UBUNTU)$(MIRROR_MOS_UBUNTU_ROOT) $(MIRROR_MOS_UBUNTU_SUITE)-updates $(MIRROR_MOS_UBUNTU_SECTION)
|
||||
deb $(MIRROR_MOS_UBUNTU_METHOD)://$(MIRROR_MOS_UBUNTU)$(MIRROR_MOS_UBUNTU_ROOT) $(MIRROR_MOS_UBUNTU_SUITE)-holdback $(MIRROR_MOS_UBUNTU_SECTION)
|
||||
|
||||
#Extra repositories
|
||||
$(if $(EXTRA_DEB_REPOS),$(subst |,$(NEWLINE)deb ,deb $(EXTRA_DEB_REPOS)))
|
||||
endef
|
||||
|
||||
define apt_preferences
|
||||
# Apt repo @ obs-1 has Codename=trusty (which is OK)
|
||||
# However the one @ mirror.fuel-infra has Codename=mos6.1
|
||||
Package: *
|
||||
Pin: release o=Mirantis, n=$(MIRROR_UBUNTU_SUITE)
|
||||
Pin-Priority: 1101
|
||||
|
||||
Package: *
|
||||
Pin: release o=Mirantis, n=$(PRODUCT_NAME)$(PRODUCT_VERSION)
|
||||
Pin-Priority: 1101
|
||||
|
||||
# to install packages from unmerged fuel-infra requests
|
||||
Package: *
|
||||
Pin: release l=$(UBUNTU_RELEASE)-fuel-$(PRODUCT_VERSION)-stable*
|
||||
Pin-Priority: 1101
|
||||
|
||||
Package: *
|
||||
Pin: release o=Open Build Service $(UBUNTU_RELEASE)-fuel-$(PRODUCT_VERSION)-stable*
|
||||
Pin-Priority: 1101
|
||||
endef
|
||||
|
||||
|
||||
define SANDBOX_UBUNTU_UP
|
||||
set -e
|
||||
echo "SANDBOX_UBUNTU_UP: start"
|
||||
mkdir -p $(SANDBOX_UBUNTU)
|
||||
mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
|
||||
cat > $(BUILD_DIR)/policy-rc.d << EOF
|
||||
#!/bin/sh
|
||||
# suppress services start in the staging chroots
|
||||
exit 101
|
||||
EOF
|
||||
chmod 755 $(BUILD_DIR)/policy-rc.d
|
||||
mkdir -p $(SANDBOX_UBUNTU)/etc/init.d
|
||||
touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
|
||||
mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
|
||||
cp -a $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
|
||||
echo "Running debootstrap"
|
||||
sudo debootstrap --no-check-gpg --include=ca-certificates --arch=$(UBUNTU_ARCH) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
|
||||
if [ -e $(SANDBOX_UBUNTU)/etc/resolv.conf ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf.orig; fi
|
||||
sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
|
||||
if [ -e $(SANDBOX_UBUNTU)/etc/hosts ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/hosts $(SANDBOX_UBUNTU)/etc/hosts.orig; fi
|
||||
sudo cp /etc/hosts $(SANDBOX_UBUNTU)/etc/hosts
|
||||
echo "Generating utf8 locale"
|
||||
sudo chroot $(SANDBOX_UBUNTU) /usr/bin/env -i \
|
||||
LC_ALL=C \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
DEBCONF_NONINTERACTIVE_SEEN=true \
|
||||
/bin/sh -c 'locale-gen en_US.UTF-8; dpkg-reconfigure locales'
|
||||
echo "Preparing directory for chroot local mirror"
|
||||
sudo mkdir -p $(SANDBOX_UBUNTU)/etc/apt/preferences.d/
|
||||
echo "Generating pinning file for Ubuntu SandBox"
|
||||
cat > $(BUILD_DIR)/mirror/ubuntu/preferences << EOF
|
||||
$(apt_preferences)
|
||||
EOF
|
||||
sudo cp $(BUILD_DIR)/mirror/ubuntu/preferences $(SANDBOX_UBUNTU)/etc/apt/preferences.d/
|
||||
echo "Configuring apt sources.list"
|
||||
cat > $(BUILD_DIR)/mirror/ubuntu/sources.list << EOF
|
||||
$(apt_sources_list)
|
||||
EOF
|
||||
sudo cp $(BUILD_DIR)/mirror/ubuntu/sources.list $(SANDBOX_UBUNTU)/etc/apt/
|
||||
sudo cp $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
|
||||
echo "Allowing using unsigned repos"
|
||||
echo "APT::Get::AllowUnauthenticated 1;" | sudo tee $(SANDBOX_UBUNTU)/etc/apt/apt.conf.d/02mirantis-unauthenticated
|
||||
if [ "$(SANDBOX_COPY_CERTS)" = "1" ] ; then
|
||||
echo "Copying local certificates and CA to chroot"
|
||||
sudo bash -c "mkdir -p $(SANDBOX_UBUNTU)/usr/share/ca-certificates/ ; rsync -arzL /etc/ssl/certs/ $(SANDBOX_UBUNTU)/usr/share/ca-certificates/local/"
|
||||
echo "Acquire::https { Verify-Peer \"true\"; Verify-Host \"true\"; }; " | sudo tee -a $(SANDBOX_UBUNTU)/etc/apt/apt.conf.d/05-local-ssl-certs
|
||||
sudo chroot $(SANDBOX_UBUNTU) sh -xc "(cd /usr/share/ca-certificates; find local -type f) >> /etc/ca-certificates.conf"
|
||||
sudo chroot $(SANDBOX_UBUNTU) update-ca-certificates
|
||||
fi
|
||||
echo "Updating apt package database"
|
||||
sudo chroot $(SANDBOX_UBUNTU) bash -c "(mkdir -p /tmp/user/0)"
|
||||
sudo chroot $(SANDBOX_UBUNTU) apt-get update
|
||||
if ! mountpoint -q $(SANDBOX_UBUNTU)/proc; then sudo mount -t proc sandboxproc $(SANDBOX_UBUNTU)/proc; fi
|
||||
echo "Installing additional packages: $(SANDBOX_DEB_PKGS)"
|
||||
sudo chroot $(SANDBOX_UBUNTU) env LC_ALL=C DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get dist-upgrade --yes
|
||||
test -n "$(SANDBOX_DEB_PKGS)" && sudo chroot $(SANDBOX_UBUNTU) env LC_ALL=C DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install --yes $(SANDBOX_DEB_PKGS)
|
||||
echo "SANDBOX_UBUNTU_UP: done"
|
||||
endef
|
||||
|
||||
define SANDBOX_UBUNTU_DOWN
|
||||
if mountpoint -q $(SANDBOX_UBUNTU)/proc; then sudo umount $(SANDBOX_UBUNTU)/proc; fi
|
||||
sudo umount $(SANDBOX_UBUNTU)/tmp/apt || true
|
||||
endef
|
||||
|
||||
show-ubuntu-sandbox-repos: export apt_source_content:=$(apt_sources_list)
|
||||
show-ubuntu-sandbox-repos: export apt_pinning_content:=$(apt_preferences)
|
||||
show-ubuntu-sandbox-repos:
|
||||
/bin/echo -e "$${apt_source_content}"
|
||||
/bin/echo -e "$${apt_pinning_content}"
|
||||
|
||||
show-centos-sandbox-repos: export sandbox_yum_conf_content:=$(sandbox_yum_conf)
|
||||
show-centos-sandbox-repos: export yum_upstream_repo_content:=$(yum_upstream_repo)
|
||||
show-centos-sandbox-repos: export yum_epel_repo_content:=$(yum_epel_repo)
|
||||
show-centos-sandbox-repos: export yum_local_repo_content:=$(yum_local_repo)
|
||||
show-centos-sandbox-repos: export yum_local_mos_repo_content:=$(yum_local_mos_repo)
|
||||
show-centos-sandbox-repos: export yum_extra_build_repo_content:=$(yum_extra_build_repo)
|
||||
show-centos-sandbox-repos:
|
||||
/bin/echo -e "$${sandbox_yum_conf_content}\n"
|
||||
/bin/echo -e "$${yum_upstream_repo_content}\n"
|
||||
/bin/echo -e "$${yum_epel_repo_content}\n"
|
||||
/bin/echo -e "$${yum_local_repo_content}\n"
|
||||
/bin/echo -e "$${yum_local_mos_repo_content}\n"
|
||||
/bin/echo -e "$${yum_extra_build_repo_content}\n"
|
@ -1,105 +0,0 @@
|
||||
#TEMP fixme
|
||||
%define repo_name fuel-main
|
||||
|
||||
%define name fuel
|
||||
%{!?version: %define version 10.0.0}
|
||||
%{!?fuel_release: %define fuel_release 10.0}
|
||||
%{!?release: %define release 1}
|
||||
|
||||
Name: %{name}
|
||||
Summary: Fuel for OpenStack
|
||||
URL: http://mirantis.com
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
License: Apache
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
BuildArch: noarch
|
||||
Requires: fuel-library10.0
|
||||
Requires: fuelmenu >= %{version}
|
||||
Requires: fuel-release >= %{version}
|
||||
Requires: network-checker >= %{version}
|
||||
Requires: python-fuelclient >= %{version}
|
||||
Requires: shotgun >= %{version}
|
||||
Requires: yum
|
||||
|
||||
%description
|
||||
Fuel for OpenStack is a lifecycle management utility for
|
||||
managing OpenStack.
|
||||
|
||||
%prep
|
||||
%setup -cq -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}/etc
|
||||
mkdir -p %{buildroot}/etc/yum/vars/
|
||||
mkdir -p %{buildroot}/etc/yum.repos.d
|
||||
echo %{fuel_release} > %{buildroot}%{_sysconfdir}/fuel_release
|
||||
echo %{fuel_release} > %{buildroot}%{_sysconfdir}/yum/vars/fuelver
|
||||
# copy GPG key
|
||||
install -D -m 644 %{_builddir}/%{name}-%{version}/fuel-release/RPM-GPG-KEY-mos %{buildroot}/etc/pki/fuel-gpg/RPM-GPG-KEY-mos
|
||||
# copy yum repos and mirror lists to /etc/yum.repos.d
|
||||
for file in %{_builddir}/%{name}-%{version}/fuel-release/*.repo ; do
|
||||
install -D -m 644 "$file" %{buildroot}/etc/yum.repos.d
|
||||
done
|
||||
install -D -p -m 755 %{_builddir}/%{name}-%{version}/iso/bootstrap_admin_node.sh %{buildroot}%{_sbindir}/bootstrap_admin_node.sh
|
||||
install -D -p -m 755 %{_builddir}/%{name}-%{version}/iso/fix_default_repos.py %{buildroot}%{_sbindir}/fix_default_repos.py
|
||||
install -D -p -m 755 %{_builddir}/%{name}-%{version}/fuel-release/override_rpm_repos.py %{buildroot}%{_sbindir}/override_rpm_repos.py
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
|
||||
|
||||
%package -n fuel-release
|
||||
|
||||
Summary: Fuel release package
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
License: Apache
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
URL: http://github.com/Mirantis
|
||||
Requires: python
|
||||
Requires: PyYAML >= 3.10
|
||||
|
||||
%description -n fuel-release
|
||||
This packages provides /etc/fuel_release file
|
||||
and Yum configuration for Fuel online repositories.
|
||||
|
||||
%files -n fuel-release
|
||||
%defattr(-,root,root)
|
||||
%{_sysconfdir}/fuel_release
|
||||
%{_sbindir}/override_rpm_repos.py
|
||||
%config(noreplace) %attr(0644,root,root) /etc/yum/vars/fuelver
|
||||
%config(noreplace) %attr(0644,root,root) /etc/yum.repos.d/*
|
||||
%dir /etc/pki/fuel-gpg
|
||||
/etc/pki/fuel-gpg/*
|
||||
|
||||
%post -n fuel-release
|
||||
if [[ -f /root/override_rpm_repos.yaml ]]; then
|
||||
rm -f /etc/yum.repos.d/*.repo
|
||||
override_rpm_repos.py --repositories-file /root/override_rpm_repos.yaml --output-file /etc/yum.repos.d/overriden.repo
|
||||
fi
|
||||
|
||||
%package -n fuel-setup
|
||||
|
||||
Summary: Fuel deployment script package
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
License: Apache
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
URL: http://github.com/Mirantis
|
||||
|
||||
%description -n fuel-setup
|
||||
This packages provides script to deploy Fuel components.
|
||||
|
||||
%files -n fuel-setup
|
||||
%defattr(-,root,root)
|
||||
%{_sbindir}/bootstrap_admin_node.sh
|
||||
%{_sbindir}/fix_default_repos.py
|
Loading…
Reference in New Issue
Block a user