diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-01 17:43:57 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-01 17:43:57 +0000 |
commit | a6dbeaebf67ea7f970df5a42d1b9bf9e4b07f2d4 (patch) | |
tree | 301f57bb2567e1aa0c4d2f2e126461c86ddef632 | |
parent | 85d56a9a449d593b46aef34736585009ce958abb (diff) | |
parent | 2ae6652f9132b9ba40d2dec50a9a85ba82973c71 (diff) | |
download | infrastructure-a6dbeaebf67ea7f970df5a42d1b9bf9e4b07f2d4.tar.gz |
Merge branch 'master' of git://git.baserock.org/baserock/baserock/definitions
Conflicts:
README
strata/python2-core/pyyaml.morph~
strata/trove.morph
78 files changed, 657 insertions, 2469 deletions
diff --git a/extensions/mason/mason-report.sh b/extensions/mason/mason-report.sh index 04bd0fe2..f6cca0ef 100755 --- a/extensions/mason/mason-report.sh +++ b/extensions/mason/mason-report.sh @@ -269,7 +269,7 @@ if [ "$RESULT" = skip ]; then fi DURATION=$(( $(date +%s) - $(date --date="$START_TIME" +%s) )) -SHA1="$(cd "ws/$DEFINITIONS_REF/$UPSTREAM_TROVE_ADDRESS/baserock/baserock/definitions" && git rev-parse HEAD)" +SHA1="$(cd "/ws/mason-definitions-$DEFINITIONS_REF" && git rev-parse HEAD)" BUILD_LOG="log/${SHA1}--${START_TIME}.log" update_report "$START_TIME" \ @@ -293,5 +293,5 @@ mv "$logfile" "$SERVER_PATH/$BUILD_LOG" # Cleanup mkdir -p /srv/distbuild/remove -mv /srv/distbuild/!(remove) /srv/distbuild/remove -rm -r /srv/distbuild/remove +find /srv/distbuild/ -not \( -name "remove" -o -name "trees.cache.pickle" \) -mindepth 1 -maxdepth 1 -exec mv '{}' /srv/distbuild/remove \; +find /srv/distbuild/remove -delete diff --git a/extensions/mason/mason.sh b/extensions/mason/mason.sh index 6f2a62b1..8b2cea5f 100755 --- a/extensions/mason/mason.sh +++ b/extensions/mason/mason.sh @@ -11,7 +11,9 @@ set -x # Load our deployment config . /etc/mason.conf -definitions_repo=mason-definitions-"$DEFINITIONS_REF" +mkdir -p /ws + +definitions_repo=/ws/mason-definitions-"$DEFINITIONS_REF" if [ ! -e "$definitions_repo" ]; then git clone -b "$DEFINITIONS_REF" git://"$UPSTREAM_TROVE_ADDRESS"/baserock/baserock/definitions "$definitions_repo" cd "$definitions_repo" diff --git a/extensions/pyfdisk.py b/extensions/pyfdisk.py index 265dc64e..a7796729 100644 --- a/extensions/pyfdisk.py +++ b/extensions/pyfdisk.py @@ -464,9 +464,12 @@ class Device(object): def get_partition_by_mountpoint(self, mountpoint): """Return a Partition with a specified mountpoint""" - return next(r for r in self.partitionlist - if hasattr(r, 'mountpoint') - and r.mountpoint == '/') + try: + return next(r for r in self.partitionlist + if hasattr(r, 'mountpoint') + and r.mountpoint == mountpoint) + except StopIteration: + return False def commit(self): """Write the partition table to the disk or image""" diff --git a/extensions/writeexts.py b/extensions/writeexts.py index f356a34a..528e4e71 100644 --- a/extensions/writeexts.py +++ b/extensions/writeexts.py @@ -15,13 +15,9 @@ import contextlib import errno -import fcntl import logging import os -import partitioning -import pyfdisk import re -import select import shutil import stat import subprocess @@ -29,6 +25,10 @@ import sys import time import tempfile +import partitioning +import pyfdisk +import writeexts + if sys.version_info >= (3, 3, 0): import shlex @@ -278,7 +278,7 @@ class WriteExtension(Extension): self.create_partitioned_system(temp_root, location) else: self.format_btrfs(location) - self.create_system(temp_root, location) + self.create_unpartitioned_system(temp_root, location) @contextlib.contextmanager def created_disk_image(self, location): @@ -299,13 +299,24 @@ class WriteExtension(Extension): sys.stderr.write('Error creating disk image') raise - def create_system(self, temp_root, raw_disk): + def create_unpartitioned_system(self, temp_root, raw_disk): + '''Deploy a bootable Baserock system within a single Btrfs filesystem. + + Called if USE_PARTITIONING=no (the default) is set in the deployment + options. + + ''' with self.mount(raw_disk) as mp: try: - self.create_btrfs_system_layout( + self.create_versioned_layout(mp, version_label='factory') + self.create_btrfs_system_rootfs( temp_root, mp, version_label='factory', rootfs_uuid=self.get_uuid(raw_disk)) - except BaseException as e: + if self.bootloader_config_is_wanted(): + self.create_bootloader_config( + temp_root, mp, version_label='factory', + rootfs_uuid=self.get_uuid(raw_disk)) + except BaseException: sys.stderr.write('Error creating Btrfs system layout') raise @@ -419,7 +430,7 @@ class WriteExtension(Extension): else: subprocess.check_call(['mount', '-o', 'loop', location, mount_point]) - except BaseException as e: + except BaseException: sys.stderr.write('Error mounting filesystem') os.rmdir(mount_point) raise @@ -430,16 +441,47 @@ class WriteExtension(Extension): subprocess.check_call(['umount', mount_point]) os.rmdir(mount_point) - def create_btrfs_system_layout(self, temp_root, mountpoint, version_label, + def create_versioned_layout(self, mountpoint, version_label): + '''Create a versioned directory structure within a partition. + + The Baserock project has defined a 'reference upgrade mechanism'. This + mandates a specific directory layout. It consists of a toplevel + '/systems' directory, containing subdirectories named with a 'version + label'. These subdirectories contain the actual OS content. + + For the root file system, a Btrfs partition must be used. For each + version, two subvolumes are created: 'orig' and 'run'. This is handled + in create_btrfs_system_rootfs(). + + Other partitions (e.g. /boot) can also follow the same layout. In the + case of /boot, content goes directly in the version directory. That + means there are no 'orig' and 'run' subvolumes, which avoids the + need to use Btrfs. + + The `system-version-manager` tool from tbdiff.git is responsible for + deploying live upgrades, and it understands this layout. + + ''' + version_root = os.path.join(mountpoint, 'systems', version_label) + + os.makedirs(version_root) + os.symlink( + version_label, os.path.join(mountpoint, 'systems', 'default')) + + def create_btrfs_system_rootfs(self, temp_root, mountpoint, version_label, rootfs_uuid, device=None): '''Separate base OS versions from state using subvolumes. + The 'device' parameter should be a pyfdisk.Device instance, + as returned by partitioning.do_partitioning(), that describes the + partition layout of the target device. This is used to set up + mountpoints in the root partition for the other partitions. + If no 'device' instance is passed, no mountpoints are set up in the + rootfs. + ''' - initramfs = self.find_initramfs(temp_root) version_root = os.path.join(mountpoint, 'systems', version_label) state_root = os.path.join(mountpoint, 'state') - - os.makedirs(version_root) os.makedirs(state_root) system_dir = self.create_orig(version_root, temp_root) @@ -451,35 +493,37 @@ class WriteExtension(Extension): self.create_run(version_root) - os.symlink( - version_label, os.path.join(mountpoint, 'systems', 'default')) + if device: + self.create_partition_mountpoints(device, system_dir) - if self.bootloader_config_is_wanted(): - self.install_kernel(version_root, temp_root) - if self.get_dtb_path() != '': - self.install_dtb(version_root, temp_root) - self.install_syslinux_menu(mountpoint, version_root) - if initramfs is not None: - # Using initramfs - can boot a rootfs with a filesystem UUID - self.install_initramfs(initramfs, version_root) + def create_bootloader_config(self, temp_root, mountpoint, version_label, + rootfs_uuid, device=None): + '''Setup the bootloader. + + ''' + initramfs = self.find_initramfs(temp_root) + version_root = os.path.join(mountpoint, 'systems', version_label) + + self.install_kernel(version_root, temp_root) + if self.get_dtb_path() != '': + self.install_dtb(version_root, temp_root) + self.install_syslinux_menu(mountpoint, temp_root) + if initramfs is not None: + # Using initramfs - can boot a rootfs with a filesystem UUID + self.install_initramfs(initramfs, version_root) + self.generate_bootloader_config(mountpoint, + rootfs_uuid=rootfs_uuid) + else: + if device: + # A partitioned disk or image - boot with partition UUID + root_part = device.get_partition_by_mountpoint('/') + root_guid = device.get_partition_uuid(root_part) self.generate_bootloader_config(mountpoint, - rootfs_uuid=rootfs_uuid) + root_guid=root_guid) else: - if device: - # A partitioned disk or image - boot with partition UUID - root_part = device.get_partition_by_mountpoint('/') - root_guid = device.get_partition_uuid(root_part) - self.generate_bootloader_config(mountpoint, - root_guid=root_guid) - if self.get_bootloader_install() == 'extlinux': - self.install_syslinux_blob(device, system_dir) - else: - # Unpartitioned and no initramfs - cannot boot with a UUID - self.generate_bootloader_config(mountpoint) - self.install_bootloader(mountpoint) - - if device: - self.create_partition_mountpoints(device, system_dir) + # Unpartitioned and no initramfs - cannot boot with a UUID + self.generate_bootloader_config(mountpoint) + self.install_bootloader(mountpoint) def create_partition_mountpoints(self, device, system_dir): '''Create (or empty) partition mountpoints in the root filesystem @@ -736,7 +780,15 @@ class WriteExtension(Extension): ''' self.status(msg='Creating extlinux.conf') - config = os.path.join(real_root, 'extlinux.conf') + # To be compatible with u-boot, create the extlinux.conf file in + # /extlinux/ rather than / + # Syslinux, however, requires this to be in /, so create a symlink + # as well + config_path = os.path.join(real_root, 'extlinux') + os.makedirs(config_path) + config = os.path.join(config_path, 'extlinux.conf') + os.symlink('extlinux/extlinux.conf', os.path.join(real_root, + 'extlinux.conf')) ''' Please also update the documentation in the following files if you change these default kernel args: @@ -822,7 +874,7 @@ class WriteExtension(Extension): 'architecture? The MBR blob will only be built for x86' 'systems. You may wish to configure BOOTLOADER_INSTALL') - def install_syslinux_menu(self, real_root, version_root): + def install_syslinux_menu(self, real_root, temp_root): '''Make syslinux/extlinux menu binary available. The syslinux boot menu is compiled to a file named menu.c32. Extlinux @@ -833,8 +885,8 @@ class WriteExtension(Extension): not be able to show a menu. ''' - menu_file = os.path.join(version_root, 'orig', - 'usr', 'share', 'syslinux', 'menu.c32') + menu_file = os.path.join(temp_root, 'usr', 'share', 'syslinux', + 'menu.c32') if os.path.isfile(menu_file): self.status(msg='Copying menu.c32') shutil.copy(menu_file, real_root) @@ -902,8 +954,11 @@ class WriteExtension(Extension): raise def create_partitioned_system(self, temp_root, location): - '''Create a Baserock system in a partitioned disk image or device''' + '''Deploy a bootable Baserock system with a custom partition layout. + Called if USE_PARTITIONING=yes is set in the deployment options. + + ''' part_spec = os.environ.get('PARTITION_FILE', 'partitioning/default') disk_size = self.get_disk_size() @@ -912,6 +967,7 @@ class WriteExtension(Extension): dev = partitioning.do_partitioning(location, disk_size, temp_root, part_spec) + boot_partition_available = dev.get_partition_by_mountpoint('/boot') for part in dev.partitionlist: if not hasattr(part, 'mountpoint'): @@ -931,8 +987,23 @@ class WriteExtension(Extension): # Install root filesystem rfs_uuid = self.get_uuid(location, part.extent.start * dev.sector_size) - self.create_btrfs_system_layout(temp_root, part_mount_dir, - 'factory', rfs_uuid, dev) + self.create_versioned_layout(part_mount_dir, 'factory') + self.create_btrfs_system_rootfs(temp_root, part_mount_dir, + 'factory', rfs_uuid, dev) + + # If there's no /boot partition, but we do need to generate + # a bootloader configuration file, then it needs to go in + # the root partition. + if (boot_partition_available is False + and self.bootloader_config_is_wanted()): + self.create_bootloader_config( + temp_root, part_mount_dir, 'factory', rfs_uuid, + dev) + + if self.get_bootloader_install() == 'extlinux': + # The extlinux/syslinux MBR blob always needs to be + # installed in the root partition. + self.install_syslinux_blob(dev, temp_root) else: # Copy files to partition from unpacked rootfs src_dir = os.path.join(temp_root, @@ -941,6 +1012,16 @@ class WriteExtension(Extension): part.mountpoint) self.copy_dir_contents(src_dir, part_mount_dir) + if (part.mountpoint == '/boot' and + self.bootloader_config_is_wanted()): + # We need to mirror the layout of the root partition in the + # /boot partition. Each kernel lives in its own + # systems/$version_label/ directory within the /boot + # partition. + self.create_versioned_layout(part_mount_dir, 'factory') + self.create_bootloader_config(temp_root, part_mount_dir, + 'factory', None, dev) + # Write raw files to disk with dd partitioning.process_raw_files(dev, temp_root) diff --git a/migrations b/migrations new file mode 100644 index 00000000..2b0104d2 --- /dev/null +++ b/migrations @@ -0,0 +1,3 @@ +The content of the definitions/migrations directory is now at + +http://git.baserock.org/cgit/baserock/baserock/spec.git/tree/migrations diff --git a/migrations/000-version-info.py b/migrations/000-version-info.py deleted file mode 100755 index 2bff51f4..00000000 --- a/migrations/000-version-info.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 0. - -The format of version 0 is not formally specified, except by the Morph -codebase. It marks the starting point of the work to formalise the Baserock -Definitions format. - -''' - - -import os -import sys - -import migrations - - -TO_VERSION = 0 - - -try: - if os.path.exists('./VERSION'): - # This will raise an exception if the VERSION file is invalid, which - # might be useful. - migrations.check_definitions_version(TO_VERSION) - - sys.stdout.write("Nothing to do.\n") - sys.exit(0) - else: - sys.stdout.write("No VERSION file found, creating one.\n") - migrations.set_definitions_version(TO_VERSION) - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/001-empty-build-depends.py b/migrations/001-empty-build-depends.py deleted file mode 100755 index 5d4296d6..00000000 --- a/migrations/001-empty-build-depends.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 1. - -In version 1, the 'build-depends' parameter was made optional. It was -previously mandatory to specify 'build-depends' for a chunk, even if it was an -empty list. - -''' - - -import sys -import warnings - -import migrations - - -TO_VERSION = 1 - - -def check_empty_build_depends(contents, filename): - assert contents['kind'] == 'stratum' - - valid = True - for chunk_ref in contents.get('chunks', []): - if 'build-depends' not in chunk_ref: - chunk_ref_name = chunk_ref.get('name', chunk_ref.get('morph')) - warnings.warn( - "%s:%s has no build-depends field, which " - "is invalid in definitions version 0." % - (contents['name'], chunk_ref_name)) - valid = False - - return valid - - -def remove_empty_build_depends(contents, filename): - assert contents['kind'] == 'stratum' - - changed = False - for chunk_ref in contents.get('chunks', []): - if 'build-depends' in chunk_ref: - if len(chunk_ref['build-depends']) == 0: - del chunk_ref['build-depends'] - changed = True - - return changed - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - success = migrations.process_definitions( - path='.', kinds=['stratum'], - validate_cb=check_empty_build_depends, - modify_cb=remove_empty_build_depends) - if success: - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stderr.write("Migration failed due to warnings.\n") - sys.exit(1) - else: - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/002-missing-chunk-morphs.py b/migrations/002-missing-chunk-morphs.py deleted file mode 100755 index 2c93804e..00000000 --- a/migrations/002-missing-chunk-morphs.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 2. - -In version 2, the processing of the 'morph:' field within stratum .morph files -became more strict. This migration checks whether definitions are valid -according to version 2 of the format. - -''' - - -import os -import sys -import warnings - -import migrations - - -TO_VERSION = 2 - - -def check_missing_chunk_morphs(contents, filename): - assert contents['kind'] == 'stratum' - - valid = True - - for chunk_ref in contents.get('chunks', []): - if 'morph' in chunk_ref: - chunk_path = os.path.join('.', chunk_ref['morph']) - if not os.path.exists(chunk_path): - # There's no way we can really fix this, so - # just warn and say the migration failed. - warnings.warn( - "%s points to non-existant file %s" % - (contents['name'], chunk_ref['morph'])) - valid = False - - return valid - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - safe_to_migrate = migrations.process_definitions( - kinds=['stratum'], validate_cb=check_missing_chunk_morphs) - - if not safe_to_migrate: - sys.stderr.write( - "Migration failed due to one or more warnings.\n") - sys.exit(1) - else: - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/003-arch-armv5.py b/migrations/003-arch-armv5.py deleted file mode 100755 index 58eb79de..00000000 --- a/migrations/003-arch-armv5.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 3. - -In version 3, there were two additions: - - - the 'armv5' architecture - - the install-essential-files.configure configuration extension - -This migration checks that neither of these are in use in the input (version 2) -definitions. Which isn't particularly useful. - -''' - - -import sys -import warnings - -import migrations - - -TO_VERSION = 3 - - -def check_arch(contents, filename): - assert contents['kind'] == 'system' - - valid = True - - if contents['arch'] == 'armv5': - warnings.warn( - "%s uses armv5 architecture that is not understood until version " - "3." % filename) - valid = False - - return valid - - -def check_configuration_extensions(contents, filename): - assert contents['kind'] == 'system' - - valid = True - - for extension in contents.get('configuration-extensions', []): - if extension == 'install-essential-files': - warnings.warn( - "%s uses install-essential-files.configure extension, which " - "was not present in morph.git until commit 423dc974a61f1c0 " - "(tag baserock-definitions-v3)." % filename) - valid = False - - return valid - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - safe_to_migrate = migrations.process_definitions( - kinds=['system'], validate_cb=check_arch) - safe_to_migrate = migrations.process_definitions( - kinds=['system'], validate_cb=check_configuration_extensions) - - if not safe_to_migrate: - sys.stderr.write( - "Migration failed due to one or more warnings.\n") - sys.exit(1) - else: - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/004-install-files-overwrite-symlink.py b/migrations/004-install-files-overwrite-symlink.py deleted file mode 100755 index 6853dcb5..00000000 --- a/migrations/004-install-files-overwrite-symlink.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - -'''Migration to Baserock Definitions format version 4. - -This change to the format was made to work around a bug in a deployment -extension present in morph.git. - -Automated migration is not really possible for this change, and unless you -are experiencing the install-files.configure extension crashing, you can ignore -it completely. - -We have now moved all .configure and .write extensions into the definitions.git -repository. Changes like this no longer require a marking a new version of the -Baserock definitions format in order to prevent build tools crashing. - -Morph commit c373f5a403b0ec introduces version 4 of the definitions format. In -older versions of Morph the install-files.configure extension would crash if it -tried to overwrite a symlink. This bug is fixed in the version of Morph that -can build definitions version 4. - -If you need to overwrite a symlink at deploytime using install-files.configure, -please use VERSION to 4 or above in your definitions.git repo so older versions -of Morph gracefully refuse to deploy, instead of crashing. - -''' - - -import sys - -import migrations - - -TO_VERSION = 4 - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/005-strip-commands.py b/migrations/005-strip-commands.py deleted file mode 100755 index da3de940..00000000 --- a/migrations/005-strip-commands.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 5. - -Version 5 of the definitions format adds a 'strip-commands' field that can -be set in chunk definitions. - -Version 5 also allows deployment extensions to live in definitions.git instead -of morph.git. This greatly reduces the interface surface of the Baserock -definitions format specification, because we no longer have to mark a new -version of the definitions format each time an extension in morph.git is added, -removed, or changes its API in any way. - -In commit 6f4929946 of git://git.baserock.org/baserock/baserock/definitions.git -the deployment extensions were moved into an extensions/ subdirectory, and the -system and cluster .morph files that referred to them were all updated to -prepend 'extension/' to the filenames. This migration doesn't (re)do that -change. - -''' - - -import sys -import warnings - -import migrations - - -TO_VERSION = 5 - - -def check_strip_commands(contents, filename): - assert contents['kind'] == 'chunk' - - valid = True - - if 'strip-commands' in contents: - warnings.warn( - "%s has strip-commands, which are not valid until version 5" % - filename) - valid = False - - return valid - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - safe_to_migrate = migrations.process_definitions( - kinds=['chunk'], validate_cb=check_strip_commands) - - if not safe_to_migrate: - sys.stderr.write( - "Migration failed due to one or more warnings.\n") - sys.exit(1) - else: - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/006-specify-build-system.py b/migrations/006-specify-build-system.py deleted file mode 100755 index b66736c6..00000000 --- a/migrations/006-specify-build-system.py +++ /dev/null @@ -1,354 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -# THIS MIGRATION REQUIRES NETWORK ACCESS TO A BASEROCK GIT CACHE SERVER! If -# you do not have your own Trove, or don't know what a Trove is, it should -# work as-is, provided you have internet access that allows access to -# http://git.baserock.org:8080/. -# -# If you do have your own Trove, change the value of TROVE_HOST below to -# point to it. -# -# This migration uses the same autodetection mechanism that Morph and YBD use -# at build time, in order to fill in the 'build-system' field in strata where -# it is now needed. - - -'''Migration to Baserock Definitions format version 6. - -In definitions version 6, build system autodetection no longer happens. This -means that any chunk that wants to use one of the predefined build systems -(those built into Morph) must say so explicitly, using the 'build-system' -field. - -The build-system field for a chunk can now be specified within a stratum that -contains it. Previously you needed to add a .morph file for a chunk in order to -specify its build-system, but we want to avoid needing a .morph file for -components that follow standard patterns. - -Previously, if build-system wasn't given, Morph would scan the contents of the -chunk's Git repo and try to autodetect which build system was used. This could -be slow, could fail in confusing ways, and meant that to fully parse -definitions you needed access to some or all of the repos they referenced. - -The chosen build-system affects which predefined command sequences are set for -a chunk. It is valid to omit the field if a chunk has its own build commands -defined in a .morph file. When listing the chunks included in a stratum, either -'morph' or 'build-system' must be specified, but not both (to avoid the -possibility of conflicting values). - -''' - - -import requests -import yaml - -import logging -import os -import sys -import warnings - -import migrations - - -TROVE_HOST = 'git.baserock.org' - -REPO_ALIASES = { - 'baserock:': 'git://%s/baserock/' % TROVE_HOST, - 'freedesktop:': 'git://anongit.freedesktop.org/', - 'github:': 'git://github.com/', - 'gnome:': 'git://git.gnome.org/', - 'upstream:': 'git://%s/delta/' % TROVE_HOST, -} - -GIT_CACHE_SERVER_URL = 'http://%s:8080/' % TROVE_HOST - -FAIL_ON_REMOTE_CACHE_ERRORS = False - - -TO_VERSION = 6 - - -# From ybd.git file repos.py at commit eb3bf397ba729387f0d4145a8df8d3c1f9eb707f - -def get_repo_url(repo): - for alias, url in REPO_ALIASES.items(): - repo = repo.replace(alias, url) - if repo.endswith('.git'): - repo = repo[:-4] - return repo - - -# Based on morph.git file buildsystem.py at commit a7748f9cdaaf4112c30d7c1. -# -# I have copied and pasted this code here, as it should not be needed anywhere -# once everyone has migrated to definitions version 6. - -class BuildSystem(object): - def used_by_project(self, file_list): - '''Does a project use this build system? - - ``exists`` is a function that returns a boolean telling if a - filename, relative to the project source directory, exists or not. - - ''' - raise NotImplementedError() # pragma: no cover - - -class ManualBuildSystem(BuildSystem): - - '''A manual build system where the morphology must specify all commands.''' - - name = 'manual' - - def used_by_project(self, file_list): - return False - - -class DummyBuildSystem(BuildSystem): - - '''A dummy build system, useful for debugging morphologies.''' - - name = 'dummy' - - def used_by_project(self, file_list): - return False - - -class AutotoolsBuildSystem(BuildSystem): - - '''The automake/autoconf/libtool holy trinity.''' - - name = 'autotools' - - def used_by_project(self, file_list): - indicators = [ - 'autogen', - 'autogen.sh', - 'configure', - 'configure.ac', - 'configure.in', - 'configure.in.in', - ] - - return any(x in file_list for x in indicators) - - -class PythonDistutilsBuildSystem(BuildSystem): - - '''The Python distutils build systems.''' - - name = 'python-distutils' - - def used_by_project(self, file_list): - indicators = [ - 'setup.py', - ] - - return any(x in file_list for x in indicators) - - -class CPANBuildSystem(BuildSystem): - - '''The Perl cpan build system.''' - - name = 'cpan' - - def used_by_project(self, file_list): - indicators = [ - 'Makefile.PL', - ] - - return any(x in file_list for x in indicators) - - -class CMakeBuildSystem(BuildSystem): - - '''The cmake build system.''' - - name = 'cmake' - - def used_by_project(self, file_list): - indicators = [ - 'CMakeLists.txt', - ] - - return any(x in file_list for x in indicators) - - -class QMakeBuildSystem(BuildSystem): - - '''The Qt build system.''' - - name = 'qmake' - - def used_by_project(self, file_list): - indicator = '.pro' - - for x in file_list: - if x.endswith(indicator): - return True - - return False - - -build_systems = [ - ManualBuildSystem(), - AutotoolsBuildSystem(), - PythonDistutilsBuildSystem(), - CPANBuildSystem(), - CMakeBuildSystem(), - QMakeBuildSystem(), - DummyBuildSystem(), -] - - -def detect_build_system(file_list): - '''Automatically detect the build system, if possible. - - If the build system cannot be detected automatically, return None. - For ``exists`` see the ``BuildSystem.exists`` method. - - ''' - for bs in build_systems: - if bs.used_by_project(file_list): - return bs - return None - - -## End of code based on morph.git file buildsystem.py. - -def get_toplevel_file_list_from_repo(url, ref): - '''Try to list the set of files in the root directory of the repo at 'url'. - - ''' - try: - response = requests.get( - GIT_CACHE_SERVER_URL + '1.0/trees', - params={'repo': url, 'ref': ref}, - headers={'Accept': 'application/json'}, - timeout=9) - logging.debug("Got response: %s" % response) - try: - response.raise_for_status() - toplevel_tree = response.json()['tree'] - except Exception as e: - raise RuntimeError( - "Unexpected response from server %s for repo %s: %s" % - (GIT_CACHE_SERVER_URL, url, e.message)) - toplevel_filenames = toplevel_tree.keys() - except requests.exceptions.ConnectionError as e: - raise RuntimeError("Unable to connect to cache server %s while trying " - "to query file list of repo %s. Error was: %s" % - (GIT_CACHE_SERVER_URL, url, e.message)) - return toplevel_filenames - - -def validate_chunk_refs(contents, filename): - assert contents['kind'] == 'stratum' - - valid = True - for chunk_ref in contents.get('chunks', []): - if chunk_ref.get('morph') is None: - # No chunk .morph file -- this stratum was relying on build-system - # autodetection here. - - if 'repo' not in chunk_ref: - warnings.warn("%s: Chunk %s doesn't specify a source repo." % - (filename, chunk_ref.get('name'))) - valid = False - - if 'ref' not in chunk_ref: - warnings.warn("%s: Chunk %s doesn't specify a source ref." % - (filename, chunk_ref.get('name'))) - valid = False - return valid - - -def move_dict_entry_last(dict_object, key, error_if_missing=False): - '''Move an entry in a ordered dict to the end.''' - - # This is a hack, I couldn't find a method on the 'CommentedMap' type dict - # that we receive from ruamel.yaml that would allow doing this neatly. - if key in dict_object: - value = dict_object[key] - del dict_object[key] - dict_object[key] = value - else: - if error_if_missing: - raise KeyError(key) - - -def ensure_buildsystem_defined_where_needed(contents, filename): - assert contents['kind'] == 'stratum' - - changed = False - for chunk_ref in contents.get('chunks', []): - if chunk_ref.get('morph') is None: - # No chunk .morph file -- this stratum was relying on build-system - # autodetection here. - - chunk_git_url = get_repo_url(chunk_ref['repo']) - chunk_git_ref = chunk_ref['ref'] - - try: - toplevel_file_list = get_toplevel_file_list_from_repo( - chunk_git_url, chunk_git_ref) - except Exception as e: - warnings.warn(str(e)) - message = ( - "Unable to look up one or more repos on remote Git " - "server %s. If you are using a Trove that is not %s, " - "please edit the TROVE_HOST constant in this script " - "and run it again." % (TROVE_HOST, TROVE_HOST)) - if FAIL_ON_REMOTE_CACHE_ERRORS: - raise RuntimeError(message) - else: - warnings.warn(message) - continue - - logging.debug( - '%s: got file list %s', chunk_git_url, toplevel_file_list) - build_system = detect_build_system(toplevel_file_list) - - chunk_ref['build-system'] = build_system.name - move_dict_entry_last(chunk_ref, 'build-depends') - - changed = True - - return changed - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - success = migrations.process_definitions( - kinds=['stratum'], - validate_cb=validate_chunk_refs, - modify_cb=ensure_buildsystem_defined_where_needed) - if not success: - sys.stderr.write( - "Migration failed due to one or more warnings.\n") - sys.exit(1) - else: - migrations.set_definitions_version(TO_VERSION) - sys.stderr.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stderr.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/007-defaults-in-definitions.py b/migrations/007-defaults-in-definitions.py deleted file mode 100755 index 489baf9b..00000000 --- a/migrations/007-defaults-in-definitions.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Migration to Baserock Definitions format version 7. - -Definitions version 7 adds a file named DEFAULTS which sets the default -build commands and default split rules for the set of definitions in that -repo. - -''' - - -import os -import shutil -import sys -import warnings - -import migrations - - -TO_VERSION = 7 - - - -try: - if migrations.check_definitions_version(TO_VERSION - 1): - if os.path.exists('DEFAULTS'): - warnings.warn( - "DEFAULTS file already exists in these definitions.") - valid = False - else: - shutil.copy( - 'migrations/007-initial-defaults', - 'DEFAULTS') - valid = True - - if valid: - migrations.set_definitions_version(TO_VERSION) - sys.stdout.write("Migration completed successfully.\n") - sys.exit(0) - else: - sys.stderr.write( - "Migration failed due to one or more warnings.\n") - sys.exit(1) - else: - if not os.path.exists('DEFAULTS'): - warnings.warn( - "These definitions are marked as version 7 but there is no " - "DEFAULTS file.") - sys.stdout.write("Nothing to do.\n") - sys.exit(0) -except RuntimeError as e: - sys.stderr.write("Error: %s\n" % e.message) - sys.exit(1) diff --git a/migrations/007-initial-defaults b/migrations/007-initial-defaults deleted file mode 100644 index ab034a0b..00000000 --- a/migrations/007-initial-defaults +++ /dev/null @@ -1,199 +0,0 @@ -# Baserock definitions defaults -# ============================= -# -# The DEFAULTS file is treated specially by Baserock build tools. -# -# For more information, see: <http://wiki.baserock.org/definitions/current>. - - -# Predefined build commands -# ------------------------- -# -# Common patterns in build instructions can be defined here, which can save -# users from having to write lots of similar-looking chunk .morph files. -# -# There are pre- and post- variants for each set of commands. These exist so -# you can add more commands without having to copy the defaults. For example, -# to create an extra symlink after running `make install`, you can use -# post-install-commands. Since these exist as a way of extending the defaults, -# you cannot set default values for the pre- and post- commands. -# -# The set of environment variables available when these commands are executed -# is not formally specified right now, but you can assume PREFIX, DESTDIR and -# MORPH_ARCH are all set. -# -build-systems: - manual: - # The special, default 'no-op' build system. - configure-commands: [] - build-commands: [] - install-commands: [] - strip-commands: [] - - autotools: - # GNU Autoconf and GNU Automake, or anything which follow the same pattern. - # - # See also: https://github.com/cgwalters/build-api/blob/master/build-api.md - configure-commands: - - >- - export NOCONFIGURE=1; - if [ -e autogen ]; then ./autogen; - elif [ -e autogen.sh ]; then ./autogen.sh; - elif [ -e bootstrap ]; then ./bootstrap; - elif [ -e bootstrap.sh ]; then ./bootstrap.sh; - elif [ ! -e ./configure ]; then autoreconf -ivf; - fi - - ./configure --prefix="$PREFIX" - build-commands: - - make - install-commands: - - make DESTDIR="$DESTDIR" install - strip-commands: - # TODO: Make idempotent when files are hardlinks - # Strip all ELF binary files that are executable or named like a library. - # .so files for C, .cmxs for OCaml and .node for Node. - # - # The file name and permissions checks are done with the `find` command before - # the ELF header is checked with the shell command, because it is a lot cheaper - # to check the mode and file name first, because it is a metadata check, rather - # than a subprocess and a file read. - # - # `file` is not used, to keep the dependency requirements down. - - &generic-strip-command | - find "$DESTDIR" -type f \ - '(' -perm -111 -o -name '*.so*' -o -name '*.cmxs' -o -name '*.node' ')' \ - -exec sh -ec \ - 'read -n4 hdr <"$1" # check for elf header - if [ "$hdr" != "$(printf \\x7fELF)" ]; then - exit 0 - fi - debugfile="$DESTDIR$PREFIX/lib/debug/$(basename "$1")" - mkdir -p "$(dirname "$debugfile")" - objcopy --only-keep-debug "$1" "$debugfile" - chmod 644 "$debugfile" - strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1" - objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';' - - python-distutils: - # The Python distutils build systems. - configure-commands: [] - build-commands: - - python setup.py build - install-commands: - - python setup.py install --prefix "$PREFIX" --root "$DESTDIR" - strip-commands: - - *generic-strip-command - - cpan: - # The Perl ExtUtil::MakeMaker build system. This is called the 'cpan' build - # system for historical reasons. - # - # To install perl distributions into the correct location in our chroot - # we need to set PREFIX to <destdir>/<prefix> in the configure-commands. - # - # The mapping between PREFIX and the final installation - # directories is complex and depends upon the configuration of perl - # see, - # https://metacpan.org/pod/distribution/perl/INSTALL#Installation-Directories - # and ExtUtil::MakeMaker's documentation for more details. - configure-commands: - - perl Makefile.PL PREFIX=$DESTDIR$PREFIX - build-commands: - - make - install-commands: - - make install - strip-commands: - - *generic-strip-command - - module-build: - # The Module::Build build system - # - # See the comment in ExtUtilsMakeMakerBuildSystem to see why --prefix is - # set to $DESTDIR$PREFIX here (--prefix in Module::Build has the same - # meaning as PREFIX in ExtUtils::MakeMaker). - configure-commands: - - perl Build.PL --prefix "$DESTDIR$PREFIX" - build-commands: - - ./Build - install-commands: - - ./Build install - strip-commands: - - *generic-strip-command - - cmake: - # The CMake build system. - configure-commands: - - cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" - build-commands: - - make - install-commands: - - make DESTDIR="$DESTDIR" install - strip-commands: - - *generic-strip-command - - qmake: - # The Qt build system. - configure-commands: - - qmake -makefile - build-commands: - - make - install-commands: - - make INSTALL_ROOT="$DESTDIR" install - strip-commands: - - *generic-strip-command - - -# Predefined artifact splitting rules -# ----------------------------------- -# -# Once a build has completed, you have some files that have been installed into -# $DESTDIR. The splitting rules control how many 'artifact' tarballs are -# generated as a result of the build, and which files from $DESTDIR end up in -# which 'artifact'. -# -# The default split rules are defined here. These can be overriden in -# individual chunk .morph files and stratum .morph files using the 'products' -# field. -# -split-rules: - chunk: - - artifact: -bins - include: - - (usr/)?s?bin/.* - - artifact: -libs - include: - - (usr/)?lib(32|64)?/lib[^/]*\.so(\.\d+)* - - (usr/)libexec/.* - - artifact: -devel - include: - - (usr/)?include/.* - - (usr/)?lib(32|64)?/lib.*\.a - - (usr/)?lib(32|64)?/lib.*\.la - - (usr/)?(lib(32|64)?|share)/pkgconfig/.*\.pc - - artifact: -doc - include: - - (usr/)?share/doc/.* - - (usr/)?share/man/.* - - (usr/)?share/info/.* - - artifact: -locale - include: - - (usr/)?share/locale/.* - - (usr/)?share/i18n/.* - - (usr/)?share/zoneinfo/.* - - artifact: -misc - include: - - .* - - stratum: - - artifact: -devel - include: - - .*-devel - - .*-debug - - .*-doc - - artifact: -runtime - include: - - .*-bins - - .*-libs - - .*-locale - - .*-misc - - .* diff --git a/migrations/GUIDELINES b/migrations/GUIDELINES deleted file mode 100644 index 3694e2c9..00000000 --- a/migrations/GUIDELINES +++ /dev/null @@ -1,35 +0,0 @@ -Guidelines for writing migrations ---------------------------------- - -All changes to the definitions format must have a migration, but it is valid -for the migration to do nothing except update the version number (see -004-install-files-overwrite-symlink.py for an example of that). - -This small set of rules exists to ensure that the migrations are consistent and -easy to understand. If you are writing a migration and these rules don't make -any sense, we should probably change them. Please sign up to the -baserock-dev@baserock.org mailing list to suggest the change. - -- Write migrations in Python. They must be valid Python 3. For now, since - only Python 2 is available in Baserock 'build' and 'devel' reference systems - up to the 15.25 release of Baserock, they must also be valid Python 2. - -- Don't use any external libraries. - -- Follow the existing file naming pattern, and the existing code convention. - -- Keep the migration code as simple as possible. - -- Avoid crashing on malformed input data, where practical. For example, use - contents.get('field') instead of contents['field'] to avoid crashing when - 'field' is not present. The idea of this is to avoid a "cascade of errors" - problem when running the migrations on bad inputs. It is confusing when - migrations break on problems that are unrelated to the actual area where - they operate, even if they are theoretically "within their rights" to do so. - -- Migrate the definitions in line with current best practices. For example, - migrations/001-empty-build-depends.py doesn't need to remove empty - build-depends fields: they are still valid in version 1 of the format. But - best practice is now to remove them. Users who don't agree with this practice - can choose to not run that migration, which can be done with `chmod -x - migrations/xxx.py`. diff --git a/migrations/indent b/migrations/indent deleted file mode 100755 index 8d6f034f..00000000 --- a/migrations/indent +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Automatically reformat a set of Baserock definition files. - -This tool expects to be able to use ruamel.yaml to load and write YAML. -It will totally ruin things if used with PyYAML. - -It makes sense to run this script on your definitions, and check through -and commit the result, before running any of the automated migrations. This -way, you can be sure that the migrations will only change things that they need -to in the .morph files. - -''' - - -import migrations - - -def force_rewrite(contents, filename): - return True - -migrations.process_definitions(path='.', modify_cb=force_rewrite) diff --git a/migrations/migrations.py b/migrations/migrations.py deleted file mode 100644 index 22ed1328..00000000 --- a/migrations/migrations.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Tools for migrating Baserock definitions from one format version to another. - -''' - - -# ruamel.yaml is a fork of PyYAML which allows rewriting YAML files without -# destroying all of the comments, ordering and formatting. The more -# widely-used PyYAML library will produce output totally different to the -# input file in most cases. -# -# See: <https://bitbucket.org/ruamel/yaml> -import ruamel.yaml as yaml - -import logging -import os -import warnings - - -# Uncomment this to cause all log messages to be written to stdout. By -# default they are hidden, but if you are debugging something this might help! -# -# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) - - -def pretty_warnings(message, category, filename, lineno, - file=None, line=None): - '''Format warning messages from warnings.warn().''' - return 'WARNING: %s\n' % (message) - -# Override the default warning formatter (which is ugly), and add a filter to -# ensure duplicate warnings only get displayed once. -warnings.simplefilter("once", append=True) -warnings.formatwarning = pretty_warnings - - - -def parse_yaml_with_roundtrip_info(text): - return yaml.load(text, yaml.RoundTripLoader) - -def write_yaml_with_roundtrip_info(contents, stream, **kwargs): - yaml.dump(contents, stream, Dumper=yaml.RoundTripDumper, **kwargs) - - - -class VersionFileError(RuntimeError): - '''Represents errors in the version marker file (./VERSION).''' - pass - - -class MigrationOutOfOrderError(RuntimeError): - '''Raised if a migration is run on too old a version of definitions. - - It's not an error to run a migration on a version that is already migrated. - - ''' - pass - - -def check_definitions_version(from_version, version_file='./VERSION', - to_version=None): - '''Check if migration between 'from_version' and 'to_version' is needed. - - Both 'from_version' and 'to_version' should be whole numbers. The - 'to_version' defaults to from_version + 1. - - This function reads the version marker file specified by 'version_file'. - Returns True if the version is between 'from_version' and 'to_version', - indicating that migration needs to be done. Returns False if the version is - already at or beyond 'to_version'. Raises MigrationOutOfOrderError if the - version is below 'from_version'. - - If 'version_file' is missing or invalid, it raises VersionFileError. The - version file is expected to follow the following format: - - version: 1 - - ''' - to_version = to_version or (from_version + 1) - need_to_migrate = False - - if os.path.exists(version_file): - logging.info("Found version information file: %s" % version_file) - - with open(version_file) as f: - version_text = f.read() - - if len(version_text) == 0: - raise VersionFileError( - "File %s exists but is empty." % version_file) - - try: - version_info = yaml.safe_load(version_text) - current_version = version_info['version'] - - if current_version >= to_version: - logging.info( - "Already at version %i." % current_version) - elif current_version < from_version: - raise MigrationOutOfOrderError( - "This tool expects to migrate from version %i to version " - "%i of the Baserock Definitions syntax. These definitions " - "claim to be version %i." % ( - from_version, to_version, current_version)) - else: - logging.info("Need to migrate from %i to %i.", - current_version, to_version) - need_to_migrate = True - except (KeyError, TypeError, ValueError) as e: - logging.exception(e) - raise VersionFileError( - "Invalid version info: '%s'" % version_text) - else: - raise VersionFileError( - "No file %s was found. Please run the migration scripts in order," - "starting from 000-version-info.py." % version_file) - - return need_to_migrate - - -def set_definitions_version(new_version, version_file='./VERSION'): - '''Update the version information stored in 'version_file'. - - The new version must be a whole number. If 'version_file' doesn't exist, - it will be created. - - ''' - version_info = {'version': new_version} - with open(version_file, 'w') as f: - # If 'default_flow_style' is True (the default) then the output here - # will look like "{version: 0}" instead of "version: 0". - yaml.safe_dump(version_info, f, default_flow_style=False) - - -def walk_definition_files(path='.', extensions=['.morph']): - '''Recursively yield all files under 'path' with the given extension(s). - - This is safe to run in the top level of a Git repository, as anything under - '.git' will be ignored. - - ''' - for dirname, dirnames, filenames in os.walk('.'): - filenames.sort() - dirnames.sort() - if '.git' in dirnames: - dirnames.remove('.git') - for filename in filenames: - for extension in extensions: - if filename.endswith(extension): - yield os.path.join(dirname, filename) - - -ALL_KINDS = ['cluster', 'system', 'stratum', 'chunk'] - - -def process_definitions(path='.', kinds=ALL_KINDS, validate_cb=None, - modify_cb=None): - '''Run callbacks for all Baserock definitions found in 'path'. - - If 'validate_cb' is set, it will be called for each definition and can - return True or False to indicate whether that definition is valid according - a new version of the format. The process_definitions() function will return - True if all definitions were valid according to validate_cb(), and False - otherwise. - - If 'modify_cb' is set, it will be called for each definition and can - modify the 'content' dict. It should return True if the dict was modified, - and in this case the definition file will be overwritten with the new - contents. The 'ruamel.yaml' library is used if it is available, which will - try to preserve comments, ordering and some formatting in the YAML - definition files. - - If 'validate_cb' is set and returns False for a definition, 'modify_cb' - will not be called. - - Both callbacks are passed two parameters: a dict containing the contents of - the definition file, and its filename. The filename is passed so you can - use it when reporting errors. - - The 'kinds' setting can be used to ignore some definitions according to the - 'kind' field. - - ''' - all_valid = True - - for filename in walk_definition_files(path=path): - with open(filename) as f: - text = f.read() - - if modify_cb is None: - contents = yaml.load(text) - else: - contents = parse_yaml_with_roundtrip_info(text) - - if 'kind' in contents: - if contents['kind'] in kinds: - valid = True - changed = False - - if validate_cb is not None: - valid = validate_cb(contents, filename) - all_valid &= valid - - if valid and modify_cb is not None: - changed = modify_cb(contents, filename) - - if changed: - with open(filename, 'w') as f: - write_yaml_with_roundtrip_info(contents, f, width=80) - else: - warnings.warn("%s is invalid: no 'kind' field set." % filename) - - return all_valid diff --git a/migrations/run-all b/migrations/run-all deleted file mode 100755 index 5a817ee5..00000000 --- a/migrations/run-all +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -'''Run a set of migration scripts. - -This script does exactly what `PYTHONPATH=. run-parts --exit-on-error` would -do. I avoided using 'run-parts' purely because the implementation in Fedora 22 -doesn't have an '--exit-on-error' option. The Busybox and Debian -implementations do have that option. - -Please fix run-parts in https://git.fedorahosted.org/cgit/crontabs.git/tree/ -so we can simplify this script :-) - -''' - - -import os -import subprocess -import sys - - -if len(sys.argv) == 2: - migration_dir = sys.argv[1] -elif len(sys.argv) == 1: - migration_dir = os.path.dirname(__file__) -else: - sys.stderr.write("Usage: %s [MIGRATION_DIR]\n" % sys.argv[0]) - sys.exit(1) - - -def is_executable(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - -env = os.environ -if 'PYTHONPATH' in env: - env['PYTHONPATH'] = env['PYTHONPATH'] + ':' + migration_dir -else: - env['PYTHONPATH'] = migration_dir - -try: - migrations_found = 0 - for fname in sorted(os.listdir(migration_dir)): - migration_fpath = os.path.join(migration_dir, fname) - if is_executable(migration_fpath): - if not os.path.samefile(migration_fpath, __file__) and \ - fname != 'indent': - migrations_found += 1 - sys.stdout.write(migration_fpath + ":\n") - subprocess.check_call( - migration_fpath, env=env) - - if migrations_found == 0: - sys.stderr.write("No migration files found in '%s'\n" % migration_dir) - sys.exit(1) - else: - sys.exit(0) - -except (subprocess.CalledProcessError, RuntimeError) as e: - sys.stderr.write(str(e) + '\n') - sys.exit(1) diff --git a/schemas/README.schemas b/schemas/README.schemas deleted file mode 100644 index a7789187..00000000 --- a/schemas/README.schemas +++ /dev/null @@ -1,137 +0,0 @@ -Schemas for the Baserock definitions format -=========================================== - -The starting point for learning about the Baserock definitions format is the -wiki page at <http://wiki.baserock.org/definitions/>. - -The schemas/ directory in the Baserock reference definitions.git repository is -the canonical home for some schemas which describe the format in a -machine-readable way. - -There are two parts to 'Baserock definitions'. The 'Baserock data model' is an -abstract vocabulary for describing how to build, integrate and deploy software -components. The 'Baserock definitions YAML representation format' is a -serialisation format for the data model, which lets you write YAML files -describing how to build, integrate and deploy software components. - -If you want to make the YAML files easier to deal with, you only need -to care about the JSON-Schema schemas and anything that parses the YAML files. - -If you want to write a new tool to build, visualise, analyse or otherwise -process Baserock definitions in some way, you can ignore the syntax altogether, -use a pre-existing parser, and just think in terms of the data -model. - -If you want to change the data model, you still have quite a difficult job, -but at least it should be simple to write a translation layer on top of an -existing parser so that you can interpret all the existing Baserock reference -system definitions in terms of your new data model. - - -The Baserock definitions YAML representation format ---------------------------------------------------- - -YAML itself is a syntax for representating data as text. The YAML specification -is at <http://www.yaml.org/>. - -The data needs to be structured in a certain way for it to make sense as -Baserock build/integration/deployment instructions. We have used JSON-Schema -to describe the required layout of the data. - -The JSON-Schema standard is described at <http://json-schema.org/>. The -JSON-Schema language was designed for use with JSON, which is another syntax -for representing data as text, which happens to be a subset of YAML. We have -found so far that JSON-Schema works well with YAML, at least when using the -Python 'jsonschema' module. - -Definitions are represented by files with a '.morph' extension. There are four -different kinds: 'chunk', 'stratum', 'system', and 'cluster'. Each of these is -described with a different .json-schema file. It is possible to merge all these -into one file, and use the 'oneOf' field to say that any .morph file should -match exactly one of the layouts. The only issue with this approach is that -the Python 'jsonschema' model will give you totally useless errors if anything -is invalid (along the lines of "<dump of entire file> is not valid under any of -the given schemas"). So for now they are separate. - - -Tools for working with the Baserock YAML schemas ------------------------------------------------- - -You can use `scripts/yaml-jsonschema` to validate .morph files against the -schemas. For example: - - scripts/yaml-jsonschema schemas/cluster.json-schema clusters/*.morph - - -The Baserock data model ------------------------ - -The best way to represent information on disk may be a pretty inefficient way -to represent that data in a computer's memory. Likewise, the way a program -stores data internally may be totally impractical for people to edit directly. - -The file `baserock.owl` is an initial effort to describe the Baserock data -model independently of any syntax or representation. - -We use the W3C standard Web Ontology Language (OWL), combined with the much -simpler RDF Schema language. Together, this allows defining the vocabulary we -can use to define build, integration and deployment instructions. There are -various ways to represent OWL 'ontologies'; `baserock.owl` uses a -representation format named Turtle, which is designed to be convenient for -hand-editing. - -The current data model is very closely tied to the current syntax, but we are -looking to change this and make it much more generic. This will involve -removing the current 'Chunk', 'Stratum', 'System' and 'Cluster' classes, and -adding something like 'thing with build instructions' and 'thing that contains -other things' instead. Name suggestions are welcome :-) - -It's useful to consider existing OWL and RDF Schema vocabularies that are -related to the Baserock data model. In future we can link the Baserock -reference system definitions with related data published elsewhere on the Web. -Here is an incomplete list: - - - Description of a Project (DOAP): https://github.com/edumbill/doap - - Software Ontology: https://robertdavidstevens.wordpress.com/2014/06/19/the-software-ontology-swo/ - - Software Packet Data Exchange (SPDX): https://spdx.org/about-spdx/what-is-spdx - - -Tools for working with the Baserock data model schema ------------------------------------------------------ - -It's difficult to find to a short, relevant 'getting started' guide. The -website http://www.linkeddata.org/ has a lot of background that should be -useful. - -The `rapper` commandline tool, which comes as part of the 'raptor2' C library, -is helpful for converting from one syntax to another, and checking if -`baserock.owl` is valid Turtle syntax. The 'raptor2' homepage is -<http://www.librdf.org/>. - -To check the syntax of `baserock.owl` using `rapper`: - - rapper -i turtle schemas/baserock.owl - - -Omissions / TODO items ----------------------- - -- Device nodes: chunk .morph files can list a set of device nodes. In - `chunk.json-schema` this is recognised, but in `baserock.owl` it is missing. - -- 'Lorry' mirroring instructions. These contain information on where 'upstream' - source code is kept, which should be considered part of the data model. A - JSON schema may be better off in lorry.git or - baserock/local-config/lorries.git. - -- Metadata in built systems. This is currently not standardised at all. - - -Comments --------- - -As far as I know, Baserock is the first project to treat build, integration and -deployment instructions as data rather than code. If you have questions about -the schemas, the definitions format, or the overall approach, and they aren't -answered here or in <http://wiki.baserock.org/definitions/>, then please ask on -the baserock-dev@baserock.org mailing list. diff --git a/schemas/baserock.owl b/schemas/baserock.owl deleted file mode 100644 index 33113d84..00000000 --- a/schemas/baserock.owl +++ /dev/null @@ -1,295 +0,0 @@ -# Copyright (C) 2015 Codethink Limited -# -# 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; version 2 of the License. -# -# 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. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - - -# This schema describes the Baserock data model. It describes how the data -# can be represented in computer memory, it doesn't specify anything about -# how it should be stored on disk or transferred. -# -# Please see README.schemas, and http://wiki.baserock.org/definitions/current/ -# for more information. -# -# This is not a brilliant schema, in Linked Data terms, because it's using -# Baserock-specific terminology and a rigid layout, instead of being a generic -# vocabulary for describing how to assemble software. However, it maps closely -# to the format that the existing Baserock reference system definitions use. -# We hope to produce a simpler and more flexible 2.x version of this schema in -# future. - - -# Partial OWL and RDF Schema glossary: -# -# domain: the set of objects that a can have a property. -# range: the set of possible values for a property. -# -# ObjectProperty: -# a property whose value must be another resource. -# DatatypeProperty: -# a property whose value is one of the datatype defined by XML Schema ("xsd") -# FunctionalProperty: -# a property which can only have one value per resource -# InverseFunctionalProperty: -# a property which can only have one resource per value - - -# Metadata - -@prefix : <http://baserock.org/definitions/example-schema#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix dc: <http://purl.org/dc/elements/1.1/> . - -: a owl:Ontology ; - dc:title "Schema for Baserock data model" ; - dc:creator "The Baserock Project" ; - # Versioned according to Semantic Versioning http://www.semver.org/ - owl:versionInfo "0.9.0" . - - -## Entities - -# Source definitions - -:Morphology a owl:Class ; - rdfs:comment "A definition file." . - -:Cluster a owl:Class ; - rdfs:subClassOf :Morphology ; - rdfs:comment "Instructions for deploying one or systems." ; - owl:disjointWith :System, :Stratum, :Chunk . - -:System a owl:Class ; - rdfs:subClassOf :Morphology ; - rdfs:comment "A collection of strata in a form that can be executed." ; - owl:disjointWith :Cluster, :Stratum, :Chunk . - -:Stratum a owl:Class ; - rdfs:subClassOf :Morphology ; - rdfs:comment "A set of related chunks." ; - owl:disjointWith :Cluster, :System, :Chunk . - -:Chunk a owl:Class ; - rdfs:subClassOf :Morphology ; - rdfs:comment "An individual component, that can be built from a Git repository." ; - owl:disjointWith :Cluster, :System, :Stratum . - -# Container contents - -:SystemDeployment a owl:Class ; - rdfs:comment "Information for deploying one system of a cluster." . - -:ChunkReference a owl:Class ; - rdfs:comment "An instance of a chunk within a stratum." . - -# Products (for artifact split rules). - -:Artifact a owl:Class ; - rdfs:comment "One part of the result of building a morphology. The output of a build is split according to patterns, so there are multiple artifacts produced for a given source." . - -:StratumArtifact a owl:Class ; - rdfs:subClassOf :Artifact ; - rdfs:comment "Part of the result of building a stratum." ; - owl:disjointWith :ChunkArtifact. - -:ChunkArtifact a owl:Class ; - rdfs:subClassOf :Artifact ; - rdfs:comment "Part of the result of building a chunk." ; - owl:disjointWith :StratumArtifact. - - -## Shared properties - -# 'name' becomes part of the URL when we import definition .morph files as RDF, -# so it doesn't need a property. - -# Use dc:description for 'description', see: -# http://dublincore.org/documents/2012/06/14/dcmi-terms/?v=terms#terms-description - - -## Cluster-specific properties - -:containsSystemDeployment a owl:ObjectProperty ; - rdfs:domain :Cluster ; - rdfs:range :SystemDeployment ; - owl:minCardinality 1 . - - -## SystemDeployment-specific properties - -:deploysSystem a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :SystemDeployment ; - rdfs:range :System . - -:hasLabel a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :SystemDeployment ; - rdfs:range xsd:string . - -:hasType a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :SystemDeployment ; - rdfs:range xsd:string ; - rdfs:comment "The .write extension used to perform the deployment." . - -:hasLocation a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :SystemDeployment ; - rdfs:range xsd:string ; - rdfs:comment "Deployment location. This is passed to the selected .write extension" . - -# FIXME: this is actually a key-value mapping, how do you do that in RDF properly? -:hasConfigurationSetting a owl:DatatypeProperty ; - rdfs:domain :SystemDeployment ; - rdfs:range xsd:string ; - rdfs:comment "Arbitrary key=value pair that is set in the environment of the .configure and .write extensions during deployment." . - - -## System-specific properties - -:containsStratumArtifact a owl:ObjectProperty ; - rdfs:domain :System ; - rdfs:range :StratumArtifact ; - owl:minCardinality 1 . - -# A build tool will only understand a certain set of architectures, but I think -# that should not be part of the data model. -:hasArchitecture a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :System ; - rdfs:range xsd:string . - -:hasConfigurationExtension a owl:DatatypeProperty ; - rdfs:domain :System ; - rdfs:range xsd:string ; - rdfs:comment "A .configure extension to be run when with system is deployed." . - - -## Stratum-specific properties - -:producesStratumArtifact a owl:ObjectProperty , rdf:Seq ; - rdfs:domain :Stratum ; - rdfs:range :StratumArtifact ; - rdfs:comment "iDescribes how this artifact is split once all chunks are built." . - -:hasStratumBuildDependency a owl:ObjectProperty ; - rdfs:domain :Stratum ; - rdfs:range :Stratum . - -:containsChunkReference a owl:ObjectProperty ; - rdfs:domain :Stratum ; - rdfs:range :ChunkReference ; - owl:minCardinality 1 . - - -## ChunkReference-specific properties - -:refersToChunk a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range :Chunk . - -:repo a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range xsd:string ; - rdfs:comment "Git repo that this chunk's build instructions should be run in. Can be a keyed URL according to the repo-alias mapping, which isn't currently defined in this data model." . - -:ref a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range xsd:string ; - rdfs:comment "Ref of the Git repo that should be checked out before building. Usually a SHA1." . - -:unpetrifyRef a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range xsd:string ; - rdfs:comment "Name of the ref that should be checked out (useful when 'ref' is a SHA1 to keep track of the actual branch/tag name)." . - -:hasChunkBuildDependency a owl:ObjectProperty ; - rdfs:domain :ChunkReference ; - rdfs:range :Chunk . - -:prefix a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range xsd:string ; - rdfs:comment "Value of the PREFIX environment variable in the build environment (defaults to /usr)" . - -# FIXME: it's possible to specify in OWL that 'bootstrap' and 'normal' are the -# only valid values. -:buildMode a owl:DatatypeProperty , owl:FunctionalProperty ; - rdfs:domain :ChunkReference ; - rdfs:range xsd:string . - - -## Chunk-specific properties - -# build-system isn't included here, as it overlaps with the *-commands -# fields in an unfortunate way. - -# Note that representing lists of things in RDF is a bit of a pain. -# http://smiy.sourceforge.net/olo/spec/orderedlistontology.html might -# be worth investigating. - -:producesChunkArtifact a owl:ObjectProperty , rdf:Seq ; - rdfs:domain :Chunk ; - rdfs:range :ChunkArtifact ; - rdfs:comment "Describes how this artifact is split once built." . - -:maxJobs a owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range xsd:integer ; - rdfs:comment "Number of parallel jobs that can be run for this chunk. Only useful if set to 1, to mark components which have Makefiles that do not work with `make -j N`.". - -:CommandSequence a owl:Class ; - rdfs:subClassOf rdf:Seq ; - rdfs:comment "An ordered sequence of commands." . - -:preConfigureCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:configureCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:postConfigureCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:preBuildCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:buildCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:postBuildCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:preInstallCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:installCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - -:postInstallCommands a owl:ObjectProperty , owl:FunctionalProperty ; - rdfs:domain :Chunk ; - rdfs:range :CommandSequence . - - -# Artifact properties - -:includes a owl:DatatypeProperty , rdf:Seq ; - rdfs:domain :Artifact ; - rdfs:range xsd:string ; - rdfs:comment "A regular expression pattern. The results of a build are matched against this pattern and any that match will be included in that artifact." . diff --git a/schemas/chunk.json-schema b/schemas/chunk.json-schema deleted file mode 100644 index 8de2fb5f..00000000 --- a/schemas/chunk.json-schema +++ /dev/null @@ -1,116 +0,0 @@ -$schema: http://json-schema.org/draft-04/schema# -id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/chunk.json-schema - -description: | - This is a JSON-Schema description of a 'chunk' .morph file, which is part of - the Baserock definitions YAML representation format. - - This JSON-Schema file is valid for VERSION 7 of the Baserock definitions - YAML serialisation format. - - The Baserock definitions format is the recommended way of representing - Baserock definitions on disk. The actual data model is described separately. - See https://wiki.baserock.org/definitions for more information. - - This schema is represented as YAML, so that it can be edited more easily. - You may need to convert to JSON if using a JSON-Schema tool that expects - its input to be an actual string containing data serialised as JSON. - -definitions: - # Corresponds to CommandSequence in Baserock data model. - command-sequence: - type: array - items: { type: string } - - # Corresponds to DeviceNode in Baserock data model. - device-node: - type: object - required: [type, filename, gid, uid, major, minor, permissions] - properties: - type: { type: string } - filename: { type: string } - gid: { type: integer } - uid: { type: integer } - major: { type: integer } - minor: { type: integer } - permissions: { type: string } - - # Defines one or more instances of ChunkArtifact from the Baserock data model. - split-rules: - type: array - items: - type: object - - required: [artifact, include] - additionalProperties: false - - properties: - artifact: {type: string} - include: - type: array - items: - type: string - format: regex - - system-integration-commands: - type: object - patternProperties: - # The property name here should correspond to the name of the chunk's - # artifacts, probably the '-bins' artifact if you are using the normal - # splitting rules. - ^.*$: - type: object - patternProperties: - ^.*$: - $ref: "#/definitions/command-sequence" - -# Corresponds to Chunk in Baserock data model. -type: object - -additionalProperties: false -required: [ 'name', 'kind'] - -properties: - name: { type: string } - kind: { enum: [ "chunk" ] } - - description: { type: string } - - build-system: { type: string } - max-jobs: { type: integer } - - products: - $ref: "#/definitions/split-rules" - - pre-configure-commands: - $ref: "#/definitions/command-sequence" - configure-commands: - $ref: "#/definitions/command-sequence" - post-configure-commands: - $ref: "#/definitions/command-sequence" - pre-build-commands: - $ref: "#/definitions/command-sequence" - build-commands: - $ref: "#/definitions/command-sequence" - post-build-commands: - $ref: "#/definitions/command-sequence" - pre-install-commands: - $ref: "#/definitions/command-sequence" - install-commands: - $ref: "#/definitions/command-sequence" - post-install-commands: - $ref: "#/definitions/command-sequence" - pre-strip-commands: - $ref: "#/definitions/command-sequence" - strip-commands: - $ref: "#/definitions/command-sequence" - post-strip-commands: - $ref: "#/definitions/command-sequence" - - system-integration: - $ref: "#/definitions/system-integration-commands" - - devices: - type: array - items: - $ref: "#/definitions/device-node" diff --git a/schemas/cluster.json-schema b/schemas/cluster.json-schema deleted file mode 100644 index 1a628c7f..00000000 --- a/schemas/cluster.json-schema +++ /dev/null @@ -1,64 +0,0 @@ -$schema: http://json-schema.org/draft-04/schema# -id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/cluster.json-schema - -description: - This is a JSON-Schema description of a 'cluster' .morph file, which is part - of the Baserock definitions YAML representation format. - - This JSON-Schema file is valid for VERSION 7 of the Baserock definitions - YAML serialisation format. - - The Baserock definitions format is the recommended way of representing - Baserock definitions on disk. The actual data model is described separately. - See https://wiki.baserock.org/definitions for more information. - - This schema is represented as YAML, so that it can be edited more easily. - You may need to convert to JSON if using a JSON-Schema tool that expects - its input to be an actual string containing data serialised as JSON. - -definitions: - # A reference to a System, plus one or more SystemDeployment for that system. - system-deployment-set: - type: object - - required: [ 'morph', 'deploy' ] - additionalProperties: false - - properties: - morph: { type: string } - deploy-defaults: - type: object - additionalProperties: true - deploy: - patternProperties: - ^.*$: { $ref: "#/definitions/system-deployment" } - subsystems: - type: array - items: { $ref: "#/definitions/system-deployment-set" } - - # Corresponds to SystemDeployment in Baserock data model. - system-deployment: - type: object - - required: [ 'type', 'location' ] - additionalProperties: true - - properties: - type: { type: string } - location: { type: string } - - -# Corresponds to Cluster in Baserock data model. -type: object - -#required: [ 'name', 'kind', 'systems' ] -additionalProperties: false - -properties: - name: { type: string } - kind: { enum: [ "cluster" ] } - description: { type: string } - - systems: - type: array - items: { $ref: "#/definitions/system-deployment-set" } diff --git a/schemas/defaults.json-schema b/schemas/defaults.json-schema deleted file mode 100644 index 2f713425..00000000 --- a/schemas/defaults.json-schema +++ /dev/null @@ -1,66 +0,0 @@ -$schema: http://json-schema.org/draft-04/schema# -id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/defaults.json-schema - -description: | - This is a JSON-Schema description of the DEFAULTS file specified in the - Baserock definitions format. DEFAULTS is a YAML file that contains global - defaults for a set of Baserock definitions. - - This JSON-Schema file is valid for VERSION 7 of the Baserock definitions - YAML serialisation format. - - The Baserock definitions YAML serialisation format is the recommended way of - representing Baserock definitions on disk. The actual data model is described - separately. See <https://wiki.baserock.org/definitions> for more information. - - This schema is represented as YAML, so that it can be edited more easily. - You may need to convert to JSON if using a JSON-Schema tool that expects - its input to be an actual string containing data serialised as JSON. - -definitions: - command-sequence: - type: array - items: {type: string} - - build-system: - type: object - additionalProperties: false - properties: - build-commands: {$ref: '#/definitions/command-sequence'} - configure-commands: {$ref: '#/definitions/command-sequence'} - install-commands: {$ref: '#/definitions/command-sequence'} - strip-commands: {$ref: '#/definitions/command-sequence'} - - split-rules: - type: array - items: - type: object - - required: [artifact, include] - additionalProperties: false - - properties: - artifact: {type: string} - include: - type: array - items: - type: string - format: regex - -type: object -additionalProperties: false - -properties: - # Predefined build systems. - build-systems: - type: object - patternProperties: - ^.*$: {$ref: '#/definitions/build-system'} - - # Predefined artifact splitting rules. - split-rules: - type: object - additionalProperties: false - properties: - chunk: {$ref: '#/definitions/split-rules'} - stratum: {$ref: '#/definitions/split-rules'} diff --git a/schemas/stratum.json-schema b/schemas/stratum.json-schema deleted file mode 100644 index 0330f37d..00000000 --- a/schemas/stratum.json-schema +++ /dev/null @@ -1,99 +0,0 @@ -$schema: http://json-schema.org/draft-04/schema# -id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/chunk.json-schema - -description: | - This is a JSON-Schema description of a 'stratum' .morph file, which is part - of the Baserock definitions YAML representation format. - - This JSON-Schema file is valid for VERSION 7 of the Baserock definitions - YAML serialisation format. - - The Baserock definitions format is the recommended way of representing - Baserock definitions on disk. The actual data model is described separately. - See https://wiki.baserock.org/definitions for more information. - - This schema is represented as YAML, so that it can be edited more easily. - You may need to convert to JSON if using a JSON-Schema tool that expects - its input to be an actual string containing data serialised as JSON. - -definitions: - # Defines one or more instances of StratumArtifact from the Baserock data - # model. - split-rules: - type: array - items: - type: object - - required: [artifact, include] - additionalProperties: false - - properties: - artifact: {type: string} - include: - type: array - items: - type: string - format: regex - - # Corresponds to ChunkReference in Baserock data model. - chunk-reference: - type: object - - required: [ 'repo', 'ref' ] - additionalProperties: false - - properties: - name: { type: string } - morph: { type: string } - repo: { type: string } - ref: { type: string } - unpetrify-ref: { type: string } - build-mode: { type: string } - prefix: { type: string } - build-system: { type: string } - build-depends: - type: array - items: { type: string } - artifacts: - type: object - # This defines which chunk artifacts go in which stratum artifact. - # E.g. "glibc-nss: build-essential-runtime" specifies the glibc-nss - # chunk artifact should go in the build-essential-runtime stratum - # artifact. - patternProperties: - ^.*$: { type: string } - - # This doesn't need any special treatment in the Baserock data model because - # it's a link to another stratum definition, without any extra info. - stratum-reference: - type: object - - required: [ 'morph' ] - additionalProperties: false - - properties: - morph: { type: string } - - -# Corresponds to Stratum in Baserock data model. -type: object - -required: [ 'name', 'kind', 'chunks' ] -additionalProperties: false - -properties: - name: { type: string } - kind: { enum: [ "stratum" ] } - description: { type: string } - - build-depends: - type: array - items: - $ref: "#/definitions/stratum-reference" - - products: - $ref: "#/definitions/split-rules" - - chunks: - type: array - items: { $ref: "#/definitions/chunk-reference" } diff --git a/schemas/system.json-schema b/schemas/system.json-schema deleted file mode 100644 index a2fc0c5d..00000000 --- a/schemas/system.json-schema +++ /dev/null @@ -1,59 +0,0 @@ -$schema: http://json-schema.org/draft-04/schema# -id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/system.json-schema - -description: | - This is a JSON-Schema description of a 'system' .morph file, which is part of - the Baserock definitions YAML representation format. - - This JSON-Schema file is valid for VERSION 7 of the Baserock definitions - YAML serialisation format. - - The Baserock definitions format is the recommended way of representing - Baserock definitions on disk. The actual data model is described separately. - See https://wiki.baserock.org/definitions for more information. - - This schema is represented as YAML, so that it can be edited more easily. - You may need to convert to JSON if using a JSON-Schema tool that expects - its input to be an actual string containing data serialised as JSON. - -definitions: - # In the Baserock data model, this becomes a list of links to StratumArtifact - # entities. - stratum-reference: - type: object - - required: [ 'morph' ] - additionalProperties: false - - properties: - name: { type: string } - morph: { type: string } - artifacts: - type: array - items: { type: string } - - -# Corresponds to System in Baserock data model. -system: -type: object - -required: [ 'name', 'kind', 'strata' ] -additionalProperties: false - -properties: - name: { type: string } - kind: { enum: [ "system" ] } - description: { type: string } - - # Morph and YBD will only accept certain values for 'arch' based on - # hardcoded conditions in those tools. - arch: { type: string } - - strata: - type: array - items: - $ref: "#/definitions/stratum-reference" - - configuration-extensions: - type: array - items: { type: string } diff --git a/scripts/check-unpetrify-refs.py b/scripts/check-unpetrify-refs.py new file mode 100755 index 00000000..27792c4a --- /dev/null +++ b/scripts/check-unpetrify-refs.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# Copyright (C) 2016 Codethink Limited +# +# 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; version 2 of the License. +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os +import sys +import glob +import yaml +import subprocess + + +''' +Script for checking unpetrify-refs in strata. + +Without args this script will check everything in strata/, or each stratum +given on the command-line and will print on stdout whether a chunk has +a missing or non-existent unpetrify-ref and if it fails to check the remote +(missing repo). +''' + +strata_dir = "strata" +trove_host = "git.baserock.org" +aliases = { + 'baserock:': 'git://%(trove)s/baserock/', + 'freedesktop:': 'git://anongit.freedesktop.org/', + 'github:': 'git://github.com/', + 'gnome:': 'git://git.gnome.org/', + 'upstream:': 'git://%(trove)s/delta/' +} + +def ref_exists(remote, ref): + output = subprocess.check_output( + ["git", "ls-remote", remote, str(ref)], + stderr=subprocess.STDOUT).strip() + return True if output else False + +def get_repo_url(repo): + remote = repo[:repo.find(':') + 1] + return repo.replace(remote, aliases[remote]) + +def definitions_root(): + return subprocess.check_output( + ["git", "rev-parse", "--show-toplevel"]).strip() + +def load_yaml_file(yaml_file): + with open(yaml_file, 'r') as f: + return yaml.safe_load(f) + +def main(args): + global trove_host, aliases + opt = next(((i, j.split('=')[1]) for i, j in enumerate(args) + if j.startswith("--trove-host=")), None) + if opt: + trove_host = opt[1] + del args[opt[0]] + aliases = {k: v % {'trove': trove_host} for k, v in aliases.iteritems()} + + if args: + strata = args + else: + strata_path = os.path.join(definitions_root(), strata_dir) + strata = glob.glob("%s/*.morph" % strata_path) + + for stratum in strata: + path = os.path.relpath(stratum) + morphology = load_yaml_file(stratum) + for chunk in morphology['chunks']: + unpetrify_ref = chunk.get("unpetrify-ref") + if not unpetrify_ref: + print ("%s: '%s' has no unpetrify-ref!" % + (path, chunk['name'])) + continue + remote = get_repo_url(chunk['repo']) + try: + if not ref_exists(remote, unpetrify_ref): + print ("%s: unpetrify-ref for '%s' is not present on the " + "remote (%s)!" % (path, chunk['name'], remote)) + except subprocess.CalledProcessError as e: + print ("%s: failed to ls-remote (%s) for chunk '%s':\n%s" % + (path, remote, chunk['name'], e.output.strip())) + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/scripts/licensecheck.py b/scripts/licensecheck.py new file mode 100755 index 00000000..c5f72f07 --- /dev/null +++ b/scripts/licensecheck.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python +# Copyright (C) 2016 Codethink Limited +# +# 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; version 2 of the License. +# +# 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. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import argparse +import errno +import os +import pipes +import re +import string +import subprocess +import sys +import tempfile +import yaml + + +gpl3_chunks = ("autoconf", + "automake", + "bash", + "binutils", + "bison", + "ccache", + "cmake", + "flex", + "gawk", + "gcc", + "gdbm", + "gettext", + "gperf", + "groff", + "libtool", + "m4-tarball", + "make", + "nano", + "patch", + "rsync", + "texinfo-tarball") + + +def definitions_root(): + return subprocess.check_output( + ["git", "rev-parse", "--show-toplevel"]).strip() + + +def load_yaml_file(yaml_file): + with open(yaml_file, 'r') as f: + return yaml.safe_load(f) + + +def license_file_name(repo_name, sha, licenses_dir): + license_file = os.path.join(licenses_dir, repo_name + '-' + sha) + return license_file + + +def check_license(repo_name, sha, clone_path, license_file): + + licenses_dir = os.path.dirname(license_file) + + try: + os.makedirs(licenses_dir) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + _, license_file_temp = tempfile.mkstemp(dir=licenses_dir) + with open(license_file_temp,"wb") as out: + sys.stderr.write("Checking license of '%s' ...\n" % repo_name) + with open(os.devnull, 'w') as devnull: + subprocess.check_call("perl scripts/licensecheck.pl -r " + + pipes.quote(clone_path) + "|cut -d: -f2- | sort -u", + stdout=out, stderr=devnull, shell=True) + + os.rename(license_file_temp, license_file) + return license_file + + +def check_repo_if_needed(name, repo, ref, repos_dir, licenses_dir): + repo_name = re.split('/|:',repo)[-1] + if repo_name.endswith(".git"): + repo_name = repo_name[:-4] + + # Check if ref is sha1 to speedup + if len(ref) == 40 and all(c in string.hexdigits for c in ref): + license_file = license_file_name(repo_name, ref, licenses_dir) + if os.path.isfile(license_file): + return (repo, license_file) + + clone_path = os.path.join(repos_dir, repo_name) + + if os.path.isdir(clone_path): + sys.stderr.write("Updating repo '%s' ...\n" % repo_name) + with open(os.devnull, 'w') as devnull: + subprocess.check_call([ + "git", "remote", "update", "origin", "--prune"], + stderr=devnull, stdout=devnull, cwd=clone_path) + subprocess.check_call(["git", "checkout", ref], stderr=devnull, + stdout=devnull, cwd=clone_path) + else: + sys.stderr.write("Getting repo '%s' ...\n" % repo_name) + with open(os.devnull, 'w') as devnull: + subprocess.check_call(["morph", "get-repo", name, clone_path], + stdout=devnull, stderr=devnull) + + sha = subprocess.check_output( + ["git", "rev-parse", "HEAD"], cwd=clone_path).strip() + + license_file = license_file_name(repo_name, sha, licenses_dir) + if os.path.isfile(license_file): + return (repo, license_file) + + return (repo, check_license(repo_name, sha, clone_path, license_file)) + + +def check_stratum(stratum_file, repos_dir, licenses_dir): + stratum = load_yaml_file(stratum_file) + license_files = [] + for chunk in stratum['chunks']: + + name = chunk["name"] + build_mode = chunk.get("build-mode") # Allowed to be None + + # Don't include bootstrap chunks and stripped gplv3 chunks + if name in gpl3_chunks or build_mode == "bootstrap": + continue + repo = chunk["repo"] + ref = chunk["ref"] + yield check_repo_if_needed(name, repo, ref, repos_dir, licenses_dir) + + +def main(): + + parser = argparse.ArgumentParser( + description='Checks licenses of the components of a given System.') + parser.add_argument('system', metavar='SYSTEM', type=str, + help='System to check for licenses') + parser.add_argument('--repos-dir', default="./repos", + help='DIR to clone all the repos (default ./repos)') + parser.add_argument('--licenses-dir', default="./licenses", + help='DIR to store chunk license files (default ./licenses)') + + args = parser.parse_args() + + system = load_yaml_file(args.system) + license_files = [] + for stratum in system['strata']: + stratum_file = stratum['morph'] + stratum_path = os.path.join(definitions_root(), stratum_file) + license_files.extend(check_stratum(stratum_path, args.repos_dir, args.licenses_dir)) + + for chunk_repo, chunk_license in license_files: + try: + # Print repo name + sys.stdout.write("%s\n%s\n" % (chunk_repo, '-' * len(chunk_repo))) + + # Print license file of the repo + with open(chunk_license, 'r') as f: + for line in f: + sys.stdout.write(line) + sys.stdout.write("\n") + except IOError: + # stdout is closed, no point in continuing + # Attempt to close them explicitly to prevent cleanup problems: + try: + sys.stdout.flush() + sys.stdout.close() + except IOError: + pass + finally: + exit() + + +if __name__ == "__main__": + main() diff --git a/strata/CPAN-Mini-Inject/CPAN-Mini-Inject.morph b/strata/CPAN-Mini-Inject/CPAN-Mini-Inject.morph index e872843c..a92c26f3 100644 --- a/strata/CPAN-Mini-Inject/CPAN-Mini-Inject.morph +++ b/strata/CPAN-Mini-Inject/CPAN-Mini-Inject.morph @@ -1,4 +1,3 @@ name: CPAN-Mini-Inject kind: chunk build-system: module-build -test-commands: [] # disable test commands diff --git a/strata/NetworkManager-common.morph b/strata/NetworkManager-common.morph index 14994a80..35ed2107 100644 --- a/strata/NetworkManager-common.morph +++ b/strata/NetworkManager-common.morph @@ -3,6 +3,7 @@ kind: stratum build-depends: - morph: strata/audio-bluetooth.morph - morph: strata/connectivity.morph +- morph: strata/device-management.morph - morph: strata/network-security.morph - morph: strata/privileges-management.morph chunks: @@ -16,18 +17,12 @@ chunks: ref: 7628b745a813aac53586b640da056a975f1c443e unpetrify-ref: readline-6.3 build-system: autotools -- name: libgudev - repo: upstream:libgudev - ref: d722339aae9065a379acc0c421e8bbab866d5a38 - unpetrify-ref: 230 - build-system: autotools - name: NetworkManager morph: strata/NetworkManager-common/NetworkManager.morph repo: upstream:NetworkManager ref: c41be469ab107ea2b4813bf28a1618572b78aa6a unpetrify-ref: baserock/1.1.0-dev-1952-gc41be46 build-depends: - - libgudev - libndp - readline6 - name: libmbim @@ -35,8 +30,6 @@ chunks: ref: 6cf74ebfae1dccf807bb34d88f2cd024d4b14da7 unpetrify-ref: master build-system: autotools - build-depends: - - libgudev - name: libqmi repo: upstream:libqmi ref: 97aaa6855d071f64ec2e28df1b9f816da02a3e07 diff --git a/strata/audio-bluetooth.morph b/strata/audio-bluetooth.morph index d60d1121..6bd8ce66 100644 --- a/strata/audio-bluetooth.morph +++ b/strata/audio-bluetooth.morph @@ -13,13 +13,17 @@ chunks: - name: alsa-lib repo: upstream:alsa-lib ref: 9cfd1faa27511edbb8bebbab85030125f33590ae - unpetrify-ref: v1.0.28 + # Note: ref anchored because alsa-lib is known for rebasing + # tags, and master + unpetrify-ref: baserock/v1.0.28 build-system: autotools - name: alsa-utils morph: strata/audio-bluetooth/alsa-utils.morph repo: upstream:alsa-utils ref: bbf137f66b2c8ce36db73f59ee69d5c443436524 - unpetrify-ref: v1.0.28 + # Note: ref anchored because alsa-utils is known for rebasing + # tags, and master + unpetrify-ref: baserock/v1.0.28 build-depends: - alsa-lib - name: libical @@ -93,7 +97,7 @@ chunks: - name: sbc repo: upstream:sbc ref: f64b34a770bc7fbf180d2a733fe63d352f281ea2 - unpetrify-ref: 1.3 + unpetrify-ref: "1.3" build-system: autotools build-depends: - libsndfile diff --git a/strata/audio-bluetooth/avahi.morph b/strata/audio-bluetooth/avahi.morph index 49d249d5..a255ce1e 100644 --- a/strata/audio-bluetooth/avahi.morph +++ b/strata/audio-bluetooth/avahi.morph @@ -1,8 +1,6 @@ name: avahi kind: chunk build-system: autotools -pre-configure-commands: -- sed -i 's/AM_CFLAGS=-I$(top_srcdir) -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1/AM_CFLAGS=-I$(top_srcdir)/g' avahi-ui/Makefile.am configure-commands: - | ./autogen.sh --prefix="$PREFIX" --sysconfdir=/etc --localstatedir=/var --disable-werror \ diff --git a/strata/core.morph b/strata/core.morph index 33010335..55525d91 100644 --- a/strata/core.morph +++ b/strata/core.morph @@ -90,8 +90,8 @@ chunks: - name: openssl-new morph: strata/core/openssl-new.morph repo: upstream:openssl-new - ref: 506c1068801fdeef5cb00f2053854bf56150fb6d - unpetrify-ref: OpenSSL_1_0_1m + ref: 57ac73fb5d0a878f282cbcd9e7951c77fdc59e3c + unpetrify-ref: OpenSSL_1_0_1s build-depends: - perl - name: bzip2 @@ -384,8 +384,8 @@ chunks: - name: cython repo: upstream:cython ref: 4dd8e762fa51d01775506fbbc102c45dbcea065d - unpetrify-ref: 0.22 - build-system: python-distutils + unpetrify-ref: "0.22" + build-system: python3-distutils build-depends: - python3 - name: gperf diff --git a/strata/device-management.morph b/strata/device-management.morph new file mode 100644 index 00000000..e0ed4a25 --- /dev/null +++ b/strata/device-management.morph @@ -0,0 +1,12 @@ +name: device-management +kind: stratum +description: libraries that provides access to devices +build-depends: +- morph: strata/foundation.morph +- morph: strata/glib-common.morph +chunks: +- name: libgudev + repo: upstream:libgudev + ref: d722339aae9065a379acc0c421e8bbab866d5a38 + unpetrify-ref: "230" + build-system: autotools diff --git a/strata/django.morph b/strata/django.morph index 27c1c662..01f471f2 100644 --- a/strata/django.morph +++ b/strata/django.morph @@ -13,12 +13,12 @@ chunks: - name: django-appconf repo: upstream:python-packages/django-appconf ref: 0c9835f95b44db1b3eb1a9409f95a3ecd63b8ff5 - unpetrify-ref: 0.6 + unpetrify-ref: "0.6" build-system: python-distutils - name: django-compressor repo: upstream:python-packages/django-compressor ref: e747dce3d7e04fe595bbfed54f9554c2725eb757 - unpetrify-ref: 1.4 + unpetrify-ref: "1.4" build-system: python-distutils build-depends: - django-appconf diff --git a/strata/foundation.morph b/strata/foundation.morph index 4e1052b2..be983cca 100644 --- a/strata/foundation.morph +++ b/strata/foundation.morph @@ -7,7 +7,7 @@ chunks: - name: bash-completion repo: upstream:bash-completion ref: 3085c7e12179817a02a611016606391295c69942 - unpetrify-ref: 2.1 + unpetrify-ref: "2.1" build-system: autotools - name: groff morph: strata/foundation/groff.morph @@ -32,8 +32,8 @@ chunks: - name: dbus-pre morph: strata/foundation/dbus-pre.morph repo: upstream:dbus - ref: 6b265f7e2ce10e69a07d4a6bc4ec2746fb032135 - unpetrify-ref: baserock/v1.10.0+custom_marshaling + ref: 09a48734991d09c7b1b73b9e1aa9e2c2a93ab565 + unpetrify-ref: baserock/dbus-1.10.6-capi-patches - name: libgpg-error morph: strata/foundation/libgpg-error.morph repo: upstream:libgpg-error @@ -88,8 +88,8 @@ chunks: - name: dbus morph: strata/foundation/dbus.morph repo: upstream:dbus - ref: 6b265f7e2ce10e69a07d4a6bc4ec2746fb032135 - unpetrify-ref: baserock/v1.10.0+custom_marshaling + ref: 09a48734991d09c7b1b73b9e1aa9e2c2a93ab565 + unpetrify-ref: baserock/dbus-1.10.6-capi-patches build-depends: - systemd - name: openssh diff --git a/strata/genivi-demo-platform.morph b/strata/genivi-demo-platform.morph index bfacc95d..4da796e6 100644 --- a/strata/genivi-demo-platform.morph +++ b/strata/genivi-demo-platform.morph @@ -25,11 +25,6 @@ chunks: repo: upstream:audiomanager ref: bb65a4d0a18667baa64e5ba40104dc2cda06b299 unpetrify-ref: baserock/genivi/genivi-demo-platform -- name: navit - morph: strata/genivi-demo-platform/navit.morph - repo: upstream:navit-svn - ref: 358812af2c27c4abe324beb205e6d156b96fb1ea - unpetrify-ref: master - name: audiomanager@gdp morph: strata/genivi-demo-platform/audiomanager@gdp.morph repo: upstream:audiomanager @@ -45,5 +40,5 @@ chunks: - name: genivi-demo-platform-hmi morph: strata/genivi-demo-platform/genivi-demo-platform-hmi.morph repo: upstream:genivi/genivi-demo-platform-hmi - ref: 253e30329f1d22c859e07150533702c2d3f986d5 - unpetrify-ref: baserock/genivi/gdp-0.1 + ref: f56acfadb5400087c1bb935406fcb005e315f27f + unpetrify-ref: baserock/weston-1.9-wip diff --git a/strata/genivi.morph b/strata/genivi.morph index 1d8889fe..f33394f8 100644 --- a/strata/genivi.morph +++ b/strata/genivi.morph @@ -37,13 +37,13 @@ chunks: - name: genivi-common-api-runtime morph: strata/genivi/genivi-common-api-runtime.morph repo: upstream:genivi-common-api-runtime - ref: 56d1059459c24971bcbf45adef60f6dfd0b44667 - unpetrify-ref: 3.1.2p1 + ref: 77d9cdaf6acee03a1e360e0e1a3cd0b01a95b407 + unpetrify-ref: 3.1.5 - name: genivi-common-api-dbus-runtime morph: strata/genivi/genivi-common-api-dbus-runtime.morph repo: upstream:genivi-common-api-dbus-runtime - ref: 49d0b428ca19852d49965f35328a314f22d88807 - unpetrify-ref: 3.1.2 + ref: 3348a422ffc756b63de5890356383858a898e8b1 + unpetrify-ref: 3.1.5 build-depends: - genivi-common-api-runtime - name: audiomanager diff --git a/strata/gnome.morph b/strata/gnome.morph index f6d38cf1..6648e9b8 100644 --- a/strata/gnome.morph +++ b/strata/gnome.morph @@ -16,7 +16,6 @@ build-depends: - morph: strata/network-security.morph - morph: strata/privileges-management.morph - morph: strata/python3-gobject.morph -- morph: strata/python2-core.morph - morph: strata/wayland-generic.morph - morph: strata/ruby.morph - morph: strata/samba.morph @@ -542,7 +541,7 @@ chunks: morph: strata/gnome/desktop-file-utils.morph repo: upstream:desktop-file-utils ref: 4944725bddcf5821d53d7d648fc53347ce12cc03 - unpetrify-ref: 0.22 + unpetrify-ref: "0.22" - name: gnome-terminal morph: strata/gnome/gnome-terminal.morph repo: upstream:gnome/gnome-terminal @@ -635,11 +634,6 @@ chunks: ref: ac2aef0f47fd998555abf18003f4c11ffecbf542 unpetrify-ref: 2.32.0 build-system: autotools -- name: libwacom - repo: upstream:linuxwacom/libwacom - ref: c707d0f98c79260cb72b5d2bdded50b4e816e350 - unpetrify-ref: libwacom-0.15 - build-system: autotools - name: gnome-bluetooth repo: upstream:gnome/gnome-bluetooth ref: eb2558d45518f7c23c20fa7b13639f013810494e @@ -733,7 +727,6 @@ chunks: - libcanberra - libgtop - libpwquality - - libwacom - network-manager-applet - name: gnome-initial-setup morph: strata/gnome/gnome-initial-setup.morph @@ -763,7 +756,7 @@ chunks: build-system: autotools repo: upstream:sound-theme-freedesktop ref: 9d2ac65a2f88263f0eec8b777ef3bdc023b93c25 - unpetrify-ref: 0.8 + unpetrify-ref: "0.8" - name: libwnck morph: strata/gnome/libwnck.morph repo: upstream:libwnck diff --git a/strata/input-common.morph b/strata/input-common.morph index b8f49eea..3d75536e 100644 --- a/strata/input-common.morph +++ b/strata/input-common.morph @@ -1,7 +1,9 @@ name: input-common kind: stratum build-depends: +- morph: strata/device-management.morph - morph: strata/foundation.morph +- morph: strata/glib-common.morph - morph: strata/xorg-util-macros-common.morph - morph: strata/x-common.morph chunks: @@ -20,14 +22,20 @@ chunks: ref: 6f03fd49fb949e46ebccb5dfb54489584896c791 unpetrify-ref: libevdev-1.4.2 build-system: autotools +- name: libwacom + repo: upstream:linuxwacom/libwacom + ref: c707d0f98c79260cb72b5d2bdded50b4e816e350 + unpetrify-ref: libwacom-0.15 + build-system: autotools - name: libinput repo: upstream:libinput - ref: a340736e9b9399f630ff4b436930c1dee26cb803 - unpetrify-ref: 1.1.4 + ref: 45e5847bf3e755532b2b6a62b74b85fcdadf2e36 + unpetrify-ref: 1.2.0 build-system: autotools build-depends: - mtdev - libevdev + - libwacom - name: libxkbcommon-no-x11 repo: upstream:xorg-lib-libxkbcommon ref: c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 diff --git a/strata/input-genivi.morph b/strata/input-genivi.morph deleted file mode 100644 index 5e86e704..00000000 --- a/strata/input-genivi.morph +++ /dev/null @@ -1,39 +0,0 @@ -name: input-genivi -kind: stratum -description: | - Input components for GENIVI Demo Platform. GDP needs libinput 0.7, - because 0.8+ changed function signatures that weston uses. -build-depends: -- morph: strata/foundation.morph -- morph: strata/xorg-util-macros-common.morph -chunks: -- name: mtdev - repo: upstream:mtdev-git - ref: 4381b78fea54de0e775bf54952b2f95e5a06c57d - unpetrify-ref: v1.1.5 - build-system: autotools -- name: xkeyboard-config - morph: strata/input-genivi/xkeyboard-config.morph - repo: upstream:xkeyboard-config - ref: 26f344c93f8c6141e9233eb68088ba4fd56bc9ef - unpetrify-ref: xkeyboard-config-2.14 -- name: libevdev - repo: upstream:libevdev - ref: 6f03fd49fb949e46ebccb5dfb54489584896c791 - unpetrify-ref: libevdev-1.4.2 - build-system: autotools -- name: libinput@genivi - repo: upstream:libinput - ref: 06e2f522a4ab5ea0a1de68cce1b5f9fff568ed4f - unpetrify-ref: 0.7.0 - build-system: autotools - build-depends: - - mtdev - - libevdev -- name: libxkbcommon-no-x11 - repo: upstream:xorg-lib-libxkbcommon - ref: c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 - morph: strata/input-genivi/libxkbcommon-no-x11.morph - unpetrify-ref: xkbcommon-0.5.0 - build-depends: - - xkeyboard-config diff --git a/strata/input-genivi/libxkbcommon-no-x11.morph b/strata/input-genivi/libxkbcommon-no-x11.morph deleted file mode 100644 index 95165aaf..00000000 --- a/strata/input-genivi/libxkbcommon-no-x11.morph +++ /dev/null @@ -1,12 +0,0 @@ -name: libxkbcommon-no-x11 -kind: chunk - -description: | - xkbcommon is a library to handle keyboard descriptions. - - This version is built without X11 support. If built with X11 support, - it depends on the xcb-xkb library. - -build-system: autotools -configure-commands: -- ./autogen.sh --prefix="$PREFIX" --sysconfdir=/etc --disable-x11 diff --git a/strata/input-genivi/xkeyboard-config.morph b/strata/input-genivi/xkeyboard-config.morph deleted file mode 100644 index 2195befe..00000000 --- a/strata/input-genivi/xkeyboard-config.morph +++ /dev/null @@ -1,7 +0,0 @@ -name: xkeyboard-config -kind: chunk -configure-commands: -- ./autogen.sh --prefix="$PREFIX" --sysconfdir=/etc --disable-runtime-deps -install-commands: -- mkdir -p "$DESTDIR"/"$PREFIX"/share/X11/xkb/ -- make install DESTDIR="$DESTDIR" diff --git a/strata/libdrm-common.morph b/strata/libdrm-common.morph index e565617f..1ee7c9b1 100644 --- a/strata/libdrm-common.morph +++ b/strata/libdrm-common.morph @@ -5,13 +5,13 @@ build-depends: chunks: - name: xorg-lib-libpciaccess repo: upstream:xorg-lib-libpciaccess - ref: f99c2e4199ce37f6f94428df504427f67c3ec543 - unpetrify-ref: libpciaccess-0.13.3 + ref: bbd1acdd1d25b9a68f4b7913a4094af20d7cf78f + unpetrify-ref: libpciaccess-0.13.4 build-system: autotools - name: drm repo: upstream:drm morph: strata/libdrm-common/drm.morph - ref: b38a4b2326c1be5702f5cb73a53c0ed74c12d510 - unpetrify-ref: libdrm-2.4.66 + ref: d49efb55846c6ec96400061213b76ab867461c1a + unpetrify-ref: libdrm-2.4.67 build-depends: - xorg-lib-libpciaccess diff --git a/strata/llvm-common/llvm.morph b/strata/llvm-common/llvm.morph index de274476..dca81043 100644 --- a/strata/llvm-common/llvm.morph +++ b/strata/llvm-common/llvm.morph @@ -3,5 +3,9 @@ kind: chunk description: Low Level Virtual Machine build-system: autotools configure-commands: -- ./configure --prefix="$PREFIX" --sysconfdir=/etc --enable-shared --enable-targets=host - --enable-optimized --disable-assertions +- ./configure --prefix="$PREFIX" --sysconfdir=/etc + --enable-shared + --enable-targets=host + --enable-optimized + --disable-assertions + --with-python=/usr/bin/python3 diff --git a/strata/lorry.morph b/strata/lorry.morph index 44005c48..ccc987cb 100644 --- a/strata/lorry.morph +++ b/strata/lorry.morph @@ -110,7 +110,7 @@ chunks: - name: lorry morph: strata/lorry/lorry.morph repo: baserock:baserock/lorry - ref: d64da0cb16679f0791077ff5e1f9d03fa16a745f + ref: c06dc5acf0e712827ca52d6611c3b13dab6744fd unpetrify-ref: master build-depends: - bzr-tarball diff --git a/strata/lua53.morph b/strata/lua53.morph new file mode 100644 index 00000000..5cea88fb --- /dev/null +++ b/strata/lua53.morph @@ -0,0 +1,11 @@ +name: lua53 +kind: stratum +description: Interpreter for the lua 5.3 scripting language. +build-depends: +- morph: strata/core.morph +chunks: +- name: lua53 + morph: strata/lua53/lua53.morph + repo: upstream:lua-github + ref: a7d799273a401040945826dbe1bd9edb8dab0662 + unpetrify-ref: baserock/5.3.2 diff --git a/strata/lua53/lua53.morph b/strata/lua53/lua53.morph new file mode 100644 index 00000000..c8c43d64 --- /dev/null +++ b/strata/lua53/lua53.morph @@ -0,0 +1,9 @@ +name: lua53 +kind: chunk +build-system: manual +build-commands: +- make linux +install-commands: +- make INSTALL_TOP="$DESTDIR/$PREFIX" install +- mkdir -p "$DESTDIR/$PREFIX/lib/pkgconfig/" +- cp lua.pc "$DESTDIR/$PREFIX/lib/pkgconfig/" diff --git a/strata/mesa-common.morph b/strata/mesa-common.morph index e15d4d23..092ff3ca 100644 --- a/strata/mesa-common.morph +++ b/strata/mesa-common.morph @@ -11,8 +11,8 @@ chunks: - name: mesa morph: strata/mesa-common/mesa.morph repo: upstream:mesa - ref: 5a616125acf0ac043d2d44b7a8e804739d55014e - unpetrify-ref: mesa-11.1.0 + ref: 7bcd827806b0816d61122ba3d37dd40178d96d98 + unpetrify-ref: mesa-11.1.2 - name: libepoxy repo: upstream:libepoxy ref: e2c33af5bfcfc9d168f9e776156dd47c33f428b3 diff --git a/strata/multimedia-gstreamer-openmax-generic.morph b/strata/multimedia-gstreamer-openmax-generic.morph new file mode 100644 index 00000000..9d21a0db --- /dev/null +++ b/strata/multimedia-gstreamer-openmax-generic.morph @@ -0,0 +1,11 @@ +name: multimedia-gstreamer-openmax-generic +kind: stratum +description: GStreamer OpenMAX IL wrapper plugin +build-depends: +- morph: strata/multimedia-gstreamer.morph +chunks: +- name: gst-omx + morph: strata/multimedia-gstreamer-openmax-generic/gst-omx.morph + repo: upstream:gst-omx + ref: baserock/1.2.0 + unpetrify-ref: baserock/1.2.0 diff --git a/strata/multimedia-gstreamer-openmax-generic/gst-omx.morph b/strata/multimedia-gstreamer-openmax-generic/gst-omx.morph new file mode 100644 index 00000000..3f7be605 --- /dev/null +++ b/strata/multimedia-gstreamer-openmax-generic/gst-omx.morph @@ -0,0 +1,7 @@ +name: gst-omx +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" + --disable-gtk-doc + --with-omx-target=generic diff --git a/strata/navigation.morph b/strata/navigation.morph new file mode 100644 index 00000000..669f4084 --- /dev/null +++ b/strata/navigation.morph @@ -0,0 +1,11 @@ +name: navigation +kind: stratum +description: Stratum that provides navigation libraries / services +build-depends: +- morph: strata/core.morph +chunks: +- name: navit + morph: strata/navigation/navit.morph + repo: upstream:navit-svn + ref: 358812af2c27c4abe324beb205e6d156b96fb1ea + unpetrify-ref: master diff --git a/strata/genivi-demo-platform/navit.morph b/strata/navigation/navit.morph index 2bdb09d5..2bdb09d5 100644 --- a/strata/genivi-demo-platform/navit.morph +++ b/strata/navigation/navit.morph diff --git a/strata/openstack-clients.morph b/strata/openstack-clients.morph index ae0662e1..05b0e028 100644 --- a/strata/openstack-clients.morph +++ b/strata/openstack-clients.morph @@ -75,7 +75,7 @@ chunks: morph: strata/openstack-clients/cliff-tablib.morph repo: upstream:python-packages/cliff-tablib ref: a83bf47d7dfbb690dd53e189c532f0859898db04 - unpetrify-ref: 1.1 + unpetrify-ref: "1.1" - name: python-neutronclient repo: upstream:openstack/python-neutronclient ref: aa1215a5ad063b299d32ef319eb63d5210249a9b diff --git a/strata/openstack-common.morph b/strata/openstack-common.morph index e2bd0071..2cc262c8 100644 --- a/strata/openstack-common.morph +++ b/strata/openstack-common.morph @@ -80,7 +80,7 @@ chunks: - name: pyopenssl repo: upstream:python-packages/pyopenssl ref: 0146d447e63a737b4f05a1164d5950eff68543e7 - unpetrify-ref: 0.14 + unpetrify-ref: "0.14" build-system: python-distutils - name: oslo-i18n repo: upstream:openstack/oslo-i18n diff --git a/strata/openstack-services.morph b/strata/openstack-services.morph index 0b8e7aca..a26a6729 100644 --- a/strata/openstack-services.morph +++ b/strata/openstack-services.morph @@ -13,7 +13,7 @@ chunks: morph: strata/openstack-services/erlang-sd_notify.morph repo: upstream:erlang-modules/erlang-sd_notify ref: 99f4689c2c18570680329f822591f95f9341ca10 - unpetrify-ref: 0.1 + unpetrify-ref: "0.1" - name: rabbitmq-codegen morph: strata/openstack-services/rabbitmq-codegen.morph ref: 4dc5ccde2a0b3d638e5754b00abf94196fe9ca32 @@ -189,7 +189,7 @@ chunks: - name: repoze-lru repo: upstream:python-packages/repoze-lru ref: 29c8281dee7fe8dae8c66c7c40ce7c058ec2ab0f - unpetrify-ref: 0.6 + unpetrify-ref: "0.6" build-system: python-distutils - name: routes repo: upstream:python-packages/routes @@ -206,7 +206,7 @@ chunks: - name: tempita repo: upstream:python-packages/tempita ref: b2b67795a009e9f825cbd855d766b78a00273f10 - unpetrify-ref: 0.5 + unpetrify-ref: "0.5" build-system: python-distutils - name: numpy repo: upstream:python-packages/numpy.git @@ -245,7 +245,7 @@ chunks: - name: python-pexpect repo: upstream:python-packages/pexpect ref: 671417beb41c21f772687c565196fdde444b053b - unpetrify-ref: 3.3 + unpetrify-ref: "3.3" build-system: python-distutils - name: ply repo: upstream:python-packages/ply.git @@ -355,7 +355,7 @@ chunks: - name: aioeventlet repo: upstream:python-packages/aioeventlet ref: 3cac0d7740592a380a7dadb2ddcdda000cae2bda - unpetrify-ref: 0.4 + unpetrify-ref: "0.4" build-system: python-distutils build-depends: - trollius @@ -409,7 +409,7 @@ chunks: - name: happybase repo: upstream:python-packages/happybase ref: 90a4b7ef741f0ecfe5145693f64c6f7180b9ba3d - unpetrify-ref: 0.8 + unpetrify-ref: "0.8" build-system: python-distutils build-depends: - thrift @@ -713,7 +713,7 @@ chunks: - name: pint repo: upstream:python-packages/pint ref: e7e7de5ca2e1c19963be8a918369fb19186f9a73 - unpetrify-ref: 0.6 + unpetrify-ref: "0.6" build-system: python-distutils - name: horizon morph: strata/openstack-services/horizon.morph diff --git a/strata/python-common.morph b/strata/python-common.morph index ac05a58e..72cb5e4b 100644 --- a/strata/python-common.morph +++ b/strata/python-common.morph @@ -25,7 +25,7 @@ chunks: - name: markupsafe repo: upstream:markupsafe ref: feb1d70c16df62f60dcb521d127fdad8819fc036 - unpetrify-ref: 0.23 + unpetrify-ref: "0.23" build-system: python-distutils - name: jinja2 repo: upstream:jinja2 @@ -64,12 +64,12 @@ chunks: - name: kazoo repo: upstream:python-packages/kazoo.git ref: 93a718ea4c20df797766742c3d74de281613c651 - unpetrify-ref: 2.0 + unpetrify-ref: "2.0" build-system: python-distutils - name: webob repo: upstream:python-packages/webob ref: ae0ac90f22f9e1ff351e445f92330efd89195f51 - unpetrify-ref: 1.4 + unpetrify-ref: "1.4" build-system: python-distutils - name: python-decorator repo: upstream:python-packages/python-decorator diff --git a/strata/python2-core.morph b/strata/python2-core.morph index 23c4e3c8..7e6b6310 100644 --- a/strata/python2-core.morph +++ b/strata/python2-core.morph @@ -67,7 +67,7 @@ chunks: - name: cython2 repo: upstream:cython ref: 4dd8e762fa51d01775506fbbc102c45dbcea065d - unpetrify-ref: 0.22 + unpetrify-ref: "0.22" build-system: python-distutils build-depends: - python2 diff --git a/strata/python2-core/pyyaml.morph~ b/strata/python2-core/pyyaml.morph~ deleted file mode 100644 index 8ebd7b57..00000000 --- a/strata/python2-core/pyyaml.morph~ +++ /dev/null @@ -1,6 +0,0 @@ -name: pyyaml -kind: chunk -build-commands: -- python setup.py --without-libyaml build -install-commands: -- python setup.py --without-libyaml install --prefix="$PREFIX" --root "$DESTDIR" diff --git a/strata/storage-management.morph b/strata/storage-management.morph index 0b26d2f9..c972d0d3 100644 --- a/strata/storage-management.morph +++ b/strata/storage-management.morph @@ -2,8 +2,10 @@ name: storage-management kind: stratum description: libraries/services that provides access to storage build-depends: +- morph: strata/device-management.morph - morph: strata/glib-common.morph - morph: strata/privileges-management.morph +- morph: strata/secret-service.morph chunks: - name: libatasmart morph: strata/storage-management/libatasmart.morph @@ -17,10 +19,22 @@ chunks: unpetrify-ref: master build-depends: - libatasmart +- name: libgphoto2 + repo: upstream:libgphoto2 + ref: 3745402108932b457d73b102cbf8b2da8d383a18 + unpetrify-ref: libgphoto2-2_5_9-release + build-system: autotools +- name: libmtp + morph: strata/storage-management/libmtp.morph + repo: upstream:libmtp + ref: 83820ced69dca750b2edd6ac6d5640f246022a10 + unpetrify-ref: libmtp-1-1-11 - name: gvfs morph: strata/storage-management/gvfs.morph repo: upstream:gvfs ref: d037b5fd56cae878ed7bb5269a40e4bd046551d7 unpetrify-ref: master build-depends: + - libgphoto2 + - libmtp - udisks diff --git a/strata/storage-management/gvfs.morph b/strata/storage-management/gvfs.morph index 1fde8c82..bafd3158 100644 --- a/strata/storage-management/gvfs.morph +++ b/strata/storage-management/gvfs.morph @@ -2,4 +2,4 @@ name: gvfs kind: chunk build-system: autotools configure-commands: -- ./autogen.sh --prefix="$PREFIX" --sysconfdir=/etc --disable-gphoto2 --disable-documentation +- ./autogen.sh --prefix="$PREFIX" --sysconfdir=/etc --disable-documentation diff --git a/strata/storage-management/libmtp.morph b/strata/storage-management/libmtp.morph new file mode 100644 index 00000000..8dbb22ba --- /dev/null +++ b/strata/storage-management/libmtp.morph @@ -0,0 +1,8 @@ +name: libmtp +kind: chunk +build-system: autotools +configure-commands: +# autogen.sh asks user about autoupdate config.sub and config.guess +- touch config.rpath +- autoreconf -if +- ./configure --prefix="$PREFIX" --sysconfdir=/etc --localstatedir=/var diff --git a/strata/trove.morph b/strata/trove.morph index 073ecd98..e19e673b 100644 --- a/strata/trove.morph +++ b/strata/trove.morph @@ -71,7 +71,7 @@ chunks: - name: trove-setup morph: strata/trove/trove-setup.morph repo: baserock:baserock/trove-setup - ref: ae208aa0b8a8fa1c73edfc6467c64772eee90907 + ref: 1f2edd45b03a3e9d86d7c77847612c969b60b86f unpetrify-ref: master - name: lua-scrypt morph: strata/trove/lua-scrypt.morph diff --git a/strata/weston-genivi.morph b/strata/weston-genivi.morph index 88d6df66..2fb1e78d 100644 --- a/strata/weston-genivi.morph +++ b/strata/weston-genivi.morph @@ -2,7 +2,7 @@ name: weston-genivi kind: stratum build-depends: - morph: strata/graphics-common.morph -- morph: strata/input-genivi.morph +- morph: strata/input-common.morph - morph: strata/mesa-common.morph - morph: strata/libdrm-common.morph - morph: strata/wayland-generic.morph @@ -10,12 +10,12 @@ chunks: - name: weston morph: strata/weston-genivi/weston.morph repo: upstream:weston - ref: 1a43127064349577d1d41a910d8ed1a39caf2867 - unpetrify-ref: baserock/genivi/genivi-demo-platform + ref: c7dbc0a8c18e03719b3618b2dff7102f47a1331b + unpetrify-ref: baserock/weston-1.9.0/tegra - name: wayland-ivi-extension morph: strata/weston-genivi/wayland-ivi-extension.morph repo: upstream:genivi/wayland-ivi-extension - ref: bac7fc24bb94e37e33f447b58ec74240bb248841 - unpetrify-ref: 1.3.91 + ref: beac5d2e25324ca9cc82d0e3b364512258af3567 + unpetrify-ref: 1.9.0 build-depends: - weston diff --git a/strata/weston-genivi/wayland-ivi-extension.morph b/strata/weston-genivi/wayland-ivi-extension.morph index bceb2a88..08d43bac 100644 --- a/strata/weston-genivi/wayland-ivi-extension.morph +++ b/strata/weston-genivi/wayland-ivi-extension.morph @@ -1,7 +1,7 @@ name: wayland-ivi-extension kind: chunk configure-commands: -- cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_C_FLAGS="-I/usr/include/weston" +- cmake -DWITH_ILM_INPUT=ON -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_C_FLAGS="-I/usr/include/weston" build-commands: - make install-commands: diff --git a/strata/weston-genivi/weston.morph b/strata/weston-genivi/weston.morph index 3bc1884b..ff1d6a9c 100644 --- a/strata/weston-genivi/weston.morph +++ b/strata/weston-genivi/weston.morph @@ -14,7 +14,7 @@ post-install-commands: - install -d "$DESTDIR/usr/share/weston" - install -m 0644 data/*.png "$DESTDIR/usr/share/weston/" - cp ivi-shell/weston.ini ivi-shell/ivi-shell-weston.ini -- cp ivi-shell/weston.ini ivi-shell/gdp-weston.ini + # Generate ivi-shell-weston config used for GENIVI Baseline - sed -i 's,/weston.build/data/,/usr/share/weston/,g' ivi-shell/ivi-shell-weston.ini - sed -i 's,/weston.build/clients/,/usr/bin/,g' ivi-shell/ivi-shell-weston.ini @@ -51,14 +51,36 @@ post-install-commands: icon-id=4005 icon=/usr/share/weston/icon_ivi_smoke.png path=/usr/bin/weston-smoke - EOF -- install -d "$DESTDIR/usr/share/doc/weston" -- install -m 0644 ivi-shell/ivi-shell-weston.ini "$DESTDIR/usr/share/doc/weston/ivi-shell-weston.ini" + [ivi-launcher] + workspace-id=2 + icon-id=4006 + icon=/usr/share/weston/terminal.png + path=/usr/bin/EGLWLMockNavigation + EOF # Generate gdp-weston config used for GENIVI Demo Platform -- sed -i 's/hmi-controller.so/ivi-controller.so/' ivi-shell/gdp-weston.ini +- | + cat <<EOF > ivi-shell/gdp-weston.ini + [core] + shell=ivi-shell.so + + [ivi-shell] + ivi-module=ivi-controller.so + ivi-input-module=ivi-input-controller.so + + cursor-theme=default + cursor-size=32 + + base-layer-id=1000 + workspace-background-layer-id=2000 + workspace-layer-id=3000 + application-layer-id=4000 + + transition-duration=300 + EOF # Install both config files to decide later which one to use +- install -d "$DESTDIR/usr/share/doc/weston" - install -m 0644 ivi-shell/ivi-shell-weston.ini "$DESTDIR/usr/share/doc/weston/ivi-shell-weston.ini" - install -m 0644 ivi-shell/gdp-weston.ini "$DESTDIR/usr/share/doc/weston/gdp-weston.ini" diff --git a/strata/xdg-app-common.morph b/strata/xdg-app-common.morph index 23ab1eca..44f82403 100644 --- a/strata/xdg-app-common.morph +++ b/strata/xdg-app-common.morph @@ -4,8 +4,15 @@ build-depends: - morph: strata/ostree-core.morph - morph: strata/x-common.morph chunks: +- name: elfutils + morph: strata/xdg-app-common/elfutils.morph + repo: upstream:elfutils + ref: 9b4bce40709611875754cf4931eb91d394042122 + unpetrify-ref: elfutils-0.165 - name: xdg-app morph: strata/xdg-app-common/xdg-app.morph repo: upstream:xdg-app - ref: aa535b7b01f4dd406e9bed0dfe4a0de2b8e56565 - unpetrify-ref: baserock/0.4.4 + ref: 7e90d39533745d5fd2a1b030f55099f803ae3a5c + unpetrify-ref: baserock/0.4.13 + build-depends: + - elfutils diff --git a/strata/xdg-app-common/elfutils.morph b/strata/xdg-app-common/elfutils.morph new file mode 100644 index 00000000..45707250 --- /dev/null +++ b/strata/xdg-app-common/elfutils.morph @@ -0,0 +1,7 @@ +name: elfutils +kind: chunk +build-system: autotools +configure-commands: +- autoreconf -fi +- ./configure --prefix="$PREFIX" --sysconfdir=/etc --localstatedir=/var + --enable-maintainer-mode diff --git a/systems/genivi-baseline-system-armv7lhf-jetson.morph b/systems/genivi-baseline-system-armv7lhf-jetson.morph index 59e2c86f..ccf59f81 100644 --- a/systems/genivi-baseline-system-armv7lhf-jetson.morph +++ b/systems/genivi-baseline-system-armv7lhf-jetson.morph @@ -15,6 +15,8 @@ strata: morph: strata/connectivity.morph - name: connman-common morph: strata/connman-common.morph +- name: device-management + morph: strata/device-management.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph - name: glib-common @@ -31,8 +33,8 @@ strata: morph: strata/wayland-generic.morph - name: graphics-common morph: strata/graphics-common.morph -- name: input-genivi - morph: strata/input-genivi.morph +- name: input-common + morph: strata/input-common.morph - name: mesa-common morph: strata/mesa-common.morph - name: x-common diff --git a/systems/genivi-baseline-system-armv7lhf-versatile.morph b/systems/genivi-baseline-system-armv7lhf-versatile.morph index 6a69e3b2..74493383 100644 --- a/systems/genivi-baseline-system-armv7lhf-versatile.morph +++ b/systems/genivi-baseline-system-armv7lhf-versatile.morph @@ -15,6 +15,8 @@ strata: morph: strata/connectivity.morph - name: connman-common morph: strata/connman-common.morph +- name: device-management + morph: strata/device-management.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph - name: glib-common @@ -31,8 +33,8 @@ strata: morph: strata/wayland-generic.morph - name: graphics-common morph: strata/graphics-common.morph -- name: input-genivi - morph: strata/input-genivi.morph +- name: input-common + morph: strata/input-common.morph - name: x-common morph: strata/x-common.morph - name: weston-genivi diff --git a/systems/genivi-baseline-system-x86_64-generic.morph b/systems/genivi-baseline-system-x86_64-generic.morph index 693437b4..bbef3ee3 100644 --- a/systems/genivi-baseline-system-x86_64-generic.morph +++ b/systems/genivi-baseline-system-x86_64-generic.morph @@ -15,6 +15,8 @@ strata: morph: strata/connectivity.morph - name: connman-common morph: strata/connman-common.morph +- name: device-management + morph: strata/device-management.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph - name: glib-common @@ -31,8 +33,8 @@ strata: morph: strata/wayland-generic.morph - name: graphics-common morph: strata/graphics-common.morph -- name: input-genivi - morph: strata/input-genivi.morph +- name: input-common + morph: strata/input-common.morph - name: llvm-common morph: strata/llvm-common.morph - name: mesa-common diff --git a/systems/genivi-demo-platform-armv7lhf-jetson.morph b/systems/genivi-demo-platform-armv7lhf-jetson.morph index d683a33e..b2eef775 100644 --- a/systems/genivi-demo-platform-armv7lhf-jetson.morph +++ b/systems/genivi-demo-platform-armv7lhf-jetson.morph @@ -19,6 +19,8 @@ strata: morph: strata/connectivity.morph - name: connman-common morph: strata/connman-common.morph +- name: device-management + morph: strata/device-management.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph - name: libdrm-common @@ -27,14 +29,16 @@ strata: morph: strata/multimedia-common.morph - name: multimedia-gstreamer morph: strata/multimedia-gstreamer.morph +- name: navigation + morph: strata/navigation.morph - name: genivi morph: strata/genivi.morph - name: wayland-generic morph: strata/wayland-generic.morph - name: graphics-common morph: strata/graphics-common.morph -- name: input-genivi - morph: strata/input-genivi.morph +- name: input-common + morph: strata/input-common.morph - name: mesa-common morph: strata/mesa-common.morph - name: x-common diff --git a/systems/genivi-demo-platform-x86_64-generic.morph b/systems/genivi-demo-platform-x86_64-generic.morph index 7b92faf1..17f077ad 100644 --- a/systems/genivi-demo-platform-x86_64-generic.morph +++ b/systems/genivi-demo-platform-x86_64-generic.morph @@ -19,6 +19,8 @@ strata: morph: strata/connectivity.morph - name: connman-common morph: strata/connman-common.morph +- name: device-management + morph: strata/device-management.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph - name: libdrm-common @@ -27,14 +29,16 @@ strata: morph: strata/multimedia-common.morph - name: multimedia-gstreamer morph: strata/multimedia-gstreamer.morph +- name: navigation + morph: strata/navigation.morph - name: genivi morph: strata/genivi.morph - name: wayland-generic morph: strata/wayland-generic.morph - name: graphics-common morph: strata/graphics-common.morph -- name: input-genivi - morph: strata/input-genivi.morph +- name: input-common + morph: strata/input-common.morph - name: llvm-common morph: strata/llvm-common.morph - name: mesa-common diff --git a/systems/gnome-system-armv7lhf-jetson.morph b/systems/gnome-system-armv7lhf-jetson.morph index 44cf5e80..c64b03f5 100644 --- a/systems/gnome-system-armv7lhf-jetson.morph +++ b/systems/gnome-system-armv7lhf-jetson.morph @@ -15,6 +15,8 @@ strata: morph: strata/core.morph - name: data-indexing-management morph: strata/data-indexing-management.morph +- name: device-management + morph: strata/device-management.morph - name: dlna-services morph: strata/dlna-services.morph - name: foundation diff --git a/systems/gnome-system-x86_64.morph b/systems/gnome-system-x86_64.morph index 2068397f..431da3b0 100644 --- a/systems/gnome-system-x86_64.morph +++ b/systems/gnome-system-x86_64.morph @@ -15,6 +15,8 @@ strata: morph: strata/core.morph - name: data-indexing-management morph: strata/data-indexing-management.morph +- name: device-management + morph: strata/device-management.morph - name: dlna-services morph: strata/dlna-services.morph - name: foundation @@ -45,6 +47,8 @@ strata: morph: strata/multimedia-hardware-codecs-x86.morph - name: multimedia-gstreamer morph: strata/multimedia-gstreamer.morph +- name: multimedia-gstreamer-openmax-generic + morph: strata/multimedia-gstreamer-openmax-generic.morph - name: privileges-management morph: strata/privileges-management.morph - name: python2-core diff --git a/systems/weston-qt5-system-x86_64.morph b/systems/weston-qt5-system-x86_64.morph index b7fe546a..1e19a543 100644 --- a/systems/weston-qt5-system-x86_64.morph +++ b/systems/weston-qt5-system-x86_64.morph @@ -10,6 +10,8 @@ strata: morph: strata/core.morph - name: coreutils-common morph: strata/coreutils-common.morph +- name: device-management + morph: strata/device-management.morph - name: foundation morph: strata/foundation.morph - name: audio-bluetooth diff --git a/systems/weston-system-armv7lhf-jetson.morph b/systems/weston-system-armv7lhf-jetson.morph index 652c4690..5b25ebd0 100644 --- a/systems/weston-system-armv7lhf-jetson.morph +++ b/systems/weston-system-armv7lhf-jetson.morph @@ -10,6 +10,8 @@ strata: morph: strata/core.morph - name: coreutils-common morph: strata/coreutils-common.morph +- name: device-management + morph: strata/device-management.morph - name: foundation morph: strata/foundation.morph - name: bsp-jetson diff --git a/systems/weston-system-x86_64-generic.morph b/systems/weston-system-x86_64-generic.morph index 0adfa767..5e91fb71 100644 --- a/systems/weston-system-x86_64-generic.morph +++ b/systems/weston-system-x86_64-generic.morph @@ -9,6 +9,8 @@ strata: morph: strata/core.morph - name: coreutils-common morph: strata/coreutils-common.morph +- name: device-management + morph: strata/device-management.morph - name: foundation morph: strata/foundation.morph - name: bsp-x86_64-generic diff --git a/systems/xfce-system-x86_64.morph b/systems/xfce-system-x86_64.morph index fedddd57..62616000 100644 --- a/systems/xfce-system-x86_64.morph +++ b/systems/xfce-system-x86_64.morph @@ -9,6 +9,8 @@ strata: morph: strata/core.morph - name: coreutils-common morph: strata/coreutils-common.morph +- name: device-management + morph: strata/device-management.morph - name: python2-core morph: strata/python2-core.morph - name: foundation |