Commit 032a3ad2 authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

Add thin-provisioning-tools to support build system for R62 and higher

-  add --nouse-image flags to cros_sdk to prevent usage of missing lvm2
-  add dynamic discovery of ebuild files instead of rely on hard-coded versions

/reviewed-on nexedi/slapos!219
parent bdf5815e
......@@ -28,7 +28,7 @@ git-executable = {{ git_path }}/bin/git
[customize-path]
# add depot tools directory (for cros_sdk binary among others) and git directory to the path
command =
export PATH="${directory:wrapper_dir}":"{{ git_path }}/bin":"{{ curl_path }}/bin":"${depot-tools:location}":"$PATH";
export PATH="${directory:wrapper_dir}":"{{ git_path }}/bin":"{{ curl_path }}/bin":"${depot-tools:location}":"{{thin_provisioning_tools}}/sbin":"$PATH";
[nayuos-ebuilds]
recipe = slapos.recipe.build:gitclone
......@@ -99,7 +99,7 @@ context =
recipe = slapos.recipe.template:jinja2
template = {{ software_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build
md5sum = 2bb9dd83260ea96dd6a6602f6faa9794
md5sum = b2ef515a871b18216baf187485be74f8
mode = 0700
context =
key bash_path bin:bash
......
#! {{ bash_path }}
function increase_revision_number() {
# this increase the revision number an ebuild
# (except for revision number 9999 which is a value for "live ebuild", for dev revisions)
......@@ -35,6 +36,7 @@ function increase_revision_number() {
fi
}
function insert_packages_into_ebuild() {
# Insert packages (in form of "category/package") into RDEPEND part of ebuild.
# Optionally increasing version of given ebuild.
......@@ -61,6 +63,14 @@ function insert_packages_into_ebuild() {
fi
}
function latest_ebuild() {
# find the latest ebuild file (previously we hardcoded the versions)
# @argument ebuild directory to find the file in
find $1 -type f -name '*ebuild' | sort -r | head -1
}
######################## Download of sources using the "repo" command ########################
DL_LOG="{{ instance_log_dir }}/cros_sources_dl.log"
BRANCH="{{ branch }}"
......@@ -124,24 +134,26 @@ install -m 770 "{{ scripts_dir }}/test_nayuos_image" "{{ cros_location }}/{{ bra
# make virtual ebuild responsible for installing all packages dependent on NayuOS own packages
insert_packages_into_ebuild \
${CHROMIUM_OVERLAY}/virtual/target-chromium-os-dev/target-chromium-os-dev-1.ebuild \
{{ nayu_dev_packages }}
$(latest_ebuild ${CHROMIUM_OVERLAY}/virtual/target-chromium-os-dev) \
net-misc/re6stnet dev-vcs/git dev-python/flask dev-python/virtualenv sys-fs/cryptsetup
# insert policies into /etc/chromium/policies/recommended with NayuOS customizations
CHROMEOS_DEV_ROOT_EBIULD=
Please register or sign in to reply
insert_packages_into_ebuild \
${CHROMIUM_OVERLAY}/chromeos-base/chromeos-dev-root/chromeos-dev-root-0.0.1.ebuild \
{{ nayu_dev_rootfs_packages }}
$(latest_ebuild ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-dev-root) \
app-misc/nayuos-chromium-policy
# do not install the Upstart init script that starts ssh daemon at boot time
rm ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/files/openssh-server.conf
find ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init* -name openssh-server.conf -delete
# strip away the src_install part because it only sets up booting scripts
sed -i -n '/src_install/q;p' ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init/openssh-server-init-0.0.1.ebuild
sed -i -n '/src_install/q;p' ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/chromeos-sshd-init-0.0.1.ebuild
# increase version in case of other overlays with the same packages
# and increase version in case of other overlays with the same packages
sed -i -n '/src_install/q;p' $(latest_ebuild ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init)
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init/
sed -i -n '/src_install/q;p' $(latest_ebuild ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init)
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/
# bashrc modifications
BASH_EBUILD_DIR="${PORTAGE_STABLE}/app-shells/bash"
if ! grep "BEGIN NayuOS configuration" "${BASH_EBUILD_DIR}/files/dot-bashrc" > /dev/null ; then
......@@ -292,7 +304,7 @@ for board in ${BOARDS} ; do
# preparing packages (for chroot and image)
date >> "${BUILD_LOG}"
echo "building packages for a ${board}-flavoured Chromium OS..." >> "${BUILD_LOG}"
cros_sdk -- ./build_packages --board=${board} >> "${BUILD_LOG}"
cros_sdk --nouse-image -- ./build_packages --board=${board} >> "${BUILD_LOG}"
Please register or sign in to reply
# change boot pictures
cros_sdk -- cros_workon --board=${board} start chromiumos-assets
......@@ -305,12 +317,12 @@ for board in ${BOARDS} ; do
NAYU_IMAGE_LOCATION=/tmp/${board}.nayuos.img
# rebuild packages with boot pictures
cros_sdk -- ./build_packages --board=${board} >> "${BUILD_LOG}"
cros_sdk --nouse-image-- ./build_packages --board=${board} >> "${BUILD_LOG}"
# NayuOS images
date >> "${BUILD_LOG}"
echo "building image" >> "${BUILD_LOG}"
cros_sdk -- ./build_image --board=${board} dev >> "${BUILD_LOG}" \
cros_sdk --nouse-image -- ./build_image --board=${board} dev >> "${BUILD_LOG}" \
&& cros_sdk -- rm -f $NAYU_IMAGE_LOCATION && cros_sdk -- touch $NAYU_IMAGE_LOCATION \
&& cros_sdk -- cros flash --board=${board} file://$NAYU_IMAGE_LOCATION >> "${BUILD_LOG}" \
&& cros_sdk -- ./test_nayuos_image ${board} > "${TEST_LOG}" \
Please register or sign in to reply
......
......@@ -2,16 +2,20 @@
extends =
# basic needs
../../stack/slapos.cfg
../../component/automake/buildout.cfg
../../component/libexpat/buildout.cfg
../../component/libaio/buildout.cfg
../../component/boost-lib/buildout.cfg
parts +=
slapos-cookbook
template-instance
git
curl
thin-provisioning-tools
versions = versions
[versions]
slapos.recipe.template = 3.0
......@@ -22,7 +26,7 @@ recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg
mode = 0644
md5sum = 154882944c6a58642629c17d47b4f6fc
md5sum = 22be269701616bb6f5453eb769e0cdaa
context =
key software_dir :_profile_base_location_
key instance_dir buildout:directory
......@@ -30,4 +34,23 @@ context =
key git_path git:location
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key thin_provisioning_tools thin-provisioning-tools:location
[thin-provisioning-tools]
recipe = slapos.recipe.cmmi
location = ${buildout:parts-directory}/${:_buildout_section_name_}
url = https://github.com/jthornber/thin-provisioning-tools/archive/v0.7.1.tar.gz
md5sum = 44cc03dd39a55b2f0364b330850d63fd
pre-configure = ${autoconf:location}/bin/autoconf
make-options = PREFIX=${:location}
# environment has to define CXXFLAGS and not CPPFLAGS because of the ./configure
# which has kind-of special behaviour
environment =
PATH=${m4:location}/bin:${automake:location}/bin:${autoconf:location}/bin:%(PATH)s
CXXFLAGS=-I${libexpat:location}/include -I${libaio:location}/include -I${boost-lib:location}/include
LDFLAGS=-L${libexpat:location}/lib -L${libaio:location}/lib -L${boost-lib:location}/lib
dependencies =
automake
libexpat
libaio
boost-lib
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment