Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos
Commits
8e498af3
Commit
8e498af3
authored
Jul 07, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Aug 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nayuos] Refactor build script as hinted by XXX comments
parent
182e5044
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
28 deletions
+44
-28
software/nayuos/instance.cfg
software/nayuos/instance.cfg
+1
-1
software/nayuos/scripts/cros_full_build.in
software/nayuos/scripts/cros_full_build.in
+37
-25
software/nayuos/software.cfg
software/nayuos/software.cfg
+6
-2
No files found.
software/nayuos/instance.cfg
View file @
8e498af3
...
...
@@ -96,7 +96,7 @@ context =
recipe = slapos.recipe.template:jinja2
template = {{ scripts_dir }}/cros_full_build.in
rendered = ${directory:run}/cros_full_build
md5sum =
d015e62f327dc8b81ba4c5ea2b2f863e
md5sum =
2bb9dd83260ea96dd6a6602f6faa9794
mode = 0700
context =
key bash_path bin:bash
...
...
software/nayuos/scripts/cros_full_build.in
View file @
8e498af3
...
...
@@ -35,6 +35,32 @@ 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.
EBUILD=$1
changed=0
shift
while [ ! -z "$1" ]
do
package=$1
if [[ $( grep "${package}" "${EBUILD}" ) ]] ; then
echo "no need to change ${EBUILD} file to add ${package}..." >> "${BUILD_LOG}"
else
printf "\n\nRDEPEND=\"\${RDEPEND}\n ${package}\"\n">> ${EBUILD}
changed=1
fi
shift
done;
if [ $changed -eq 1 ]
then
# if we inserted at least one package then increase the version to be sure
# it gets selected in case of more overlays with the same package
increase_revision_number $(dirname $EBUILD)
fi
}
######################## Download of sources using the "repo" command ########################
DL_LOG="{{ instance_log_dir }}/cros_sources_dl.log"
BRANCH="{{ branch }}"
...
...
@@ -95,38 +121,24 @@ done
install -m 770 "{{ scripts_dir }}/test_nayuos_image" "{{ cros_location }}/{{ branch }}/src/scripts/test_nayuos_image"
### packages management ###
VIRTUAL_CHROMEOS_OS_DEV_EBUILD=${CHROMIUM_OVERLAY}/virtual/target-chromium-os-dev/target-chromium-os-dev-1.ebuild
VIRTUAL_CHROMEOS_DEV_ROOTFS_EBUILD=${CHROMIUM_OVERLAY}/chromeos-base/chromeos-dev-root/chromeos-dev-root-0.0.1.ebuild
# change the virtual ebuild responsible for installing all packages to add the ones
# needed for NayuOS
for package in {{ nayu_dev_packages }} ; do
echo $package
if [[ $( grep "${package}" "${VIRTUAL_CHROMEOS_OS_DEV_EBUILD}" ) ]] ; then
echo "no need to change ${VIRTUAL_CHROMEOS_OS_DEV_EBUILD} file to add ${package}..." >> "${BUILD_LOG}"
else
printf "\n\nRDEPEND=\"\${RDEPEND}\n ${package}\"\n">> ${VIRTUAL_CHROMEOS_OS_DEV_EBUILD}
fi
done
#
XXX: create a function for thi
s
for package in {{ nayu_dev_rootfs_packages }} ; do
echo $package
if [[ $( grep "${package}" "${VIRTUAL_CHROMEOS_DEV_ROOTFS_EBUILD}" ) ]] ; then
echo "no need to change ${VIRTUAL_CHROMEOS_DEV_ROOTFS_EBUILD} file to add ${package}..." >> "${BUILD_LOG}"
else
printf "\n\nRDEPEND=\"\${RDEPEND}\n ${package}\"\n">> ${VIRTUAL_CHROMEOS_DEV_ROOTFS_EBUILD}
fi
done
#
make virtual ebuild responsible for installing all packages dependent on NayuOS own package
s
insert_packages_into_ebuild \
${CHROMIUM_OVERLAY}/virtual/target-chromium-os-dev/target-chromium-os-dev-1.ebuild \
{{ nayu_dev_packages }}
# insert policies into /etc/chromium/policies/recommended with NayuOS customizations
insert_packages_into_ebuild \
${CHROMIUM_OVERLAY}/chromeos-base/chromeos-dev-root/chromeos-dev-root-0.0.1.ebuild \
{{ nayu_dev_rootfs_packages }}
increase_revision_number ${CHROMIUM_OVERLAY}/virtual/target-chromium-os-dev
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-dev-root
# 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
# 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
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init/
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/
...
...
software/nayuos/software.cfg
View file @
8e498af3
...
...
@@ -8,17 +8,20 @@ parts +=
slapos-cookbook
template-instance
versions = versions
[versions]
slapos.recipe.template = 3.0
[template-instance]
# create the instance.cfg file in the buildout directory
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg
md5sum = f4f1dcd506661a81a5c7e9f5123663a9
mode = 0644
md5sum = 085560ea84a5a7f633de0ef63a6ba7aa
scripts_dir = ${:_profile_base_location_}/scripts
logo_dir = ${:_profile_base_location_}/logo
curl_path = ${curl:location}/bin
...
...
@@ -30,3 +33,4 @@ context =
key git_path :git_path
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment