diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-11 14:34:36 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-11 14:34:36 +0000 |
commit | 5eb3c5c80dc3522f6157f07ae25850a142d8e72d (patch) | |
tree | 7741036f374848210583a1be76355e4e603129b6 | |
parent | a1b4ece4de8ad5fa497f522c61541e9d7c1d0ace (diff) | |
parent | 68fe84679215c0a08b4a38fed73f811270972ea4 (diff) | |
download | infrastructure-5eb3c5c80dc3522f6157f07ae25850a142d8e72d.tar.gz |
Merge remote-tracking branch 'baserock/master' into sam/baserock
Merge in Baserock reference system definitions.
This allows building and deploying Baserock systems from this repo with
Morph.
524 files changed, 17663 insertions, 0 deletions
@@ -0,0 +1,6 @@ +README for morphs +================= + +These are some morphologies for Baserock. Baserock is a system +for developing embedded and appliance Linux systems. For +more information, see <http://wiki.baserock.org>. diff --git a/busybox-init.configure b/busybox-init.configure new file mode 100644 index 00000000..c7dba3b9 --- /dev/null +++ b/busybox-init.configure @@ -0,0 +1,145 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. +# +# This is a "morph deploy" configuration extension to configure a system +# to use busybox for its init, if INIT_SYSTEM=busybox is specified. +# +# As well as checking INIT_SYSTEM, the following variables are used. +# +# Getty configuration: +# * CONSOLE_DEVICE: Which device to spawn a getty on (default: ttyS0) +# * CONSOLE_BAUDRATE: Baud rate of the console (default: 115200) +# * CONSOLE_MODE: What kind of terminal this console emulates +# (default: vt100) + +if [ "$INIT_SYSTEM" != busybox ]; then + echo Not configuring system to use busybox init. + exit 0 +fi + +set -e +echo Configuring system to use busybox init + +RUN_SCRIPT=/etc/rcS +INIT_SCRIPT=/sbin/init + +install_mdev_config(){ + install -D -m644 /dev/stdin "$1" <<'EOF' +# support module loading on hotplug +$MODALIAS=.* root:root 660 @modprobe "$MODALIAS" + +# null may already exist; therefore ownership has to be changed with command +null root:root 666 @chmod 666 $MDEV +zero root:root 666 +full root:root 666 +random root:root 444 +urandom root:root 444 +hwrandom root:root 444 +grsec root:root 660 + +kmem root:root 640 +mem root:root 640 +port root:root 640 +# console may already exist; therefore ownership has to be changed with command +console root:root 600 @chmod 600 $MDEV +ptmx root:root 666 +pty.* root:root 660 + +# Typical devices + +tty root:root 666 +tty[0-9]* root:root 660 +vcsa*[0-9]* root:root 660 +ttyS[0-9]* root:root 660 + +# block devices +ram[0-9]* root:root 660 +loop[0-9]+ root:root 660 +sd[a-z].* root:root 660 +hd[a-z][0-9]* root:root 660 +md[0-9]* root:root 660 +sr[0-9]* root:root 660 @ln -sf $MDEV cdrom +fd[0-9]* root:root 660 + +# net devices +SUBSYSTEM=net;.* root:root 600 @nameif +tun[0-9]* root:root 600 =net/ +tap[0-9]* root:root 600 =net/ +EOF +} + +install_start_script(){ + install -D -m755 /dev/stdin "$1" <<'EOF' +#!/bin/sh +mount -t devtmpfs devtmpfs /dev +mount -t proc proc /proc +mount -t sysfs sysfs /sys +mkdir -p /dev/pts +mount -t devpts devpts /dev/pts + +echo /sbin/mdev >/proc/sys/kernel/hotplug +mdev -s + +hostname -F /etc/hostname + +run-parts -a start /etc/init.d +EOF +} + +install_inittab(){ + local inittab="$1" + local dev="$2" + local baud="$3" + local mode="$4" + install -D -m644 /dev/stdin "$1" <<EOF +::sysinit:$RUN_SCRIPT + +::askfirst:-/bin/cttyhack /bin/sh +::askfirst:/sbin/getty -L $dev $baud $mode + +::ctrlaltdel:/sbin/reboot +::shutdown:/sbin/swapoff -a +::shutdown:/bin/umount -a -r +::restart:/sbin/init +EOF +} + +install_init_symlink(){ + local initdir="$(dirname "$1")" + local initname="$(basename "$1")" + mkdir -p "$initdir" + cd "$initdir" + for busybox_dir in . ../bin ../sbin ../usr/bin ../usr/sbin; do + local busybox="$busybox_dir/busybox" + if [ ! -x "$busybox" ]; then + continue + fi + ln -sf "$busybox" "$initname" + return 0 + done + echo Unable to find busybox >&2 + exit 1 +} + +install_mdev_config "$1/etc/mdev.conf" + +install_start_script "$1$RUN_SCRIPT" + +install_inittab "$1/etc/inittab" "${CONSOLE_DEV-ttyS0}" \ + "${CONSOLE_BAUD-115200}" "${CONSOLE_MODE-vt100}" + +install_init_symlink "$1$INIT_SCRIPT" diff --git a/ceph.configure b/ceph.configure new file mode 100644 index 00000000..14fa6f6b --- /dev/null +++ b/ceph.configure @@ -0,0 +1,216 @@ +#!/usr/bin/python +# Copyright (C) 2013 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.5 +# +# 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 cliapp +import sys +import os +import subprocess +import shutil +import re + +systemd_monitor_template = """ +[Unit] +Description=Ceph Monitor firstboot setup + +[Service] +ExecStart=/usr/bin/ceph-mon --cluster {cluster} --mkfs -c {conf} -i {hostname} {keyring} +ExecStartPost=/bin/rm /etc/systemd/system/multi-user.target.wants/ceph-{cluster}-mon-fboot.service + +[Install] +Wanted-By=multi-user.target +""" +systemd_monitor_fname_template = "ceph-{cluster}-mon-fboot.service" + +systemd_osd_template = """ +[Unit] +Description=Ceph osd firstboot setup + +[Service] +ExecStart=/usr/sbin/ceph-disk prepare --cluster {cluster} --fs-type btrfs {data} +ExecStartPost=/bin/rm /etc/systemd/system/multi-user.target.wants/ceph-{cluster}-osd-{osd_id}-fboot.service + +[Install] +Wanted-By=multi-user.target +""" +systemd_osd_fname_template = "ceph-{cluster}-osd-{osd_id}-fboot.service" + +class CephConfigurationExtension(cliapp.Application): + """ + Set up ceph server daemons. + + Must include the following environment variables: + + HOSTNAME - Must be defined it is used as the ID for + the monitor and metadata daemons. + CEPH_CONF - Provide a ceph configuration file. + + Optional environment variables: + + CEPH_CLUSTER - Cluster name, if not provided defaults to 'ceph'. + + CEPH_BOOTSTRAP_OSD - Registered key capable of generating OSD + keys. + CEPH_BOOTSTRAP_MDS - Registered key capable of generating MDS + keys. + + Bootstrap keys are required for creating OSD daemons on servers + that do not have a running monitor daemon. They are gathered + by 'ceph-deploy gatherkeys' but can be generated and registered + separately. + + CEPH_MON - (Blank) Create a ceph monitor daemon on the image. + CEPH_MON_KEYRING - Location of monitor keyring. Required by the + monitor if using cephx authentication. + + + CEPH_OSD_X_DATA_DIR - Location of data directory for OSD. + Create an OSD daemon on image. 'X' is an integer + id, many osd daemons may be run on same server. + + CEPH_MDS - (Blank) Create a metadata server daemon on server. + """ + + def process_args(self, args): + + if "HOSTNAME" not in os.environ: + print "ERROR: Need a hostname defined by 'HOSTNAME'" + sys.exit(1) + if "CEPH_CLUSTER" not in os.environ: + print "ERROR: Need a cluster name defined by 'CEPH_CLUSTER'" + sys.exit(1) + if "CEPH_CONF" not in os.environ: + print "ERROR: Need a ceph conf file defined by 'CEPH_CONF'" + sys.exit(1) + + self.dest_dir = args[0] + + self.cluster_name = os.environ["CEPH_CLUSTER"] + self.hostname = os.environ["HOSTNAME"] + + self.conf_file = "/etc/ceph/{}.conf".format(self.cluster_name) + self.mon_dir = "/var/lib/ceph/mon/" + self.osd_dir = "/var/lib/ceph/osd/" + self.mds_dir = "/var/lib/ceph/mds/" + self.tmp_dir = "/var/lib/ceph/tmp/" + self.bootstrap_mds_dir = "/var/lib/ceph/bootstrap-mds/" + self.bootstrap_osd_dir = "/var/lib/ceph/bootstrap-osd/" + self.systemd_dir = "/etc/systemd/system/" + self.systemd_multiuser_dir = "/etc/systemd/system/multi-user.target.wants/" + + self.copy_to_img(os.environ["CEPH_CONF"], self.conf_file) + + # Copy over bootstrap keyrings + if "CEPH_BOOTSTRAP_OSD" in os.environ: + self.copy_bootstrap_osd(os.environ["CEPH_BOOTSTRAP_OSD"]); + if "CEPH_BOOTSTRAP_MDS" in os.environ: + self.copy_bootstrap_mds(os.environ["CEPH_BOOTSTRAP_MDS"]); + + # Configure any monitor daemons + if "CEPH_MON" in os.environ: + self.create_mon_data_dir(os.environ.get("CEPH_MON_KEYRING")) + + # Configure any object storage daemons + osd_re = r"CEPH_OSD_(\d+)_DATA_DIR$" + + for env in os.environ.keys(): + match = re.match(osd_re, env) + if match: + osd_data_dir_env = match.group(0) + osd_id = match.group(1) + + self.create_osd_data_dir(osd_id, os.environ.get(osd_data_dir_env)) + + # Configure any mds daemons + if "CEPH_MDS" in os.environ: + self.create_mds_data_dir() + + def copy_to_img(self, src_file, dest_file): + shutil.copy(src_file, self.dest_dir + dest_file) + + def copy_bootstrap_osd(self, src_file): + self.copy_to_img(src_file, + os.path.join(self.bootstrap_osd_dir, "{}.keyring".format(self.cluster_name))) + + def copy_bootstrap_mds(self, src_file): + self.copy_to_img(src_file, + os.path.join(self.bootstrap_mds_dir, "{}.keyring".format(self.cluster_name))) + + def symlink_to_multiuser(self, fname): + print >> sys.stderr, os.path.join("../", fname) + print >> sys.stderr, self.dest_dir + os.path.join(self.systemd_multiuser_dir, fname) + os.symlink(os.path.join("../", fname), + self.dest_dir + os.path.join(self.systemd_multiuser_dir, fname)) + + def create_mon_data_dir(self, src_keyring): + + #Create the monitor data directory + mon_data_dir = os.path.join(self.mon_dir, "{}-{}".format(self.cluster_name, self.hostname)) + os.makedirs(self.dest_dir + mon_data_dir) + + #Create sysvinit file to start via sysvinit + sysvinit_file = os.path.join(mon_data_dir, "sysvinit") + open(self.dest_dir + sysvinit_file, 'a').close() + + #Create systemd file to initialize the monitor data directory + keyring = "" + if src_keyring: + #Copy the keyring from local to the image + dest_keyring = os.path.join(self.tmp_dir, + "{}-{}.mon.keyring".format(self.cluster_name, self.hostname)) + self.copy_to_img(src_keyring, dest_keyring) + + keyring = "--keyring " + dest_keyring + + mon_systemd_fname = systemd_monitor_fname_template.format(cluster=self.cluster_name) + mon_systemd = open(self.dest_dir + os.path.join(self.systemd_dir, mon_systemd_fname), "w") + mon_systemd.write(systemd_monitor_template.format(cluster=self.cluster_name, + conf=self.conf_file, + hostname=self.hostname, + keyring=keyring)) + mon_systemd.close() + + #Create a symlink to the multi user target + self.symlink_to_multiuser(mon_systemd_fname) + + def create_osd_data_dir(self, osd_id, data_dir): + if not data_dir: + data_dir = '/srv/osd' + osd_id + + #Create the osd data dir + os.makedirs(self.dest_dir + data_dir) + + osd_systemd_fname = systemd_osd_fname_template.format(cluster=self.cluster_name, osd_id=osd_id) + osd_systemd = open(self.dest_dir + os.path.join(self.systemd_dir, osd_systemd_fname), "w") + osd_systemd.write(systemd_osd_template.format(cluster=self.cluster_name, + data=data_dir, + osd_id=osd_id)) + osd_systemd.close() + + #Create a symlink to the multi user target + self.symlink_to_multiuser(osd_systemd_fname) + + def create_mds_data_dir(self): + + #Create the monitor data directory + mds_data_dir = os.path.join(self.mds_dir, "{}-{}".format(self.cluster_name, self.hostname)) + os.makedirs(self.dest_dir + mds_data_dir) + + #Create sysvinit file to start via sysvinit + sysvinit_file = os.path.join(mds_data_dir, "sysvinit") + open(self.dest_dir + sysvinit_file, 'a').close() + + +CephConfigurationExtension().run() diff --git a/cloud-init.configure b/cloud-init.configure new file mode 100755 index 00000000..aa83e0e2 --- /dev/null +++ b/cloud-init.configure @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. +# +# +# This is a "morph deploy" configuration extension to enable the +# cloud-init services. +set -e + +ROOT="$1" + +########################################################################## + +set -e + +case "$CLOUD_INIT" in +''|False|no) + exit 0 + ;; +True|yes) + echo "Configuring cloud-init" + ;; +*) + echo Unrecognised option "$CLOUD_INIT" to CLOUD_INIT + exit 1 + ;; +esac + + +cloud_init_services="cloud-config.service + cloud-init-local.service + cloud-init.service + cloud-final.service" + +# Iterate over the cloud-init services and enable them creating a link +# into /etc/systemd/system/multi-user.target.wants. +# If the services to link are not present, fail. + +services_folder="lib/systemd/system" +for service_name in $cloud_init_services; do + if [ ! -f "$ROOT/$services_folder/$service_name" ]; then + echo "ERROR: Service $service_name is missing." >&2 + echo "Failed to configure cloud-init." + exit 1 + else + echo Enabling systemd service "$service_name" >"$MORPH_LOG_FD" + ln -sf "/$services_folder/$service_name" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/$service_name" + fi +done diff --git a/clusters/ci.morph b/clusters/ci.morph new file mode 100644 index 00000000..48e978bc --- /dev/null +++ b/clusters/ci.morph @@ -0,0 +1,49 @@ +name: ci +kind: cluster +description: | + Deploy all the systems for CD. + + This cluster morph is for use by the Mason Continuous Delivery pipeline + during development. +systems: +- morph: systems/devel-system-x86_64-generic.morph + deploy: + devel-system-x86_64-generic: + type: rawdisk + location: devel-system-x86_64-generic.img + DISK_SIZE: 4G +- morph: systems/devel-system-x86_32-generic.morph + deploy: + devel-system-x86_32-generic: + type: rawdisk + location: devel-system-x86_32-generic.img + DISK_SIZE: 4G +- morph: systems/build-system-armv7lhf-jetson.morph + deploy: + devel-system-armv7lhf-jetson: + type: rawdisk + location: build-system-armv7lhf-jetson.img + DISK_SIZE: 2G + ROOT_DEVICE: "/dev/mmcblk0p1" + DTB_PATH: "boot/tegra124-jetson-tk1.dtb" + BOOTLOADER_CONFIG_FORMAT: "extlinux" + BOOTLOADER_INSTALL: "none" + KERNEL_ARGS: cma=256M console=tty0 console=ttyS0,115200n8 no_console_suspend=1 nouveau.pstate=1 +- morph: systems/weston-system-x86_64-generic.morph + deploy: + weston-system-x86_64-generic: + type: rawdisk + location: weston-system-x86_64-generic.img + DISK_SIZE: 4G + KERNEL_ARGS: vga=788 +- morph: systems/weston-system-armv7lhf-jetson.morph + deploy: + weston-system-armv7lhf-jetson: + type: rawdisk + location: weston-system-armv7lhf-jetson.img + DISK_SIZE: 4G + ROOT_DEVICE: "/dev/mmcblk0p1" + DTB_PATH: "boot/tegra124-jetson-tk1.dtb" + BOOTLOADER_CONFIG_FORMAT: "extlinux" + BOOTLOADER_INSTALL: "none" + KERNEL_ARGS: cma=256M console=tty0 console=ttyS0,115200n8 no_console_suspend=1 nouveau.pstate=1 diff --git a/clusters/example-distbuild-cluster.morph b/clusters/example-distbuild-cluster.morph new file mode 100644 index 00000000..513c16c5 --- /dev/null +++ b/clusters/example-distbuild-cluster.morph @@ -0,0 +1,37 @@ +name: example-distbuild-cluster +kind: cluster +description: | + This is an example cluster morph that can be adapted to set up a + Baserock distributed build network. + + You will need to deploy a Trove for the distributed build network + to use before deploying this cluster. The worker SSH key file should + be generated as part of the Trove deployment. It is the key used by + workers to authenticate with the Trove to give them read access to + all source repositories. +systems: +- morph: systems/build-system-x86_64.morph + deploy-defaults: + CONTROLLERHOST: build-controller + DISTBUILD_CONTROLLER: false + DISTBUILD_WORKER: true + FSTAB_SRC: LABEL=src /srv/distbuild auto defaults,rw,noatime 0 2 + INSTALL_FILES: distbuild/manifest + NFSBOOT_CONFIGURE: true + TROVE_ID: $MY_TROVE + WORKER_SSH_KEY: ssh-keys/worker.key + deploy: + build-controller: + type: nfsboot + location: $MY_TROVE + DISTBUILD_CONTROLLER: true + HOSTNAME: build-controller + WORKERS: build-node-1, build-node-2 + build-node-1: + type: nfsboot + location: $MY_TROVE + HOSTNAME: build-node-1 + build-node-2: + type: nfsboot + location: $MY_TROVE + HOSTNAME: build-node-2 diff --git a/clusters/gerrit-openstack.morph b/clusters/gerrit-openstack.morph new file mode 100644 index 00000000..bdfb128c --- /dev/null +++ b/clusters/gerrit-openstack.morph @@ -0,0 +1,16 @@ +name: open-stack-gerrit +kind: cluster +description: | + Deploy gerrit morphology into openstack +systems: +- morph: systems/gerrit-x86_64.morph + deploy: + openstack-image: + type: openstack + location: http://openstack-host:5000/v2.0/ + DISK_SIZE: 4G + OPENSTACK_USER: openstack-user + OPENSTACK_TENANT: openstack-tenant + OPENSTACK_IMAGENAME: Gerrit + CLOUD_INIT: yes + KERNEL_ARGS: console=ttyS0 console=tty0 diff --git a/clusters/gitlab-ci-runner-cluster.morph b/clusters/gitlab-ci-runner-cluster.morph new file mode 100644 index 00000000..97da4a8d --- /dev/null +++ b/clusters/gitlab-ci-runner-cluster.morph @@ -0,0 +1,16 @@ +name: gitlab-ci-runner-cluster +kind: cluster +systems: +- morph: systems/gitlab-ci-runner.morph + deploy-defaults: + AUTOSTART: false + DISK_SIZE: 6G + RAM_SIZE: 3G + VCPUS: 2 + VERSION_LABEL: factory + deploy: + gitlab-ci-runner: + type: kvm + location: kvm+ssh://USER@HOST/gitlab-ci-runner/home/USER/gitlab-ci-runner.img + HOSTNAME: gitlab-ci-runner + INSTALL_FILES: gitlab-ci-runner/manifest diff --git a/clusters/gitlab-cluster.morph b/clusters/gitlab-cluster.morph new file mode 100644 index 00000000..5f3177ca --- /dev/null +++ b/clusters/gitlab-cluster.morph @@ -0,0 +1,48 @@ +name: gitlab-cluster +kind: cluster +description: | + This is an example cluster morphology that can be adapted to set up a GitLab + server with GitLab CI running alongside it, along with one or more CI + runners to actually run the CI tests/builds. + + For the server, you will need to specify the GITLAB_HOSTNAME. This is the + domain name or IP by which your deployed GitLab instance will be able to be + reached by. You will also need a GITLAB_PORT, CI_PORT, UNICORN PORT and + UNICORN_CI_PORT. These are the port to use for GitLab, the port to use for + GitLab CI, the port for GitLab's Unicorn process to listen on, and the port + for GitLab CI's Unicorn process to listen on respectively. Finally, you will + need to define a GITLAB_EMAIL, that is the email that mail from your GitLab + instance will appear to be from. +systems: +- morph: systems/gitlab-server.morph + deploy-defaults: + AUTOSTART: false + DISK_SIZE: 10G + RAM_SIZE: 2G + VCPUS: 2 + VERSION_LABEL: factory + deploy: + gitlab: + type: kvm + location: kvm+ssh://USER@HOST/gitlab/home/USER/gitlab.img + CI_PORT: 81 + GITLAB_EMAIL: gitlab@gitlab.example.com + GITLAB_HOSTNAME: gitlab.example.com + GITLAB_PORT: 80 + HOSTNAME: gitlab + INSTALL_FILES: gitlab-server/manifest + UNICORN_CI_PORT: 8081 + UNICORN_PORT: 8080 +- morph: systems/gitlab-ci-runner.morph + deploy-defaults: + AUTOSTART: false + DISK_SIZE: 10G + RAM_SIZE: 3G + VCPUS: 2 + VERSION_LABEL: factory + deploy: + gitlab-ci-runner: + type: kvm + location: kvm+ssh://USER@HOST/gitlab-ci-runner/home/USER/gitlab-ci-runner.img + HOSTNAME: gitlab-ci-runner + INSTALL_FILES: gitlab-ci-runner/manifest diff --git a/clusters/gitlab-server-cluster.morph b/clusters/gitlab-server-cluster.morph new file mode 100644 index 00000000..fcb7c1d2 --- /dev/null +++ b/clusters/gitlab-server-cluster.morph @@ -0,0 +1,22 @@ +name: gitlab-server-cluster +kind: cluster +systems: +- morph: systems/gitlab-server.morph + deploy-defaults: + AUTOSTART: false + DISK_SIZE: 6G + RAM_SIZE: 2G + VCPUS: 2 + VERSION_LABEL: factory + deploy: + gitlab: + type: kvm + location: kvm+ssh://USER@HOST/gitlab/home/USER/gitlab.img + CI_PORT: 81 + GITLAB_EMAIL: gitlab@gitlab.example.com + GITLAB_HOSTNAME: gitlab.example.com + GITLAB_PORT: 80 + HOSTNAME: gitlab + INSTALL_FILES: gitlab-server/manifest + UNICORN_CI_PORT: 8081 + UNICORN_PORT: 8080 diff --git a/clusters/image-package-example.morph b/clusters/image-package-example.morph new file mode 100644 index 00000000..fd8487e2 --- /dev/null +++ b/clusters/image-package-example.morph @@ -0,0 +1,12 @@ +name: image-package-example +kind: cluster +description: | + Packaged system and script for installing it, for deferred instantiation. +systems: +- morph: systems/base-system-x86_32-generic.morph + deploy: + imgpkg: + type: image-package + location: image-package-example.tar + BOOTLOADER_BLOBS: /usr/share/syslinux/mbr.bin + INCLUDE_SCRIPTS: image-package-example/make-disk-image.sh.in:image-package-example/disk-install.sh.in:image-package-example/common.sh.in diff --git a/clusters/initramfs-test.morph b/clusters/initramfs-test.morph new file mode 100644 index 00000000..afc94961 --- /dev/null +++ b/clusters/initramfs-test.morph @@ -0,0 +1,17 @@ +name: initramfs-test +kind: cluster +systems: +- morph: systems/base-system-x86_64-generic.morph + deploy: + system: + type: rawdisk + location: initramfs-system-x86_64.img + DISK_SIZE: 1G + HOSTNAME: initramfs-system + INITRAMFS_PATH: boot/initramfs.gz + subsystems: + - morph: systems/initramfs-x86_64.morph + deploy: + initramfs: + type: initramfs + location: boot/initramfs.gz diff --git a/clusters/installer-build-system-x86_64.morph b/clusters/installer-build-system-x86_64.morph new file mode 100644 index 00000000..b31caced --- /dev/null +++ b/clusters/installer-build-system-x86_64.morph @@ -0,0 +1,46 @@ +name: installer-build-system-x86_64 +kind: cluster +description: | + This is a cluster morphology that can be used to deploy + installer systems. This is done by adding the files needed + using a manifest file (installer/manifest) with the INSTALL_FILES + extension, and using the installer.configure extension to generate + the configuration needed in the system. + + This manifest, which is installing the installer script in + /usr/lib/installer/installer.py, in combination of adding + "init=/usr/lib/installer/installer.py" as KERNEL_ARGS in the system + makes the system run the installer.py script as init script. + + The installer.py script will read the information needed to + install the system (where is the root filesystem to install and + where to install it) from /etc/install.conf. + + This cluster also deploys a subsystem (a build-system in this case) + which is going to be the system that the installer system/script is + going to install. + +systems: +- morph: systems/installer-system-x86_64.morph + deploy: + installer: + type: rawdisk + location: installer-build-system-x86_64.img + KERNEL_ARGS: init=/usr/lib/baserock-installer/installer + DISK_SIZE: 6G + HOSTNAME: installer-x86_64 + INSTALLER_TARGET_STORAGE_DEVICE: /dev/sda + INSTALLER_ROOTFS_TO_INSTALL: /rootfs + subsystems: + - morph: systems/build-system-x86_64.morph + deploy: + to-install: + type: sysroot + location: /rootfs + INITRAMFS_PATH: boot/initramfs.gz + subsystems: + - morph: systems/initramfs-x86_64.morph + deploy: + initramfs: + type: initramfs + location: boot/initramfs.gz diff --git a/clusters/jetson-upgrade.morph b/clusters/jetson-upgrade.morph new file mode 100644 index 00000000..a73507aa --- /dev/null +++ b/clusters/jetson-upgrade.morph @@ -0,0 +1,17 @@ +name: jetson-upgrade +kind: cluster +systems: +- morph: systems/devel-system-armv7lhf-jetson.morph + deploy-defaults: + TROVE_HOST: TROVE_HOST + TROVE_ID: TROVE_ID + ROOT_DEVICE: "/dev/mmcblk0p1" + DTB_PATH: "boot/tegra124-jetson-tk1.dtb" + BOOTLOADER_CONFIG_FORMAT: "extlinux" + BOOTLOADER_INSTALL: "none" + KERNEL_ARGS: cma=256M console=tty0 console=ttyS0,115200n8 no_console_suspend=1 nouveau.pstate=1 + FSTAB_SRC: LABEL=src /src auto defaults,rw,noatime,nofail 0 2 + deploy: + self: + type: ssh-rsync + location: root@127.0.0.1 diff --git a/clusters/mason-openstack.morph b/clusters/mason-openstack.morph new file mode 100644 index 00000000..6ef14888 --- /dev/null +++ b/clusters/mason-openstack.morph @@ -0,0 +1,39 @@ +name: openstack-mason +kind: cluster +description: | + This is a template cluster morphology that can be adapted to set up a + Mason. Masons are composed of a trove and a distbuild system. +systems: +- morph: systems/build-system-x86_64.morph + deploy-defaults: + ARTIFACT_CACHE_SERVER: example-cache-server + CONTROLLERHOST: controller-hostname + DISTBUILD_CONTROLLER: true + DISTBUILD_WORKER: true + INSTALL_FILES: distbuild/manifest + RAM_SIZE: 8G + TROVE_HOST: your-upstream-trove + TROVE_ID: your-upstream-trove-prefix + VCPUS: 2 + WORKER_SSH_KEY: ssh-keys/worker.key + deploy: + mason-openstack: + type: openstack + location: openstack-auth-url (eg example.com:5000/v2.0) + DISK_SIZE: 6G + DISTBUILD_CONTROLLER: true + HOSTNAME: controller-hostname + MASON_CLUSTER_MORPHOLOGY: clusters/ci.morph + MASON_DEFINITIONS_REF: master + MASON_DISTBUILD_ARCH: x86_64 + MASON_TEST_HOST: user@openstack-auth-url + WORKERS: controller-hostname + OPENSTACK_AUTH_URL: openstack-auth-url + OPENSTACK_USER: baserock + OPENSTACK_TENANT: baserock + OPENSTACK_TENANT_ID: 7d7ebfe23367490b973a10fa426c3aec + OPENSTACK_IMAGENAME: mason-openstack + OPENSTACK_NETWORK_ID: 71f5151a-b7c3-405d-a841-d1b07e5db099 + CLOUD_INIT: yes + KERNEL_ARGS: console=ttyS0 console=tty0 + TEST_INFRASTRUCTURE_TYPE: openstack diff --git a/clusters/mason.morph b/clusters/mason.morph new file mode 100644 index 00000000..9717239d --- /dev/null +++ b/clusters/mason.morph @@ -0,0 +1,56 @@ +name: example-mason-cluster +kind: cluster +description: | + This is a template cluster morphology that can be adapted to set up a + Mason. Masons are composed of a trove and a distbuild system. + + It is suggested that you use mason/mason-generator.sh to adapt this + template to suit your needs. It also handles the generation of + keys to let the systems communicate. +systems: +- morph: systems/trove-system-x86_64.morph + deploy: + red-box-v1-trove: + type: kvm + location: kvm+ssh://vm-user@vm-host/red-box-v1-trove/vm-path/red-box-v1-trove.img + AUTOSTART: true + DISK_SIZE: 20G + HOSTNAME: red-box-v1-trove + LORRY_SSH_KEY: ssh_keys/lorry.key + MASON_SSH_PUBKEY: ssh_keys/mason.key.pub + RAM_SIZE: 8G + TROVE_ADMIN_EMAIL: adminuser@example.com + TROVE_ADMIN_NAME: Nobody + TROVE_ADMIN_SSH_PUBKEY: ssh_keys/id_rsa.pub + TROVE_ADMIN_USER: adminuser + TROVE_COMPANY: Company name goes here + TROVE_HOST: red-box-v1 + TROVE_ID: red-box-v1-trove + UPSTREAM_TROVE: upstream-trove + VCPUS: 2 + VERSION_LABEL: 45 + WORKER_SSH_PUBKEY: ssh_keys/worker.key.pub +- morph: systems/build-system-x86_64.morph + deploy-defaults: + ARTIFACT_CACHE_SERVER: red-box-v1-trove.example.com + CONTROLLERHOST: red-box-v1-controller.example.com + DISTBUILD_CONTROLLER: false + DISTBUILD_WORKER: true + INSTALL_FILES: distbuild/manifest + RAM_SIZE: 8G + TROVE_HOST: upstream-trove + TROVE_ID: upstream-trove + VCPUS: 2 + WORKER_SSH_KEY: ssh_keys/worker.key + deploy: + red-box-v1-controller: + type: kvm + location: kvm+ssh://vm-user@vm-host/red-box-v1-controller/vm-path/red-box-v1-controller.img + DISK_SIZE: 60G + DISTBUILD_CONTROLLER: true + HOSTNAME: red-box-v1-controller + MASON_CLUSTER_MORPHOLOGY: clusters/ci.morph + MASON_DEFINITIONS_REF: master + MASON_DISTBUILD_ARCH: x86_64 + MASON_TEST_HOST: vm-user@vm-host:/vm-path/ + WORKERS: red-box-v1-controller diff --git a/clusters/minimal-system-deploy.morph b/clusters/minimal-system-deploy.morph new file mode 100644 index 00000000..06629ffc --- /dev/null +++ b/clusters/minimal-system-deploy.morph @@ -0,0 +1,14 @@ +name: minimal-system-deploy +kind: cluster +description: | + Deploy a minimal system to a system running KVM +systems: +- morph: systems/minimal-system-x86_32-generic.morph + deploy: + vm: + type: kvm + location: kvm+ssh://192.168.122.1/tiny-x86_32/srv/VMs/tiny-x86_32.img + DISK_SIZE: 512M + HOSTNAME: tiny-x86_32 + INIT_SYSTEM: busybox + RAM_SIZE: 512M diff --git a/clusters/release.morph b/clusters/release.morph new file mode 100644 index 00000000..f161d0df --- /dev/null +++ b/clusters/release.morph @@ -0,0 +1,60 @@ +name: release +kind: cluster +description: | + Deploy all the systems for we support in a release. + + This cluster morph is used by the tool 'scripts/do-release'. While + you can deploy the systems yourself, if you are making a Baserock release + then the script should be used. +systems: +- morph: systems/build-system-x86_32-chroot.morph + deploy: + build-system-x86_32-chroot: + type: tar + location: build-system-x86_32-chroot.tar +- morph: systems/build-system-x86_32.morph + deploy: + build-system-x86_32: + type: rawdisk + location: build-system-x86_32.img + DISK_SIZE: 6G +- morph: systems/build-system-x86_64-chroot.morph + deploy: + build-system-x86_64-chroot: + type: tar + location: build-system-x86_64-chroot.tar +- morph: systems/build-system-x86_64.morph + deploy: + build-system-x86_64: + type: rawdisk + location: build-system-x86_64.img + DISK_SIZE: 6G +- morph: systems/build-system-armv7lhf-jetson.morph + deploy: + devel-system-armv7lhf-jetson: + type: rawdisk + location: build-system-armv7lhf-jetson.img + DISK_SIZE: 2G + ROOT_DEVICE: "/dev/mmcblk0p1" + DTB_PATH: "boot/tegra124-jetson-tk1.dtb" + BOOTLOADER_CONFIG_FORMAT: "extlinux" + BOOTLOADER_INSTALL: "none" + KERNEL_ARGS: cma=256M console=tty0 console=ttyS0,115200n8 no_console_suspend=1 nouveau.pstate=1 +- morph: systems/genivi-baseline-system-x86_64-generic.morph + deploy: + genivi-baseline-system-x86_64-generic: + type: rawdisk + location: genivi-baseline-system-x86_64-generic.img + DISK_SIZE: 4G + KERNEL_ARGS: vga=788 +- morph: systems/genivi-baseline-system-armv7lhf-jetson.morph + deploy: + genivi-baseline-system-armv7lhf-jetson: + type: rawdisk + location: genivi-baseline-system-armv7lhf-jetson.img + DISK_SIZE: 4G + ROOT_DEVICE: "/dev/mmcblk0p1" + DTB_PATH: "boot/tegra124-jetson-tk1.dtb" + BOOTLOADER_CONFIG_FORMAT: "extlinux" + BOOTLOADER_INSTALL: "none" + KERNEL_ARGS: cma=256M console=tty0 console=ttyS0,115200n8 no_console_suspend=1 nouveau.pstate=1 diff --git a/clusters/sdk-example-cluster.morph b/clusters/sdk-example-cluster.morph new file mode 100644 index 00000000..f71d093d --- /dev/null +++ b/clusters/sdk-example-cluster.morph @@ -0,0 +1,46 @@ +name: sdk +kind: cluster +description: | + An example of creating a cross-compile SDK for an embedded Baserock system. + + This cluster demonstrates how you can use the 'sdk' write extension to + produce a cross-compile SDK tarball for an Baserock applicance. In this + example the system is assumed to run on ARMv7, and the SDK is built to + run on any x86_32 GNU/Linux system. + + The SDK is a Baserock system itself, containing just 'build-essential' and a + 'cross-toolchain' stratum. The SDK system also includes the target + appliance's system, as a 'subsystem', so that the libraries and headers are + available when building. + + This cluster deploys the SDK system using the 'sdk' write extension, which + produces a tarball with a small shell header. When the shell header is + executed, and passed a directory name on the commandline, it extracts the SDK + to that path and patches the binaries so that they execute correctly from + that directory. + + Deploying the applicate system artifact to the target device should be + done with a separate cluster morphology, because you will often want to + do this without rebuilding the SDK. + + You must build each system with `morph build` before deploying. We recommend + doing this all from your Baserock development machine, using a Baserock + ARM distributed build network to produce the system artifact. Once both + system artifacts are cached locally, the `morph deploy` command will produce + a self-extracting shell script/tarball following the 'location' field. + + See the documentation of the sdk.write extension for more information. +systems: +- morph: systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph + deploy: + sdk: + type: sdk + location: armv7lhf-cross-toolchain-system-x86_32-generic.sh + PREFIX: /usr + TARGET: armv7lhf-baserock-linux-gnueabi + subsystems: + - morph: systems/devel-system-armv7lhf-highbank.morph + deploy: + sysroot: + type: sysroot + location: usr/armv7lhf-baserock-linux-gnueabi/sys-root diff --git a/clusters/trove-example.morph b/clusters/trove-example.morph new file mode 100644 index 00000000..25ee579d --- /dev/null +++ b/clusters/trove-example.morph @@ -0,0 +1,60 @@ +name: trove-example +kind: cluster +description: | + This is an example cluster morphology for deploying a Trove, + both the initial deployment and an upgrade. + + You need some ssh keys, which you can create like this: + + mkdir ssh_keys + ssh-keygen -N '' -f ssh_keys/lorry.key + ssh-keygen -N '' -f ssh_keys/mason.key + ssh-keygen -N '' -f ssh_keys/worker.key + ssh-keygen -N '' -f ssh_keys/trove-admin.key + + You may also put in your own keys instead of creating new ones. + + To do the initial deployment: + + morph deploy --upgrade clusters/trove-example.morph \ + initial \ + initial.location=kvm+ssh://liw@192.168.122.1/test-trove/tmp/test-trove.img + + To do an upgrade: + + morph deploy clusters/trove-example.morph \ + upgrade upgrade.VERSION_LABEL=123 + + where `VERSION_LABEL` gets a new unique value each time. + + Remember to always specify either initial or upgrade as the + deployment name to use, otherwise morph will attempt to deploy both. + + You can find documentation for Trove at the following web address: + http://wiki.baserock.org/Trove/ +systems: +- morph: systems/trove-system-x86_64.morph + deploy-defaults: + HOSTNAME: test-trove + VCPUS: 2 + RAM_SIZE: 2G + DISK_SIZE: 8G + LORRY_SSH_KEY: ssh_keys/lorry.key + MASON_SSH_PUBKEY: ssh_keys/mason.key.pub + WORKER_SSH_PUBKEY: ssh_keys/worker.key.pub + TROVE_ADMIN_EMAIL: adminuser@example.com + TROVE_ADMIN_NAME: Nobody + TROVE_ADMIN_SSH_PUBKEY: ssh_keys/trove-admin.key.pub + TROVE_ADMIN_USER: adminuser + TROVE_COMPANY: Company name goes here + TROVE_HOST: test-trove + TROVE_ID: test-trove + UPSTREAM_TROVE: '' + deploy: + initial: + type: kvm + location: kvm+ssh://vm-user@vm-host/test-trove/vm-path/test-trove.img + VERSION_LABEL: 1 + upgrade: + type: ssh-rsync + location: test-trove diff --git a/clusters/trove.baserock.org-upgrade.morph b/clusters/trove.baserock.org-upgrade.morph new file mode 100644 index 00000000..eaf939e1 --- /dev/null +++ b/clusters/trove.baserock.org-upgrade.morph @@ -0,0 +1,23 @@ +name: trove.baserock.org-upgrade +kind: cluster +description: | + This is a cluster morphology for deploying an UPGRADE to + git.baserock.org. It doesn't work for the initial deployment. The + deployer MUST have ssh access to root@git.baserock.org. To use: + + morph deploy --upgrade trove.baserock.org-upgrade gbo.VERSION_LABEL=2014-05-29 + + Replace the value of gbo.VERSION_LABEL above with the current date. + You can add letters if you need to upgrade multiple times in a day. +systems: +- morph: systems/trove-system-x86_64.morph + deploy: + gbo: + type: ssh-rsync + location: root@git.baserock.org + FSTAB_HOME: LABEL=homes /home auto defaults,noatime,rw 0 2 + HOSTNAME: firehose1 + LORRY_CONTROLLER_MINIONS: 4 + TROVE_COMPANY: Baserock + TROVE_HOSTNAME: git.baserock.org + TROVE_ID: baserock diff --git a/clusters/upgrade-devel.morph b/clusters/upgrade-devel.morph new file mode 100644 index 00000000..b7ce9bc0 --- /dev/null +++ b/clusters/upgrade-devel.morph @@ -0,0 +1,39 @@ +name: upgrade-devel +kind: cluster +description: | + This is a cluster morphology that can be used to deploy systems to a + an existing Baserock devel system, as an upgrade of the running system. + + This method is for users who deployed a system manually from one of the + images provided on http://download.baserock.org. IT IS ONLY POSSIBLE TO + UPGRADE BASEROCK 14 RELEASES OR NEWER. + + If you deployed your system using `morph deploy` then you should reuse the + cluster morphology you did the initial deployment with, instead of this one, + so that the configuration is preserved in the new system. + + Ensure that your root user has passwordless SSH access to localhost with + `ssh root@localhost whoami`. If not, run `ssh-copy-id root@localhost`. + Make sure the 'morph' field below matches the system you are upgrading. + + To upgrade, select a sensible a value for VERSION_LABEL and run: + + morph deploy --upgrade upgrade-devel.morph self.HOSTNAME=$(hostname) self.VERSION_LABEL=$VERSION_LABEL + + Your configuration in /etc should be propagated to the new system, but there + may be merge conflicts. Check /etc for files named '.rej' and '.orig' in the + new system, which will indicate that there are changes from the old system + that must be merged manually. You can get a nice diff from the old /etc as + follows: + + mount /dev/sda /mnt + git diff --no-index /mnt/systems/factory/run/etc /mnt/systems/$VERSION_LABEL/run/etc + + On a base system, use 'diff -r' instead of 'git diff --no-index'. It will + not be as colourful. +systems: +- morph: systems/devel-system-x86_64-generic.morph + deploy: + self: + type: ssh-rsync + location: root@127.0.0.1 diff --git a/clusters/weston-system-x86_64-generic-deploy.morph b/clusters/weston-system-x86_64-generic-deploy.morph new file mode 100644 index 00000000..ac63a93a --- /dev/null +++ b/clusters/weston-system-x86_64-generic-deploy.morph @@ -0,0 +1,12 @@ +name: release +kind: cluster +description: | + Deploy a stock weston system. +systems: +- morph: systems/weston-system-x86_64-generic.morph + deploy: + weston-system-x86_64-generic: + type: rawdisk + location: /weston-system-x86_64-generic.img + DISK_SIZE: 4G + KERNEL_ARGS: vga=788 diff --git a/distbuild.configure b/distbuild.configure new file mode 100644 index 00000000..062aaecc --- /dev/null +++ b/distbuild.configure @@ -0,0 +1,132 @@ +#!/bin/sh +# Copyright (C) 2013-2014 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. +# +# This is a "morph deploy" configure extension to configure a Baserock +# build node, as part of a distributed building cluster. It uses the +# following variables from the environment: +# +# * DISTBUILD_CONTROLLER: if 'yes', machine is set up as the controller. +# * DISTBUILD_WORKER: if 'yes', machine is set up as a worker. +# * TROVE_ID: hostname and Trove prefix of the server to pull source +# from and push built artifacts to. +# * TROVE_HOST: FQDN of the same server as in TROVE_ID +# +# The following variable is optional: +# +# * ARTIFACT_CACHE_SERVER: by default artifacts are pushed to the same +# Trove that served the source, but you can use a different one. +# +# The following variable is required for worker nodes only: +# +# * CONTROLLERHOST: hostname or IP address of distbuild controller machine. +# * WORKER_SSH_KEY: identity used to authenticate with Trove +# +# The following variable is required for the controller node only: +# +# * WORKERS: hostnames or IP address of worker nodes, comma-separated. + +set -e + +if [ -n "$DISTBUILD_GENERIC" ]; then + echo "Not configuring the distbuild node, it will be generic" + exit 0 +fi + +# Set default values for these two options if they are unset, so that if the +# user specifies no distbuild config at all the configure extension exits +# without doing anything but does not raise an error. +DISTBUILD_CONTROLLER=${DISTBUILD_CONTROLLER-False} +DISTBUILD_WORKER=${DISTBUILD_WORKER-False} + +if [ "$DISTBUILD_CONTROLLER" = False -a "$DISTBUILD_WORKER" = False ]; then + exit 0 +fi + +set -u + +# Check that all the variables needed are present: + +error_vars=false + +if [ "x$TROVE_HOST" = "x" ]; then + echo "ERROR: TROVE_HOST needs to be defined." + error_vars=true +fi + +if [ "x$TROVE_ID" = "x" ]; then + echo "ERROR: TROVE_ID needs to be defined." + error_vars=true +fi + +if [ "$DISTBUILD_WORKER" = True ]; then + if ! ssh-keygen -lf "$WORKER_SSH_KEY" > /dev/null 2>&1; then + echo "ERROR: WORKER_SSH_KEY is not a vaild ssh key." + error_vars=true + fi + + if [ "x$CONTROLLERHOST" = "x" ]; then + echo "ERROR: CONTROLLERHOST needs to be defined." + error_vars=true + fi +fi + +if [ "$DISTBUILD_CONTROLLER" = True ]; then + if [ "x$WORKERS" = "x" ]; then + echo "ERROR: WORKERS needs to be defined." + error_vars=true + fi +fi + +if "$error_vars"; then + exit 1 +fi + + +ROOT="$1" + +DISTBUILD_DATA="$ROOT/etc/distbuild" +mkdir -p "$DISTBUILD_DATA" + +# If it's a worker, install the worker ssh key. +if [ "$DISTBUILD_WORKER" = True ] +then + install -m 0644 "$WORKER_SSH_KEY" "$DISTBUILD_DATA/worker.key" +fi + + + +# Create the configuration file +python <<'EOF' >"$DISTBUILD_DATA/distbuild.conf" +import os, sys, yaml + +distbuild_configuration={ + 'TROVE_ID': os.environ['TROVE_ID'], + 'TROVE_HOST': os.environ['TROVE_HOST'], + 'DISTBUILD_WORKER': os.environ['DISTBUILD_WORKER'], + 'DISTBUILD_CONTROLLER': os.environ['DISTBUILD_CONTROLLER'], + 'WORKER_SSH_KEY': '/etc/distbuild/worker.key', +} + + +optional_keys = ('ARTIFACT_CACHE_SERVER', 'CONTROLLERHOST', 'WORKERS', + 'TROVE_BACKUP_KEYS') + +for key in optional_keys: + if key in os.environ: + distbuild_configuration[key] = os.environ[key] + +yaml.dump(distbuild_configuration, sys.stdout, default_flow_style=False) +EOF diff --git a/distbuild/lib/systemd/system-generators/ccache-nfs-mount-generator b/distbuild/lib/systemd/system-generators/ccache-nfs-mount-generator new file mode 100755 index 00000000..127bc84f --- /dev/null +++ b/distbuild/lib/systemd/system-generators/ccache-nfs-mount-generator @@ -0,0 +1,16 @@ +#!/bin/sh +read trove_host </etc/trove-host +while read line; do echo "$line"; done >"$1/srv-distbuild-ccache.mount" <<EOF +[Unit] +Requires=rpcbind.service +After=rpcbind.service +SourcePath=/etc/trove-host + +[Mount] +Type=nfs +What=$trove_host:/home/cache/ccache +Where=/srv/distbuild/ccache + +[Install] +WantedBy=morph-worker.service +EOF diff --git a/distbuild/manifest b/distbuild/manifest new file mode 100644 index 00000000..35047028 --- /dev/null +++ b/distbuild/manifest @@ -0,0 +1,28 @@ +0040755 0 0 /lib +0040755 0 0 /lib/systemd +0040755 0 0 /lib/systemd/system-generators +0100755 0 0 /lib/systemd/system-generators/ccache-nfs-mount-generator +0040755 0 0 /usr +0040755 0 0 /usr/lib +0040755 0 0 /usr/lib/distbuild-setup +0040755 0 0 /usr/lib/distbuild-setup/ansible +0100644 0 0 /usr/lib/distbuild-setup/ansible/hosts +0100644 0 0 /usr/lib/distbuild-setup/ansible/distbuild-setup.yml +0040755 0 0 /usr/lib/systemd +0040755 0 0 /usr/lib/systemd/system +0100755 0 0 /usr/lib/systemd/system/morph-cache-server.service +0100755 0 0 /usr/lib/systemd/system/morph-controller.service +0100755 0 0 /usr/lib/systemd/system/morph-controller-helper.service +0100755 0 0 /usr/lib/systemd/system/morph-worker.service +0100755 0 0 /usr/lib/systemd/system/morph-worker-helper.service +0100755 0 0 /usr/lib/systemd/system/distbuild-setup.service +0040755 0 0 /usr/lib/systemd/system/multi-user.target.wants +0120755 0 0 /usr/lib/systemd/system/multi-user.target.wants/distbuild-setup.service +0040755 0 0 /usr/share +0040755 0 0 /usr/share/distbuild-setup +0100644 0 0 /usr/share/distbuild-setup/morph.conf +0100644 0 0 /usr/share/distbuild-setup/morph-cache-server.conf +0100644 0 0 /usr/share/distbuild-setup/morph-controller.conf +0100644 0 0 /usr/share/distbuild-setup/morph-controller-helper.conf +0100644 0 0 /usr/share/distbuild-setup/morph-worker.conf +0100644 0 0 /usr/share/distbuild-setup/morph-worker-helper.conf diff --git a/distbuild/usr/lib/distbuild-setup/ansible/distbuild-setup.yml b/distbuild/usr/lib/distbuild-setup/ansible/distbuild-setup.yml new file mode 100644 index 00000000..e4f94f54 --- /dev/null +++ b/distbuild/usr/lib/distbuild-setup/ansible/distbuild-setup.yml @@ -0,0 +1,105 @@ +--- +- hosts: localhost + vars_files: + - "/etc/distbuild/distbuild.conf" + tasks: + + - set_fact: ARTIFACT_CACHE_SERVER={{ TROVE_HOST }} + when: ARTIFACT_CACHE_SERVER is not defined + + - name: Create mountpoint for extra disk space /srv/distbuild/ + file: path=/srv/distbuild state=directory owner=root group=root mode=0755 + + - name: Create the morph and morph-cache-server configuration files + template: src=/usr/share/distbuild-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - morph.conf + - morph-cache-server.conf + + - name: Link the morph log file + file: src=/srv/distbuild/morph.log dest=/var/log/morph.log state=link force=yes + + - name: Create the controller configuration files + template: src=/usr/share/distbuild-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - morph-controller.conf + - morph-controller-helper.conf + when: DISTBUILD_CONTROLLER + + - name: Link the controller log files + file: src=/srv/distbuild/{{ item }} dest=/var/log/{{ item }} state=link force=yes + with_items: + - morph-controller.log + - morph-controller-helper.log + when: DISTBUILD_CONTROLLER + + - name: Create the worker configuration files + template: src=/usr/share/distbuild-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - morph-worker.conf + - morph-worker-helper.conf + when: DISTBUILD_WORKER + + - name: Link the controller log files + file: src=/srv/distbuild/{{ item }} dest=/var/log/{{ item }} state=link force=yes + with_items: + - morph-worker.log + - morph-worker-helper.log + when: DISTBUILD_WORKER + + - name: Create /root/.ssh directory + file: path=/root/.ssh state=directory owner=root group=root mode=0700 + + - name: Copy the worker ssh key + copy: src={{ WORKER_SSH_KEY }} dest=/root/.ssh/id_rsa owner=root group=root mode=0600 + + - name: Create ssh public key + shell: ssh-keygen -y -f /root/.ssh/id_rsa > /root/.ssh/id_rsa.pub creates=/root/.ssh/id_rsa.pub + + - name: Add trove's host key + shell: | + trove_key="$(ssh-keyscan -t dsa,ecdsa,rsa {{ TROVE_HOST|quote }})" + if [ -n "$trove_key" ]; then + echo "$trove_key" > /etc/ssh/ssh_known_hosts + fi + creates=/etc/ssh/ssh_known_hosts + + + - name: Enable the morph-cache-server service + service: name=morph-cache-server.service enabled=yes + register: morph_cache_server_service + - name: Restart the morph-cache-server service + service: name=morph-cache-server state=restarted + when: morph_cache_server_service|changed + + - name: Enable the morph-worker service + service: name=morph-worker.service enabled=yes + register: morph_worker_service + when: DISTBUILD_WORKER + - name: Restart the morph-worker service + service: name=morph-worker state=restarted + when: morph_worker_service|changed + + - name: Enable the morph-worker-helper service + service: name=morph-worker-helper.service enabled=yes + register: morph_worker_helper_service + when: DISTBUILD_WORKER + - name: Restart the morph-worker-helper service + service: name=morph-worker-helper state=restarted + when: morph_worker_helper_service|changed + + - name: Enable the morph-controller service + service: name=morph-controller.service enabled=yes + register: morph_controller_service + when: DISTBUILD_CONTROLLER + - name: Restart the morph-controller service + service: name=morph-controller state=restarted + when: morph_controller_service|changed + + - name: Enable the morph-controller-helper service + service: name=morph-controller-helper.service enabled=yes + register: morph_controller_helper_service + when: DISTBUILD_CONTROLLER + - name: Restart the morph-controller-helper service + service: name=morph-controller-helper state=restarted + when: morph_controller_helper_service|changed diff --git a/distbuild/usr/lib/distbuild-setup/ansible/hosts b/distbuild/usr/lib/distbuild-setup/ansible/hosts new file mode 100644 index 00000000..5b97818d --- /dev/null +++ b/distbuild/usr/lib/distbuild-setup/ansible/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/distbuild/usr/lib/systemd/system/distbuild-setup.service b/distbuild/usr/lib/systemd/system/distbuild-setup.service new file mode 100644 index 00000000..ec5f5a2d --- /dev/null +++ b/distbuild/usr/lib/systemd/system/distbuild-setup.service @@ -0,0 +1,16 @@ +[Unit] +Description=Run distbuild-setup Ansible scripts +Requires=network.target +After=network.target +Requires=opensshd.service +After=opensshd.service + +# If there's a shared /var subvolume, it must be mounted before this +# unit runs. +Requires=local-fs.target +After=local-fs.target + +ConditionPathExists=/etc/distbuild/distbuild.conf + +[Service] +ExecStart=/usr/bin/ansible-playbook -v -i /usr/lib/distbuild-setup/ansible/hosts /usr/lib/distbuild-setup/ansible/distbuild-setup.yml diff --git a/distbuild/usr/lib/systemd/system/morph-cache-server.service b/distbuild/usr/lib/systemd/system/morph-cache-server.service new file mode 100644 index 00000000..f55f3b6d --- /dev/null +++ b/distbuild/usr/lib/systemd/system/morph-cache-server.service @@ -0,0 +1,12 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Morph cache server +Requires=local-fs.target network.target +After=local-fs.target network.target +ConditionPathExists=/etc/morph-cache-server.conf + +[Service] +ExecStart=/usr/bin/morph-cache-server +Restart=always diff --git a/distbuild/usr/lib/systemd/system/morph-controller-helper.service b/distbuild/usr/lib/systemd/system/morph-controller-helper.service new file mode 100644 index 00000000..3f30cbcf --- /dev/null +++ b/distbuild/usr/lib/systemd/system/morph-controller-helper.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Morph distributed build controller helper +Requires=morph-controller.service +After=morph-controller.service +ConditionPathExists=/etc/morph-controller.conf +ConditionPathExists=/etc/morph-controller-helper.conf + +[Service] +ExecStart=/usr/bin/distbuild-helper --config /etc/morph-controller-helper.conf +Restart=always diff --git a/distbuild/usr/lib/systemd/system/morph-controller.service b/distbuild/usr/lib/systemd/system/morph-controller.service new file mode 100644 index 00000000..1556d232 --- /dev/null +++ b/distbuild/usr/lib/systemd/system/morph-controller.service @@ -0,0 +1,12 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Morph distributed build controller +Requires=local-fs.target network.target +After=local-fs.target network.target +ConditionPathExists=/etc/morph-controller.conf + +[Service] +ExecStart=/usr/bin/morph controller-daemon --config /etc/morph-controller.conf +Restart=always diff --git a/distbuild/usr/lib/systemd/system/morph-worker-helper.service b/distbuild/usr/lib/systemd/system/morph-worker-helper.service new file mode 100644 index 00000000..28400701 --- /dev/null +++ b/distbuild/usr/lib/systemd/system/morph-worker-helper.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Morph distributed build worker helper +Requires=morph-worker.service +After=morph-worker.service +ConditionPathExists=/etc/morph-worker.conf +ConditionPathExists=/etc/morph-worker-helper.conf + +[Service] +ExecStart=/usr/bin/distbuild-helper --config /etc/morph-worker-helper.conf +Restart=always diff --git a/distbuild/usr/lib/systemd/system/morph-worker.service b/distbuild/usr/lib/systemd/system/morph-worker.service new file mode 100644 index 00000000..90fea404 --- /dev/null +++ b/distbuild/usr/lib/systemd/system/morph-worker.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=Morph distributed build worker +Requires=local-fs.target network.target +Wants=srv-distbuild-ccache.mount +After=local-fs.target network.target srv-distbuild-ccache.mount +ConditionPathExists=/etc/morph-worker.conf + +[Service] +ExecStart=/usr/bin/morph worker-daemon --config /etc/morph-worker.conf +Restart=always diff --git a/distbuild/usr/lib/systemd/system/multi-user.target.wants/distbuild-setup.service b/distbuild/usr/lib/systemd/system/multi-user.target.wants/distbuild-setup.service new file mode 120000 index 00000000..8f06febd --- /dev/null +++ b/distbuild/usr/lib/systemd/system/multi-user.target.wants/distbuild-setup.service @@ -0,0 +1 @@ +../distbuild-setup.service
\ No newline at end of file diff --git a/distbuild/usr/share/distbuild-setup/morph-cache-server.conf b/distbuild/usr/share/distbuild-setup/morph-cache-server.conf new file mode 100644 index 00000000..b9020e7d --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph-cache-server.conf @@ -0,0 +1,5 @@ +[config] +port = 8080 +artifact-dir = /srv/distbuild/artifacts +direct-mode = True +fcgi-server = False diff --git a/distbuild/usr/share/distbuild-setup/morph-controller-helper.conf b/distbuild/usr/share/distbuild-setup/morph-controller-helper.conf new file mode 100644 index 00000000..99d38739 --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph-controller-helper.conf @@ -0,0 +1,5 @@ +[config] +log = /srv/distbuild/morph-controller-helper.log +log-max = 100M +parent-port = 5656 +parent-address = 127.0.0.1 diff --git a/distbuild/usr/share/distbuild-setup/morph-controller.conf b/distbuild/usr/share/distbuild-setup/morph-controller.conf new file mode 100644 index 00000000..c16c0343 --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph-controller.conf @@ -0,0 +1,6 @@ +[config] +log = /srv/distbuild/morph-controller.log +log-max = 100M +writeable-cache-server = http://{{ ARTIFACT_CACHE_SERVER }}:8081/ +worker = {{ WORKERS }} +controller-helper-address = 127.0.0.1 diff --git a/distbuild/usr/share/distbuild-setup/morph-worker-helper.conf b/distbuild/usr/share/distbuild-setup/morph-worker-helper.conf new file mode 100644 index 00000000..29d4ef3f --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph-worker-helper.conf @@ -0,0 +1,4 @@ +[config] +log = /srv/distbuild/morph-worker-helper.log +log-max = 100M +parent-address = 127.0.0.1 diff --git a/distbuild/usr/share/distbuild-setup/morph-worker.conf b/distbuild/usr/share/distbuild-setup/morph-worker.conf new file mode 100644 index 00000000..fb382bad --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph-worker.conf @@ -0,0 +1,4 @@ +[config] +log = /srv/distbuild/morph-worker.log +log-max = 100M +controller-initiator-address = diff --git a/distbuild/usr/share/distbuild-setup/morph.conf b/distbuild/usr/share/distbuild-setup/morph.conf new file mode 100644 index 00000000..29de684c --- /dev/null +++ b/distbuild/usr/share/distbuild-setup/morph.conf @@ -0,0 +1,13 @@ +[config] +log = /srv/distbuild/morph.log +log-max = 100M +cachedir = /srv/distbuild +tempdir = /srv/distbuild/tmp +trove-host = {{ TROVE_HOST }} +trove-id = {{ TROVE_ID }} +controller-initiator-address = {{ CONTROLLERHOST }} +tempdir-min-space = 4G +cachedir-min-space = 4G +build-ref-prefix = {{ TROVE_ID }} +artifact-cache-server = http://{{ ARTIFACT_CACHE_SERVER }}:8080/ +git-resolve-cache-server = http://{{ TROVE_HOST }}:8080/ diff --git a/genivi-devel-system-armv7/etc/morph.conf b/genivi-devel-system-armv7/etc/morph.conf new file mode 120000 index 00000000..8f384049 --- /dev/null +++ b/genivi-devel-system-armv7/etc/morph.conf @@ -0,0 +1 @@ +/src/morph.conf
\ No newline at end of file diff --git a/genivi-devel-system-armv7/manifest b/genivi-devel-system-armv7/manifest new file mode 100644 index 00000000..31980633 --- /dev/null +++ b/genivi-devel-system-armv7/manifest @@ -0,0 +1,5 @@ +0040755 0 0 /src +0040755 0 0 /src/tmp +0100666 0 0 /src/morph.conf +0040755 0 0 /etc +0120666 0 0 /etc/morph.conf diff --git a/genivi-devel-system-armv7/src/morph.conf b/genivi-devel-system-armv7/src/morph.conf new file mode 100644 index 00000000..76b6fde9 --- /dev/null +++ b/genivi-devel-system-armv7/src/morph.conf @@ -0,0 +1,5 @@ +[config] +log = /src/morph.log +cachedir = /src/cache +tempdir = /src/tmp +staging-chroot = true diff --git a/gerrit.configure b/gerrit.configure new file mode 100755 index 00000000..b691ea95 --- /dev/null +++ b/gerrit.configure @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. +# +# +# This is a "morph deploy" configuration extension to enable bash +# as default shell in gerrit systems. +set -e + +ROOT="$1" + +############################################################################### + +# Set bash as default shell +ln -sfn bash "$ROOT/bin/sh" + +############################################################################### +echo "Creating gerrit-daemon unit file" + +cat << EOF > "$ROOT"/etc/systemd/system/gerrit-daemon.service +[Unit] +Description=Gerrit Code Review Server Service + +ConditionPathExists=/home/gerrit2/gerrit/.gerrit_controller + +[Service] +User=gerrit2 +Group=gerrit2 +Environment="PATH=/usr/bin:/bin" +Type=forking +ExecStart=/home/gerrit2/gerrit/.gerrit_controller/bin/gerrit.sh start + +[Install] +WantedBy=multi-user.target +EOF +ln -sfn "../gerrit-daemon.service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/gerrit-daemon.service" diff --git a/gitlab-ci-runner/manifest b/gitlab-ci-runner/manifest new file mode 100644 index 00000000..bad84dea --- /dev/null +++ b/gitlab-ci-runner/manifest @@ -0,0 +1,4 @@ +0040755 0 0 /usr/share/gitlab-install +0100755 0 0 /usr/share/gitlab-install/install-runner +0040755 0 0 /usr/share/gitlab-install/systemd-units +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-ci-runner.service diff --git a/gitlab-ci-runner/usr/share/gitlab-install/install-runner b/gitlab-ci-runner/usr/share/gitlab-install/install-runner new file mode 100755 index 00000000..f1165af8 --- /dev/null +++ b/gitlab-ci-runner/usr/share/gitlab-install/install-runner @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. + +set -e + +gem install bundler + +git config --global http.sslVerify false +git config --global user.name 'GitLab CI Runner' +git config --global user.email 'ci_runner@localhost' +git config --global core.autocrlf input + +git clone https://gitlab.com/gitlab-org/gitlab-ci-runner.git -b 5-0-stable +cd gitlab-ci-runner + +bundle install --deployment +bundle exec ./bin/setup +nohup bundle exec ./bin/runner & + +cd /etc/systemd/system +cp /usr/share/gitlab-install/systemd-units/gitlab-ci-runner.service . +systemctl enable gitlab-ci-runner.service diff --git a/gitlab-ci-runner/usr/share/gitlab-install/systemd-units/gitlab-ci-runner.service b/gitlab-ci-runner/usr/share/gitlab-install/systemd-units/gitlab-ci-runner.service new file mode 100644 index 00000000..dfc84d96 --- /dev/null +++ b/gitlab-ci-runner/usr/share/gitlab-install/systemd-units/gitlab-ci-runner.service @@ -0,0 +1,15 @@ +[Unit] +Description=GitLab CI Runner + +[Service] +User=root +WorkingDirectory=/root/gitlab-ci-runner +SyslogIdentifier=gitlab-ci-runner + +ExecStart=/usr/bin/bundle exec "./bin/runner" +ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s USR2 $MAINPID + +[Install] +WantedBy=multi-user.target + diff --git a/gitlab-server/manifest b/gitlab-server/manifest new file mode 100644 index 00000000..7ac74744 --- /dev/null +++ b/gitlab-server/manifest @@ -0,0 +1,37 @@ +0100755 0 0 /usr/share/gitlab-setup +0040755 0 0 /usr/share/gitlab-install +0100755 0 0 /usr/share/gitlab-install/backup-gitlab +0040755 0 0 /usr/share/gitlab-install/gitlab +0040755 0 0 /usr/share/gitlab-install/gitlab/config +0100644 0 0 /usr/share/gitlab-install/gitlab/config/gitlab.yml +0040755 0 0 /usr/share/gitlab-install/gitlab/config/initializers +0100644 0 0 /usr/share/gitlab-install/gitlab/config/resque.yml +0100644 0 0 /usr/share/gitlab-install/gitlab/config/unicorn.rb +0100644 0 0 /usr/share/gitlab-install/gitlab/config/initializers/rack_attack.rb +0040755 0 0 /usr/share/gitlab-install/gitlab/lib +0040755 0 0 /usr/share/gitlab-install/gitlab/lib/support +0040755 0 0 /usr/share/gitlab-install/gitlab/lib/support/nginx +0100644 0 0 /usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab +0040755 0 0 /usr/share/gitlab-install/gitlab-shell +0100644 0 0 /usr/share/gitlab-install/gitlab-shell/config.yml +0040755 0 0 /usr/share/gitlab-install/gitlab-ci +0040755 0 0 /usr/share/gitlab-install/gitlab-ci/config +0100644 0 0 /usr/share/gitlab-install/gitlab-ci/config/application.yml +0100644 0 0 /usr/share/gitlab-install/gitlab-ci/config/resque.yml +0100644 0 0 /usr/share/gitlab-install/gitlab-ci/config/unicorn.rb +0040755 0 0 /usr/share/gitlab-install/gitlab-ci/lib +0040755 0 0 /usr/share/gitlab-install/gitlab-ci/lib/support +0040755 0 0 /usr/share/gitlab-install/gitlab-ci/lib/support/nginx +0100644 0 0 /usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci +0100644 0 0 /usr/share/gitlab-install/nginx.conf +0040755 0 0 /usr/share/gitlab-install/systemd-units +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab.target +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-unicorn.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/nginx.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/postgres.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/redis.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-backup.service +0100644 0 0 /usr/share/gitlab-install/systemd-units/gitlab-backup.timer diff --git a/gitlab-server/usr/share/gitlab-install/backup-gitlab b/gitlab-server/usr/share/gitlab-install/backup-gitlab new file mode 100644 index 00000000..1320df81 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/backup-gitlab @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Run the gitlab backup script. The backup will be stored as +# /home/git/gitlab-backup.tar . A separate backup host will need to +# back that up. +# +# This script be run as the postgres user on a Baserock GitLab host. + +set -e + +export PATH=/usr/local/bin:/usr/bin:/bin + +mkdir -p /home/postgres/dumps +cd /home/postgres/dumps +pg_dumpall > new.dump +mv new.dump gitlab.pg_dumpall diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/application.yml b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/application.yml new file mode 100644 index 00000000..6eb5eb19 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/application.yml @@ -0,0 +1,43 @@ +defaults: &defaults + gitlab_server_urls: + # Replace with your gitlab server url + - 'http://##GITLAB_HOSTNAME##/' + + ## Gitlab CI settings + gitlab_ci: + ## Web server settings + host: ##GITLAB_HOSTNAME## + port: ##CI_PORT## + https: false + + ## Email settings + # Email address used in the "From" field in mails sent by GitLab-CI + email_from: gitlab-ci@localhost + + # Email address of your support contact (default: same as email_from) + support_email: support@localhost + + # Default project notifications settings: + # + # Send emails only on broken builds (default: true) + # all_broken_builds: true + # + # Add committer to recipients list (default: false) + # add_committer: true + + gravatar: + enabled: true + plain_url: "http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm" + ssl_url: "https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm" + + +development: + <<: *defaults + +test: + <<: *defaults + gitlab_server_urls: + - 'http://demo.gitlab.com/' + +production: + <<: *defaults diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/resque.yml b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/resque.yml new file mode 100644 index 00000000..f42ffe78 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/resque.yml @@ -0,0 +1,3 @@ +development: redis://127.0.0.1:6379 +test: redis://127.0.0.1:6379 +production: redis://127.0.0.1:6379 diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/unicorn.rb b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/unicorn.rb new file mode 100644 index 00000000..cdcbe39a --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-ci/config/unicorn.rb @@ -0,0 +1,102 @@ +# Sample verbose configuration file for Unicorn (not Rack) +# +# This configuration file documents many features of Unicorn +# that may not be needed for some applications. See +# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb +# for a much simpler configuration file. +# +# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete +# documentation. + +# Use at least one worker per core if you're on a dedicated server, +# more will usually help for _short_ waits on databases/caches. +worker_processes 2 + +# Since Unicorn is never exposed to outside clients, it does not need to +# run on the standard HTTP port (80), there is no reason to start Unicorn +# as root unless it's from system init scripts. +# If running the master process as root and the workers as an unprivileged +# user, do this to switch euid/egid in the workers (also chowns logs): +# user "unprivileged_user", "unprivileged_group" + +# Help ensure your application will always spawn in the symlinked +# "current" directory that Capistrano sets up. +working_directory "/home/gitlab_ci/gitlab-ci" # available in 0.94.0+ + +# listen on both a Unix domain socket and a TCP port, +# we use a shorter backlog for quicker failover when busy +listen "/home/gitlab_ci/gitlab-ci/tmp/sockets/gitlab-ci.socket", :backlog => 64 +listen "127.0.0.1:##UNICORN_CI_PORT##", :tcp_nopush => true + +# nuke workers after 30 seconds instead of 60 seconds (the default) +timeout 30 + +# feel free to point this anywhere accessible on the filesystem +pid "/home/gitlab_ci/gitlab-ci/tmp/pids/unicorn.pid" + +# By default, the Unicorn logger will write to stderr. +# Additionally, some applications/frameworks log to stderr or stdout, +# so prevent them from going to /dev/null when daemonized here: +stderr_path "/home/gitlab_ci/gitlab-ci/log/unicorn.stderr.log" +stdout_path "/home/gitlab_ci/gitlab-ci/log/unicorn.stdout.log" + +# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings +# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow +preload_app true +GC.respond_to?(:copy_on_write_friendly=) and + GC.copy_on_write_friendly = true + +# Enable this flag to have unicorn test client connections by writing the +# beginning of the HTTP headers before calling the application. This +# prevents calling the application for connections that have disconnected +# while queued. This is only guaranteed to detect clients on the same +# host unicorn runs on, and unlikely to detect disconnects even on a +# fast LAN. +check_client_connection false + +before_fork do |server, worker| + # the following is highly recomended for Rails + "preload_app true" + # as there's no need for the master process to hold a connection + defined?(ActiveRecord::Base) and + ActiveRecord::Base.connection.disconnect! + + # The following is only recommended for memory/DB-constrained + # installations. It is not needed if your system can house + # twice as many worker_processes as you have configured. + # + # This allows a new master process to incrementally + # phase out the old master process with SIGTTOU to avoid a + # thundering herd (especially in the "preload_app false" case) + # when doing a transparent upgrade. The last worker spawned + # will then kill off the old master process with a SIGQUIT. + old_pid = "#{server.config[:pid]}.oldbin" + if old_pid != server.pid + begin + sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU + Process.kill(sig, File.read(old_pid).to_i) + rescue Errno::ENOENT, Errno::ESRCH + end + end + # + # Throttle the master from forking too quickly by sleeping. Due + # to the implementation of standard Unix signal handlers, this + # helps (but does not completely) prevent identical, repeated signals + # from being lost when the receiving process is busy. + # sleep 1 +end + +after_fork do |server, worker| + # per-process listener ports for debugging/admin/migrations + # addr = "127.0.0.1:#{9293 + worker.nr}" + # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true) + + # the following is *required* for Rails + "preload_app true", + defined?(ActiveRecord::Base) and + ActiveRecord::Base.establish_connection + + # if preload_app is true, then you may also want to check and + # restart any other shared sockets/descriptors such as Memcached, + # and Redis. TokyoCabinet file handles are safe to reuse + # between any number of forked children (assuming your kernel + # correctly implements pread()/pwrite() system calls) +end diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci b/gitlab-server/usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci new file mode 100644 index 00000000..aa26614c --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci @@ -0,0 +1,36 @@ +# GITLAB CI +# Maintainer: @randx +# App Version: 2.0 + +upstream gitlab_ci { + server unix:/home/gitlab_ci/gitlab-ci/tmp/sockets/gitlab-ci.socket; +} + +server { + listen 81 default_server; # e.g., listen 192.168.1.1:80; + server_name ct-gitlab.dyn.ducie.codethink.co.uk; # e.g., server_name source.example.com; + root /home/gitlab_ci/gitlab-ci/public; + + access_log /var/log/nginx/gitlab_ci_access.log; + error_log /var/log/nginx/gitlab_ci_error.log; + + location / { + try_files $uri $uri/index.html $uri.html @gitlab_ci; + } + + location @gitlab_ci { + proxy_read_timeout 300; + proxy_connect_timeout 300; + proxy_redirect off; + + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + + proxy_pass http://gitlab_ci; + } + + # adjust this to match the largest build log your runners might submit, + # set to 0 to disable limit + client_max_body_size 10m; +} diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-remote-backup.sh b/gitlab-server/usr/share/gitlab-install/gitlab-remote-backup.sh new file mode 100644 index 00000000..85618811 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-remote-backup.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copy relevant files of a Baserock Gitlab instance out of the instance. +# +# Usage: backup.sh ADDR +# where ADDR is the address (domain name, IP address) of the instance. +# The files are copied to the current directory. + +set -eux + +ADDR="$1" + +backup() +{ + rsync -ahHS --delete "root@$ADDR:$1" "$2" +} + +mkdir -p dumps repositories uploads +backup /home/postgres/dumps/. dumps/. +backup /home/git/repositories/. repositories/. +backup /home/git/gitlab/public/uploads/. uploads/. + diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh b/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh new file mode 100644 index 00000000..78ff691a --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Restore a Baserock Gitlab system backup to a fresh instance. +# +# Usage: restore.sh ADDR +# where ADDR is the address (domain name, IP address) of the instance. +# +# What this does is a) stop services b) copy files over c) reset the Postgres +# databases. + +set -eux + +ADDR="$1" + +restore() +{ + rsync -ahHS --delete "$2" "root@$ADDR:$1" +} + +# Stop services so we don't modify files and databases from underneath +# them, and also so they don't modify things while restore is happening. + +ssh "root@$ADDR" systemctl stop \ + crond gitlab-backup.service \ + gitlab-ci-sidekiq.service \ + gitlab-ci-unicorn.service \ + gitlab-sidekiq.service \ + gitlab-unicorn.service \ + gitlab.target \ + gitlab-backup.timer \ + nginx.service \ + redis.service + +# Create the directory where postgres dump files go. + +ssh "root@$ADDR" install -d -o postgres -g postgres /home/postgres/dumps + +# Restore the various files. + +restore /home/postgres/dumps/. dumps/. +restore /home/git/repositories/. repositories/. +restore /home/git/gitlab/public/uploads/. uploads/. + +# And thier uid/gid +ssh "root@$ADDR" chown -R git:git /home/git/repositories /home/git/gitlab/public/uploads + +# Delete tables and roles from Postgres so that the restore can happen. + +ssh "root@$ADDR" sudo -u postgres psql <<EOF +drop database gitlabhq_production; +drop database gitlab_ci_production; +drop role git, gitlab_ci; +EOF + +# Restore the Postgres databases from the latest dump. + +ssh "root@$ADDR" sudo -u postgres psql -q -f /home/postgres/dumps/gitlab.pg_dumpall diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-shell/config.yml b/gitlab-server/usr/share/gitlab-install/gitlab-shell/config.yml new file mode 100644 index 00000000..fba31eb6 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab-shell/config.yml @@ -0,0 +1,41 @@ +# GitLab user. git by default +user: git + +# Url to gitlab instance. Used for api calls. Should end with a slash. +gitlab_url: "http://##GITLAB_HOSTNAME##/" + +http_settings: +# user: someone +# password: somepass +# ca_file: /etc/ssl/cert.pem +# ca_path: /etc/pki/tls/certs + self_signed_cert: false + +# Repositories path +# Give the canonicalized absolute pathname, +# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!! +# Check twice that none of the components is a symlink, including "/home". +repos_path: "/home/git/repositories" + +# File used as authorized_keys for gitlab user +auth_file: "/home/git/.ssh/authorized_keys" + +# Redis settings used for pushing commit notices to gitlab +redis: + bin: /usr/bin/redis-cli + host: 127.0.0.1 + port: 6379 + # socket: /tmp/redis.socket # Only define this if you want to use sockets + namespace: resque:gitlab + +# Log file. +# Default is gitlab-shell.log in the root directory. +# log_file: "/home/git/gitlab-shell/gitlab-shell.log" + +# Log level. INFO by default +log_level: INFO + +# Audit usernames. +# Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but +# incurs an extra API call on every gitlab-shell command. +audit_usernames: false diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/config/database.yml b/gitlab-server/usr/share/gitlab-install/gitlab/config/database.yml new file mode 100644 index 00000000..66960551 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/config/database.yml @@ -0,0 +1,49 @@ +# +# PRODUCTION +# +production: + adapter: postgresql + encoding: unicode + database: gitlabhq_production + pool: 10 + # username: git + # password: + # host: localhost + # port: 5432 + # socket: /tmp/postgresql.sock + +# +# Development specific +# +development: + adapter: postgresql + encoding: unicode + database: gitlabhq_development + pool: 5 + username: postgres + password: + # socket: /tmp/postgresql.sock + +# +# Staging specific +# +staging: + adapter: postgresql + encoding: unicode + database: gitlabhq_staging + pool: 5 + username: postgres + password: + # socket: /tmp/postgresql.sock + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: &test + adapter: postgresql + encoding: unicode + database: gitlabhq_test + pool: 5 + username: postgres + password: + # socket: /tmp/postgresql.sock diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/config/gitlab.yml b/gitlab-server/usr/share/gitlab-install/gitlab/config/gitlab.yml new file mode 100644 index 00000000..06d2cee5 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/config/gitlab.yml @@ -0,0 +1,270 @@ +# # # # # # # # # # # # # # # # # # +# GitLab application config file # +# # # # # # # # # # # # # # # # # # +# +# How to use: +# 1. copy file as gitlab.yml +# 2. Replace gitlab -> host with your domain +# 3. Replace gitlab -> email_from + +production: &base + # + # 1. GitLab app settings + # ========================== + + ## GitLab settings + gitlab: + ## Web server settings (note: host is the FQDN, do not include http://) + host: ##GITLAB_HOSTNAME## + port: ##GITLAB_PORT## + https: false + + # Uncomment and customize the last line to run in a non-root path + # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. + # Note that four settings need to be changed for this to work. + # 1) In your application.rb file: config.relative_url_root = "/gitlab" + # 2) In your gitlab.yml file: relative_url_root: /gitlab + # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" + # 4) In ../gitlab-shell/config.yml: gitlab_url: "http://127.0.0.1/gitlab" + # To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production + # + # relative_url_root: /gitlab + + # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') + # user: git + + ## Email settings + # Email address used in the "From" field in mails sent by GitLab + email_from: ##GITLAB_EMAIL## + + # Email address of your support contact (default: same as email_from) + support_email: ##GITLAB_EMAIL## + + ## User settings + default_projects_limit: 10 + # default_can_create_group: false # default: true + # username_changing_enabled: false # default: true - User can change her username/namespace + ## Default theme + ## BASIC = 1 + ## MARS = 2 + ## MODERN = 3 + ## GRAY = 4 + ## COLOR = 5 + # default_theme: 2 # default: 2 + + + ## Users management + # default: false - Account passwords are not sent via the email if signup is enabled. + # signup_enabled: true + # + # default: true - If set to false, standard login form won't be shown on the sign-in page + # signin_enabled: false + + + # Restrict setting visibility levels for non-admin users. + # The default is to allow all levels. + #restricted_visibility_levels: [ "public" ] + + ## Automatic issue closing + # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. + # This happens when the commit is pushed or merged into the default branch of a project. + # When not specified the default issue_closing_pattern as specified below will be used. + # issue_closing_pattern: '([Cc]lose[sd]|[Ff]ixe[sd]) #(\d+)' + + ## Default project features settings + default_projects_features: + issues: true + merge_requests: true + wiki: true + wall: false + snippets: false + visibility_level: "private" # can be "private" | "internal" | "public" + + ## Repository downloads directory + # When a user clicks e.g. 'Download zip' on a project, a temporary zip file is created in the following directory. + # The default is 'tmp/repositories' relative to the root of the Rails app. + # repository_downloads_path: tmp/repositories + + ## External issues trackers + issues_tracker: + # redmine: + # title: "Redmine" + # ## If not nil, link 'Issues' on project page will be replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # project_url: "http://redmine.sample/projects/:issues_tracker_id" + # + # ## If not nil, links from /#\d/ entities from commit messages will replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # ## :id - Issue id (from commit messages) + # issues_url: "http://redmine.sample/issues/:id" + # + # ## If not nil, linkis to creating new issues will be replaced with this + # ## Use placeholders: + # ## :project_id - GitLab project identifier + # ## :issues_tracker_id - Project Name or Id in external issue tracker + # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" + # + # jira: + # title: "Atlassian Jira" + # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" + # issues_url: "http://jira.sample/browse/:id" + # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" + + ## Gravatar + gravatar: + enabled: true # Use user avatar image from Gravatar.com (default: true) + # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm + # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm + + # + # 2. Auth settings + # ========================== + + ## LDAP settings + # You can inspect a sample of the LDAP users with login access by running: + # bundle exec rake gitlab:ldap:check RAILS_ENV=production + ldap: + enabled: false + host: '_your_ldap_server' + port: 636 + uid: 'sAMAccountName' + method: 'ssl' # "tls" or "ssl" or "plain" + bind_dn: '_the_full_dn_of_the_user_you_will_bind_with' + password: '_the_password_of_the_bind_user' + # If allow_username_or_email_login is enabled, GitLab will ignore everything + # after the first '@' in the LDAP username submitted by the user on login. + # + # Example: + # - the user enters 'jane.doe@example.com' and 'p@ssw0rd' as LDAP credentials; + # - GitLab queries the LDAP server with 'jane.doe' and 'p@ssw0rd'. + # + # If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to + # disable this setting, because the userPrincipalName contains an '@'. + allow_username_or_email_login: true + + # Base where we can search for users + # + # Ex. ou=People,dc=gitlab,dc=example + # + base: '' + + # Filter LDAP users + # + # Format: RFC 4515 + # Ex. (employeeType=developer) + # + user_filter: '' + + + ## OmniAuth settings + omniauth: + # Allow login via Twitter, Google, etc. using OmniAuth providers + enabled: false + + # CAUTION! + # This allows users to login without having a user account first (default: false). + # User accounts will be created automatically when authentication was successful. + allow_single_sign_on: false + # Locks down those users until they have been cleared by the admin (default: true). + block_auto_created_users: true + + ## Auth providers + # Uncomment the following lines and fill in the data of the auth provider you want to use + # If your favorite auth provider is not listed you can use others: + # see https://github.com/gitlabhq/gitlab-public-wiki/wiki/Custom-omniauth-provider-configurations + # The 'app_id' and 'app_secret' parameters are always passed as the first two + # arguments, followed by optional 'args' which can be either a hash or an array. + # Documentation for this is available at http://doc.gitlab.com/ce/integration/omniauth.html + providers: + # - { name: 'google_oauth2', app_id: 'YOUR APP ID', + # app_secret: 'YOUR APP SECRET', + # args: { access_type: 'offline', approval_prompt: '' } } + # - { name: 'twitter', app_id: 'YOUR APP ID', + # app_secret: 'YOUR APP SECRET'} + # - { name: 'github', app_id: 'YOUR APP ID', + # app_secret: 'YOUR APP SECRET', + # args: { scope: 'user:email' } } + + + + # + # 3. Advanced settings + # ========================== + + # GitLab Satellites + satellites: + # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) + path: /home/git/gitlab-satellites/ + + ## Backup settings + backup: + path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) + # keep_time: 604800 # default: 0 (forever) (in seconds) + + ## GitLab Shell settings + gitlab_shell: + path: /home/git/gitlab-shell/ + + # REPOS_PATH MUST NOT BE A SYMLINK!!! + repos_path: /home/git/repositories/ + hooks_path: /home/git/gitlab-shell/hooks/ + + # Git over HTTP + upload_pack: true + receive_pack: true + + # If you use non-standard ssh port you need to specify it + # ssh_port: 22 + + ## Git settings + # CAUTION! + # Use the default values unless you really know what you are doing + git: + bin_path: /usr/bin/git + # The next value is the maximum memory size grit can use + # Given in number of bytes per git object (e.g. a commit) + # This value can be increased if you have very large commits + max_size: 5242880 # 5.megabytes + # Git timeout to read a commit, in seconds + timeout: 10 + + # + # 4. Extra customization + # ========================== + + extra: + ## Google analytics. Uncomment if you want it + # google_analytics_id: '_your_tracking_id' + + ## Piwik analytics. + # piwik_url: '_your_piwik_url' + # piwik_site_id: '_your_piwik_site_id' + + ## Text under sign-in page (Markdown enabled) + # sign_in_text: | + # ![Company Logo](http://www.companydomain.com/logo.png) + # [Learn more about CompanyName](http://www.companydomain.com/) + +development: + <<: *base + +test: + <<: *base + gravatar: + enabled: true + gitlab: + host: localhost + port: 80 + issues_tracker: + redmine: + title: "Redmine" + project_url: "http://redmine/projects/:issues_tracker_id" + issues_url: "http://redmine/:project_id/:issues_tracker_id/:id" + new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" + +staging: + <<: *base diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/config/initializers/rack_attack.rb b/gitlab-server/usr/share/gitlab-install/gitlab/config/initializers/rack_attack.rb new file mode 100644 index 00000000..bc3234bf --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/config/initializers/rack_attack.rb @@ -0,0 +1,18 @@ +# 1. Rename this file to rack_attack.rb +# 2. Review the paths_to_be_protected and add any other path you need protecting +# + +paths_to_be_protected = [ + "#{Rails.application.config.relative_url_root}/users/password", + "#{Rails.application.config.relative_url_root}/users/sign_in", + "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json", + "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session", + "#{Rails.application.config.relative_url_root}/users", + "#{Rails.application.config.relative_url_root}/users/confirmation" +] + +unless Rails.env.test? + Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req| + req.ip if paths_to_be_protected.include?(req.path) && req.post? + end +end diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/config/resque.yml b/gitlab-server/usr/share/gitlab-install/gitlab/config/resque.yml new file mode 100644 index 00000000..f42ffe78 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/config/resque.yml @@ -0,0 +1,3 @@ +development: redis://127.0.0.1:6379 +test: redis://127.0.0.1:6379 +production: redis://127.0.0.1:6379 diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/config/unicorn.rb b/gitlab-server/usr/share/gitlab-install/gitlab/config/unicorn.rb new file mode 100644 index 00000000..02dbd98a --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/config/unicorn.rb @@ -0,0 +1,113 @@ +# Sample verbose configuration file for Unicorn (not Rack) +# +# This configuration file documents many features of Unicorn +# that may not be needed for some applications. See +# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb +# for a much simpler configuration file. +# +# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete +# documentation. + +# Uncomment and customize the last line to run in a non-root path +# WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. +# Note that four settings need to be changed for this to work. +# 1) In your application.rb file: config.relative_url_root = "/gitlab" +# 2) In your gitlab.yml file: relative_url_root: /gitlab +# 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" +# 4) In ../gitlab-shell/config.yml: gitlab_url: "http://127.0.0.1/gitlab" +# To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production +# +# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" + +# Use at least one worker per core if you're on a dedicated server, +# more will usually help for _short_ waits on databases/caches. +worker_processes 2 + +# Since Unicorn is never exposed to outside clients, it does not need to +# run on the standard HTTP port (80), there is no reason to start Unicorn +# as root unless it's from system init scripts. +# If running the master process as root and the workers as an unprivileged +# user, do this to switch euid/egid in the workers (also chowns logs): +# user "unprivileged_user", "unprivileged_group" + +# Help ensure your application will always spawn in the symlinked +# "current" directory that Capistrano sets up. +working_directory "/home/git/gitlab" # available in 0.94.0+ + +# listen on both a Unix domain socket and a TCP port, +# we use a shorter backlog for quicker failover when busy +listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64 +listen "127.0.0.1:##UNICORN_PORT##", :tcp_nopush => true + +# nuke workers after 30 seconds instead of 60 seconds (the default) +timeout 30 + +# feel free to point this anywhere accessible on the filesystem +pid "/home/git/gitlab/tmp/pids/unicorn.pid" + +# By default, the Unicorn logger will write to stderr. +# Additionally, some applications/frameworks log to stderr or stdout, +# so prevent them from going to /dev/null when daemonized here: +stderr_path "/home/git/gitlab/log/unicorn.stderr.log" +stdout_path "/home/git/gitlab/log/unicorn.stdout.log" + +# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings +# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow +preload_app true +GC.respond_to?(:copy_on_write_friendly=) and + GC.copy_on_write_friendly = true + +# Enable this flag to have unicorn test client connections by writing the +# beginning of the HTTP headers before calling the application. This +# prevents calling the application for connections that have disconnected +# while queued. This is only guaranteed to detect clients on the same +# host unicorn runs on, and unlikely to detect disconnects even on a +# fast LAN. +check_client_connection false + +before_fork do |server, worker| + # the following is highly recomended for Rails + "preload_app true" + # as there's no need for the master process to hold a connection + defined?(ActiveRecord::Base) and + ActiveRecord::Base.connection.disconnect! + + # The following is only recommended for memory/DB-constrained + # installations. It is not needed if your system can house + # twice as many worker_processes as you have configured. + # + # This allows a new master process to incrementally + # phase out the old master process with SIGTTOU to avoid a + # thundering herd (especially in the "preload_app false" case) + # when doing a transparent upgrade. The last worker spawned + # will then kill off the old master process with a SIGQUIT. + old_pid = "#{server.config[:pid]}.oldbin" + if old_pid != server.pid + begin + sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU + Process.kill(sig, File.read(old_pid).to_i) + rescue Errno::ENOENT, Errno::ESRCH + end + end + # + # Throttle the master from forking too quickly by sleeping. Due + # to the implementation of standard Unix signal handlers, this + # helps (but does not completely) prevent identical, repeated signals + # from being lost when the receiving process is busy. + # sleep 1 +end + +after_fork do |server, worker| + # per-process listener ports for debugging/admin/migrations + # addr = "127.0.0.1:#{9293 + worker.nr}" + # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true) + + # the following is *required* for Rails + "preload_app true", + defined?(ActiveRecord::Base) and + ActiveRecord::Base.establish_connection + + # if preload_app is true, then you may also want to check and + # restart any other shared sockets/descriptors such as Memcached, + # and Redis. TokyoCabinet file handles are safe to reuse + # between any number of forked children (assuming your kernel + # correctly implements pread()/pwrite() system calls) +end diff --git a/gitlab-server/usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab b/gitlab-server/usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab new file mode 100644 index 00000000..e9d3b1f0 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab @@ -0,0 +1,70 @@ +# GITLAB +# Maintainer: @randx + +# CHUNKED TRANSFER +# It is a known issue that Git-over-HTTP requires chunked transfer encoding [0] which is not +# supported by Nginx < 1.3.9 [1]. As a result, pushing a large object with Git (i.e. a single large file) +# can lead to a 411 error. In theory you can get around this by tweaking this configuration file and either +# - installing an old version of Nginx with the chunkin module [2] compiled in, or +# - using a newer version of Nginx. +# +# At the time of writing we do not know if either of these theoretical solutions works. As a workaround +# users can use Git over SSH to push large files. +# +# [0] https://git.kernel.org/cgit/git/git.git/tree/Documentation/technical/http-protocol.txt#n99 +# [1] https://github.com/agentzh/chunkin-nginx-module#status +# [2] https://github.com/agentzh/chunkin-nginx-module + +upstream gitlab { + server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; +} + +server { + listen *:##GITLAB_PORT## default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea + server_name ##GITLAB_HOSTNAME##; # e.g., server_name source.example.com; + server_tokens off; # don't show the version number, a security best practice + root /home/git/gitlab/public; + + # Increase this if you want to upload large attachments + # Or if you want to accept large git objects over http + client_max_body_size 20m; + + # individual nginx logs for this gitlab vhost + access_log /var/log/nginx/gitlab_access.log; + error_log /var/log/nginx/gitlab_error.log; + + location / { + # serve static files from defined root folder;. + # @gitlab is a named location for the upstream fallback, see below + try_files $uri $uri/index.html $uri.html @gitlab; + } + + # if a file, which is not found in the root folder is requested, + # then the proxy pass the request to the upsteam (gitlab unicorn) + location @gitlab { + # If you use https make sure you disable gzip compression + # to be safe against BREACH attack + # gzip off; + + proxy_read_timeout 300; # Some requests take more than 30 seconds. + proxy_connect_timeout 300; # Some requests take more than 30 seconds. + proxy_redirect off; + + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_pass http://gitlab; + } + + # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression + location ~ ^/(assets)/ { + root /home/git/gitlab/public; + #gzip_static on; # to serve pre-gzipped version + expires max; + add_header Cache-Control public; + } + + error_page 502 /502.html; +} diff --git a/gitlab-server/usr/share/gitlab-install/nginx.conf b/gitlab-server/usr/share/gitlab-install/nginx.conf new file mode 100644 index 00000000..6e40b0e9 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/nginx.conf @@ -0,0 +1,73 @@ + +#user nobody; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + # '$status $body_bytes_sent "$http_referer" ' + # '"$http_user_agent" "$http_x_forwarded_for"'; + + #access_log logs/access.log main; + + sendfile on; + #tcp_nopush on; + + #keepalive_timeout 0; + keepalive_timeout 65; + + #gzip on; + + include /home/git/gitlab/lib/support/nginx/gitlab; + include /home/gitlab_ci/gitlab-ci/lib/support/nginx/gitlab_ci; + + # another virtual host using mix of IP-, name-, and port-based configuration + # + #server { + # listen 8000; + # listen somename:8080; + # server_name somename alias another.alias; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + + + # HTTPS server + # + #server { + # listen 443 ssl; + # server_name localhost; + + # ssl_certificate cert.pem; + # ssl_certificate_key cert.key; + + # ssl_session_cache shared:SSL:1m; + # ssl_session_timeout 5m; + + # ssl_ciphers HIGH:!aNULL:!MD5; + # ssl_prefer_server_ciphers on; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + +} diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.service new file mode 100644 index 00000000..8672c36d --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.service @@ -0,0 +1,11 @@ +[Unit] +Description=GitLab Backup Run +After=postgres.service + +[Install] +WantedBy=gitlab.target + +[Service] +ExecStart=/usr/share/gitlab-install/backup-gitlab +User=postgres +Group=postgres diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.timer b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.timer new file mode 100644 index 00000000..1686843f --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-backup.timer @@ -0,0 +1,8 @@ +[Unit] +Description=GitLab Backup Timer + +[Install] +WantedBy=gitlab.target + +[Timer] +OnCalendar=*-*-* 00:*:* diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service new file mode 100644 index 00000000..9a1a82d2 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service @@ -0,0 +1,24 @@ +##################################################### +# +# GitLab version : 5.x - 6.x +# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91 +# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd +# +#################################################### + +[Unit] +Description=GitLab CI Sidekiq Worker + +[Service] +Type=forking +User=gitlab_ci +WorkingDirectory=/home/gitlab_ci/gitlab-ci +Environment=RAILS_ENV=production +SyslogIdentifier=gitlab-ci-sidekiq +PIDFile=/home/gitlab_ci/gitlab-ci/tmp/pids/sidekiq.pid + +ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P tmp/pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1" +ExecStop=/usr/bin/bundle exec "sidekiqctl stop /home/gitlab_ci/gitlab-ci/tmp/pids/sidekiq.pid >> /home/gitlab_ci/gitlab-ci/log/sidekiq.log 2>&1" + +[Install] +WantedBy=gitlab.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service new file mode 100644 index 00000000..151f9677 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service @@ -0,0 +1,24 @@ +##################################################### +# +# GitLab version : 5.x - 6.x +# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91 +# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd +# +#################################################### + +[Unit] +Description=GitLab CI Unicorn Server + +[Service] +User=gitlab_ci +WorkingDirectory=/home/gitlab_ci/gitlab-ci +Environment=RAILS_ENV=production +SyslogIdentifier=gitlab-ci-unicorn +PIDFile=/home/gitlab_ci/gitlab-ci/tmp/pids/unicorn.pid + +ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/gitlab_ci/gitlab-ci/config/unicorn.rb -E production" +ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s USR2 $MAINPID + +[Install] +WantedBy=gitlab.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service new file mode 100644 index 00000000..82ff78d4 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service @@ -0,0 +1,24 @@ +##################################################### +# +# GitLab version : 5.x - 6.x +# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91 +# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd +# +#################################################### + +[Unit] +Description=GitLab Sidekiq Worker + +[Service] +Type=forking +User=git +WorkingDirectory=/home/git/gitlab +Environment=RAILS_ENV=production +SyslogIdentifier=gitlab-sidekiq +PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid + +ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P tmp/pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1" +ExecStop=/usr/bin/bundle exec "sidekiqctl stop /home/git/gitlab/tmp/pids/sidekiq.pid >> /home/git/gitlab/log/sidekiq.log 2>&1" + +[Install] +WantedBy=gitlab.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service new file mode 100644 index 00000000..a901d323 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service @@ -0,0 +1,24 @@ +##################################################### +# +# GitLab version : 5.x - 6.x +# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91 +# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd +# +#################################################### + +[Unit] +Description=GitLab Unicorn Server + +[Service] +User=git +WorkingDirectory=/home/git/gitlab +Environment=RAILS_ENV=production +SyslogIdentifier=gitlab-unicorn +PIDFile=/home/git/gitlab/tmp/pids/unicorn.pid + +ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/git/gitlab/config/unicorn.rb -E production" +ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s USR2 $MAINPID + +[Install] +WantedBy=gitlab.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target new file mode 100644 index 00000000..11e85441 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target @@ -0,0 +1,15 @@ +########################################################################################### +# +# GitLab version : 5.x - 6.x +# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91 +# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd +# +########################################################################################### + +[Unit] +Description=GitLab - Self Hosted Git Management +Requires=redis.service postgres.service +After=redis.service postgres.service syslog.target network.target + +[Install] +WantedBy=multi-user.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service b/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service new file mode 100644 index 00000000..0a50c50b --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service @@ -0,0 +1,15 @@ +[Unit] +Description=The nginx HTTP and reverse proxy server +After=syslog.target network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +PIDFile=/etc/nginx/nginx.pid +ExecStartPre=/usr/sbin/nginx -t +ExecStart=/usr/sbin/nginx +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service b/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service new file mode 100644 index 00000000..ed46d965 --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service @@ -0,0 +1,25 @@ +[Unit] +Description=PostgreSQL database server +After=network.target + +[Service] +Type=forking +TimeoutSec=120 +User=postgres +Group=postgres + +Environment=PGROOT=/home/postgres/pgsql + +SyslogIdentifier=postgres +PIDFile=/home/postgres/pgsql/data/postmaster.pid + +ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120 +ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload +ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast + +# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in +# killing Postgres, so adjust it downward +OOMScoreAdjust=-200 + +[Install] +WantedBy=multi-user.target diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service b/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service new file mode 100644 index 00000000..c936f8da --- /dev/null +++ b/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service @@ -0,0 +1,13 @@ +[Unit] +Description=Redis Server +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/redis-server +ExecStop=/bin/kill -15 $MAINPID +PIDFile=/var/run/redis.pid +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/gitlab-server/usr/share/gitlab-setup b/gitlab-server/usr/share/gitlab-setup new file mode 100755 index 00000000..e60dfcdf --- /dev/null +++ b/gitlab-server/usr/share/gitlab-setup @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. + +set -e + +# install bundler (not nice, we need to figure out how to do this traceably) +gem install bundler + +# create required users +if [ `grep -c '^git:' /etc/passwd` -ne 1 ] ; then adduser -D --gecos 'GitLab' -s /bin/sh git ; fi +adduser -D -s /bin/sh postgres +adduser -D --gecos 'GitLab CI' -s /bin/sh gitlab_ci + +# initialize postgres database, start server +su -c "mkdir -p pgsql/data" - postgres +su -c "pg_ctl -D pgsql/data initdb" - postgres +su -c "pg_ctl -D pgsql/data -l logfile start" - postgres + +# wait for the database server to start +echo "Waiting for database..." +sleep 2s + +# create gitlab database +su -c "psql -d template1 -c 'CREATE USER git;'" - postgres +su -c "psql -d template1 -c 'CREATE DATABASE gitlabhq_production OWNER git;'" - postgres + +# create the gitlab ci database +su -c "psql -d template1 -c 'CREATE USER gitlab_ci;'" - postgres +su -c "psql -d template1 -c 'CREATE DATABASE gitlab_ci_production OWNER gitlab_ci;'" - postgres + +# set up git config for gitlab user +su -c "git config --global http.sslVerify false" - git +su -c "git config --global user.name 'GitLab'" - git +su -c "git config --global user.email 'gitlab@localhost'" - git +su -c "git config --global core.autocrlf input" - git + +# install gitlab shell +su -c "cp -r /usr/share/gitlab-shell gitlab-shell" - git +cd /home/git/gitlab-shell +cp /usr/share/gitlab-install/gitlab-shell/config.yml ./config.yml +su -c "~/gitlab-shell/bin/install" - git + +# install gitlab +su -c "cp -r /usr/share/gitlab-ce gitlab" - git +cd /home/git/gitlab +su -c "cp config/database.yml.postgresql config/database.yml" git +su -c "cp -r /usr/share/gitlab-install/gitlab/config/* config/" git + +su -c "chmod -R u+rwX log/" git +su -c "chmod -R u+rwX tmp/" git +su -c "chmod o-rwx config/database.yml" git + +su -c "/usr/bin/redis-server" - git & +su -c "bundle install --deployment --without development test mysql aws" git +su -c "export force='yes'; bundle exec rake gitlab:setup RAILS_ENV=production" git +su -c "bundle exec rake assets:precompile RAILS_ENV=production" git + +# set up git config for gitlab_ci user +su -c "git config --global http.sslVerify false" - gitlab_ci +su -c "git config --global user.name 'GitLab CI'" - gitlab_ci +su -c "git config --global user.email 'gitlab_ci@localhost'" - gitlab_ci +su -c "git config --global core.autocrlf input" - gitlab_ci + +# install gitlab ci +su -c "cp -r /usr/share/gitlab-ci gitlab-ci" - gitlab_ci +cd /home/gitlab_ci/gitlab-ci +su -c "cp config/database.yml.postgresql config/database.yml" gitlab_ci +su -c "cp -r /usr/share/gitlab-install/gitlab-ci/config/* config/" gitlab_ci + +su -c "mkdir -p tmp/sockets" gitlab_ci +su -c "mkdir -p tmp/pids" gitlab_ci +su -c "chmod -R u+rwx tmp/sockets" gitlab_ci +su -c "chmod -R u+rwx tmp/pids" gitlab_ci + +su -c "bundle install --without development test mysql --deployment" gitlab_ci +su -c "bundle exec rake setup RAILS_ENV=production" gitlab_ci +su -c "bundle exec whenever -w RAILS_ENV=production" gitlab_ci + +# configure nginx +addgroup nobody +mkdir -p /var/log/nginx +cp /usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab /home/git/gitlab/lib/support/nginx/ +cp /usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci /home/gitlab_ci/gitlab-ci/lib/support/nginx/ +cp /usr/share/gitlab-install/nginx.conf /etc/nginx/nginx.conf + +# make systemd units to start gitlab and required stuff on boot +cd /etc/systemd/system +cp /usr/share/gitlab-install/systemd-units/* . +systemctl enable redis.service nginx.service postgres.service gitlab.target gitlab-unicorn.service gitlab-sidekiq.service gitlab-ci-sidekiq.service gitlab-ci-unicorn.service gitlab-backup.timer gitlab-backup.service +reboot diff --git a/gitlab.configure b/gitlab.configure new file mode 100644 index 00000000..9798c775 --- /dev/null +++ b/gitlab.configure @@ -0,0 +1,128 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. +# +# This is a "morph deploy" configuration extension to fully configure +# a GitLab and GitLab CI instance at deployment time. It uses the +# following variables from the environment: +# +# * GITLAB_HOSTNAME +# * GITLAB_PORT +# * GITLAB_EMAIL +# * UNICORN_PORT +# * CI_PORT +# * UNICORN_CI_PORT +# * MAIL_SEND_TYPE +# * SMTP_ADDR +# * SMTP_PORT +# * SMTP_USER +# * SMTP_PASS +# * SMTP_DOMAIN + +set -e + +ROOT="$1" + + +########################################################################## +# Substitutions in configuration files +########################################################################## + +echo "Creating /etc/gitlab-setup.sed" + +cat <<EOF > "$ROOT"/etc/gitlab-setup.sed +s/##GITLAB_HOSTNAME##/$GITLAB_HOSTNAME/g +s/##GITLAB_PORT##/$GITLAB_PORT/g +s/##GITLAB_EMAIL##/$GITLAB_EMAIL/g +s/##UNICORN_PORT##/$UNICORN_PORT/g +s/##CI_PORT##/$CI_PORT/g +s/##UNICORN_CI_PORT##/$UNICORN_CI_PORT/g +EOF + +echo "Performing substitutions in /usr/share/gitlab config" + +sed -f "$ROOT"/etc/gitlab-setup.sed -i \ + "$ROOT"/usr/share/gitlab-install/gitlab/config/gitlab.yml \ + "$ROOT"/usr/share/gitlab-install/gitlab/config/unicorn.rb \ + "$ROOT"/usr/share/gitlab-install/gitlab/lib/support/nginx/gitlab \ + "$ROOT"/usr/share/gitlab-install/gitlab-shell/config.yml \ + "$ROOT"/usr/share/gitlab-install/gitlab-ci/config/application.yml \ + "$ROOT"/usr/share/gitlab-install/gitlab-ci/config/unicorn.rb \ + "$ROOT"/usr/share/gitlab-install/gitlab-ci/lib/support/nginx/gitlab_ci \ + "$ROOT"/usr/share/gitlab-install/nginx.conf + +########################################################################## + +echo "Create gitlab-setup unit file" +cat <<EOF > "$ROOT/etc/systemd/system/gitlab-setup.service" +[Unit] +Description=Run gitlab-setup (once) +Requires=network.target +After=network.target +Requires=local-fs.target +After=local-fs.target + +ConditionPathExists=!/home/git/gitlab + +[Service] +Type=oneshot +ExecStart=/usr/share/gitlab-setup +Restart=no + +[Install] +WantedBy=multi-user.target +EOF + +ln -s "/etc/systemd/system/gitlab-setup.service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/gitlab-setup.service" + +########################################################################## + +rubyescape() { + # In ruby, single quoted strings need \ and ' escaping + printf "%s\n" "$1" | sed -e "s/['\\]/\\\&/g" \ + -e "s/^/'/" \ + -e "s/$/'/" +} + +sedescape() { + # Escape all non-alphanumeric characters + printf "%s\n" "$1" | sed -e 's/\W/\\&/g' +} + +do_escapes() { + printf "%s\n" "$(sedescape "$(rubyescape "$1")")" +} + +if [ "$MAIL_SEND_TYPE" = "smtp" ]; then + + echo "Setting up SMTP for sending e-mail" + + for CONFIG_PATH in \ + "/usr/share/gitlab-ce/config" "/usr/share/gitlab-ci/config" + do + sed -i 's/sendmail/smtp/' \ + "$ROOT$CONFIG_PATH/environments/production.rb" + + sed -e s/\"email.server.com\"/"$(do_escapes "$SMTP_ADDR")/g" \ + -e s/\"smtp\"/"$(do_escapes "$SMTP_USER")/g" \ + -e s/\"123456\"/"$(do_escapes "$SMTP_PASS")/g" \ + -e s/\"gitlab.company.com\"/"$(do_escapes "$SMTP_DOMAIN")/g" \ + -e s/456/$SMTP_PORT/g \ + <"$ROOT$CONFIG_PATH/initializers/smtp_settings.rb.sample" \ + >"$ROOT$CONFIG_PATH/initializers/smtp_settings.rb" + done +fi diff --git a/image-package-example/README b/image-package-example/README new file mode 100644 index 00000000..c1322f25 --- /dev/null +++ b/image-package-example/README @@ -0,0 +1,9 @@ +Image package example scripts +============================= + +These are scripts used to create disk images or install the system onto +an existing disk. + +This is also implemented independently for the rawdisk.write write +extension; see morphlib.writeexts.WriteExtension.create_local_system() +for a similar, python implementation. diff --git a/image-package-example/common.sh.in b/image-package-example/common.sh.in new file mode 100644 index 00000000..9a7389a7 --- /dev/null +++ b/image-package-example/common.sh.in @@ -0,0 +1,72 @@ +#!/bin/false +# Script library to be used by disk-install.sh and make-disk-image.sh + +status(){ + echo "$@" +} + +info(){ + echo "$@" >&2 +} + +warn(){ + echo "$@" >&2 +} + +extract_rootfs(){ + tar -C "$1" -xf @@ROOTFS_TAR_PATH@@ . +} + +make_disk_image(){ + truncate --size "$1" "$2" +} + +format_disk(){ + local disk="$1" + mkfs.ext4 -F -L rootfs "$disk" +} + +install_fs_config(){ + local mountpoint="$1" + local rootdisk="${2-/dev/vda}" + cat >>"$mountpoint/etc/fstab" <<EOF +$rootdisk / ext4 rw,errors=remount-ro 0 0 +EOF + install -D -m 644 /proc/self/fd/0 "$mountpoint/boot/extlinux.conf" <<EOF +DEFAULT baserock +LABEL baserock +SAY Booting Baserock +LINUX /boot/vmlinuz +APPEND root=$rootdisk +EOF +} + +install_bootloader(){ + local disk="$1" + local mountpoint="$2" + dd if=@@IMAGE_DIR@@/mbr.bin conv=notrunc bs=440 count=1 of="$disk" + extlinux --install "$mountpoint/boot" +} + +loop_file(){ + losetup --show --find "$1" +} +unloop_file(){ + #losetup --detach "$1" + # unlooping handled by umount -d, for busybox compatibility + true +} + +temp_mount(){ + local mp="$(mktemp -d)" + if ! mount "$@" "$mp"; then + rmdir "$mp" + return 1 + fi + echo "$mp" +} +untemp_mount(){ + # Unmount and detach in one step for busybox compatibility + umount -d "$1" + rmdir "$1" +} diff --git a/image-package-example/disk-install.sh.in b/image-package-example/disk-install.sh.in new file mode 100644 index 00000000..bc8e0e67 --- /dev/null +++ b/image-package-example/disk-install.sh.in @@ -0,0 +1,51 @@ +#!/bin/sh +# Script for writing the system to an existing disk. +# This formats the disk, extracts the rootfs to it, installs the +# bootloader, and ensures there's appropriate configuration for the +# bootloader, kernel and userland to agree what the rootfs is. + +set -eu + +usage(){ + cat <<EOF +usage: $0 DISK [TARGET_DISK] + +DISK: Where the disk appears on your development machine +TARGET_DISK: What the disk will appear as on the target machine +EOF +} + +. @@SCRIPT_DIR@@/common.sh + +if [ "$#" -lt 1 -o "$#" -gt 2 ]; then + usage + exit 1 +fi + +DISK="$1" +TARGET_DISK="${1-/dev/sda}" + +status Formatting "$DISK" as ext4 +format_disk "$DISK" +( + info Mounting "$DISK" + MP="$(temp_mount -t ext4 "$DISK")" + info Mounted "$DISK" to "$MP" + set +e + ( + set -e + info Copying rootfs onto disk + extract_rootfs "$MP" + info Configuring disk paths + install_fs_config "$MP" "$TARGET_DISK" + info Installing bootloader + install_bootloader "$DISK" "$MP" + ) + ret="$?" + if [ "$ret" != 0 ]; then + warn Filling rootfs failed with "$ret" + fi + info Unmounting "$DISK" from "$MP" and removing "$MP" + untemp_mount "$MP" + exit "$ret" +) diff --git a/image-package-example/make-disk-image.sh.in b/image-package-example/make-disk-image.sh.in new file mode 100644 index 00000000..61264fa0 --- /dev/null +++ b/image-package-example/make-disk-image.sh.in @@ -0,0 +1,36 @@ +#!/bin/sh +# Script for writing the system to a disk image file. +# This creates a file of the right size, attaches it to a loop device, +# then hands the rest of the work off to disk-install.sh + +usage(){ + cat <<EOF +usage: $0 FILENAME SIZE [TARGET_DISK] + +FILENAME: Location to write the disk image to +SIZE: Size to create the disk image with +TARGET_DISK: What the disk will appear as on the target machine +EOF +} + +. @@SCRIPT_DIR@@/common.sh + +if [ "$#" -lt 2 -o "$#" -gt 3 ]; then + usage + exit 1 +fi + +DISK_IMAGE="$1" +DISK_SIZE="$2" +TARGET_DISK="${3-/dev/vda}" + +make_disk_image "$DISK_SIZE" "$DISK_IMAGE" + +( + LOOP="$(loop_file "$DISK_IMAGE")" + set +e + @@SCRIPT_DIR@@/disk-install.sh "$DISK_IMAGE" "$TARGET_DISK" + ret="$?" + unloop_file "$LOOP" + exit "$ret" +) diff --git a/image-package.write b/image-package.write new file mode 100755 index 00000000..15ceadcf --- /dev/null +++ b/image-package.write @@ -0,0 +1,168 @@ +#!/bin/sh +# Copyright (C) 2014 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. +# +# =*= License: GPL-2 =*= +# +# +# This is a write extension for making a package that can be used to +# install the produced system. Ideally we'd instead have Baserock +# everywhere to do the deployment, but we need to support this workflow +# until that is possible. +# +# This write extension produces a tarball, which contains: +# - a tarball of the configured system root file system +# - any supporting files listed in BOOTLOADER_BLOBS +# - any supporting scripts, generated from templates listed in +# INCLUDE_SCRIPTS +# +# The extension requires the following environment variables to be set: +# +# * BOOTLOADER_BLOBS: files to include besides rootfs tarball, +# paths are relative to the root of the built rootfs +# works on any kind of file in the rootfs, named +# BOOTLOADER_BLOBS since that's the common use-case +# :-separated by default +# * INCLUDE_SCRIPTS: script templates that are included in the package +# after being filled out +# file paths are relative to the definitions repository +# :-separated by default +# +# The script templates may contain any of the following strings, which +# will be replaced with a string which will expand to the appropriate +# value as a shell word: +# - @@SCRIPT_DIR@@: the path the script files are installed to +# - @@IMAGE_DIR@@: the path BOOTLOADER_BLOBS are installed to +# - @@ROOTFS_TAR_PATH@@: path to the rootfs tarball +# +# The interpolated strings may run commands dependant on the current +# working directory, so if `cd` is required, bind these values to a +# variable beforehand. +# +# The following optional variables can be set as well: +# +# * INCLUDE_SCRIPTS_SEPARATOR: character to separate INCLUDE_SCRIPTS with (default: :) +# * BOOTLOADER_BLOBS_SEPARATOR: character to separate BOOTLOADER_BLOBS with (default: :) +# * SCRIPT_SUBDIR: where in the package processed scripts are installed to (default: tools) +# * IMAGE_SUBDIR: where in the package BOOTLOADER_BLOBS are copied to (default: image_files) +# * ROOTFS_TAR: name to call the rootfs tarball inside IMAGE_SUBDIR (default: rootfs.tar) +# * OUTPUT_COMPRESS: compression used for output tarball (default: none) +# * ROOTFS_COMPRESS: compression used for rootfs (default: none) + +set -eu + +die(){ + echo "$@" >&2 + exit 1 +} + +warn(){ + echo "$@" >&2 +} + +info(){ + echo "$@" >&2 +} + +shellescape(){ + echo "'$(echo "$1" | sed -e "s/'/'\\''/g")'" +} + +sedescape(){ + # Escape the passed in string so it can be safely interpolated into + # a sed expression as a literal value. + echo "$1" | sed -e 's/[\/&]/\\&/g' +} + +ROOTDIR="$1" +OUTPUT_TAR="$2" +td="$(mktemp -d)" +IMAGE_SUBDIR="${IMAGE_SUBDIR-image_files}" +SCRIPT_SUBDIR="${SCRIPT_SUBDIR-tools}" +ROOTFS_TAR="${ROOTFS_TAR-rootfs.tar}" + +# Generate shell snippets that will expand to paths to various resources +# needed by the scripts. +# They expand to a single shell word, so constructs like the following work +# SCRIPT_DIR=@@SCRIPT_DIR@@ +# dd if="$SCRIPT_DIR/mbr" of="$disk" count=1 +# tar -C "$mountpoint" -xf @@ROOTFS_TAR_PATH@@ . +find_script_dir='"$(readlink -f "$(dirname "$0")")"' +image_dir="$find_script_dir/../$(shellescape "$IMAGE_SUBDIR")" +rootfs_tar_path="$image_dir/$(shellescape "$ROOTFS_TAR")" + +install_script(){ + local source_file="$1" + local output_dir="$2" + local target_file="$output_dir/$SCRIPT_SUBDIR/$(basename "$source_file" .in)" + sed -e "s/@@SCRIPT_DIR@@/$(sedescape "$find_script_dir")/g" \ + -e "s/@@IMAGE_DIR@@/$(sedescape "$image_dir")/g" \ + -e "s/@@ROOTFS_TAR_PATH@@/$(sedescape "$rootfs_tar_path")/g" \ + "$source_file" \ + | install -D -m 755 /proc/self/fd/0 "$target_file" +} + +install_scripts(){ + local output_dir="$1" + ( + IFS="${INCLUDE_SCRIPTS_SEPARATOR-:}" + for script in $INCLUDE_SCRIPTS; do + local script_path="$(pwd)/$script" + if [ ! -e "$script_path" ]; then + warn Script "$script" not found, ignoring + continue + fi + install_script "$script" "$output_dir" + done + ) +} + +install_bootloader_blobs(){ + local output_dir="$1" + local image_dir="$output_dir/$IMAGE_SUBDIR" + ( + IFS="${BOOTLOADER_BLOBS_SEPARATOR-:}" + for blob in $BOOTLOADER_BLOBS; do + local blob_path="$ROOTDIR/$blob" + if [ ! -e "$blob_path" ]; then + warn Bootloader blob "$blob" not found, ignoring + continue + fi + install -D -m644 "$blob_path" "$image_dir/$(basename "$blob_path")" + done + ) +} + +# Determine a basename for our directory as the same as our tarball with +# extensions removed. This is needed, since tarball packages usually +# have a base directory of its contents, rather then extracting into the +# current directory. +output_dir="$(basename "$OUTPUT_TAR")" +for ext in .xz .bz2 .gzip .gz .tgz .tar; do + output_dir="${output_dir%$ext}" +done + +info Installing scripts +install_scripts "$td/$output_dir" + +info Installing bootloader blobs +install_bootloader_blobs "$td/$output_dir" + +info Writing rootfs tar to "$IMAGE_SUBDIR/$ROOTFS_TAR" +tar -C "$ROOTDIR" -c . \ +| sh -c "${ROOTFS_COMPRESS-cat}" >"$td/$output_dir/$IMAGE_SUBDIR/$ROOTFS_TAR" + +info Writing image package tar to "$OUTPUT_TAR" +tar -C "$td" -c "$output_dir" | sh -c "${OUTPUT_COMPRESS-cat}" >"$OUTPUT_TAR" diff --git a/installer.configure b/installer.configure new file mode 100755 index 00000000..a77dc851 --- /dev/null +++ b/installer.configure @@ -0,0 +1,48 @@ +#!/usr/bin/python +# +# Copyright (C) 2014 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. +# +# This is a "morph deploy" configuration extension to configure an installer +# system. It will create the configuration needed in the installer system +# to perform an installation. It uses the following variables from the +# environment: +# +# * INSTALLER_TARGET_STORAGE_DEVICE +# * INSTALLER_ROOTFS_TO_INSTALL +# * INSTALLER_POST_INSTALL_COMMAND (optional, defaults to `reboot -f`) + +import os +import sys +import yaml + +install_config_file = os.path.join(sys.argv[1], 'etc', 'install.conf') + +try: + installer_configuration = { + 'INSTALLER_TARGET_STORAGE_DEVICE': os.environ['INSTALLER_TARGET_STORAGE_DEVICE'], + 'INSTALLER_ROOTFS_TO_INSTALL': os.environ['INSTALLER_ROOTFS_TO_INSTALL'], + } +except KeyError as e: + print "Not configuring as an installer system" + sys.exit(0) + +postinstkey = 'INSTALLER_POST_INSTALL_COMMAND' +installer_configuration[postinstkey] = os.environ.get(postinstkey, 'reboot -f') + +with open(install_config_file, 'w') as f: + f.write( yaml.dump(installer_configuration, default_flow_style=False) ) + +print "Configuration of the installer system in %s" % install_config_file diff --git a/mason.configure b/mason.configure new file mode 100644 index 00000000..1198ebd0 --- /dev/null +++ b/mason.configure @@ -0,0 +1,153 @@ +#!/bin/sh +# +# Copyright (C) 2014 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. +# +# This is a "morph deploy" configuration extension to fully configure +# a Mason instance at deployment time. It uses the following variables +# from the environment: +# +# * ARTIFACT_CACHE_SERVER +# * MASON_CLUSTER_MORPHOLOGY +# * MASON_DEFINITIONS_REF +# * MASON_DISTBUILD_ARCH +# * MASON_TEST_HOST +# * OPENSTACK_NETWORK_ID +# * TEST_INFRASTRUCTURE_TYPE +# * TROVE_HOST +# * TROVE_ID +# * CONTROLLERHOST + +set -e + +########################################################################## +# Copy Mason files into root filesystem +########################################################################## + +ROOT="$1" + +mkdir -p "$ROOT"/usr/lib/mason +cp mason/mason.sh "$ROOT"/usr/lib/mason/mason.sh +cp mason/mason-report.sh "$ROOT"/usr/lib/mason/mason-report.sh +cp mason/os-init-script "$ROOT"/usr/lib/mason/os-init-script + +cp mason/mason.timer "$ROOT"/etc/systemd/system/mason.timer + +cp mason/mason.service "$ROOT"/etc/systemd/system/mason.service + +########################################################################## +# Set up httpd web server +########################################################################## + +cp mason/httpd.service "$ROOT"/etc/systemd/system/httpd.service + +mkdir -p "$ROOT"/srv/mason + +cat >>"$ROOT"/etc/httpd.conf <<EOF +.log:text/plain +EOF + +mkdir -p "$ROOT"/var/mason + +########################################################################## +# Copy files needed for Ansible configuration +########################################################################## + +mkdir -p "$ROOT/usr/share/mason-setup" +mkdir -p "$ROOT/usr/lib/mason-setup" + +cp mason/share/* "$ROOT/usr/share/mason-setup" +cp -r mason/ansible "$ROOT/usr/lib/mason-setup/" +cp mason/mason-setup.service "$ROOT"/etc/systemd/system/mason-setup.service + +ln -s ../mason-setup.service "$ROOT"/etc/systemd/system/multi-user.target.wants/mason-setup.service + +########################################################################## +# Check variables +########################################################################## + +if [ -n "$MASON_GENERIC" ]; then + echo Not configuring Mason, it will be generic + exit 0 +fi + +if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \ + -z "$MASON_DEFINITIONS_REF" -a \ + -z "$MASON_DISTBUILD_ARCH" -a \ + -z "$MASON_TEST_HOST" ]; then + # No Mason options defined, do nothing. + exit 0 +fi + +if [ -z "$ARTIFACT_CACHE_SERVER" -o \ + -z "$CONTROLLERHOST" -o \ + -z "$MASON_CLUSTER_MORPHOLOGY" -o \ + -z "$MASON_DEFINITIONS_REF" -o \ + -z "$MASON_DISTBUILD_ARCH" -o \ + -z "$MASON_TEST_HOST" -o \ + -z "$TROVE_HOST" -o \ + -z "$TROVE_ID" ]; then + echo Some options required for Mason were defined, but not all. + exit 1 +fi + +########################################################################## +# Generate config variable shell snippet +########################################################################## + +MASON_DATA="$ROOT/etc/mason" +mkdir -p "$MASON_DATA" + +python <<'EOF' >"$MASON_DATA/mason.conf" +import os, sys, yaml + +mason_configuration={ + 'ARTIFACT_CACHE_SERVER': os.environ['ARTIFACT_CACHE_SERVER'], + 'MASON_CLUSTER_MORPHOLOGY': os.environ['MASON_CLUSTER_MORPHOLOGY'], + 'MASON_DEFINITIONS_REF': os.environ['MASON_DEFINITIONS_REF'], + 'MASON_DISTBUILD_ARCH': os.environ['MASON_DISTBUILD_ARCH'], + 'MASON_TEST_HOST': os.environ['MASON_TEST_HOST'], + 'OPENSTACK_NETWORK_ID': os.environ['OPENSTACK_NETWORK_ID'], + 'TEST_INFRASTRUCTURE_TYPE': os.environ['TEST_INFRASTRUCTURE_TYPE'], + 'TROVE_ID': os.environ['TROVE_ID'], + 'TROVE_HOST': os.environ['TROVE_HOST'], + 'CONTROLLERHOST': os.environ['CONTROLLERHOST'], +} + +yaml.dump(mason_configuration, sys.stdout, default_flow_style=False) +EOF + +if [ "$TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then + python <<'EOF' >>"$MASON_DATA/mason.conf" +import os, sys, yaml + +openstack_credentials={ + 'OS_USERNAME': os.environ['OPENSTACK_USER'], + 'OS_TENANT_NAME': os.environ['OPENSTACK_TENANT'], + 'OS_TENANT_ID': os.environ['OPENSTACK_TENANT_ID'], + 'OS_AUTH_URL': os.environ['OPENSTACK_AUTH_URL'], + 'OS_PASSWORD': os.environ['OPENSTACK_PASSWORD'], +} + +yaml.dump(openstack_credentials, sys.stdout, default_flow_style=False) +EOF +fi + +########################################################################## +# Enable services +########################################################################## + +ln -s ../mason.timer "$ROOT"/etc/systemd/system/multi-user.target.wants/mason.timer +ln -s ../httpd.service "$ROOT"/etc/systemd/system/multi-user.target.wants/httpd.service diff --git a/mason/ansible/hosts b/mason/ansible/hosts new file mode 100644 index 00000000..5b97818d --- /dev/null +++ b/mason/ansible/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml new file mode 100644 index 00000000..d1528dbb --- /dev/null +++ b/mason/ansible/mason-setup.yml @@ -0,0 +1,83 @@ +--- +- hosts: localhost + vars_files: + - "/etc/mason/mason.conf" + tasks: + + + - fail: msg='TROVE_ID is mandatory' + when: TROVE_ID is not defined + + - fail: msg='TROVE_HOST is mandatory' + when: TROVE_HOST is not defined + + - fail: msg='ARTIFACT_CACHE_SERVER is mandatory' + when: ARTIFACT_CACHE_SERVER is not defined + + - fail: msg='MASON_CLUSTER_MORPHOLOGY is mandatory' + when: MASON_CLUSTER_MORPHOLOGY is not defined + + - fail: msg='MASON_DEFINITIONS_REF is mandatory' + when: MASON_DEFINITIONS_REF is not defined + + - fail: msg='MASON_DISTBUILD_ARCH is mandatory' + when: MASON_DISTBUILD_ARCH is not defined + + - fail: msg='MASON_TEST_HOST is mandatory' + when: MASON_TEST_HOST is not defined + + - fail: msg='CONTROLLERHOST is mandatory' + when: CONTROLLERHOST is not defined + + - fail: msg='TEST_INFRASTRUCTURE_TYPE is mandatory' + when: TEST_INFRASTRUCTURE_TYPE is not defined + + - fail: msg='OPENSTACK_NETWORK_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OPENSTACK_NETWORK_ID is not defined + + - fail: msg='OS_USERNAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_USERNAME is not defined + + - fail: msg='OS_PASSWORD is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_PASSWORD is not defined + + - fail: msg='OS_TENANT_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_ID is not defined + + - fail: msg='OS_TENANT_NAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_NAME is not defined + + - fail: msg='OS_AUTH_URL is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_AUTH_URL is not defined + + - name: Create the Mason configuration file + template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - mason.conf + + - name: Create the OpenStack credentials file + template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - os.conf + when: TEST_INFRASTRUCTURE_TYPE == "openstack" + + - name: Enable the mason service + service: name=mason.service enabled=yes + register: mason_service + - name: Restart the mason service + service: name=mason.service state=restarted + when: mason_service|changed + + - name: Enable the mason timer + service: name=mason.timer enabled=yes + register: mason_timer + - name: Restart the mason timer + service: name=mason.timer state=restarted + when: mason_timer|changed + + - name: Enable the httpd service + service: name=httpd.service enabled=yes + register: httpd_service + - name: Restart the httpd service + service: name=httpd state=restarted + when: httpd_service|changed diff --git a/mason/httpd.service b/mason/httpd.service new file mode 100644 index 00000000..7572b732 --- /dev/null +++ b/mason/httpd.service @@ -0,0 +1,10 @@ +[Unit] +Description=HTTP server for Mason +After=network.target + +[Service] +User=root +ExecStart=/usr/sbin/httpd -f -p 80 -h /srv/mason + +[Install] +WantedBy=multi-user.target diff --git a/mason/mason-generator.sh b/mason/mason-generator.sh new file mode 100755 index 00000000..187db72c --- /dev/null +++ b/mason/mason-generator.sh @@ -0,0 +1,101 @@ +#!/bin/sh + +set -e + +if [ "$#" -lt 5 -o "$#" -gt 6 -o "$1" == "-h" -o "$1" == "--help" ]; then + cat <<EOF +Usage: + `basename $0` HOST_PREFIX UPSTREAM_TROVE_HOSTNAME VM_USER VM_HOST VM_PATH [HOST_POSTFIX] + +Where: + HOST_PREFIX -- Name of your Mason instance + e.g. "my-mason" to produce hostnames: + my-mason-trove and my-mason-controller + UPSTREAM_TROVE_HOSTNAME -- Upstream trove's hostname + VM_USER -- User on VM host for VM deployment + VM_HOST -- VM host for VM deployment + VM_PATH -- Path to store VM images in on VM host + HOST_POSTFIX -- e.g. ".example.com" to get + my-mason-trove.example.com + +This script makes deploying a Mason system simpler by automating +the generation of keys for the systems to use, building of the +systems, filling out the mason deployment cluster morphology +template with useful values, and finally deploying the systems. + +To ensure that the deployed system can deploy test systems, you +must supply an ssh key to the VM host. Do so with the following +command: + ssh-copy-id -i ssh_keys-HOST_PREFIX/worker.key.pub VM_USER@VM_HOST + +To ensure that the mason can upload artifacts to the upstream trove, +you must supply an ssh key to the upstream trove. Do so with the +following command: + ssh-copy-id -i ssh_keys-HOST_PREFIX/id_rsa.key.pub root@UPSTREAM_TROVE_HOSTNAME + +EOF + exit 0 +fi + + +HOST_PREFIX="$1" +UPSTREAM_TROVE="$2" +VM_USER="$3" +VM_HOST="$4" +VM_PATH="$5" +HOST_POSTFIX="$6" + +sedescape() { + # Escape all non-alphanumeric characters + printf "%s\n" "$1" | sed -e 's/\W/\\&/g' +} + + +############################################################################## +# Key generation +############################################################################## + +mkdir -p "ssh_keys-${HOST_PREFIX}" +cd "ssh_keys-${HOST_PREFIX}" +test -e mason.key || ssh-keygen -t rsa -b 2048 -f mason.key -C mason@TROVE_HOST -N '' +test -e lorry.key || ssh-keygen -t rsa -b 2048 -f lorry.key -C lorry@TROVE_HOST -N '' +test -e worker.key || ssh-keygen -t rsa -b 2048 -f worker.key -C worker@TROVE_HOST -N '' +test -e id_rsa || ssh-keygen -t rsa -b 2048 -f id_rsa -C trove-admin@TROVE_HOST -N '' +cd ../ + + +############################################################################## +# Mason setup +############################################################################## + +cp clusters/mason.morph mason-${HOST_PREFIX}.morph + +sed -i "s/red-box-v1/$(sedescape "$HOST_PREFIX")/g" "mason-$HOST_PREFIX.morph" +sed -i "s/ssh_keys/ssh_keys-$(sedescape "$HOST_PREFIX")/g" "mason-$HOST_PREFIX.morph" +sed -i "s/upstream-trove/$(sedescape "$UPSTREAM_TROVE")/" "mason-$HOST_PREFIX.morph" +sed -i "s/vm-user/$(sedescape "$VM_USER")/g" "mason-$HOST_PREFIX.morph" +sed -i "s/vm-host/$(sedescape "$VM_HOST")/g" "mason-$HOST_PREFIX.morph" +sed -i "s/vm-path/$(sedescape "$VM_PATH")/g" "mason-$HOST_PREFIX.morph" +sed -i "s/\.example\.com/$(sedescape "$HOST_POSTFIX")/g" "mason-$HOST_PREFIX.morph" + + +############################################################################## +# System building +############################################################################## + +morph build systems/trove-system-x86_64.morph +morph build systems/build-system-x86_64.morph + + +############################################################################## +# System deployment +############################################################################## + +morph deploy mason-${HOST_PREFIX}.morph + + +############################################################################## +# Cleanup +############################################################################## + +rm mason-${HOST_PREFIX}.morph diff --git a/mason/mason-report.sh b/mason/mason-report.sh new file mode 100755 index 00000000..9c20b65b --- /dev/null +++ b/mason/mason-report.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -x + +. /etc/mason.conf + +REPORT_PATH=/var/mason/report.html +SERVER_PATH=/srv/mason + +sed_escape() { + printf "%s\n" "$1" | sed -e 's/\W/\\&/g' +} + +create_report() { +cat > $REPORT_PATH <<'EOF' +<html> +<head> +<meta charset="UTF-8"> +<meta http-equiv="refresh" content="60"> +<style> +html, body { + margin: 0; + padding: 0; +} +p.branding { + background: black; + color: #fff; + padding: 0.4em; + margin: 0; + font-weight: bold; +} +h1 { + background: #225588; + color: white; + margin: 0; + padding: 0.6em; +} +table { + width: 90%; + margin: 1em auto 6em auto; + border: 1px solid black; + border-spacing: 0; +} +table tr.headings { + background: #555; + color: white; +} +table tr.pass { + background: #aaffaa; +} +table tr.pass:hover { + background: #bbffbb; +} +table tr.fail { + background: #ffaaaa; +} +table tr.fail:hover { + background: #ffbbbb; +} +table tr.nonet { + background: #ffdd99; +} +table tr.nonet:hover { + background: #ffeeaa; +} +table tr.headings th { + font-weight: bold; + text-align: left; + padding: 3px 2px; +} +table td { + padding: 2px; +} +td.result { + font-weight: bold; + text-transform: uppercase; +} +td.result a { + text-decoration: none; +} +td.result a:before { + content: "âž« "; +} +tr.pass td.result a { + color: #252; +} +tr.pass td.result a:hover { + color: #373; +} +tr.fail td.result a { + color: #622; +} +tr.fail td.result a:hover { + color: #933; +} +tr.nonet td.result a { + color: #641; +} +tr.nonet td.result a:hover { + color: #962; +} +td.ref { + font-family: monospace; +} +td.ref a { + color: #333; +} +td.ref a:hover { + color: #555; +} +table tr.pass td, table tr.fail td { + border-top: solid white 1px; +} +p { + margin: 1.3em; +} +code { + padding: 0.3em 0.5em; + background: #eee; + border: 1px solid #bbb; + border-radius: 1em; +} +#footer { + margin: 0; + background: #aaa; + color: #222; + border-top: #888 1px solid; + font-size: 80%; + padding: 0; + position: fixed; + bottom: 0; + width: 100%; + display: table; +} +#footer p { + padding: 1.3em; + display: table-cell; +} +#footer p code { + font-size: 110%; +} +#footer p.about { + text-align: right; +} +</style> +</head> +<body> +<p class="branding">Mason</p> +<h1>Baserock: Continuous Delivery</h1> +<p>Build log of changes to <code>BRANCH</code> from <code>TROVE</code>. Most recent first.</p> +<table> +<tr class="headings"> + <th>Started</th> + <th>Ref</th> + <th>Duration</th> + <th>Result</th> +</tr> +<!--INSERTION POINT--> +</table> +<div id="footer"> +<p>Last checked for updates at: <code>....-..-.. ..:..:..</code></p> +<p class="about">Generated by Mason | Powered by Baserock</p> +</div> +</body> +</html> +EOF + + sed -i 's/BRANCH/'"$(sed_escape "$1")"'/' $REPORT_PATH + sed -i 's/TROVE/'"$(sed_escape "$2")"'/' $REPORT_PATH +} + +update_report() { + # Give function params sensible names + build_start_time="$1" + build_trove_host="$2" + build_ref="$3" + build_sha1="$4" + build_duration="$5" + build_result="$6" + + # Generate template if report file is not there + if [ ! -f $REPORT_PATH ]; then + create_report $build_ref $build_trove_host + fi + + # Build table row for insertion into report file + if [ "$build_result" = nonet ]; then + msg='<tr class="'"${build_result}"'"><td>'"${build_start_time}"'</td><td class="ref">Failed to contact '"${build_trove_host}"'</a></td><td>'"${build_duration}s"'</td><td class="result"><a href="log/'"${build_sha1}"'--'"${build_start_time}"'.log">'"${build_result}"'</a></td></tr>' + else + msg='<tr class="'"${build_result}"'"><td>'"${build_start_time}"'</td><td class="ref"><a href="http://'"${build_trove_host}"'/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/commit/?h='"${build_ref}"'&id='"${build_sha1}"'">'"${build_sha1}"'</a></td><td>'"${build_duration}s"'</td><td class="result"><a href="log/'"${build_sha1}"'--'"${build_start_time}"'.log">'"${build_result}"'</a></td></tr>' + fi + + # Insert report line, newest at top + sed -i 's/<!--INSERTION POINT-->/<!--INSERTION POINT-->\n'"$(sed_escape "$msg")"'/' $REPORT_PATH +} + +update_report_time() { + # Give function params sensible names + build_start_time="$1" + + # If the report file exists, update the last-checked-for-updates time + if [ -f $REPORT_PATH ]; then + sed -i 's/<code>....-..-.. ..:..:..<\/code>/<code>'"$(sed_escape "$build_start_time")"'<\/code>/' $REPORT_PATH + fi +} + +START_TIME=`date +%Y-%m-%d\ %T` + +update_report_time "$START_TIME" +cp "$REPORT_PATH" "$SERVER_PATH/index.html" + +logfile="$(mktemp)" +/usr/lib/mason/mason.sh 2>&1 | tee "$logfile" +case "${PIPESTATUS[0]}" in +0) + RESULT=pass + ;; +33) + RESULT=skip + ;; +42) + RESULT=nonet + ;; +*) + RESULT=fail + ;; +esac + +# TODO: Update page with last executed time +if [ "$RESULT" = skip ]; then + rm "$logfile" + exit 0 +fi + +DURATION=$(( $(date +%s) - $(date --date="$START_TIME" +%s) )) +SHA1="$(cd "ws/$DEFINITIONS_REF/$UPSTREAM_TROVE_ADDRESS/baserock/baserock/definitions" && git rev-parse HEAD)" + +update_report "$START_TIME" \ + "$UPSTREAM_TROVE_ADDRESS" \ + "$DEFINITIONS_REF" \ + "$SHA1" \ + "$DURATION" \ + "$RESULT" + + +# +# Copy report into server directory +# + +cp "$REPORT_PATH" "$SERVER_PATH/index.html" +mkdir "$SERVER_PATH/log" +mv "$logfile" "$SERVER_PATH/log/$SHA1--$START_TIME.log" diff --git a/mason/mason-setup.service b/mason/mason-setup.service new file mode 100644 index 00000000..60403bde --- /dev/null +++ b/mason/mason-setup.service @@ -0,0 +1,16 @@ +[Unit] +Description=Run mason-setup Ansible scripts +Requires=network.target +After=network.target +Requires=opensshd.service +After=opensshd.service + +# If there's a shared /var subvolume, it must be mounted before this +# unit runs. +Requires=local-fs.target +After=local-fs.target + +ConditionPathExists=/etc/mason/mason.conf + +[Service] +ExecStart=/usr/bin/ansible-playbook -v -i /usr/lib/mason-setup/ansible/hosts /usr/lib/mason-setup/ansible/mason-setup.yml diff --git a/mason/mason.service b/mason/mason.service new file mode 100644 index 00000000..a864d610 --- /dev/null +++ b/mason/mason.service @@ -0,0 +1,10 @@ +[Unit] +Description=Mason: Continuous Delivery Service +After=mason-setup.service + +[Service] +User=root +ExecStart=/usr/lib/mason/mason-report.sh + +[Install] +WantedBy=multi-user.target diff --git a/mason/mason.sh b/mason/mason.sh new file mode 100755 index 00000000..dba99dfa --- /dev/null +++ b/mason/mason.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +# Load OpenStack credentials +if [ -f "/etc/os.conf" ]; then + . /etc/os.conf +fi + +set -e +set -x + +# Load our deployment config +. /etc/mason.conf + +if [ ! -e ws ]; then + morph init ws +fi +cd ws + +definitions_repo="$DEFINITIONS_REF"/"$UPSTREAM_TROVE_ADDRESS"/baserock/baserock/definitions +if [ ! -e "$definitions_repo" ]; then + morph checkout git://"$UPSTREAM_TROVE_ADDRESS"/baserock/baserock/definitions "$DEFINITIONS_REF" + cd "$definitions_repo" + git config user.name "$TROVE_ID"-mason + git config user.email "$TROVE_ID"-mason@$(hostname) +else + cd "$definitions_repo" + SHA1_PREV="$(git rev-parse HEAD)" +fi + +if ! git remote update origin; then + echo ERROR: Unable to contact trove + exit 42 +fi +git clean -fxd +git reset --hard origin/"$DEFINITIONS_REF" + +SHA1="$(git rev-parse HEAD)" + +if [ -f "$HOME/success" ] && [ "$SHA1" = "$SHA1_PREV" ]; then + echo INFO: No changes to "$DEFINITIONS_REF", nothing to do + exit 33 +fi + +rm -f "$HOME/success" + +echo INFO: Mason building: $DEFINITIONS_REF at $SHA1 + +if ! "scripts/release-build" --no-default-configs \ + --trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --artifact-cache-server "http://$ARTIFACT_CACHE_SERVER:8080/" \ + --controllers "$DISTBUILD_ARCH:$DISTBUILD_CONTROLLER_ADDRESS" \ + "$BUILD_CLUSTER_MORPHOLOGY"; then + echo ERROR: Failed to build release images + echo Build logs for chunks: + find builds -type f -exec echo {} \; -exec cat {} \; + exit 1 +fi + +releases_made="$(cd release && ls | wc -l)" +if [ "$releases_made" = 0 ]; then + echo ERROR: No release images created + exit 1 +else + echo INFO: Created "$releases_made" release images +fi + +if [ "$TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then + "scripts/release-test-os" \ + --deployment-host "$DISTBUILD_ARCH":"$MASON_TEST_HOST" \ + --trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --trove-id "$TROVE_ID" \ + --net-id "$OPENSTACK_NETWORK_ID" \ + "$BUILD_CLUSTER_MORPHOLOGY" +elif [ "$TEST_INFRASTRUCTURE_TYPE" = "kvmhost" ]; then + "scripts/release-test" \ + --deployment-host "$DISTBUILD_ARCH":"$MASON_TEST_HOST" \ + --trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --trove-id "$TROVE_ID" \ + "$BUILD_CLUSTER_MORPHOLOGY" +fi + +"scripts/release-upload" --build-trove-host "$ARTIFACT_CACHE_SERVER" \ + --arch "$DISTBUILD_ARCH" \ + --log-level=debug --log="$HOME"/release-upload.log \ + --public-trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --public-trove-username root \ + --public-trove-artifact-dir /home/cache/artifacts \ + --no-upload-release-artifacts \ + "$BUILD_CLUSTER_MORPHOLOGY" + +echo INFO: Artifact upload complete for $DEFINITIONS_REF at $SHA1 + +touch "$HOME/success" diff --git a/mason/mason.timer b/mason/mason.timer new file mode 100644 index 00000000..107dff97 --- /dev/null +++ b/mason/mason.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Runs Mason continually with 1 min between calls + +[Timer] +#Time between Mason finishing and calling it again +OnUnitActiveSec=1min +Unit=mason.service + +[Install] +WantedBy=multi-user.target diff --git a/mason/os-init-script b/mason/os-init-script new file mode 100644 index 00000000..77afb926 --- /dev/null +++ b/mason/os-init-script @@ -0,0 +1,6 @@ +#!/bin/bash + +# This allows the test runner to know that cloud-init has completed the +# disc resizing, and there is enough free space to continue. +touch /root/cloud-init-finished + diff --git a/mason/share/mason.conf b/mason/share/mason.conf new file mode 100644 index 00000000..1295ce84 --- /dev/null +++ b/mason/share/mason.conf @@ -0,0 +1,14 @@ +# This file is generarated by the mason-setup systemd unit. +# If you want to change the configuration, change the configuration +# in /etc/mason/mason.conf and restart the service. + +ARTIFACT_CACHE_SERVER={{ ARTIFACT_CACHE_SERVER|quote }} +UPSTREAM_TROVE_ADDRESS={{ TROVE_HOST|quote }} +DEFINITIONS_REF={{ MASON_DEFINITIONS_REF|quote }} +DISTBUILD_ARCH={{ MASON_DISTBUILD_ARCH|quote }} +DISTBUILD_CONTROLLER_ADDRESS={{ CONTROLLERHOST|quote }} +TROVE_ID={{ TROVE_ID|quote }} +BUILD_CLUSTER_MORPHOLOGY={{ MASON_CLUSTER_MORPHOLOGY|quote }} +MASON_TEST_HOST={{ MASON_TEST_HOST|quote }} +TEST_INFRASTRUCTURE_TYPE={{ TEST_INFRASTRUCTURE_TYPE|quote }} +{% if OPENSTACK_NETWORK_ID is defined %}OPENSTACK_NETWORK_ID={{ OPENSTACK_NETWORK_ID|quote }}{% endif %} diff --git a/mason/share/os.conf b/mason/share/os.conf new file mode 100644 index 00000000..21ef398c --- /dev/null +++ b/mason/share/os.conf @@ -0,0 +1,30 @@ +#!/bin/bash + +# A version of this file with the relevant information included can be +# obtained by navigating to 'Access & Security' -> 'API Access' -> +# 'Download OpenStack RC file' in The Horizon web interface of your +# OpenStack. However, the file obtained from there sets OS_PASSWORD +# such that it will ask the user for a password, so you will need to +# change that for Mason to work automatically. +# +# With the addition of Keystone, to use an openstack cloud you should +# authenticate against keystone, which returns a **Token** and **Service +# Catalog**. The catalog contains the endpoint for all services the +# user/tenant has access to - including nova, glance, keystone, swift. +# +# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We +# will use the 1.1 *compute api* +export OS_AUTH_URL={{ OS_AUTH_URL|quote }} + +# With the addition of Keystone we have standardized on the term **tenant** +# as the entity that owns the resources. +export OS_TENANT_ID={{ OS_TENANT_ID|quote }} +export OS_TENANT_NAME={{ OS_TENANT_NAME|quote }} + +# In addition to the owning entity (tenant), openstack stores the entity +# performing the action as the **user**. +export OS_USERNAME={{ OS_USERNAME|quote }} + +# With Keystone you pass the keystone password. +export OS_PASSWORD={{ OS_PASSWORD|quote }} + diff --git a/nfsboot-server.configure b/nfsboot-server.configure new file mode 100755 index 00000000..9fb48096 --- /dev/null +++ b/nfsboot-server.configure @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Copyright (C) 2013-2014 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. +# +# +# This is a "morph deploy" configuration extension to set up a server for +# booting over nfs and tftp. +set -e + +ROOT="$1" + +########################################################################## + +nfsboot_root=/srv/nfsboot +tftp_root="$nfsboot_root"/tftp +nfs_root="$nfsboot_root"/nfs +mkdir -p "$ROOT$tftp_root" "$ROOT$nfs_root" + +install -D /dev/stdin "$ROOT/usr/lib/systemd/system/nfsboot-tftp.service" <<EOF +[Unit] +Description=tftp service for booting kernels +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/udpsvd -E 0 69 /usr/sbin/tftpd $tftp_root + +[Install] +WantedBy=multi-user.target +EOF + +for prefix in / /usr; do + for unit in nfsboot-tftp.service nfs-server.service; do + unit_path="${prefix}/lib/systemd/system/$unit" + if [ -e "$ROOT/$unit_path" ]; then + ln -s "../../../../$unit_path" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/$unit" + fi + done +done + +pxelinux_file="$ROOT/usr/share/syslinux/pxelinux.0" +if [ -e "$pxelinux_file" ]; then + cp "$pxelinux_file" "$ROOT$tftp_root/pxelinux.0" +fi diff --git a/pxeboot.check b/pxeboot.check new file mode 100755 index 00000000..d7eb9b5c --- /dev/null +++ b/pxeboot.check @@ -0,0 +1,69 @@ +#!/usr/bin/python + +import itertools +import os +import sys +flatten = itertools.chain.from_iterable + +def powerset(iterable): + "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)" + s = list(iterable) + return flatten(itertools.combinations(s, r) for r in range(len(s)+1)) + +valid_option_sets = frozenset(( + ('spawn-novlan', frozenset(('PXEBOOT_DEPLOYER_INTERFACE',))), + ('spawn-vlan', frozenset(('PXEBOOT_DEPLOYER_INTERFACE', 'PXEBOOT_VLAN'))), + ('existing-dhcp', frozenset(('PXEBOOT_DEPLOYER_INTERFACE', + 'PXEBOOT_CONFIG_TFTP_ADDRESS'))), + ('existing-server', frozenset(('PXEBOOT_CONFIG_TFTP_ADDRESS', + 'PXEBOOT_ROOTFS_RSYNC_ADDRESS'))), +)) +valid_modes = frozenset(mode for (mode, opt_set in valid_option_sets)) + + +def compute_matches(env): + complete_matches = set() + for mode, opt_set in valid_option_sets: + if all(k in env for k in opt_set): + complete_matches.add(opt_set) + return complete_matches +complete_matches = compute_matches(os.environ) + +def word_separate_options(options): + assert options + s = options.pop(-1) + if options: + s = '%s and %s' % (', '.join(options), s) + return s + + +valid_options = frozenset(flatten(opt_set for (mode, opt_set) + in valid_option_sets)) +matched_options = frozenset(o for o in valid_options) + if o in os.environ) +if not complete_matches: + addable_sets = frozenset(frozenset(os) - matched_options for os in + valid_options + if frozenset(os) - matched_options) + print('Please provide %s' % ' or '.join( + word_separate_options(list(opt_set)) + for opt_set in addable_sets if opt_set)) + sys.exit(1) +elif len(complete_matches) > 1: + removable_sets = frozenset(matched_options - frozenset(os) for os in + powerset(matched_options) + if len(compute_matches(os)) == 1) + print('Please unset %s' % ' or '.join( + word_separate_options(list(opt_set)) + for opt_set in removable_sets if opt_set)) + sys.exit(1) + +if 'PXEBOOT_MODE' in os.environ: + mode = os.environ['PXEBOOT_MODE'] +else: + mode, = (mode for (mode, opt_set) in valid_option_sets + if all(o in os.environ for o in opt_set)) + +if mode not in valid_modes: + print('%s is not a valid PXEBOOT_MODE' % mode) + sys.exit(1) diff --git a/pxeboot.write b/pxeboot.write new file mode 100755 index 00000000..e33da527 --- /dev/null +++ b/pxeboot.write @@ -0,0 +1,679 @@ +#!/usr/bin/env python + + +import collections +import contextlib +import errno +import itertools +import logging +import os +import select +import signal +import shutil +import socket +import string +import StringIO +import subprocess +import sys +import tempfile +import textwrap +import urlparse + +import cliapp + +import morphlib + + +def _int_to_quad_dot(i): + return '.'.join(( + str(i >> 24 & 0xff), + str(i >> 16 & 0xff), + str(i >> 8 & 0xff), + str(i & 0xff))) + + +def _quad_dot_to_int(s): + i = 0 + for octet in s.split('.'): + i <<= 8 + i += int(octet, 10) + return i + + +def _netmask_to_prefixlen(mask): + bs = '{:032b}'.format(mask) + prefix = bs.rstrip('0') + if '0' in prefix: + raise ValueError('abnormal netmask: %s' % + _int_to_quad_dot(mask)) + return len(prefix) + + +def _get_routes(): + routes = [] + with open('/proc/net/route', 'r') as f: + for line in list(f)[1:]: + fields = line.split() + destination, flags, mask = fields[1], fields[3], fields[7] + flags = int(flags, 16) + if flags & 2: + # default route, ignore + continue + destination = socket.ntohl(int(destination, 16)) + mask = socket.ntohl(int(mask, 16)) + prefixlen = _netmask_to_prefixlen(mask) + routes.append((destination, prefixlen)) + return routes + + +class IPRange(object): + def __init__(self, prefix, prefixlen): + self.prefixlen = prefixlen + mask = (1 << prefixlen) - 1 + self.mask = mask << (32 - prefixlen) + self.prefix = prefix & self.mask + @property + def bitstring(self): + return ('{:08b}' * 4).format( + self.prefix >> 24 & 0xff, + self.prefix >> 16 & 0xff, + self.prefix >> 8 & 0xff, + self.prefix & 0xff + )[:self.prefixlen] + def startswith(self, other_range): + return self.bitstring.startswith(other_range.bitstring) + + +def find_subnet(valid_ranges, invalid_ranges): + for vr in valid_ranges: + known_subnets = set(ir for ir in invalid_ranges if ir.startswith(vr)) + prefixlens = set(r.prefixlen for r in known_subnets) + prefixlens.add(32 - 2) # need at least 4 addresses in subnet + prefixlen = min(prefixlens) + if prefixlen <= vr.prefixlen: + # valid subnet is full, move on to next + continue + subnetlen = prefixlen - vr.prefixlen + for prefix in (subnetid + vr.prefix + for subnetid in xrange(1 << subnetlen)): + if any(subnet.prefix == prefix for subnet in known_subnets): + continue + return prefix, prefixlen + + +def _normalise_macaddr(macaddr): + '''pxelinux.0 wants the mac address to be lowercase and - separated''' + digits = (c for c in macaddr.lower() if c in string.hexdigits) + nibble_pairs = grouper(digits, 2) + return '-'.join(''.join(byte) for byte in nibble_pairs) + + +@contextlib.contextmanager +def executor(target_pid): + 'Kills a process if its parent dies' + read_fd, write_fd = os.pipe() + helper_pid = os.fork() + if helper_pid == 0: + try: + os.close(write_fd) + while True: + rlist, _, _ = select.select([read_fd], [], []) + if read_fd in rlist: + d = os.read(read_fd, 1) + if not d: + os.kill(target_pid, signal.SIGKILL) + if d in ('', 'Q'): + os._exit(0) + else: + os._exit(1) + except BaseException as e: + import traceback + traceback.print_exc() + os._exit(1) + os.close(read_fd) + yield + os.write(write_fd, 'Q') + os.close(write_fd) + + +def grouper(iterable, n, fillvalue=None): + "Collect data into fixed-length chunks or blocks" + # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx" + args = [iter(iterable)] * n + return itertools.izip_longest(*args, fillvalue=fillvalue) + + +class PXEBoot(morphlib.writeexts.WriteExtension): + @contextlib.contextmanager + def _vlan(self, interface, vlan): + viface = '%s.%s' % (interface, vlan) + self.status(msg='Creating vlan %(viface)s', viface=viface) + subprocess.check_call(['vconfig', 'add', interface, str(vlan)]) + try: + yield viface + finally: + self.status(msg='Destroying vlan %(viface)s', viface=viface) + subprocess.call(['vconfig', 'rem', viface]) + + @contextlib.contextmanager + def _static_ip(self, iface): + valid_ranges = set(( + IPRange(_quad_dot_to_int('192.168.0.0'), 16), + IPRange(_quad_dot_to_int('172.16.0.0'), 12), + IPRange(_quad_dot_to_int('10.0.0.0'), 8), + )) + invalid_ranges = set(IPRange(prefix, prefixlen) + for (prefix, prefixlen) in _get_routes()) + prefix, prefixlen = find_subnet(valid_ranges, invalid_ranges) + netaddr = prefix + dhcp_server_ip = netaddr + 1 + client_ip = netaddr + 2 + broadcast_ip = prefix | ((1 << (32 - prefixlen)) - 1) + self.status(msg='Assigning ip address %(ip)s/%(prefixlen)d to ' + 'iface %(iface)s', + ip=_int_to_quad_dot(dhcp_server_ip), prefixlen=prefixlen, + iface=iface) + subprocess.check_call(['ip', 'addr', 'add', + '{}/{}'.format(_int_to_quad_dot(dhcp_server_ip), + prefixlen), + 'broadcast', _int_to_quad_dot(broadcast_ip), + 'scope', 'global', + 'dev', iface]) + try: + yield (dhcp_server_ip, client_ip, broadcast_ip) + finally: + self.status(msg='Removing ip addresses from iface %(iface)s', + iface=iface) + subprocess.call(['ip', 'addr', 'flush', 'dev', iface]) + + @contextlib.contextmanager + def _up_interface(self, iface): + self.status(msg='Bringing interface %(iface)s up', iface=iface) + subprocess.check_call(['ip', 'link', 'set', iface, 'up']) + try: + yield + finally: + self.status(msg='Bringing interface %(iface)s down', iface=iface) + subprocess.call(['ip', 'link', 'set', iface, 'down']) + + @contextlib.contextmanager + def static_ip(self, interface): + with self._static_ip(iface=interface) as (host_ip, client_ip, + broadcast_ip), \ + self._up_interface(iface=interface): + yield (_int_to_quad_dot(host_ip), + _int_to_quad_dot(client_ip), + _int_to_quad_dot(broadcast_ip)) + + @contextlib.contextmanager + def vlan(self, interface, vlan): + with self._vlan(interface=interface, vlan=vlan) as viface, \ + self.static_ip(interface=viface) \ + as (host_ip, client_ip, broadcast_ip): + yield host_ip, client_ip, broadcast_ip + + @contextlib.contextmanager + def _tempdir(self): + td = tempfile.mkdtemp() + print 'Created tempdir:', td + try: + yield td + finally: + shutil.rmtree(td, ignore_errors=True) + + @contextlib.contextmanager + def _remote_tempdir(self, hostname, template): + td = cliapp.ssh_runcmd(hostname, ['mktemp', '-d', template]).strip() + try: + yield td + finally: + cliapp.ssh_runcmd(hostname, ['find', td, '-delete']) + + def _serve_tftpd(self, sock, host, port, interface, tftproot): + self.settings.progname = 'tftp server' + self._set_process_name() + while True: + logging.debug('tftpd waiting for connections') + # recvfrom with MSG_PEEK is how you accept UDP connections + _, peer = sock.recvfrom(0, socket.MSG_PEEK) + conn = sock + logging.debug('Connecting socket to peer: ' + repr(peer)) + conn.connect(peer) + # The existing socket is now only serving that peer, so we need to + # bind a new UDP socket to the wildcard address, which needs the + # port to be in REUSEADDR mode. + conn.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + logging.debug('Binding replacement socket to ' + repr((host, port))) + sock.bind((host, port)) + + logging.debug('tftpd server handing connection to tftpd') + tftpd_serve = ['tftpd', '-rl', tftproot] + ret = subprocess.call(args=tftpd_serve, stdin=conn, + stdout=conn, stderr=None, close_fds=True) + # It's handy to turn off REUSEADDR after the rebinding, + # so we can protect against future bind attempts on this port. + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0) + logging.debug('tftpd exited %d' % ret) + os._exit(0) + + @contextlib.contextmanager + def _spawned_tftp_server(self, tftproot, host_ip, interface, tftp_port=0): + # inetd-style launchers tend to bind UDP ports with SO_REUSEADDR, + # because they need to have multiple ports bound, one for recieving + # all connection attempts on that port, and one for each concurrent + # connection with a peer + # this makes detecting whether there's a tftpd running difficult, so + # we'll instead use an ephemeral port and configure the PXE boot to + # use that tftp server for the kernel + s = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) + s.bind((host_ip, tftp_port)) + host, port = s.getsockname() + self.status(msg='Bound listen socket to %(host)s, %(port)s', + host=host, port=port) + pid = os.fork() + if pid == 0: + try: + self._serve_tftpd(sock=s, host=host, port=port, + interface=interface, tftproot=tftproot) + except BaseException as e: + import traceback + traceback.print_exc() + os._exit(1) + s.close() + with executor(pid): + try: + yield port + finally: + self.status(msg='Killing tftpd listener pid=%(pid)d', + pid=pid) + os.kill(pid, signal.SIGKILL) + + @contextlib.contextmanager + def tftp_server(self, host_ip, interface, tftp_port=0): + with self._tempdir() as tftproot, \ + self._spawned_tftp_server(tftproot=tftproot, host_ip=host_ip, + interface=interface, + tftp_port=tftp_port) as tftp_port: + self.status(msg='Serving tftp root %(tftproot)s, on port %(port)d', + port=tftp_port, tftproot=tftproot) + yield tftp_port, tftproot + + @contextlib.contextmanager + def _local_copy(self, src, dst): + self.status(msg='Installing %(src)s to %(dst)s', + src=src, dst=dst) + shutil.copy2(src=src, dst=dst) + try: + yield + finally: + self.status(msg='Removing %(dst)s', dst=dst) + os.unlink(dst) + + def local_pxelinux(self, tftproot): + return self._local_copy('/usr/share/syslinux/pxelinux.0', + os.path.join(tftproot, 'pxelinux.0')) + + def local_kernel(self, rootfs, tftproot): + return self._local_copy(os.path.join(rootfs, 'boot/vmlinuz'), + os.path.join(tftproot, 'kernel')) + + @contextlib.contextmanager + def _remote_copy(self, hostname, src, dst): + with open(src, 'r') as f: + cliapp.ssh_runcmd(hostname, + ['install', '-D', '-m644', '/proc/self/fd/0', + dst], stdin=f, stdout=None, stderr=None) + try: + yield + finally: + cliapp.ssh_runcmd(hostname, ['rm', dst]) + + @contextlib.contextmanager + def remote_kernel(self, rootfs, tftp_url, macaddr): + for name in ('vmlinuz', 'zImage', 'uImage'): + kernel_path = os.path.join(rootfs, 'boot', name) + if os.path.exists(kernel_path): + break + else: + raise cliapp.AppException('Failed to locate kernel') + url = urlparse.urlsplit(tftp_url) + basename = '{}-kernel'.format(_normalise_macaddr(macaddr)) + target_path = os.path.join(url.path, basename) + with self._remote_copy(hostname=url.hostname, src=kernel_path, + dst=target_path): + yield basename + + @contextlib.contextmanager + def local_nfsroot(self, rootfs, target_ip): + nfsroot = target_ip + ':' + rootfs + self.status(msg='Exporting %(nfsroot)s as local nfsroot', + nfsroot=nfsroot) + cliapp.runcmd(['exportfs', '-o', 'ro,insecure,no_root_squash', + nfsroot]) + try: + yield + finally: + self.status(msg='Removing %(nfsroot)s from local nfsroots', + nfsroot=nfsroot) + cliapp.runcmd(['exportfs', '-u', nfsroot]) + + @contextlib.contextmanager + def remote_nfsroot(self, rootfs, rsync_url, macaddr): + url = urlparse.urlsplit(rsync_url) + template = os.path.join(url.path, 'nfsroot.XXXXXXXXXX') + with self._remote_tempdir(hostname=url.hostname, template=template) \ + as tempdir: + nfsroot = urlparse.urlunsplit(url.scheme, url.netloc, tempdir, + url.query, url.fragment) + cliapp.runcmd(['rsync', '-asXSPH', '--delete', rootfs, nfsroot], + stdin=None, stdout=None, stderr=None) + yield basename + + @staticmethod + def _write_pxe_config(fh, kernel_tftp_url, rootfs_nfs_url, extra_args=''): + fh.write(textwrap.dedent('''\ + DEFAULT default + LABEL default + LINUX {kernel_url} + APPEND root=/dev/nfs ip=dhcp nfsroot={rootfs_nfs_url} {extra_args} + ''').format(kernel_url=kernel_tftp_url, + rootfs_nfs_url=rootfs_nfs_url, extra_args=extra_args)) + fh.flush() + + @contextlib.contextmanager + def local_pxeboot_config(self, tftproot, macaddr, ip, tftp_port, + nfsroot_dir): + kernel_tftp_url = 'tftp://{}:{}/kernel'.format(ip, tftp_port) + rootfs_nfs_url = '{}:{}'.format(ip, nfsroot_dir) + pxe_cfg_filename = _normalise_macaddr(macaddr) + pxe_cfg_path = os.path.join(tftproot, 'pxelinux.cfg', pxe_cfg_filename) + os.makedirs(os.path.dirname(pxe_cfg_path)) + with open(pxe_cfg_path, 'w') as f: + self._write_pxe_config(fh=f, kernel_tftp_url=kernel_tftp_url, + rootfs_nfs_url=rootfs_nfs_url, + extra_args=os.environ.get('KERNEL_ARGS','')) + try: + yield + finally: + os.unlink(pxe_cfg_path) + + @contextlib.contextmanager + def remote_pxeboot_config(self, tftproot, kernel_tftproot, kernel_subpath, + rootfs_nfsroot, rootfs_subpath, macaddr): + rootfs_nfs_url = '{}:{}/{}'.format(ip, rootfs_nfsroot, rootfs_subpath) + kernel_tftp_url = '{}/{}'.format(kernel_tftproot, kernel_subpath) + pxe_cfg_filename = _normalise_macaddr(macaddr) + url = urlparse.urlsplit(tftproot) + inst_cfg_path = os.path.join(url.path, 'pxelinux.cfg', + pxe_cfg_filename) + with tempfile.NamedTemporaryFile() as f: + self._write_pxe_config(fh=f, kernel_tftp_url=kernel_tftp_url, + rootfs_nfs_url=rootfs_nfs_url, + extra_args=os.environ.get('KERNEL_ARGS','')) + with self._remote_copy(hostname=url.hostname, src=f.name, + dst=inst_cfg_path): + yield + + @contextlib.contextmanager + def dhcp_server(self, interface, host_ip, target_ip, broadcast_ip): + with self._tempdir() as td: + leases_path = os.path.join(td, 'leases') + config_path = os.path.join(td, 'config') + stdout_path = os.path.join(td, 'stdout') + stderr_path = os.path.join(td, 'stderr') + pidfile_path = os.path.join(td, 'pid') + with open(config_path, 'w') as f: + f.write(textwrap.dedent('''\ + start {target_ip} + end {target_ip} + interface {interface} + max_leases 1 + lease_file {leases_path} + pidfile {pidfile_path} + boot_file pxelinux.0 + option dns {host_ip} + option broadcast {broadcast_ip} + ''').format(**locals())) + with open(stdout_path, 'w') as stdout, \ + open(stderr_path, 'w') as stderr: + sp = subprocess.Popen(['udhcpd', '-f', config_path], cwd=td, + stdin=open(os.devnull), stdout=stdout, + stderr=stderr) + try: + with executor(sp.pid): + yield + finally: + sp.terminate() + + def get_interface_ip(self, interface): + ip_addresses = [] + info = cliapp.runcmd(['ip', '-o', '-f', 'inet', + 'addr', 'show', interface]).rstrip('\n') + if info: + tokens = collections.deque(info.split()[1:]) + ifname = tokens.popleft() + while tokens: + tok = tokens.popleft() + if tok == 'inet': + address = tokens.popleft() + address, netmask = address.split('/') + ip_addresses.append(address) + elif tok == 'brd': + tokens.popleft() # not interested in broadcast address + elif tok == 'scope': + tokens.popleft() # not interested in scope tag + else: + continue + if not ip_addresses: + raise cliapp.AppException('Interface %s has no addresses' + % interface) + if len(ip_addresses) > 1: + warnings.warn('Interface %s has multiple addresses, ' + 'using first (%s)' % (interface, ip_addresses[0])) + return ip_addresses[0] + + def ipmi_set_target_vlan(self): + if any(env_var.startswith('IPMI_') for env_var in os.environ): + # Needs IPMI_USER, IPMI_PASSWORD, IPMI_HOST and PXEBOOT_VLAN + default = textwrap.dedent('''\ + ipmitool -I lanplus -U "$IPMI_USER" -E -H "$IPMI_HOST" \\ + lan set 1 vlan id "$PXEBOOT_VLAN" + ''') + else: + default = textwrap.dedent('''\ + while true; do + echo Please set the target\\'s vlan to $PXEBOOT_VLAN, \\ + then enter \\"vlanned\\" + read + if [ "$REPLY" = vlanned ]; then + break + fi + done + ''') + command = os.environ.get('PXEBOOT_SET_VLAN_COMMAND', default) + subprocess.check_call(['sh', '-euc', command, '-']) + + def ipmi_pxe_reboot_target(self): + if any(env_var.startswith('IPMI_') for env_var in os.environ): + # Needs IPMI_USER, IPMI_PASSWORD, IPMI_HOST and PXEBOOT_VLAN + default = textwrap.dedent('''\ + set -- ipmitool -I lanplus -U "$IPMI_USER" -E -H "$IPMI_HOST" + "$@" chassis bootdev pxe + "$@" chassis power reset + ''') + else: + default = textwrap.dedent('''\ + while true; do + echo Please reboot the target in PXE mode, then\\ + enter \\"pxe-booted\\" + read + if [ "$REPLY" = pxe-booted ]; then + break + fi + done + ''') + command = os.environ.get('PXEBOOT_PXE_REBOOT_COMMAND', default) + subprocess.check_call(['sh', '-euc', command, '-']) + + def wait_for_target_to_install(self): + command = os.environ.get( + 'PXEBOOT_WAIT_INSTALL_COMMAND', + textwrap.dedent('''\ + while true; do + echo Please wait for the system to install, then \\ + enter \\"installed\\" + read + if [ "$REPLY" = installed ]; then + break + fi + done + ''')) + subprocess.check_call(['sh', '-euc', command, '-']) + + def ipmi_unset_target_vlan(self): + if any(env_var.startswith('IPMI_') for env_var in os.environ): + # Needs IPMI_USER, IPMI_PASSWORD, IPMI_HOST + default = textwrap.dedent('''\ + ipmitool -I lanplus -U "$IPMI_USER" -E -H "$IPMI_HOST" \\ + lan set 1 vlan id off + ''') + else: + default = textwrap.dedent('''\ + while true; do + echo Please reset the target\\'s vlan, \\ + then enter \\"unvlanned\\" + read + if [ "$REPLY" = unvlanned ]; then + break + fi + done + ''') + command = os.environ.get('PXEBOOT_UNSET_VLAN_COMMAND', default) + subprocess.check_call(['sh', '-euc', command, '-']) + + def ipmi_reboot_target(self): + if any(env_var.startswith('IPMI_') for env_var in os.environ): + # Needs IPMI_USER, IPMI_PASSWORD, IPMI_HOST + default = textwrap.dedent('''\ + ipmitool -I lanplus -U "$IPMI_USER" -E -H "$IPMI_HOST" \\ + chassis power reset + ''') + else: + default = textwrap.dedent('''\ + while true; do + echo Please reboot the target, then\\ + enter \\"rebooted\\" + read + if [ "$REPLY" = rebooted ]; then + break + fi + done + ''') + command = os.environ.get('PXEBOOT_REBOOT_COMMAND', default) + subprocess.check_call(['sh', '-euc', command, '-']) + + def process_args(self, (temp_root, macaddr)): + interface = os.environ.get('PXEBOOT_DEPLOYER_INTERFACE', None) + vlan = os.environ.get('PXEBOOT_VLAN') + if vlan is not None: vlan = int(vlan) + mode = os.environ.get('PXEBOOT_MODE') + if mode is None: + if interface: + if vlan is not None: + mode = 'spawn-vlan' + else: + if 'PXEBOOT_CONFIG_TFTP_ADDRESS' in os.environ: + mode = 'existing-dhcp' + else: + mode = 'spawn-novlan' + else: + mode = 'existing-server' + assert mode in ('spawn-vlan', 'spawn-novlan', 'existing-dhcp', + 'existing-server') + if mode == 'spawn-vlan': + with self.vlan(interface=interface, vlan=vlan) \ + as (host_ip, target_ip, broadcast_ip), \ + self.tftp_server(host_ip=host_ip, interface=interface) \ + as (tftp_port, tftproot), \ + self.local_pxelinux(tftproot=tftproot), \ + self.local_kernel(rootfs=temp_root, tftproot=tftproot), \ + self.local_nfsroot(rootfs=temp_root, target_ip=target_ip), \ + self.local_pxeboot_config(tftproot=tftproot, macaddr=macaddr, + ip=host_ip, tftp_port=tftp_port, + nfsroot_dir=temp_root), \ + self.dhcp_server(interface=interface, host_ip=host_ip, + target_ip=target_ip, + broadcast_ip=broadcast_ip): + self.ipmi_set_target_vlan() + self.ipmi_pxe_reboot_target() + self.wait_for_target_to_install() + self.ipmi_unset_target_vlan() + self.ipmi_reboot_target() + elif mode == 'spawn-novlan': + with self.static_ip(interface=interface) as (host_ip, target_ip, + broadcast_ip), \ + self.tftp_server(host_ip=host_ip, interface=interface, + tftp_port=69) \ + as (tftp_port, tftproot), \ + self.local_pxelinux(tftproot=tftproot), \ + self.local_kernel(rootfs=temp_root, tftproot=tftproot), \ + self.local_nfsroot(rootfs=temp_root, target_ip=target_ip), \ + self.local_pxeboot_config(tftproot=tftproot, macaddr=macaddr, + ip=host_ip, tftp_port=tftp_port, + nfsroot_dir=temp_root), \ + self.dhcp_server(interface=interface, host_ip=host_ip, + target_ip=target_ip, + broadcast_ip=broadcast_ip): + self.ipmi_pxe_reboot_target() + self.wait_for_target_to_install() + self.ipmi_reboot_target() + elif mode == 'existing-dhcp': + ip = self.get_interface_ip(interface) + config_tftpaddr = os.environ['PXEBOOT_CONFIG_TFTP_ADDRESS'] + with self.tftp_server(ip=ip, interface=interface, tftp_port=69) \ + as (tftp_port, tftproot), \ + self.local_kernel(rootfs=temp_root, tftproot=tftproot), \ + self.local_nfsroot(rootfs=temp_root, client_ip=''): + kernel_tftproot = 'tftp://{}:{}/'.format(ip, tftp_port) + rootfs_nfsroot = '{}:{}'.format(ip, temp_root) + with self.remote_pxeboot_config( + tftproot=config_tftpaddr, + kernel_tftproot=kernel_tftproot, + kernel_subpath='kernel', + rootfs_nfsroot=nfsroot, + rootfs_subpath='', + macaddr=macaddr): + self.ipmi_pxe_reboot_target() + self.wait_for_target_to_install() + self.ipmi_reboot_target() + elif mode == 'existing-server': + config_tftpaddr = os.environ[ 'PXEBOOT_CONFIG_TFTP_ADDRESS'] + kernel_tftpaddr = os.environ.get('PXEBOOT_KERNEL_TFTP_ADDRESS', + config_tftpaddr) + url = urlparse.urlsplit(kernel_tftpaddr) + kernel_tftproot = os.environ.get('PXEBOOT_KERNEL_TFTP_ROOT', + 'tftp://%s/%s' % (url.hostname, + url.path)) + rootfs_rsync = os.environ['PXEBOOT_ROOTFS_RSYNC_ADDRESS'] + url = urlparse.urlsplit(rootfs_rsync) + nfsroot = os.environ.get('PXEBOOT_ROOTFS_NFSROOT', + '%s:%s' % (url.hostname, url.path)) + with self.remote_kernel(rootfs=temp_root, url=kernel_tftpaddr, + macaddr=macaddr) as kernel_subpath, \ + self.remote_nfsroot(rootfs=temp_root, rsync_url=rootfs_rsync)\ + as rootfs_subpath, \ + self.remote_pxeboot_config(tftproot=config_tftpaddr, + kernel_tftproot=kernel_tftproot, + kernel_subpath=kernel_subpath, + rootfs_nfsroot=nfsroot, + rootfs_subpath=rootfs_subpath, + macaddr=macaddr): + self.ipmi_pxe_reboot_target() + self.wait_for_target_to_install() + self.ipmi_reboot_target() + else: + cliapp.AppException('Invalid PXEBOOT_MODE: %s' % mode) + +PXEBoot().run() diff --git a/pxeboot.write.help b/pxeboot.write.help new file mode 100644 index 00000000..58a86957 --- /dev/null +++ b/pxeboot.write.help @@ -0,0 +1,123 @@ +help: > + pxeboot.write extension. + + + This write extension will serve your generated system over NFS to + the target system. + + In all modes `location` is the mac address of the interface that + the target will PXE boot from. This is used so that the target will + load the configuration file appropriate to it. + + + # `PXEBOOT_MODE` + + + It has 4 modes, which can be specified with PXEBOOT_MODE, or inferred + from which parameters are passed: + + + ## spawn-vlan + + + Specify PXEBOOT_DEPLOYER_INTERFACE and PXEBOOT_VLAN to configure + the target to pxeboot on a vlan and spawn a dhcp, nfs and tftp + server. This is potentially the fastest, since it doesn't need to + copy data to other servers. + + This will create a vlan interface for the interface specified in + PXEBOOT_DEPLOYER_INTERFACE and spawn a dhcp server which serves + pxelinux.0, a configuration file and a kernel image from itself. + + The configuration file informs the target to boot with a kernel + command-line that uses an NFS root served from the deployment host. + + + ## spawn-novlan + + + Specify PXEBOOT_DEPLOYER_INTERFACE without PXEBOOT_VLAN to configure + like `spawn-vlan`, but without creating the vlan interface. + + This assumes that you have exclusive access to the interface, such + as if you're plugged in to the device directly, or your interface + is vlanned by your infrastructure team. + + This is required if you are serving from a VM and bridging it to the + correct network via macvtap. For this to work, you need to macvtap + bridge to a pre-vlanned interface on your host machine. + + + ## existing-dhcp + + + Specify PXEBOOT_DEPLOYER_INTERFACE and PXEBOOT_CONFIG_TFTP_ADDRESS + to put config on an existing tftp server, already configured by the + dhcp server. + + This spawns a tftp server and configures the local nfs server, but + doesn't spawn a dhcp server. This is useful if you have already got a + dhcp server that serves PXE images. + + PXEBOOT_CONFIG_TFTP_ADDRESS is a URL in the form `sftp://$HOST/$PATH`. + The configuration file is copied to `$PATH/pxelinux.cfg/` on the + target identified by `$HOST`. + + + ## existing-server + + + Specify at least PXEBOOT_CONFIG_TFTP_ADDRESS and + PXEBOOT_ROOTFS_RSYNC_ADDRESS to specify existing servers to copy + config, kernels and the rootfs to. + + Configuration is copied to the target as `existing-dhcp`. + + Specify PXEBOOT_KERNEL_TFTP_ADDRESS if the tftp server that the + kernel must be downloaded from is different to that of the pxelinux + configuration file. + + PXEBOOT_ROOTFS_RSYNC_ADDRESS is a rsync URL describing where to copy + nfsroots to where they will be exported by the NFS server. + + Specify PXEBOOT_ROOTFS_NFSROOT if the nfsroot appears as a different + address from the target's perspective. + + + # IPMI commands + + + After the PXE boot has been set up, the target needs to be rebooted + in PXE mode. + + If the target is IPMI enabled, you can set `IPMI_USER`, `IPMI_HOST` + and `IPMI_PASSWORD` to make it reboot the target into netboot mode + automatically. + + If they are not specified, then instructions will be displayed, and + `pxeboot.write` will wait for you to finish. + + If there are command-line automation tools for rebooting the target + in netboot mode, then appropriate commands can be defined in the + following variables. + + + ## PXEBOOT_PXE_REBOOT_COMMAND + + + This command will be used to reboot the target device with its boot + device set to PXE boot. + + + ## PXEBOOT_REBOOT_COMMAND + + + This command will be used to reboot the target device in its default + boot mode. + + + ## PXEBOOT_WAIT_INSTALL_COMMAND + + + If it is possible for the target to notify you that it has finished + installing, you can put a command in here to wait for the event. diff --git a/scripts/cycle.sh b/scripts/cycle.sh new file mode 100755 index 00000000..c0e2aa67 --- /dev/null +++ b/scripts/cycle.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# Copyright (C) 2014 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. + +usage() { + echo "Usage: cycle.sh some-system some-cluster [newversion]" + echo + echo "This builds and deploys the current checked out version of" + echo "some-system, applying it as a self-upgrade to the system you" + echo "are working in, using configuration from some-cluster." + echo "The upgrade is labelled TEST by default, or [newversion] if" + echo "specified, and is set to be the default for next boot." +} + +if [ -z "$1" ] || [ -z "$2" ] || [ ! -z "$4" ] ; then + usage + exit 1 +fi + +newversion=TEST +if [ ! -z "$3" ] ; then + newversion=$3 + if (echo "$newversion" | grep ' ' > /dev/null 2>&1) ; then + echo 'Version label must not contain spaces.' + exit 1 + fi +fi + +if system-version-manager get-running | grep -q "^$newversion$"; then + echo "You are currently running the $newversion system." + echo "Maybe you want to boot into a different system version?" + exit 1 +fi + +set -e +set -v + +runningversion=`system-version-manager get-running` +system-version-manager set-default $runningversion +if system-version-manager list | grep -q "^$newversion$"; then + system-version-manager remove $newversion +fi + +morph gc +morph build "$1" + +sed -i "s|^- morph: .*$|- morph: $1|" "$2" +morph deploy --upgrade "$2" self.HOSTNAME=$(hostname) self.VERSION_LABEL=$newversion +system-version-manager list diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl new file mode 100644 index 00000000..180e8989 --- /dev/null +++ b/scripts/licensecheck.pl @@ -0,0 +1,596 @@ +#!/usr/bin/perl +# This script was originally based on the script of the same name from +# the KDE SDK (by dfaure@kde.org) +# +# This version is +# Copyright (C) 2007, 2008 Adam D. Barratt +# Copyright (C) 2012 Francesco Poli +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + +=head1 NAME + +licensecheck - simple license checker for source files + +=head1 SYNOPSIS + +B<licensecheck> B<--help>|B<--version> + +B<licensecheck> [B<--no-conf>] [B<--verbose>] [B<--copyright>] +[B<-l>|B<--lines=>I<N>] [B<-i>|B<--ignore=>I<regex>] [B<-c>|B<--check=>I<regex>] +[B<-m>|B<--machine>] [B<-r>|B<--recursive>] +I<list of files and directories to check> + +=head1 DESCRIPTION + +B<licensecheck> attempts to determine the license that applies to each file +passed to it, by searching the start of the file for text belonging to +various licenses. + +If any of the arguments passed are directories, B<licensecheck> will add +the files contained within to the list of files to process. + +=head1 OPTIONS + +=over 4 + +=item B<--verbose>, B<--no-verbose> + +Specify whether to output the text being processed from each file before +the corresponding license information. + +Default is to be quiet. + +=item B<-l=>I<N>, B<--lines=>I<N> + +Specify the number of lines of each file's header which should be parsed +for license information. (Default is 60). + +=item B<-i=>I<regex>, B<--ignore=>I<regex> + +When processing the list of files and directories, the regular +expression specified by this option will be used to indicate those which +should not be considered (e.g. backup files, VCS metadata). + +=item B<-r>, B<--recursive> + +Specify that the contents of directories should be added +recursively. + +=item B<-c=>I<regex>, B<--check=>I<regex> + +Specify a pattern against which filenames will be matched in order to +decide which files to check the license of. + +The default includes common source files. + +=item B<--copyright> + +Also display copyright text found within the file + +=item B<-m>, B<--machine> + +Display the information in a machine readable way, i.e. in the form +<file><tab><license>[<tab><copyright>] so that it can be easily sorted +and/or filtered, e.g. with the B<awk> and B<sort> commands. +Note that using the B<--verbose> option will kill the readability. + +=item B<--no-conf>, B<--noconf> + +Do not read any configuration files. This can only be used as the first +option given on the command line. + +=back + +=head1 CONFIGURATION VARIABLES + +The two configuration files F</etc/devscripts.conf> and +F<~/.devscripts> are sourced by a shell in that order to set +configuration variables. Command line options can be used to override +configuration file settings. Environment variable settings are +ignored for this purpose. The currently recognised variables are: + +=over 4 + +=item B<LICENSECHECK_VERBOSE> + +If this is set to I<yes>, then it is the same as the B<--verbose> command +line parameter being used. The default is I<no>. + +=item B<LICENSECHECK_PARSELINES> + +If this is set to a positive number then the specified number of lines +at the start of each file will be read whilst attempting to determine +the license(s) in use. This is equivalent to the B<--lines> command line +option. + +=back + +=head1 LICENSE + +This code is copyright by Adam D. Barratt <I<adam@adam-barratt.org.uk>>, +all rights reserved; based on a script of the same name from the KDE +SDK, which is copyright by <I<dfaure@kde.org>>. +This program comes with ABSOLUTELY NO WARRANTY. +You are free to redistribute this code under the terms of the GNU +General Public License, version 2 or later. + +=head1 AUTHOR + +Adam D. Barratt <adam@adam-barratt.org.uk> + +=cut + +use strict; +use warnings; +use Getopt::Long qw(:config gnu_getopt); +use File::Basename; + +my $progname = basename($0); + +# From dpkg-source +my $default_ignore_regex = ' +# Ignore general backup files +(?:^|/).*~$| +# Ignore emacs recovery files +(?:^|/)\.#.*$| +# Ignore vi swap files +(?:^|/)\..*\.swp$| +# Ignore baz-style junk files or directories +(?:^|/),,.*(?:$|/.*$)| +# File-names that should be ignored (never directories) +(?:^|/)(?:DEADJOE|\.cvsignore|\.arch-inventory|\.bzrignore|\.gitignore)$| +# File or directory names that should be ignored +(?:^|/)(?:CVS|RCS|\.deps|\{arch\}|\.arch-ids|\.svn|\.hg|_darcs|\.git| +\.shelf|_MTN|\.bzr(?:\.backup|tags)?)(?:$|/.*$) +'; + +# Take out comments and newlines +$default_ignore_regex =~ s/^#.*$//mg; +$default_ignore_regex =~ s/\n//sg; + +my $default_check_regex = '\.(c(c|pp|xx)?|h(h|pp|xx)?|f(77|90)?|go|p(l|m)|xs|sh|php|py(|x)|rb|java|vala|el|sc(i|e)|cs|pas|inc|dtd|xsl|mod|m|tex|mli?)$'; + +my $modified_conf_msg; + +my %OPT=( + verbose => '', + lines => '', + noconf => '', + ignore => '', + check => '', + recursive => 0, + copyright => 0, + machine => 0, +); + +my $def_lines = 60; + +# Read configuration files and then command line +# This is boilerplate + +if (@ARGV and $ARGV[0] =~ /^--no-?conf$/) { + $modified_conf_msg = " (no configuration files read)"; + shift; +} else { + my @config_files = ('/etc/devscripts.conf', '~/.devscripts'); + my %config_vars = ( + 'LICENSECHECK_VERBOSE' => 'no', + 'LICENSECHECK_PARSELINES' => $def_lines, + ); + my %config_default = %config_vars; + + my $shell_cmd; + # Set defaults + foreach my $var (keys %config_vars) { + $shell_cmd .= qq[$var="$config_vars{$var}";\n]; + } + $shell_cmd .= 'for file in ' . join(" ", @config_files) . "; do\n"; + $shell_cmd .= '[ -f $file ] && . $file; done;' . "\n"; + # Read back values + foreach my $var (keys %config_vars) { $shell_cmd .= "echo \$$var;\n" } + my $shell_out = `/bin/bash -c '$shell_cmd'`; + @config_vars{keys %config_vars} = split /\n/, $shell_out, -1; + + # Check validity + $config_vars{'LICENSECHECK_VERBOSE'} =~ /^(yes|no)$/ + or $config_vars{'LICENSECHECK_VERBOSE'} = 'no'; + $config_vars{'LICENSECHECK_PARSELINES'} =~ /^[1-9][0-9]*$/ + or $config_vars{'LICENSECHECK_PARSELINES'} = $def_lines; + + foreach my $var (sort keys %config_vars) { + if ($config_vars{$var} ne $config_default{$var}) { + $modified_conf_msg .= " $var=$config_vars{$var}\n"; + } + } + $modified_conf_msg ||= " (none)\n"; + chomp $modified_conf_msg; + + $OPT{'verbose'} = $config_vars{'LICENSECHECK_VERBOSE'} eq 'yes' ? 1 : 0; + $OPT{'lines'} = $config_vars{'LICENSECHECK_PARSELINES'}; +} + +GetOptions(\%OPT, + "help|h", + "check|c=s", + "copyright", + "ignore|i=s", + "lines|l=i", + "machine|m", + "noconf|no-conf", + "recursive|r", + "verbose!", + "version|v", +) or die "Usage: $progname [options] filelist\nRun $progname --help for more details\n"; + +$OPT{'lines'} = $def_lines if $OPT{'lines'} !~ /^[1-9][0-9]*$/; +$OPT{'ignore'} = $default_ignore_regex if ! length $OPT{'ignore'}; +$OPT{'check'} = $default_check_regex if ! length $OPT{'check'}; + +if ($OPT{'noconf'}) { + fatal("--no-conf is only acceptable as the first command-line option!"); +} +if ($OPT{'help'}) { help(); exit 0; } +if ($OPT{'version'}) { version(); exit 0; } + +die "Usage: $progname [options] filelist\nRun $progname --help for more details\n" unless @ARGV; + +$OPT{'lines'} = $def_lines if not defined $OPT{'lines'}; + +my @files = (); +my @find_args = (); +my $files_count = @ARGV; + +push @find_args, qw(-maxdepth 1) unless $OPT{'recursive'}; +push @find_args, qw(-follow -type f -print); + +while (@ARGV) { + my $file = shift @ARGV; + + if (-d $file) { + open my $FIND, '-|', 'find', $file, @find_args + or die "$progname: couldn't exec find: $!\n"; + + while (<$FIND>) { + chomp; + next unless m%$OPT{'check'}%; + # Skip empty files + next if (-z $_); + push @files, $_ unless m%$OPT{'ignore'}%; + } + close $FIND; + } else { + next unless ($files_count == 1) or $file =~ m%$OPT{'check'}%; + push @files, $file unless $file =~ m%$OPT{'ignore'}%; + } +} + +while (@files) { + my $file = shift @files; + my $content = ''; + my $copyright_match; + my $copyright = ''; + my $license = ''; + my %copyrights; + + open (my $F, '<' ,$file) or die "Unable to access $file\n"; + while (<$F>) { + last if ($. > $OPT{'lines'}); + $content .= $_; + $copyright_match = parse_copyright($_); + if ($copyright_match) { + $copyrights{lc("$copyright_match")} = "$copyright_match"; + } + } + close($F); + + $copyright = join(" / ", values %copyrights); + + print qq(----- $file header -----\n$content----- end header -----\n\n) + if $OPT{'verbose'}; + + $license = parselicense(clean_comments($content)); + + if ($OPT{'machine'}) { + print "$file\t$license"; + print "\t" . ($copyright or "*No copyright*") if $OPT{'copyright'}; + print "\n"; + } else { + print "$file: "; + print "*No copyright* " unless $copyright; + print $license . "\n"; + print " [Copyright: " . $copyright . "]\n" + if $copyright and $OPT{'copyright'}; + print "\n" if $OPT{'copyright'}; + } +} + +sub parse_copyright { + my $copyright = ''; + my $match; + + my $copyright_indicator_regex = ' + (?:copyright # The full word + |copr\. # Legally-valid abbreviation + |\x{00a9} # Unicode character COPYRIGHT SIGN + |\xc2\xa9 # Unicode copyright sign encoded in iso8859 + |\(c\) # Legally-null representation of sign + )'; + my $copyright_disindicator_regex = ' + \b(?:info(?:rmation)? # Discussing copyright information + |notice # Discussing the notice + |and|or # Part of a sentence + )\b'; + + if (m%$copyright_indicator_regex(?::\s*|\s+)(\S.*)$%ix) { + $match = $1; + + # Ignore lines matching "see foo for copyright information" etc. + if ($match !~ m%^\s*$copyright_disindicator_regex%ix) { + # De-cruft + $match =~ s/([,.])?\s*$//; + $match =~ s/$copyright_indicator_regex//igx; + $match =~ s/^\s+//; + $match =~ s/\s{2,}/ /g; + $match =~ s/\\@/@/g; + $copyright = $match; + } + } + + return $copyright; +} + +sub clean_comments { + local $_ = shift or return q{}; + + # Remove generic comments: look for 4 or more lines beginning with + # regular comment pattern and trim it. Fall back to old algorithm + # if no such pattern found. + my @matches = m/^\s*([^a-zA-Z0-9\s]{1,3})\s\w/mg; + if (@matches >= 4) { + my $comment_length = length($matches[0]); + my $comment_re = qr/\s*[\Q$matches[0]\E]{${comment_length}}\s*/; + s/^$comment_re//mg; + } + + # Remove Fortran comments + s/^[cC] //gm; + tr/\t\r\n/ /; + + # Remove C / C++ comments + s#(\*/|/[/*])##g; + tr% A-Za-z.,@;0-9\(\)/-%%cd; + tr/ //s; + + return $_; +} + +sub help { + print <<"EOF"; +Usage: $progname [options] filename [filename ...] +Valid options are: + --help, -h Display this message + --version, -v Display version and copyright info + --no-conf, --noconf Don't read devscripts config files; must be + the first option given + --verbose Display the header of each file before its + license information + --lines, -l Specify how many lines of the file header + should be parsed for license information + (Default: $def_lines) + --check, -c Specify a pattern indicating which files should + be checked + (Default: '$default_check_regex') + --machine, -m Display in a machine readable way (good for awk) + --recursive, -r Add the contents of directories recursively + --copyright Also display the file's copyright + --ignore, -i Specify that files / directories matching the + regular expression should be ignored when + checking files + (Default: '$default_ignore_regex') + +Default settings modified by devscripts configuration files: +$modified_conf_msg +EOF +} + +sub version { + print <<"EOF"; +This is $progname, from the Debian devscripts package, version ###VERSION### +Copyright (C) 2007, 2008 by Adam D. Barratt <adam\@adam-barratt.org.uk>; based +on a script of the same name from the KDE SDK by <dfaure\@kde.org>. + +This program comes with ABSOLUTELY NO WARRANTY. +You are free to redistribute this code under the terms of the +GNU General Public License, version 2, or (at your option) any +later version. +EOF +} + +sub parselicense { + my ($licensetext) = @_; + + my $gplver = ""; + my $extrainfo = ""; + my $license = ""; + + if ($licensetext =~ /version ([^, ]+?)[.,]? (?:\(?only\)?.? )?(?:of the GNU (Affero )?(Lesser |Library )?General Public License )?(as )?published by the Free Software Foundation/i or + $licensetext =~ /GNU (?:Affero )?(?:Lesser |Library )?General Public License (?:as )?published by the Free Software Foundation[;,] version ([^, ]+?)[.,]? /i) { + + $gplver = " (v$1)"; + } elsif ($licensetext =~ /GNU (?:Affero )?(?:Lesser |Library )?General Public License, version (\d+(?:\.\d+)?)[ \.]/) { + $gplver = " (v$1)"; + } elsif ($licensetext =~ /either version ([^ ]+)(?: of the License)?, or \(at your option\) any later version/) { + $gplver = " (v$1 or later)"; + } + + if ($licensetext =~ /(?:675 Mass Ave|59 Temple Place|51 Franklin Steet|02139|02111-1307)/i) { + $extrainfo = " (with incorrect FSF address)$extrainfo"; + } + + if ($licensetext =~ /permission (?:is (also granted|given))? to link (the code of )?this program with (any edition of )?(Qt|the Qt library)/i) { + $extrainfo = " (with Qt exception)$extrainfo" + } + + if ($licensetext =~ /(All changes made in this file will be lost|DO NOT (EDIT|delete this file)|Generated (automatically|by|from)|generated.*file)/i) { + $license = "GENERATED FILE"; + } + + if ($licensetext =~ /((is free software.? )?you can redistribute (it|them) and\/or modify (it|them)|is licensed) under the terms of (version [^ ]+ of )?the (GNU (Library |Lesser )General Public License|LGPL)/i) { + $license = "LGPL$gplver$extrainfo $license"; + } + + if ($licensetext =~ /is free software.? you can redistribute (it|them) and\/or modify (it|them) under the terms of the (GNU Affero General Public License|AGPL)/i) { + $license = "AGPL$gplver$extrainfo $license"; + } + + if ($licensetext =~ /(is free software.? )?you (can|may) redistribute (it|them) and\/or modify (it|them) under the terms of (?:version [^ ]+ (?:\(?only\)? )?of )?the GNU General Public License/i) { + $license = "GPL$gplver$extrainfo $license"; + } + + if ($licensetext =~ /is distributed under the terms of the GNU General Public License,/ + and length $gplver) { + $license = "GPL$gplver$extrainfo $license"; + } + + if ($licensetext =~ /is distributed.*terms.*GPL/) { + $license = "GPL (unversioned/unknown version) $license"; + } + + if ($licensetext =~ /This file is part of the .*Qt GUI Toolkit. This file may be distributed under the terms of the Q Public License as defined/) { + $license = "QPL (part of Qt) $license"; + } elsif ($licensetext =~ /may (be distributed|redistribute it) under the terms of the Q Public License/) { + $license = "QPL $license"; + } + + if ($licensetext =~ /opensource\.org\/licenses\/mit-license\.php/) { + $license = "MIT/X11 (BSD like) $license"; + } elsif ($licensetext =~ /Permission is hereby granted, free of charge, to any person obtaining a copy of this software and(\/or)? associated documentation files \(the (Software|Materials)\), to deal in the (Software|Materials)/) { + $license = "MIT/X11 (BSD like) $license"; + } elsif ($licensetext =~ /Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose/) { + $license = "MIT/X11 (BSD like) $license"; + } + + if ($licensetext =~ /Permission to use, copy, modify, and(\/or)? distribute this software for any purpose with or without fee is hereby granted, provided.*copyright notice.*permission notice.*all copies/) { + $license = "ISC $license"; + } + + if ($licensetext =~ /THIS SOFTWARE IS PROVIDED .*AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY/) { + if ($licensetext =~ /All advertising materials mentioning features or use of this software must display the following acknowledge?ment.*This product includes software developed by/i) { + $license = "BSD (4 clause) $license"; + } elsif ($licensetext =~ /(The name .*? may not|Neither the names? .*? nor the names of (its|their|other) contributors may) be used to endorse or promote products derived from this software/i) { + $license = "BSD (3 clause) $license"; + } elsif ($licensetext =~ /Redistributions of source code must retain the above copyright notice/i) { + $license = "BSD (2 clause) $license"; + } else { + $license = "BSD $license"; + } + } + + if ($licensetext =~ /Mozilla Public License,? (Version|v\.) (\d+(?:\.\d+)?)/) { + $license = "MPL (v$2) $license"; + } + + if ($licensetext =~ /Released under the terms of the Artistic License ([^ ]+)/) { + $license = "Artistic (v$1) $license"; + } + + if ($licensetext =~ /is free software under the Artistic [Ll]icense/) { + $license = "Artistic $license"; + } + + if ($licensetext =~ /This program is free software; you can redistribute it and\/or modify it under the same terms as Perl itself/) { + $license = "Perl $license"; + } + + if ($licensetext =~ /under the Apache License, Version ([^ ]+)/) { + $license = "Apache (v$1) $license"; + } + + if ($licensetext =~ /(THE BEER-WARE LICENSE)/i) { + $license = "Beerware $license"; + } + + if ($licensetext =~ /This source file is subject to version ([^ ]+) of the PHP license/) { + $license = "PHP (v$1) $license"; + } + + if ($licensetext =~ /under the terms of the CeCILL /) { + $license = "CeCILL $license"; + } + + if ($licensetext =~ /under the terms of the CeCILL-([^ ]+) /) { + $license = "CeCILL-$1 $license"; + } + + if ($licensetext =~ /under the SGI Free Software License B/) { + $license = "SGI Free Software License B $license"; + } + + if ($licensetext =~ /is in the public domain/i) { + $license = "Public domain $license"; + } + + if ($licensetext =~ /terms of the Common Development and Distribution License(, Version ([^(]+))? \(the License\)/) { + $license = "CDDL " . ($1 ? "(v$2) " : '') . $license; + } + + if ($licensetext =~ /Microsoft Permissive License \(Ms-PL\)/) { + $license = "Ms-PL $license"; + } + + if ($licensetext =~ /Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license \(the \"Software\"\)/ or + $licensetext =~ /Boost Software License([ ,-]+Version ([^ ]+)?(\.))/i) { + $license = "BSL " . ($1 ? "(v$2) " : '') . $license; + } + + if ($licensetext =~ /PYTHON SOFTWARE FOUNDATION LICENSE (VERSION ([^ ]+))/i) { + $license = "PSF " . ($1 ? "(v$2) " : '') . $license; + } + + if ($licensetext =~ /The origin of this software must not be misrepresented.*Altered source versions must be plainly marked as such.*This notice may not be removed or altered from any source distribution/ or + $licensetext =~ /see copyright notice in zlib\.h/) { + $license = "zlib/libpng $license"; + } elsif ($licensetext =~ /This code is released under the libpng license/) { + $license = "libpng $license"; + } + + if ($licensetext =~ /Do What The Fuck You Want To Public License, Version ([^, ]+)/i) { + $license = "WTFPL (v$1) $license"; + } + + if ($licensetext =~ /Do what The Fuck You Want To Public License/i) { + $license = "WTFPL $license"; + } + + if ($licensetext =~ /(License WTFPL|Under (the|a) WTFPL)/i) { + $license = "WTFPL $license"; + } + + $license = "UNKNOWN" if (!length($license)); + + # Remove trailing spaces. + $license =~ s/\s+$//; + + return $license; +} + +sub fatal { + my ($pack,$file,$line); + ($pack,$file,$line) = caller(); + (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; + $msg =~ s/\n\n$/\n/; + die $msg; +} + diff --git a/scripts/licensecheck.sh b/scripts/licensecheck.sh new file mode 100755 index 00000000..7e4c4b91 --- /dev/null +++ b/scripts/licensecheck.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +# Copyright (C) 2013 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. + +set -e + +usage() { + echo "Usage: license-check your-system" + echo + echo "This checks license info for all the chunks in your-system" + echo "It's re-runnable, and does morph edit to get each chunk." + echo "The process can take a while." +} + + +if [ -z "$1" ]; then + usage + exit 1 +fi + +workspace="$PWD"/../../.. +system="$1" + +gplv3_chunks="\ +autoconf \ +automake \ +bash \ +binutils \ +bison \ +ccache \ +cmake \ +flex \ +gawk \ +gcc \ +gdbm \ +gettext \ +gperf \ +groff \ +libtool \ +m4 \ +make \ +nano \ +patch \ +texinfo-tarball" + +gplv3_repos="" + + +for f in strata/*.morph; do + cp "$f" "$f.bak" +done + + +strata=`grep "morph.*: *" "$system" | cut -d: -f2-` +for stratum in $strata; do + chunks=`grep -E -- "-? +name.*: *" "$stratum" | cut -d: -f2-` + for chunk in $chunks; do + if ! (echo $gplv3_chunks | grep -wq "$chunk"); then + morph edit $chunk 1>&2 + else + repo=`grep "name.*: *$chunk" "$stratum" -A1 | \ + tail -n1 | cut -d: -f3-` + gplv3_repos="$gplv3_repos $repo" + fi + done +done + + +repos=`for stratum in $strata; do + grep "repo.*: *" "$stratum" | cut -d: -f3- + done | sort -u` + + +for repo in $repos; do + if ! (echo $gplv3_repos | grep -wq "$repo") && \ + [ -d "$workspace/upstream/$repo" ] ; then + echo "$repo" + perl scripts/licensecheck.pl -r "$workspace/upstream/$repo" | \ + cut -d: -f2- | sort -u + echo + fi +done + + +for f in strata/*.morph.bak; do + mv "$f" "${f%.bak}" +done diff --git a/scripts/organize-morphologies.py b/scripts/organize-morphologies.py new file mode 100755 index 00000000..abc8c739 --- /dev/null +++ b/scripts/organize-morphologies.py @@ -0,0 +1,266 @@ +#!/usr/bin/env python +# Copyright (C) 2014 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 json +import morphlib +import os +import subprocess +import sys +import urllib +import urllib2 +import urlparse +import yaml +import re +import errno + +''' organize-morphologies.py: +Tool for organizing morphologies in definitions. + +This script will move: + - cluster morphologies into clusters directory + - system morphologies into systems directory + - stratum morphologies into strata directory + +This script will download the chunk morphologies for every stratum +and placed into strata/stratum_which_the_chunk_belongs_to directory. + +It also modifies the morphologies fields which points to some morpholgy +which has been moved. +''' + + +# NOTE: The following reimplements part of morphlib's remote repo cache stuff +def parse_repo_alias(repo): + domain, path = repo.split(':') + if domain == 'baserock': + repo = 'ssh://git@git.baserock.org/baserock/%s' % path + elif domain == 'upstream': + repo = 'ssh://git@git.baserock.org/delta/%s' % path + else: + raise Exception("I don't know how to parse the repo-alias \"%s\"" % repo) + return repo + +def make_request(path): + server_url = 'http://git.baserock.org:8080/' + url = urlparse.urljoin(server_url, '/1.0/%s' % path) + handle = urllib2.urlopen(url) + return handle.read() + +def quote(*args): + return tuple(urllib.quote(string) for string in args) + +def cat_file(repo, ref, filename): + return make_request('files?repo=%s&ref=%s&filename=%s' % + quote(repo, ref, filename)) + +# NOTE: This function reimplement part of morphlib's loader +def sanitise_morphology_path(morph_field, morph_kind, belongs_to='None'): + '''This function receives the name or the morph field of one morphology + and returns the path of the morphology depending on the name, kind and + if it belongs to other morphologies. + ''' + # Dictionary which match morphology's kind and morphology's + # directory in definitions.git + morph_dir = { 'chunk': 'chunks', 'stratum': 'strata', + 'system':'systems', 'cluster': 'clusters'} + # For chunks morphologies we need to know to which stratums + # belongs this chunk. + if morph_kind == 'chunk': + if belongs_to == '': + raise morphlib.Error('Chunk morphologies need the stratum name' + 'to create the path. Please add the stratum' + 'which belongs this morphology') + # Get the name of the chunk which we assume is at the end + # of the morph file + if '/' in morph_field: + morph_field = os.path.basename(morph_field) + + # Add the stratum name to the chunk name + morph_field = os.path.join(belongs_to, morph_field) + + # Reset the kind to stratum because chunk contains stratum + # name in its path. + morph_kind = 'stratum' + + # Add the morphology path to the morph field. + if not morph_field.startswith(morph_dir[morph_kind]): + morph_field = os.path.join(morph_dir[morph_kind], morph_field) + + # Add the morphology suffix if the morphology. + if not morph_field.endswith('.morph'): + morph_field = morph_field + '.morph' + + return morph_field + +def create_directory(name, path): + directory = os.path.join(path, name) + try: + os.makedirs(directory) + except OSError as err: + if err.errno != errno.EEXIST: + raise err + else: + pass + return directory + +def move_file(morph, directory, path, loader): + if not morph.filename.startswith(directory): + filename = os.path.basename(morph.filename) + new_location = os.path.join(path, filename) + print '\nMoving %s into %s' % (filename, new_location) + subprocess.call(['git', 'mv', morph.filename, new_location]) + morph.filename = new_location + loader.unset_defaults(morph) + loader.save_to_file(morph.filename, morph) + +def load_and_fix_chunk(chunk_str, loader, name): + try: + chunk_morph = loader.load_from_string(chunk_str) + except morphlib.morphloader.InvalidFieldError as err: + if "comments" in str(err): + # This error is caused because there are old morphologies which + # contain the field "comments" instead of "description". + # Replacing "comments" field by "description" will allow the morphology + # to pass parse_morphology_text check and ready to be written to a file. + fixed_chunk = loader.parse_morphology_text(chunk_str, name) + fixed_chunk['description'] = fixed_chunk.pop('comments') + print "WARNING: Invalid 'comments' field in " \ + "%s corrected to 'description'" % name + chunk_morph = load_and_fix_chunk(str(fixed_chunk), loader, name) + elif "buildsystem" in str(err): + # This error is caused because a typo in a morphology which + # has a field "buildsystem" instead of "build-system". + fixed_chunk = loader.parse_morphology_text(chunk_str, name) + fixed_chunk['build-system'] = fixed_chunk.pop('buildsystem') + print "WARNING: Invalid 'buildsystem' field in %s" \ + "corrected to 'build-system'" % name + chunk_morph = load_and_fix_chunk(str(fixed_chunk), loader, name) + else: + print "ERROR: %s in chunk %s" %(err, name) + raise err + except morphlib.morphloader.MorphologyNotYamlError as err: + print "WARNING: %s in chunk %s is not valid YAML, " \ + "attempting to fix..." %(err, name) + # This error is caused because there are old morphologies written + # in JSON which contain '\t' characters. When try to load this + # kind of morphologies load_from_string fails when parse_morphology_text. + # Removing this characters will make load_from_string to load the morphology + # and translate it into a correct yaml format. + fixed_chunk = chunk_str.replace('\t','') + print "INFO: %s successfully fixed" % name + chunk_morph = load_and_fix_chunk(fixed_chunk, loader, name) + return chunk_morph + +def move_clusters(morphs, path, loader): + kind = 'system' + directory = 'clusters' + # Move cluster morphologies to clusters folder fixing their dependent + # morphologies which are systems. + full_path = create_directory(directory, path) + for morph in morphs: + all_systems = morph['systems'][:] + for system in morph['systems']: + all_systems.extend(system.get('subsystems', [])) + # Add the correct path to the morph fields for systems and subsystems + for field in all_systems: + field['morph'] = sanitise_morphology_path(field['morph'], kind) + move_file(morph, directory, full_path, loader) + +def move_systems(morphs, path, loader): + kind = 'stratum' + directory = 'systems' + # Move system morphologies to systems folder fixing their dependent + # morphologies which are strata. + full_path = create_directory(directory, path) + for morph in morphs: + # Add name field and the correct path to the stratum on the morph + # fields in strata. + for field in morph['strata']: + field['name'] = os.path.basename(field['morph']) + field['morph'] = sanitise_morphology_path(field['morph'], kind) + move_file(morph, directory, full_path, loader) + +def download_chunks(morph, loader): + # Download chunks morphologies defined on the stratum and + # add them to the directory tree. + for chunk in morph['chunks']: + name = chunk['name'] + '.morph' + try: + chunk['morph'] = sanitise_morphology_path(chunk['morph'], 'chunk', morph['name']) + except KeyError as err: + if 'morph' in str(err): + chunk['morph'] = sanitise_morphology_path(chunk['name'], 'chunk', morph['name']) + else: + raise err + ref = chunk['ref'] + repo = parse_repo_alias(chunk['repo']) + try: + print "\nDownloading %s from %s into %s" %(name, repo, chunk['morph']) + chunk_str = cat_file(repo, ref, name) + except urllib2.HTTPError as err: + # If there is no morphology in the repository we assume that the morphology + # system will be autodetected, so we don't have to create a new one + # unless we shut down the autodetecting system (fallback system). + if err.code == 404: + print 'INFO: Morph will fall-back to build-time' \ + 'autodetection for %s' %(name) + # Remove morph field from autodetected chunks + del chunk['morph'] + else: + loaded_chunk = load_and_fix_chunk(chunk_str, loader, name) + loader.unset_defaults(loaded_chunk) + loader.save_to_file(chunk['morph'], loaded_chunk) + +def move_strata(morphs, path, loader): + # Create strata directory + strata_dir = 'strata/' + strata_path = create_directory(strata_dir, path) + for morph in morphs: + # Create stratum directory where downloading its chunks. + stratum_path = strata_path + morph['name'] + stratum_dir = create_directory(stratum_path, path) + + # Download chunks which belongs to the stratum + download_chunks(morph, loader) + + # Add to build-depends the correct path to the dependent stratum morphologies. + for build_depends in morph['build-depends']: + build_depends['morph'] = sanitise_morphology_path(build_depends['morph'], 'stratum') + # Move stratum morphologies to strata + move_file(morph, strata_dir, strata_path, loader) + +def main(): + # Load all morphologies in the definitions repo + sb = morphlib.sysbranchdir.open_from_within('.') + loader = morphlib.morphloader.MorphologyLoader() + morphs = [m for m in sb.load_all_morphologies(loader)] + + # Clasify the morphologies regarding of their kind field + morphologies = { kind: [m for m in morphs if m['kind'] == kind] + for kind in ('chunk', 'stratum', 'system', 'cluster') } + + for kind, morphs in morphologies.iteritems(): + print 'There are: %d %s.\n' %(len(morphs), kind) + + # Get the path from definitions repo + definitions_repo = sb.get_git_directory_name(sb.root_repository_url) + + # Move the morphologies to its directories + move_clusters(morphologies['cluster'], definitions_repo, loader) + move_systems(morphologies['system'], definitions_repo, loader) + move_strata(morphologies['stratum'], definitions_repo, loader) + +main() diff --git a/scripts/release-build b/scripts/release-build new file mode 100755 index 00000000..5525e9e9 --- /dev/null +++ b/scripts/release-build @@ -0,0 +1,175 @@ +#!/usr/bin/env python +# Copyright (C) 2014 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 cliapp +import morphlib +import os +import subprocess +import sys +import time + + +class Build(object): + '''A single distbuild instance.''' + + def __init__(self, name, arch, app): + self.system_name = name + self.controller = app.controllers[arch] + self.command = [ + 'morph', 'distbuild-morphology', + '--controller-initiator-address=%s' % self.controller, + 'baserock:baserock/definitions', app.ref, self.system_name] + + def start(self): + self.process = subprocess.Popen(self.command) + + def completed(self): + return (self.process.poll() is not None) + + +class ReleaseApp(cliapp.Application): + + '''Cliapp app that handles distbuilding and deploying a cluster.''' + + def add_settings(self): + self.settings.string_list(['controllers'], + 'a list of distbuild controllers and their ' + 'architecture') + + self.settings.string(['trove-host'], + 'hostname of Trove instance') + + self.settings.string(['artifact-cache-server'], + 'server to fetch artifacts from', default=None) + + self.settings.string(['release-number'], + 'Baserock version of the systems being built', + default='yy.ww') + + def process_args(self, args): + '''Process the command line''' + self.controllers = {} + controllers_list = self.settings['controllers'] + for item in controllers_list: + arch, controller = item.split(':') + self.controllers[arch] = controller + + self.ref = cliapp.runcmd(['git', 'rev-parse', 'HEAD']).strip() + + sb = morphlib.sysbranchdir.open_from_within('.') + definitions = sb.get_git_directory_name(sb.root_repository_url) + defs_repo = morphlib.gitdir.GitDirectory(definitions) + self.loader = morphlib.morphloader.MorphologyLoader() + self.finder = morphlib.morphologyfinder.MorphologyFinder(defs_repo) + + cluster_name = args[0] + cluster, cluster_path = self.load_morphology(cluster_name) + + builds = self.prepare_builds(cluster) + if not os.path.exists('builds'): + os.mkdir('builds') + os.chdir('builds') + for build in builds: + build.start() + + while not all(build.completed() for build in builds): + time.sleep(1) + + fail = False + for build in builds: + if build.process.returncode != 0: + fail = True + sys.stderr.write( + 'Building failed for %s\n' % build.system_name) + if fail: + raise cliapp.AppException('Building of systems failed') + + os.chdir('..') + if not os.path.exists('release'): + os.mkdir('release') + self.deploy_images(cluster, cluster_path) + + def load_morphology(self, name, kind=None): + path = morphlib.util.sanitise_morphology_path(name) + morph = self.loader.load_from_string( + self.finder.read_morphology(path)) + if kind: + assert morph['kind'] == kind + return morph, path + + def iterate_systems(self, system_list): + for system in system_list: + yield system['morph'] + if 'subsystems' in system: + for subsystem in self.iterate_systems(system['subsystems']): + yield subsystem + + def prepare_builds(self, cluster): + '''Prepare a list of builds''' + systems = set(self.iterate_systems(cluster['systems'])) + builds = [] + for system_name in systems: + system, _ = self.load_morphology(system_name) + if system['arch'] in self.controllers: + builds.append(Build(system_name, system['arch'], self)) + return builds + + def deploy_images(self, cluster, cluster_path): + version_label = 'baserock-%s' % self.settings['release-number'] + outputs = {} + + for system in cluster['systems']: + morphology_name = system['morph'] + morphology = self.load_morphology(morphology_name)[0] + if morphology['arch'] not in self.controllers: + continue + + for deployment_name, deployment_info in system['deploy'].iteritems(): + # The release.morph cluster must specify a basename for the file, + # of name and extension. This script knows about name, but it + # can't find out the appropriate file extension without second + # guessing the behaviour of write extensions. + basename = deployment_info['location'] + + if '/' in basename or basename.startswith(version_label): + raise cliapp.AppException( + 'In %s: system %s.location should be just the base name, ' + 'e.g. "%s.img"' % (cluster_path, deployment_name, deployment_name)) + + filename = os.path.join('release', '%s-%s' % (version_label, basename)) + if os.path.exists(filename): + self.output.write('Reusing existing deployment of %s\n' % filename) + else: + self.output.write('Creating %s from release.morph\n' % filename) + self.deploy_single_image(cluster_path, deployment_name, filename, version_label) + + def deploy_single_image(self, cluster_path, name, location, version_label): + deploy_command = [ + 'morph', 'deploy', cluster_path, name, + '--trove-host=%s' % self.settings['trove-host']] + artifact_server = self.settings['artifact-cache-server'] + if artifact_server is not None: + deploy_command.append('--artifact-cache-server=%s' % artifact_server) + deploy_command.extend(( + '%s.location=%s' % (name, location), + '%s.VERSION_LABEL=%s' % (name, version_label) + )) + + cliapp.runcmd(deploy_command, stdout=sys.stdout) + + +ReleaseApp().run() diff --git a/scripts/release-build.test.conf b/scripts/release-build.test.conf new file mode 100644 index 00000000..50083352 --- /dev/null +++ b/scripts/release-build.test.conf @@ -0,0 +1,6 @@ +[config] +trove-host = ct-mcr-1.ducie.codethink.co.uk +controllers = x86_64:ct-mcr-1-distbuild-x86-64-majikthise-controller.dyn.ducie.codethink.co.uk, + x86_32:ct-mcr-1-distbuild-x86-32-majikthise-controller.dyn.ducie.codethink.co.uk, + armv7lhf:ct-mcr-1-distbuild-armv7lhf-jetson.dyn.ducie.codethink.co.uk +release-number = 14.29 diff --git a/scripts/release-test b/scripts/release-test new file mode 100755 index 00000000..a1611721 --- /dev/null +++ b/scripts/release-test @@ -0,0 +1,401 @@ +#!/usr/bin/env python +# +# Copyright 2014 Codethink Ltd +# +# 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. + +'''release-test + +This script deploys the set of systems in the cluster morphology it is +instructed to read, to test that they work correctly. + +''' + +import cliapp +import os +import pipes +import shlex +import shutil +import socket +import tempfile +import time +import uuid + +import morphlib + + +class MorphologyHelper(object): + + def __init__(self): + self.sb = sb = morphlib.sysbranchdir.open_from_within('.') + defs_repo_path = sb.get_git_directory_name(sb.root_repository_url) + self.defs_repo = morphlib.gitdir.GitDirectory(defs_repo_path) + self.loader = morphlib.morphloader.MorphologyLoader() + self.finder = morphlib.morphologyfinder.MorphologyFinder(self.defs_repo) + + def load_morphology(self, path): + text = self.finder.read_morphology(path) + return self.loader.load_from_string(text) + + @classmethod + def iterate_systems(cls, systems_list): + for system in systems_list: + yield morphlib.util.sanitise_morphology_path(system['morph']) + if 'subsystems' in system: + for subsystem in cls.iterate_systems(system['subsystems']): + yield subsystem + + def iterate_cluster_deployments(cls, cluster_morph): + for system in cluster_morph['systems']: + path = morphlib.util.sanitise_morphology_path(system['morph']) + defaults = system.get('deploy-defaults', {}) + for name, options in system['deploy'].iteritems(): + config = dict(defaults) + config.update(options) + yield path, name, config + + def load_cluster_systems(self, cluster_morph): + for system_path in set(self.iterate_systems(cluster_morph['systems'])): + system_morph = self.load_morphology(system_path) + yield system_path, system_morph + + +class TimeoutError(cliapp.AppException): + + """Error to be raised when a connection waits too long""" + + def __init__(self, msg): + super(TimeoutError, self).__init__(msg) + + +class VMHost(object): + + def __init__(self, user, address, disk_path): + self.user = user + self.address = address + self.disk_path = disk_path + + @property + def ssh_host(self): + return '{user}@{address}'.format(user=self.user, address=self.address) + + def runcmd(self, *args, **kwargs): + cliapp.ssh_runcmd(self.ssh_host, *args, **kwargs) + + def virsh(self, *args, **kwargs): + self.runcmd(['virsh', '-c', 'qemu:///system'] + list(args), **kwargs) + + +class DeployedSystemInstance(object): + + def __init__(self, deployment, config, host_machine, vm_id, rootfs_path): + self.deployment = deployment + self.config = config + # TODO: Stop assuming test machine can DHCP and be assigned its + # hostname in the deployer's resolve search path. + self.ip_address = self.config['HOSTNAME'] + self.host_machine = host_machine + self.vm_id = vm_id + self.rootfs_path = rootfs_path + + @property + def ssh_host(self): + # TODO: Stop assuming we ssh into test instances as root + return 'root@{host}'.format(host=self.ip_address) + + def runcmd(self, argv, chdir='.', **kwargs): + ssh_cmd = ['ssh', '-o', 'StrictHostKeyChecking=no', + '-o', 'UserKnownHostsFile=/dev/null', self.ssh_host] + cmd = ['sh', '-c', 'cd "$1" && shift && exec "$@"', '-', chdir] + cmd += argv + ssh_cmd.append(' '.join(map(pipes.quote, cmd))) + return cliapp.runcmd(ssh_cmd, **kwargs) + + def _wait_for_dhcp(self, timeout): + '''Block until given hostname resolves successfully. + + Raises TimeoutError if the hostname has not appeared in 'timeout' + seconds. + + ''' + start_time = time.time() + while True: + try: + socket.gethostbyname(self.ip_address) + return + except socket.gaierror: + pass + if time.time() > start_time + timeout: + raise TimeoutError("Host %s did not appear after %i seconds" % + (self.ip_address, timeout)) + time.sleep(0.5) + + def _wait_for_ssh(self, timeout): + """Wait until the deployed VM is responding via SSH""" + start_time = time.time() + while True: + try: + self.runcmd(['true'], stdin=None, stdout=None, stderr=None) + return + except cliapp.AppException: + # TODO: Stop assuming the ssh part of the command is what failed + if time.time() > start_time + timeout: + raise TimeoutError("%s sshd did not start after %i seconds" + % (self.ip_address, timeout)) + time.sleep(0.5) + + def wait_until_online(self, timeout=10): + self._wait_for_dhcp(timeout) + self._wait_for_ssh(timeout) + + def delete(self): + # Stop and remove VM + try: + self.host_machine.virsh('destroy', self.vm_id) + except cliapp.AppException as e: + # TODO: Stop assuming that destroy failed because it wasn't running + pass + try: + self.host_machine.virsh('undefine', self.vm_id, '--remove-all-storage') + except cliapp.AppException as e: + # TODO: Stop assuming that undefine failed because it was + # already removed + pass + + +class Deployment(object): + + def __init__(self, cluster_path, name, deployment_config, host_machine): + self.cluster_path = cluster_path + self.name = name + self.deployment_config = deployment_config + self.host_machine = host_machine + + @staticmethod + def _ssh_host_key_exists(hostname): + """Check if an ssh host key exists in known_hosts""" + if not os.path.exists('/root/.ssh/known_hosts'): + return False + with open('/root/.ssh/known_hosts', 'r') as known_hosts: + return any(line.startswith(hostname) for line in known_hosts) + + def _update_known_hosts(self): + if not self._ssh_host_key_exists(self.host_machine.address): + with open('/root/.ssh/known_hosts', 'a') as known_hosts: + cliapp.runcmd(['ssh-keyscan', self.host_machine.address], + stdout=known_hosts) + + @staticmethod + def _generate_sshkey_config(tempdir, config): + manifest = os.path.join(tempdir, 'manifest') + with open(manifest, 'w') as f: + f.write('0040700 0 0 /root/.ssh\n') + f.write('overwrite 0100600 0 0 /root/.ssh/authorized_keys\n') + authkeys = os.path.join(tempdir, 'root', '.ssh', 'authorized_keys') + os.makedirs(os.path.dirname(authkeys)) + with open(authkeys, 'w') as auth_f: + with open('/root/.ssh/id_rsa.pub', 'r') as key_f: + shutil.copyfileobj(key_f, auth_f) + + install_files = shlex.split(config.get('INSTALL_FILES', '')) + install_files.append(manifest) + yield 'INSTALL_FILES', ' '.join(pipes.quote(f) for f in install_files) + + def deploy(self): + self._update_known_hosts() + + hostname = str(uuid.uuid4()) + vm_id = hostname + image_base = self.host_machine.disk_path + rootpath = '{image_base}/{hostname}.img'.format(image_base=image_base, + hostname=hostname) + loc = 'kvm+ssh://{ssh_host}/{id}/{path}'.format( + ssh_host=self.host_machine.ssh_host, id=vm_id, path=rootpath) + + options = { + 'type': 'kvm', + 'location': loc, + 'AUTOSTART': 'True', + 'HOSTNAME': hostname, + 'DISK_SIZE': '20G', + 'RAM_SIZE': '2G', + 'VERSION_LABEL': 'release-test', + } + + tempdir = tempfile.mkdtemp() + try: + options.update( + self._generate_sshkey_config(tempdir, + self.deployment_config)) + + args = ['morph', 'deploy', self.cluster_path, self.name] + for k, v in options.iteritems(): + args.append('%s.%s=%s' % (self.name, k, v)) + cliapp.runcmd(args, stdin=None, stdout=None, stderr=None) + + config = dict(self.deployment_config) + config.update(options) + + return DeployedSystemInstance(self, config, self.host_machine, + vm_id, rootpath) + finally: + shutil.rmtree(tempdir) + + +class ReleaseApp(cliapp.Application): + + """Cliapp application which handles automatic builds and tests""" + + def add_settings(self): + """Add the command line options needed""" + group_main = 'Program Options' + self.settings.string_list(['deployment-host'], + 'ARCH:HOST:PATH that VMs can be deployed to', + default=None, + group=group_main) + self.settings.string(['trove-host'], + 'Address of Trove for test systems to build from', + default=None, + group=group_main) + self.settings.string(['trove-id'], + 'ID of Trove for test systems to build from', + default=None, + group=group_main) + self.settings.string(['build-ref-prefix'], + 'Prefix of build branches for test systems', + default=None, + group=group_main) + + @staticmethod + def _run_tests(instance, system_path, system_morph, + (trove_host, trove_id, build_ref_prefix), + morph_helper, systems): + instance.wait_until_online() + + tests = [] + def baserock_build_test(instance): + instance.runcmd(['git', 'config', '--global', 'user.name', + 'Test Instance of %s' % instance.deployment.name]) + instance.runcmd(['git', 'config', '--global', 'user.email', + 'ci-test@%s' % instance.config['HOSTNAME']]) + instance.runcmd(['mkdir', '-p', '/src/ws', '/src/cache', + '/src/tmp']) + def morph_cmd(*args, **kwargs): + # TODO: decide whether to use cached artifacts or not by + # adding --artifact-cache-server= --cache-server= + argv = ['morph', '--log=/src/morph.log', '--cachedir=/src/cache', + '--tempdir=/src/tmp', '--log-max=100M', + '--trove-host', trove_host, '--trove-id', trove_id, + '--build-ref-prefix', build_ref_prefix] + argv.extend(args) + instance.runcmd(argv, **kwargs) + + repo = morph_helper.sb.root_repository_url + ref = morph_helper.defs_repo.HEAD + sha1 = morph_helper.defs_repo.resolve_ref_to_commit(ref) + morph_cmd('init', '/src/ws') + chdir = '/src/ws' + + morph_cmd('checkout', repo, ref, chdir=chdir) + # TODO: Add a morph subcommand that gives the path to the root repository. + repo_path = os.path.relpath( + morph_helper.sb.get_git_directory_name(repo), + morph_helper.sb.root_directory) + chdir = os.path.join(chdir, ref, repo_path) + + instance.runcmd(['git', 'reset', '--hard', sha1], chdir=chdir) + print 'Building test systems for {sys}'.format(sys=system_path) + for to_build_path, to_build_morph in systems.iteritems(): + if to_build_morph['arch'] == system_morph['arch']: + print 'Test building {path}'.format(path=to_build_path) + morph_cmd('build', to_build_path, chdir=chdir, + stdin=None, stdout=None, stderr=None) + print 'Finished Building test systems' + + def python_smoke_test(instance): + instance.runcmd(['python', '-c', 'print "Hello World"']) + + # TODO: Come up with a better way of determining which tests to run + if 'devel' in system_path: + tests.append(baserock_build_test) + else: + tests.append(python_smoke_test) + + for test in tests: + test(instance) + + def deploy_and_test_systems(self, cluster_path, + deployment_hosts, build_test_config): + """Run the deployments and tests""" + + version = 'release-test' + + morph_helper = MorphologyHelper() + cluster_morph = morph_helper.load_morphology(cluster_path) + systems = dict(morph_helper.load_cluster_systems(cluster_morph)) + + for system_path, deployment_name, deployment_config in \ + morph_helper.iterate_cluster_deployments(cluster_morph): + + system_morph = systems[system_path] + # We can only test systems in KVM that have a BSP + if not any('bsp' in si['morph'] for si in system_morph['strata']): + continue + + # We can only test systems in KVM that we have a host for + if system_morph['arch'] not in deployment_hosts: + continue + host_machine = deployment_hosts[system_morph['arch']] + deployment = Deployment(cluster_path, deployment_name, + deployment_config, host_machine) + + instance = deployment.deploy() + try: + self._run_tests(instance, system_path, system_morph, + build_test_config, morph_helper, systems) + finally: + instance.delete() + + def process_args(self, args): + """Process the command line args and kick off the builds/tests""" + if self.settings['build-ref-prefix'] is None: + self.settings['build-ref-prefix'] = ( + os.path.join(self.settings['trove-id'], 'builds')) + for setting in ('deployment-host', 'trove-host', + 'trove-id', 'build-ref-prefix'): + self.settings.require(setting) + + deployment_hosts = {} + for host_config in self.settings['deployment-host']: + arch, address = host_config.split(':', 1) + user, address = address.split('@', 1) + address, disk_path = address.split(':', 1) + if user == '': + user = 'root' + # TODO: Don't assume root is the user with deploy access + deployment_hosts[arch] = VMHost(user, address, disk_path) + + build_test_config = (self.settings['trove-host'], + self.settings['trove-id'], + self.settings['build-ref-prefix']) + + if len(args) != 1: + raise cliapp.AppException('Usage: release-test CLUSTER') + cluster_path = morphlib.util.sanitise_morphology_path(args[0]) + self.deploy_and_test_systems(cluster_path, deployment_hosts, + build_test_config) + + +if __name__ == '__main__': + ReleaseApp().run() diff --git a/scripts/release-test-os b/scripts/release-test-os new file mode 100755 index 00000000..a886300e --- /dev/null +++ b/scripts/release-test-os @@ -0,0 +1,526 @@ +#!/usr/bin/env python +# +# Copyright 2014 Codethink Ltd +# +# 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. + +'''release-test + +This script deploys the set of systems in the cluster morphology it is +instructed to read, to test that they work correctly. + +''' + +import cliapp +import os +import pipes +import shlex +import shutil +import socket +import tempfile +import time +import uuid + +import morphlib + + +class NovaList: + def __init__(self): + self.output = [] + self.lines = [] + self.instance = [] + + def update(self): + self.output = cliapp.runcmd(['nova', 'list']) + self.lines = self.output.split('\n') + self.lines = self.lines[3:-2] + + def get_nova_details_for_instance(self, name): + self.update() + + for line in self.lines: + entries = line.split('|') + stripped_line = [entry.strip() for entry in entries] + if stripped_line.count(name) == 1: + self.instance = stripped_line + + def get_nova_state_for_instance(self, name): + self.get_nova_details_for_instance(name) + if not self.instance: + return + return self.instance[3] + + def get_nova_ip_for_instance(self, name): + self.get_nova_details_for_instance(name) + if not self.instance: + return + + if self.get_nova_state_for_instance(name) != 'ACTIVE': + return + + return self.instance[6] + + def get_nova_ip_for_instance_timeout(self, name, timeout=120): + start_time = time.time() + + while self.get_nova_state_for_instance(name) != 'ACTIVE': + + if time.time() > start_time + timeout: + print "%s not ACTIVE after %i seconds" % (name, timeout) + return + + time.sleep(1) + + ip_addr = self.get_nova_ip_for_instance(name) + if not ip_addr: + return + + if ip_addr.count('=') == 0: + return + + ip_addr = ip_addr[ip_addr.find('=') + 1:] + + if ip_addr.count(',') == 0: + return ip_addr + + return ip_addr[:ip_addr.find(',')] + + + +class MorphologyHelper(object): + + def __init__(self): + self.sb = sb = morphlib.sysbranchdir.open_from_within('.') + defs_repo_path = sb.get_git_directory_name(sb.root_repository_url) + self.defs_repo = morphlib.gitdir.GitDirectory(defs_repo_path) + self.loader = morphlib.morphloader.MorphologyLoader() + self.finder = morphlib.morphologyfinder.MorphologyFinder(self.defs_repo) + + def load_morphology(self, path): + text = self.finder.read_morphology(path) + return self.loader.load_from_string(text) + + @classmethod + def iterate_systems(cls, systems_list): + for system in systems_list: + yield morphlib.util.sanitise_morphology_path(system['morph']) + if 'subsystems' in system: + for subsystem in cls.iterate_systems(system['subsystems']): + yield subsystem + + def iterate_cluster_deployments(cls, cluster_morph): + for system in cluster_morph['systems']: + path = morphlib.util.sanitise_morphology_path(system['morph']) + defaults = system.get('deploy-defaults', {}) + for name, options in system['deploy'].iteritems(): + config = dict(defaults) + config.update(options) + yield path, name, config + + def load_cluster_systems(self, cluster_morph): + for system_path in set(self.iterate_systems(cluster_morph['systems'])): + system_morph = self.load_morphology(system_path) + yield system_path, system_morph + + +class TimeoutError(cliapp.AppException): + + """Error to be raised when a connection waits too long""" + + def __init__(self, msg): + super(TimeoutError, self).__init__(msg) + + +class VMHost(object): + + def __init__(self, user, address, disk_path): + self.user = user + self.address = address + self.disk_path = disk_path + + @property + def ssh_host(self): + return '{user}@{address}'.format(user=self.user, address=self.address) + + def runcmd(self, *args, **kwargs): + cliapp.ssh_runcmd(self.ssh_host, *args, **kwargs) + + +class DeployedSystemInstance(object): + + def __init__(self, deployment, config, host_machine, vm_id, rootfs_path, + ip_addr, hostname): + self.deployment = deployment + self.config = config + self.ip_address = ip_addr + self.host_machine = host_machine + self.vm_id = vm_id + self.rootfs_path = rootfs_path + self.hostname = hostname + + @property + def ssh_host(self): + # TODO: Stop assuming we ssh into test instances as root + return 'root@{host}'.format(host=self.ip_address) + + def runcmd(self, argv, chdir='.', **kwargs): + ssh_cmd = ['ssh', '-o', 'StrictHostKeyChecking=no', + '-o', 'UserKnownHostsFile=/dev/null', self.ssh_host] + cmd = ['sh', '-c', 'cd "$1" && shift && exec "$@"', '-', chdir] + cmd += argv + ssh_cmd.append(' '.join(map(pipes.quote, cmd))) + return cliapp.runcmd(ssh_cmd, **kwargs) + + def _wait_for_dhcp(self, timeout): + '''Block until given hostname resolves successfully. + + Raises TimeoutError if the hostname has not appeared in 'timeout' + seconds. + + ''' + start_time = time.time() + while True: + try: + socket.gethostbyname(self.ip_address) + return + except socket.gaierror: + pass + if time.time() > start_time + timeout: + raise TimeoutError("Host %s did not appear after %i seconds" % + (self.ip_address, timeout)) + time.sleep(0.5) + + def _wait_for_ssh(self, timeout): + """Wait until the deployed VM is responding via SSH""" + start_time = time.time() + while True: + try: + self.runcmd(['true'], stdin=None, stdout=None, stderr=None) + return + except cliapp.AppException: + # TODO: Stop assuming the ssh part of the command is what failed + if time.time() > start_time + timeout: + raise TimeoutError("%s sshd did not start after %i seconds" + % (self.ip_address, timeout)) + time.sleep(0.5) + + def _wait_for_cloud_init(self, timeout): + """Wait until cloud init has resized the disc""" + start_time = time.time() + while True: + try: + out = self.runcmd(['sh', '-c', + 'test -e "$1" && echo exists || echo does not exist', + '-', + '/root/cloud-init-finished']) + except: + import traceback + traceback.print_exc() + raise + if out.strip() == 'exists': + return + if time.time() > start_time + timeout: + raise TimeoutError("Disc size not increased after %i seconds" + % (timeout)) + time.sleep(3) + + def wait_until_online(self, timeout=120): + self._wait_for_dhcp(timeout) + self._wait_for_ssh(timeout) + self._wait_for_cloud_init(timeout) + print "Test system %s ready to run tests." % (self.hostname) + + def delete(self): + # Stop and remove VM + print "Deleting %s test instance" % (self.hostname) + try: + cliapp.runcmd(['nova', 'delete', self.hostname]) + except cliapp.AppException as e: + # TODO: Stop assuming that delete failed because the instance + # wasn't running + print "- Failed" + pass + print "Deleting %s test disc image" % (self.hostname) + try: + cliapp.runcmd(['nova', 'image-delete', self.hostname]) + except cliapp.AppException as e: + # TODO: Stop assuming that image-delete failed because it was + # already removed + print "- Failed" + pass + + +class Deployment(object): + + def __init__(self, cluster_path, name, deployment_config, + host_machine, net_id): + self.cluster_path = cluster_path + self.name = name + self.deployment_config = deployment_config + self.host_machine = host_machine + self.net_id = net_id + + @staticmethod + def _ssh_host_key_exists(hostname): + """Check if an ssh host key exists in known_hosts""" + if not os.path.exists('/root/.ssh/known_hosts'): + return False + with open('/root/.ssh/known_hosts', 'r') as known_hosts: + return any(line.startswith(hostname) for line in known_hosts) + + def _update_known_hosts(self): + if not self._ssh_host_key_exists(self.host_machine.address): + with open('/root/.ssh/known_hosts', 'a') as known_hosts: + cliapp.runcmd(['ssh-keyscan', self.host_machine.address], + stdout=known_hosts) + + @staticmethod + def _generate_sshkey_config(tempdir, config): + manifest = os.path.join(tempdir, 'manifest') + with open(manifest, 'w') as f: + f.write('0040700 0 0 /root/.ssh\n') + f.write('overwrite 0100600 0 0 /root/.ssh/authorized_keys\n') + authkeys = os.path.join(tempdir, 'root', '.ssh', 'authorized_keys') + os.makedirs(os.path.dirname(authkeys)) + with open(authkeys, 'w') as auth_f: + with open('/root/.ssh/id_rsa.pub', 'r') as key_f: + shutil.copyfileobj(key_f, auth_f) + + install_files = shlex.split(config.get('INSTALL_FILES', '')) + install_files.append(manifest) + yield 'INSTALL_FILES', ' '.join(pipes.quote(f) for f in install_files) + + def deploy(self): + self._update_known_hosts() + + hostname = str(uuid.uuid4()) + vm_id = hostname + image_base = self.host_machine.disk_path + rootpath = '{image_base}/{hostname}.img'.format(image_base=image_base, + hostname=hostname) + loc = 'http://{ssh_host}:5000/v2.0'.format( + ssh_host=self.host_machine.ssh_host, id=vm_id, path=rootpath) + + options = { + 'type': 'openstack', + 'location': loc, + 'HOSTNAME': hostname, + 'DISK_SIZE': '5G', + 'RAM_SIZE': '2G', + 'VERSION_LABEL': 'release-test', + 'OPENSTACK_USER': os.environ['OS_USERNAME'], + 'OPENSTACK_TENANT': os.environ['OS_TENANT_NAME'], + 'OPENSTACK_PASSWORD': os.environ['OS_PASSWORD'], + 'OPENSTACK_IMAGENAME': hostname, + 'CLOUD_INIT': 'yes', + 'KERNEL_ARGS': 'console=tty0 console=ttyS0', + } + + tempdir = tempfile.mkdtemp() + try: + options.update( + self._generate_sshkey_config(tempdir, + self.deployment_config)) + + # Deploy the image to openstack + args = ['morph', 'deploy', self.cluster_path, self.name] + for k, v in options.iteritems(): + args.append('%s.%s=%s' % (self.name, k, v)) + cliapp.runcmd(args, stdin=None, stdout=None, stderr=None) + + config = dict(self.deployment_config) + config.update(options) + + # Boot an instance from the image + args = ['nova', 'boot', + '--flavor', 'm1.medium', + '--image', hostname, + '--user-data', '/usr/lib/mason/os-init-script', + '--nic', "net-id=%s" % (self.net_id), + hostname] + output = cliapp.runcmd(args) + + # Print nova boot output, with adminPass line removed + output_lines = output.split('\n') + for line in output_lines: + if line.find('adminPass') != -1: + password_line = line + output_lines.remove(password_line) + output = '\n'.join(output_lines) + print output + + # Get ip address from nova list + nl = NovaList() + ip_addr = nl.get_nova_ip_for_instance_timeout(hostname) + print "IP address for instance %s: %s" % (hostname, ip_addr) + + return DeployedSystemInstance(self, config, self.host_machine, + vm_id, rootpath, ip_addr, hostname) + finally: + shutil.rmtree(tempdir) + + +class ReleaseApp(cliapp.Application): + + """Cliapp application which handles automatic builds and tests""" + + def add_settings(self): + """Add the command line options needed""" + group_main = 'Program Options' + self.settings.string_list(['deployment-host'], + 'ARCH:HOST:PATH that VMs can be deployed to', + default=None, + group=group_main) + self.settings.string(['trove-host'], + 'Address of Trove for test systems to build from', + default=None, + group=group_main) + self.settings.string(['trove-id'], + 'ID of Trove for test systems to build from', + default=None, + group=group_main) + self.settings.string(['build-ref-prefix'], + 'Prefix of build branches for test systems', + default=None, + group=group_main) + self.settings.string(['net-id'], + 'Openstack network ID', + default=None, + group=group_main) + + @staticmethod + def _run_tests(instance, system_path, system_morph, + (trove_host, trove_id, build_ref_prefix), + morph_helper, systems): + instance.wait_until_online() + + tests = [] + def baserock_build_test(instance): + instance.runcmd(['git', 'config', '--global', 'user.name', + 'Test Instance of %s' % instance.deployment.name]) + instance.runcmd(['git', 'config', '--global', 'user.email', + 'ci-test@%s' % instance.config['HOSTNAME']]) + instance.runcmd(['mkdir', '-p', '/src/ws', '/src/cache', + '/src/tmp']) + def morph_cmd(*args, **kwargs): + # TODO: decide whether to use cached artifacts or not by + # adding --artifact-cache-server= --cache-server= + argv = ['morph', '--log=/src/morph.log', '--cachedir=/src/cache', + '--tempdir=/src/tmp', '--log-max=100M', + '--trove-host', trove_host, '--trove-id', trove_id, + '--build-ref-prefix', build_ref_prefix] + argv.extend(args) + instance.runcmd(argv, **kwargs) + + repo = morph_helper.sb.root_repository_url + ref = morph_helper.defs_repo.HEAD + sha1 = morph_helper.defs_repo.resolve_ref_to_commit(ref) + morph_cmd('init', '/src/ws') + chdir = '/src/ws' + + morph_cmd('checkout', repo, ref, chdir=chdir) + # TODO: Add a morph subcommand that gives the path to the root repository. + repo_path = os.path.relpath( + morph_helper.sb.get_git_directory_name(repo), + morph_helper.sb.root_directory) + chdir = os.path.join(chdir, ref, repo_path) + + instance.runcmd(['git', 'reset', '--hard', sha1], chdir=chdir) + print 'Building test systems for {sys}'.format(sys=system_path) + for to_build_path, to_build_morph in systems.iteritems(): + if to_build_morph['arch'] == system_morph['arch']: + print 'Test building {path}'.format(path=to_build_path) + morph_cmd('build', to_build_path, chdir=chdir, + stdin=None, stdout=None, stderr=None) + print 'Finished Building test systems' + + def python_smoke_test(instance): + instance.runcmd(['python', '-c', 'print "Hello World"']) + + # TODO: Come up with a better way of determining which tests to run + if 'devel' in system_path: + tests.append(baserock_build_test) + else: + tests.append(python_smoke_test) + + for test in tests: + test(instance) + + def deploy_and_test_systems(self, cluster_path, + deployment_hosts, build_test_config, + net_id): + """Run the deployments and tests""" + + version = 'release-test' + + morph_helper = MorphologyHelper() + cluster_morph = morph_helper.load_morphology(cluster_path) + systems = dict(morph_helper.load_cluster_systems(cluster_morph)) + + for system_path, deployment_name, deployment_config in \ + morph_helper.iterate_cluster_deployments(cluster_morph): + + system_morph = systems[system_path] + # We can only test systems in KVM that have a BSP + if not any('bsp' in si['morph'] for si in system_morph['strata']): + continue + + # We can only test systems in KVM that we have a host for + if system_morph['arch'] not in deployment_hosts: + continue + host_machine = deployment_hosts[system_morph['arch']] + deployment = Deployment(cluster_path, deployment_name, + deployment_config, host_machine, + net_id) + + instance = deployment.deploy() + try: + self._run_tests(instance, system_path, system_morph, + build_test_config, morph_helper, systems) + finally: + instance.delete() + + def process_args(self, args): + """Process the command line args and kick off the builds/tests""" + if self.settings['build-ref-prefix'] is None: + self.settings['build-ref-prefix'] = ( + os.path.join(self.settings['trove-id'], 'builds')) + for setting in ('deployment-host', 'trove-host', + 'trove-id', 'build-ref-prefix', 'net-id'): + self.settings.require(setting) + + deployment_hosts = {} + for host_config in self.settings['deployment-host']: + arch, address = host_config.split(':', 1) + user, address = address.split('@', 1) + address, disk_path = address.split(':', 1) + if user == '': + user = 'root' + # TODO: Don't assume root is the user with deploy access + deployment_hosts[arch] = VMHost(user, address, disk_path) + + build_test_config = (self.settings['trove-host'], + self.settings['trove-id'], + self.settings['build-ref-prefix']) + + if len(args) != 1: + raise cliapp.AppException('Usage: release-test CLUSTER') + cluster_path = morphlib.util.sanitise_morphology_path(args[0]) + self.deploy_and_test_systems(cluster_path, deployment_hosts, + build_test_config, + self.settings['net-id']) + + +if __name__ == '__main__': + ReleaseApp().run() diff --git a/scripts/release-upload b/scripts/release-upload new file mode 100755 index 00000000..273f9ed5 --- /dev/null +++ b/scripts/release-upload @@ -0,0 +1,473 @@ +#!/usr/bin/python +# Copyright (C) 2014 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. + + +'''Upload and publish Baserock binaries for a release. + +This utility is used for the Baserock release process. See +http://wiki.baserock.org/guides/release-process/ for details on the +release process. + +This utility uploads two sets of binaries: + +* The build artifacts (built chunks and strata) used to construct the + systems being released. The systems are found in `release.morph` and + the artifacts from the Trove used to prepare the release. They get + uploaded to a public Trove (by default git.baserock.org). If they're + the same Trove, then nothing happens. + +* The released system images (disk images, tar archives, etc) + specified in `release.morph` get uploaded to a download server (by + default download.baserock.org). + +''' + + +import json +import logging +import os +import pwd +import shutil +import sys +import urllib +import urllib2 +import urlparse + +import cliapp +import yaml + +import morphlib + +class ReleaseUploader(cliapp.Application): + + def add_settings(self): + group = 'Release upload settings' + + local_username = self.get_local_username() + + self.settings.string( + ['build-trove-host'], + 'get build artifacts from Trove at ADDRESS', + metavar='ADDRESS', + group=group) + + self.settings.string( + ['public-trove-host'], + 'publish build artifacts on Trove at ADDRESS', + metavar='ADDRESS', + default='git.baserock.org', + group=group) + + self.settings.string( + ['public-trove-username'], + 'log into public trove as USER', + metavar='USER', + default=local_username, + group=group) + + self.settings.string( + ['public-trove-artifact-dir'], + 'put published artifacts into DIR', + metavar='DIR', + default='/home/cache/artifacts', + group=group) + + self.settings.string( + ['release-artifact-dir'], + 'get release artifacts from DIR (all files from there)', + metavar='DIR', + default='.', + group=group) + + self.settings.string( + ['download-server-address'], + 'publish release artifacts on server at ADDRESS', + metavar='ADDRESS', + default='download.baserock.org', + group=group) + + self.settings.string( + ['download-server-username'], + 'log into download server as USER', + metavar='USER', + default=local_username, + group=group) + + self.settings.string( + ['download-server-private-dir'], + 'use DIR as the temporary location for uploaded release ' + 'artifacts', + metavar='DIR', + default='/srv/download.baserock.org/baserock/.publish-temp', + group=group) + + self.settings.string( + ['download-server-public-dir'], + 'put published release artifacts in DIR', + metavar='DIR', + default='/srv/download.baserock.org/baserock', + group=group) + + self.settings.string( + ['local-build-artifacts-dir'], + 'keep build artifacts to be uploaded temporarily in DIR', + metavar='DIR', + default='build-artifacts', + group=group) + + self.settings.string( + ['morph-cmd'], + 'run FILE to invoke morph', + metavar='FILE', + default='morph', + group=group) + + self.settings.string_list( + ['arch'], + 'Upload files from morphologies of ARCH', + metavar='ARCH', + default=[], + group=group) + + self.settings.boolean( + ['upload-build-artifacts'], + 'upload build artifacts?', + default=True) + + self.settings.boolean( + ['upload-release-artifacts'], + 'upload release artifacts (disk images etc)?', + default=True) + + def get_local_username(self): + uid = os.getuid() + return pwd.getpwuid(uid)[0] + + def process_args(self, args): + if len(args) != 1: + raise cliapp.AppException('Usage: release-upload CLUSTER') + cluster_morphology_path = args[0] + self.status(msg='Uploading and publishing Baserock release') + + if self.settings['upload-build-artifacts']: + self.publish_build_artifacts(cluster_morphology_path) + else: + self.status( + msg='Not uploading build artifacts ' + '(upload-build-artifacts set to false') + + if self.settings['upload-release-artifacts']: + self.publish_release_artifacts() + else: + self.status( + msg='Not uploading release artifacts ' + '(upload-release-artifacts set to false') + + def publish_build_artifacts(self, cluster_morphology_path): + publisher = BuildArtifactPublisher(self.settings, self.status) + publisher.publish_build_artifacts(cluster_morphology_path) + self.status(msg='Build artifacts have been published') + + def publish_release_artifacts(self): + publisher = ReleaseArtifactPublisher(self.settings, self.status) + publisher.publish_release_artifacts() + self.status(msg='Release artifacts have been published') + + def status(self, msg, **kwargs): + formatted = msg.format(**kwargs) + logging.info(formatted) + sys.stdout.write(formatted + '\n') + sys.stdout.flush() + + +class BuildArtifactPublisher(object): + + '''Publish build artifacts related to the release.''' + + def __init__(self, settings, status): + self.settings = settings + self.status = status + + def publish_build_artifacts(self, cluster_path): + artifact_basenames = self.list_build_artifacts_for_release(cluster_path) + self.status( + msg='Found {count} build artifact files in release', + count=len(artifact_basenames)) + + to_be_uploaded = self.filter_away_build_artifacts_on_public_trove( + artifact_basenames) + + logging.debug('List of artifacts (basenames) to upload (without already uploaded):') + for i, basename in enumerate(to_be_uploaded): + logging.debug(' {0}: {1}'.format(i, basename)) + logging.debug('End of artifact list (to_be_uploaded)') + + self.status( + msg='Need to fetch locally, then upload {count} build artifacts', + count=len(to_be_uploaded)) + + self.upload_build_artifacts_to_public_trove(to_be_uploaded) + + def list_build_artifacts_for_release(self, cluster_morphology_path): + self.status(msg='Find build artifacts included in release') + + # FIXME: These are hardcoded for simplicity. They would be + # possible to deduce automatically from the workspace, but + # that can happen later. + repo = 'file://%s' % os.path.abspath('.') + ref = 'HEAD' + + argv = [self.settings['morph-cmd'], 'list-artifacts', '--quiet', repo, ref] + argv += self.find_system_morphologies(cluster_morphology_path) + output = cliapp.runcmd(argv) + basenames = output.splitlines() + logging.debug('List of build artifacts in release:') + for basename in basenames: + logging.debug(' {0}'.format(basename)) + logging.debug('End of list of build artifacts in release') + + return basenames + + def find_system_morphologies(self, cluster_morphology_path): + cluster = self.load_cluster_morphology(cluster_morphology_path) + system_dicts = self.find_systems_in_parsed_cluster_morphology(cluster) + if self.settings['arch']: + system_dicts = self.choose_systems_for_wanted_architectures( + system_dicts, self.settings['arch']) + return [sd['morph'] for sd in system_dicts] + + def load_cluster_morphology(self, pathname): + with open(pathname) as f: + return yaml.load(f) + + def find_systems_in_parsed_cluster_morphology(self, cluster): + return cluster['systems'] + + def choose_systems_for_wanted_architectures(self, system_dicts, archs): + return [ + sd + for sd in system_dicts + if self.system_is_for_wanted_arch(sd, archs)] + + def system_is_for_wanted_arch(self, system_dict, archs): + morph = self.load_system_morphology(system_dict) + return morph['arch'] in archs + + def load_system_morphology(self, system_dict): + pathname = morphlib.util.sanitise_morphology_path(system_dict['morph']) + return self.load_morphology_from_named_file(pathname) + + def load_morphology_from_named_file(self, pathname): + finder = self.get_morphology_finder_for_root_repository() + morphology_text = finder.read_morphology(pathname) + loader = morphlib.morphloader.MorphologyLoader() + return loader.load_from_string(morphology_text) + + def get_morphology_finder_for_root_repository(self): + sb = morphlib.sysbranchdir.open_from_within('.') + definitions = sb.get_git_directory_name(sb.root_repository_url) + definitions_repo = morphlib.gitdir.GitDirectory(definitions) + return morphlib.morphologyfinder.MorphologyFinder(definitions_repo) + + def filter_away_build_artifacts_on_public_trove(self, basenames): + result = [] + logging.debug('Filtering away already existing artifacts:') + for basename, exists in self.query_public_trove_for_artifacts(basenames): + logging.debug(' {0}: {1}'.format(basename, exists)) + if not exists: + result.append(basename) + logging.debug('End of filtering away') + return result + + def query_public_trove_for_artifacts(self, basenames): + host = self.settings['public-trove-host'] + + # FIXME: This could use + # contextlib.closing(urllib2.urlopen(url, data=data) instead + # of explicit closing. + url = 'http://{host}:8080/1.0/artifacts'.format(host=host) + data = json.dumps(basenames) + f = urllib2.urlopen(url, data=data) + obj = json.load(f) + return obj.items() + + def upload_build_artifacts_to_public_trove(self, basenames): + self.download_artifacts_locally(basenames) + self.upload_artifacts_to_public_trove(basenames) + + def download_artifacts_locally(self, basenames): + dirname = self.settings['local-build-artifacts-dir'] + self.create_directory_if_missing(dirname) + for i, basename in enumerate(basenames): + url = self.construct_artifact_url(basename) + pathname = os.path.join(dirname, basename) + if not os.path.exists(pathname): + self.status( + msg='Downloading {i}/{total} {basename}', + basename=repr(basename), i=i, total=len(basenames)) + self.download_from_url(url, dirname, pathname) + + def create_directory_if_missing(self, dirname): + if not os.path.exists(dirname): + os.makedirs(dirname) + + def construct_artifact_url(self, basename): + scheme = 'http' + netloc = '{host}:8080'.format(host=self.settings['build-trove-host']) + path = '/1.0/artifacts' + query = 'filename={0}'.format(urllib.quote_plus(basename)) + fragment = '' + components = (scheme, netloc, path, query, fragment) + return urlparse.urlunsplit(components) + + def download_from_url(self, url, dirname, pathname): + logging.info( + 'Downloading {url} to {pathname}'.format( + url=url, pathname=pathname)) + with open(pathname, 'wb') as output: + try: + incoming = urllib2.urlopen(url) + shutil.copyfileobj(incoming, output) + incoming.close() + except urllib2.HTTPError as e: + if pathname.endswith('.meta'): + return + self.status( + msg="ERROR: Can't download {url}: {explanation}", + url=url, + explanation=str(e)) + os.remove(pathname) + raise + + def upload_artifacts_to_public_trove(self, basenames): + self.status( + msg='Upload build artifacts to {trove}', + trove=self.settings['public-trove-host']) + rsync_files_to_server( + self.settings['local-build-artifacts-dir'], + basenames, + self.settings['public-trove-username'], + self.settings['public-trove-host'], + self.settings['public-trove-artifact-dir']) + set_permissions_on_server( + self.settings['public-trove-username'], + self.settings['public-trove-host'], + self.settings['public-trove-artifact-dir'], + basenames) + +class ReleaseArtifactPublisher(object): + + '''Publish release artifacts for a release.''' + + def __init__(self, settings, status): + self.settings = settings + self.status = status + + def publish_release_artifacts(self): + files = self.list_release_artifacts() + if files: + self.upload_release_artifacts_to_private_dir(files) + self.move_release_artifacts_to_public_dir(files) + self.create_symlinks_to_new_release_artifacts(files) + + def list_release_artifacts(self): + self.status(msg='Find release artifacts to publish') + return os.listdir(self.settings['release-artifact-dir']) + + def upload_release_artifacts_to_private_dir(self, files): + self.status(msg='Upload release artifacts to private directory') + path = self.settings['download-server-private-dir'] + self.create_directory_on_download_server(path) + self.rsync_files_to_download_server(files, path) + + def create_directory_on_download_server(self, path): + user = self.settings['download-server-username'] + host = self.settings['download-server-address'] + self.status(msg='Create {host}:{path}', host=host, path=path) + target = '{user}@{host}'.format(user=user, host=host) + cliapp.ssh_runcmd(target, ['mkdir', '-p', path]) + + def rsync_files_to_download_server(self, files, path): + self.status(msg='Upload release artifacts to download server') + rsync_files_to_server( + self.settings['release-artifact-dir'], + files, + self.settings['download-server-username'], + self.settings['download-server-address'], + path) + set_permissions_on_server( + self.settings['download-server-username'], + self.settings['download-server-address'], + path, + files) + + def move_release_artifacts_to_public_dir(self, files): + self.status(msg='Move release artifacts to public directory') + private_dir = self.settings['download-server-private-dir'] + public_dir = self.settings['download-server-public-dir'] + self.create_directory_on_download_server(public_dir) + + # Move just the contents of the private dir, not the dir + # itself (-mindepth). Avoid overwriting existing files (mv + # -n). + argv = ['find', private_dir, '-mindepth', '1', + '-exec', 'mv', '-n', '{}', public_dir + '/.', ';'] + + target = '{user}@{host}'.format( + user=self.settings['download-server-username'], + host=self.settings['download-server-address']) + cliapp.ssh_runcmd(target, argv) + + def create_symlinks_to_new_release_artifacts(self, files): + self.status(msg='FIXME: Create symlinks to new releas artifacts') + + +def rsync_files_to_server( + source_dir, source_filenames, user, host, target_dir): + + if not source_filenames: + return + + argv = [ + 'rsync', + '-a', + '--progress', + '--partial', + '--human-readable', + '--sparse', + '--protect-args', + '-0', + '--files-from=-', + source_dir, + '{user}@{host}:{path}'.format(user=user, host=host, path=target_dir), + ] + + files_list = '\0'.join(filename for filename in source_filenames) + cliapp.runcmd(argv, feed_stdin=files_list, stdout=None, stderr=None) + + +def set_permissions_on_server(user, host, target_dir, filenames): + # If we have no files, we can't form a valid command to run on the server + if not filenames: + return + target = '{user}@{host}'.format(user=user, host=host) + argv = ['xargs', '-0', 'chmod', '0644'] + files_list = ''.join( + '{0}\0'.format(os.path.join(target_dir, filename)) for filename in filenames) + cliapp.ssh_runcmd(target, argv, feed_stdin=files_list, stdout=None, stderr=None) + + +ReleaseUploader(description=__doc__).run() diff --git a/scripts/release-upload.test.conf b/scripts/release-upload.test.conf new file mode 100644 index 00000000..13227983 --- /dev/null +++ b/scripts/release-upload.test.conf @@ -0,0 +1,10 @@ +[config] +download-server-address = localhost +download-server-private-dir = /tmp/private +download-server-public-dir = /tmp/public +build-trove-host = ct-mcr-1.ducie.codethink.co.uk +public-trove-host = localhost +public-trove-username = root +public-trove-artifact-dir = /tmp/artifacts +release-artifact-dir = t.release-files +morph-cmd = /home/root/git-morph diff --git a/sdk.write b/sdk.write new file mode 100755 index 00000000..3b07ea9d --- /dev/null +++ b/sdk.write @@ -0,0 +1,284 @@ +#!/bin/sh +# Copyright (C) 2014 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. +# +# =*= License: GPL-2 =*= + +set -eu + +die(){ + echo "$@" >&2 + exit 1 +} + +shellescape(){ + echo "'$(echo "$1" | sed -e "s/'/'\\''/g")'" +} + +########################## END OF COMMON HEADER ############################### +# +# The above lines, as well as being part of this script, are copied into the +# self-installing SDK blob's header script, as a means of re-using content. +# + +help(){ + cat <<EOF +sdk.write: Write extension for making an SDK installer. + +Description: + This is a write extension for producing a self-installing SDK blob + from a configured system. + + It generates a shell script header and appends the rootfs as a tarball, + which the header later extracts, and performs various configuration + to have it useable as a relocatable toolchain. + + This is similar to what the shar and makeself programs do, but we + need custom setup, so shar isn't appropriate, and makeself's api is + insufficiently flexible for our requirements. + + The toolchain relocation is handled by sedding every text file in the + SDK directory, and using the patchelf from inside the SDK to change + every ELF binary in the toolchain to use the linker and libraries from + inside the SDK. + + The ELF patching is required so that the SDK can work independently + of the versions of libraries installed on the host system. + +Location: Path to create the script at + +ENV VARS: + PREFIX (optional) The prefix the toolchain is built with + defaults to /usr + TARGET (mandatory) The gnu triplet the toolchain was built with +EOF +} + +ROOTDIR="$1" +OUTPUT_SCRIPT="$2" +PREFIX=${PREFIX-/usr} + +find_patchelf(){ + # Look for patchelf in the usual places + for binpath in /bin "$PREFIX/bin"; do + if [ -x "$ROOTDIR$binpath/patchelf" ]; then + echo "$binpath/patchelf" + return + fi + done + die "patchelf not found in rootfs" +} + +read_elf_interpreter(){ + # Use readelf and sed to find the interpreter a binary uses this is + # required since we can't yet guarantee that the deploying system + # contains patchelf + readelf --wide --program-headers "$1" | + sed -nr -f /proc/self/fd/3 3<<'EOF' +/\s+INTERP/{ + n # linker is on line after INTERP line + s/^\s*\[Requesting program interpreter: (.*)]$/\1/ + p # in -n mode, so need to print our text +} +EOF +} + +find_lib_paths(){ + local found_first=false + for libpath in "$PREFIX/lib32" "$PREFIX/lib64" "$PREFIX/lib" \ + /lib32 /lib64 /lib; do + if [ -e "$ROOTDIR$libpath" ]; then + if "$found_first"; then + printf ":%s" "$libpath" + else + printf "%s" "$libpath" + found_first=true + fi + fi + done +} + +# Create script with common header +header_end=$(grep -En -m1 -e '^#+ END OF COMMON HEADER #+$' "$0" | cut -d: -f1) +head -n "$header_end" "$0" | install -m 755 -D /dev/stdin "$OUTPUT_SCRIPT" + +# Determine any config +PATCHELF="$(find_patchelf)" +RTLD="$(read_elf_interpreter "$ROOTDIR$PATCHELF")" +LIB_PATH="${LIB_PATH-$(find_lib_paths)}" + +# Append deploy-time config to header +cat >>"$OUTPUT_SCRIPT" <<EOF +#################### START OF DEPLOY TIME CONFIGURATION ####################### + +TARGET=$(shellescape "$TARGET") +PREFIX=$(shellescape "$PREFIX") +PATCHELF=$(shellescape "$PATCHELF") +RTLD=$(shellescape "$RTLD") +LIB_PATH=$(shellescape "$LIB_PATH") + +##################### END OF DEPLOY TIME CONFIGURATION ######################## +EOF + +# Append deployment script +cat >>"$OUTPUT_SCRIPT" <<'EOF' +########################### START OF HEADER SCRIPT ############################ + +usage(){ + cat <<USAGE +usage: $0 TOOLCHAIN_PATH +USAGE +} + +if [ "$#" != 1 ]; then + echo TOOLCHAIN_PATH not given >&2 + usage >&2 + exit 1 +fi + +TOOLCHAIN_PATH="$1" + +sedescape(){ + # Escape the passed in string so it can be safely interpolated into + # a sed expression as a literal value. + echo "$1" | sed -e 's/[\/&]/\\&/g' +} + +prepend_to_path_elements(){ + # Prepend $1 to every entry in the : separated list specified as $2. + local prefix="$1" + ( + # Split path into components + IFS=: + set -- $2 + # Print path back out with new prefix + printf %s "$prefix/$1" + shift + for arg in "$@"; do + printf ":%s" "$prefix/$arg" + done + ) +} + +extract_rootfs(){ + # Extract the bzipped tarball at the end of the script passed as $1 + # to the path specified as $2 + local selfextractor="$1" + local target="$2" + local script_end="$(($(\ + grep -aEn -m1 -e '^#+ END OF HEADER SCRIPT #+$' "$selfextractor" | + cut -d: -f1) + 1 ))" + mkdir -p "$target" + tail -n +"$script_end" "$selfextractor" | tar -xj -C "$target" . +} + +amend_text_file_paths(){ + # Replace all instances of $3 with $4 in the directory specified by $1 + # excluding the subdirectory $2 + local root="$1" + local inner_sysroot="$2" + local old_prefix="$3" + local new_prefix="$4" + find "$root" \( -path "$inner_sysroot" -prune \) -o -type f \ + -exec sh -c 'file "$1" | grep -q text' - {} \; \ + -exec sed -i -e \ + "s/$(sedescape "$old_prefix")/$(sedescape "$new_prefix")/g" {} + +} + +filter_patchelf_errors(){ + # Filter out warnings from patchelf that are acceptable + # The warning that it's making a file bigger is just noise + # The warning about not being an ELF executable just means we got a + # false positive from file that it was an ELF binary + # Failing to find .interp is because for convenience, we set the + # interpreter in the same command as setting the rpath, even though + # we give it both executables and libraries. + grep -v -e 'warning: working around a Linux kernel bug' \ + -e 'not an ELF executable' \ + -e 'cannot find section .interp' +} + +patch_elves(){ + # Set the interpreter and library paths of ELF binaries in $1, + # except for the $2 subdirectory, using the patchelf command in the + # toolchain specified as $3, so that it uses the linker specified + # as $4 as the interpreter, and the runtime path specified by $5. + # + # The patchelf inside the toolchain is used to ensure that it works + # independently of the availability of patchelf on the host. + # + # This is possible by invoking the linker directly and specifying + # --linker-path as the RPATH we want to set the binaries to use. + local root="$1" + local inner_sysroot="$2" + local patchelf="$3" + local linker="$4" + local lib_path="$5" + find "$root" \( -path "$inner_sysroot" -prune \) -o -type f \ + -type f -perm +111 \ + -exec sh -c 'file "$1" | grep -q "ELF"' - {} \; \ + -exec "$linker" --library-path "$lib_path" \ + "$patchelf" --set-interpreter "$linker" \ + --set-rpath "$lib_path" {} \; 2>&1 \ + | filter_patchelf_errors +} + +generate_environment_setup(){ + local target="$1" + install -m 644 -D /dev/stdin "$target" <<ENVSETUP +export PATH=$(shellescape "$TOOLCHAIN_PATH/usr/bin"):"\$PATH" +export TARGET_PREFIX=$(shellescape "$TARGET"-) +export CC=$(shellescape "$TARGET-gcc") +export CXX=$(shellescape "$TARGET-g++") +export CPP=$(shellescape "$TARGET-gcc -E") +export AS=$(shellescape "$TARGET-as") +export LD=$(shellescape "$TARGET-ld") +export STRIP=$(shellescape "$TARGET-strip") +export RANLIB=$(shellescape "$TARGET-ranlib") +export OBJCOPY=$(shellescape "$TARGET-objcopy") +export OBJDUMP=$(shellescape "$TARGET-objdump") +export AR=$(shellescape "$TARGET-ar") +export NM=$(shellescape "$TARGET-nm") +ENVSETUP +} + +SYSROOT="$TOOLCHAIN_PATH$PREFIX/$TARGET/sys-root" +PATCHELF="$TOOLCHAIN_PATH$PATCHELF" +RTLD="$TOOLCHAIN_PATH$RTLD" +OLD_PREFIX="$PREFIX" +NEW_PREFIX="$TOOLCHAIN_PATH/$PREFIX" +RPATH="$(prepend_to_path_elements "$TOOLCHAIN_PATH" "$LIB_PATH")" +ENV_SETUP_FILE="$(dirname "$TOOLCHAIN_PATH")/environment-setup-$TARGET" + +echo Writing environment setup script to "$ENV_SETUP_FILE" +generate_environment_setup "$ENV_SETUP_FILE" + +echo Extracting rootfs +extract_rootfs "$0" "$TOOLCHAIN_PATH" + +echo "Relocating prefix references of $OLD_PREFIX to $NEW_PREFIX in" \ + "the toolchain's textual config files." +amend_text_file_paths "$TOOLCHAIN_PATH" "$SYSROOT" "$OLD_PREFIX" "$NEW_PREFIX" + +echo "Patching ELF binary files' interpreter and runtime library paths" \ + "to refer to libraries within the toolchain" +patch_elves "$TOOLCHAIN_PATH" "$SYSROOT" "$PATCHELF" "$RTLD" "$RPATH" + +exit +############################ END OF HEADER SCRIPT ############################# +EOF + +# Append rootfs as tarball +tar -C "$1" -cj >>"$OUTPUT_SCRIPT" . diff --git a/strata/NetworkManager-common.morph b/strata/NetworkManager-common.morph new file mode 100644 index 00000000..44adc1fb --- /dev/null +++ b/strata/NetworkManager-common.morph @@ -0,0 +1,19 @@ +name: NetworkManager-common +kind: stratum +build-depends: +- morph: strata/audio-bluetooth.morph +- morph: strata/network-security.morph +- morph: strata/connectivity.morph +chunks: +- name: libndp + repo: upstream:libndp + ref: f3a3a63d5b5abced8f75731d7b995606933c6e33 + unpetrify-ref: v1.4 + build-depends: [] +- name: NetworkManager + morph: strata/NetworkManager-common/NetworkManager.morph + repo: upstream:NetworkManager + ref: 6eb82acd6dce882f4b91aafcf68dd9e143ce34e2 + unpetrify-ref: 0.9.10 + build-depends: + - libndp diff --git a/strata/NetworkManager-common/NetworkManager.morph b/strata/NetworkManager-common/NetworkManager.morph new file mode 100644 index 00000000..9840dfa4 --- /dev/null +++ b/strata/NetworkManager-common/NetworkManager.morph @@ -0,0 +1,5 @@ +name: NetworkManager +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --with-session-tracking=systemd --disable-ppp diff --git a/strata/ansible.morph b/strata/ansible.morph new file mode 100644 index 00000000..e0cb8581 --- /dev/null +++ b/strata/ansible.morph @@ -0,0 +1,30 @@ +name: ansible +kind: stratum +description: A stratum with ansible and its dependencies +build-depends: +- morph: strata/core.morph +chunks: +- name: paramiko + repo: upstream:paramiko + ref: 951faed80b017e553a27c4cb98f210df44341f8f + unpetrify-ref: baserock/morph + build-depends: [] +- name: markupsafe + repo: upstream:markupsafe + ref: 58cde05bdcb0a53d87213b4a5bb605937f178171 + unpetrify-ref: baserock/morph + build-depends: [] +- name: jinja2 + repo: upstream:jinja2 + ref: 91fa138077d9ed5cf73a7903479077498e695492 + unpetrify-ref: baserock/morph + build-depends: + - markupsafe +- name: ansible + morph: strata/ansible/ansible.morph + repo: upstream:ansible + ref: aa56db7e28d4fe256471043b05120c2f41a840e5 + unpetrify-ref: baserock/morph + build-depends: + - paramiko + - jinja2 diff --git a/strata/ansible/ansible.morph b/strata/ansible/ansible.morph new file mode 100644 index 00000000..da434f03 --- /dev/null +++ b/strata/ansible/ansible.morph @@ -0,0 +1,5 @@ +name: ansible +kind: chunk +build-system: python-distutils +post-install-commands: +- install -D -m644 ansible.cfg "$DESTDIR/etc/ansible/ansible.cfg" diff --git a/strata/armv7lhf-cross-toolchain.morph b/strata/armv7lhf-cross-toolchain.morph new file mode 100644 index 00000000..c76ae537 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain.morph @@ -0,0 +1,42 @@ +name: armv7lhf-cross-toolchain +kind: stratum +description: Stratum for building an armv7lhf cross compiler for your native system. +build-depends: +- morph: strata/build-essential.morph +chunks: +- name: armv7lhf-cross-binutils + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph + repo: upstream:binutils-redhat + ref: 987eb543a034cddc4eeb103f08f566f24a5f964a + unpetrify-ref: baserock/build-essential + build-depends: [] +- name: armv7lhf-cross-linux-api-headers + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph + repo: upstream:linux + ref: df2e1b9168a7ab5dd8149e38b5ac70cdef86d1fa + unpetrify-ref: baserock/v3.8 + build-depends: [] +- name: armv7lhf-cross-gcc-nolibc + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph + repo: upstream:gcc-tarball + ref: 0a1a077d3466cd99a4ed5590db2146b3fec6fff1 + unpetrify-ref: baserock/build-essential + build-depends: + - armv7lhf-cross-binutils +- name: armv7lhf-cross-eglibc + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph + repo: upstream:eglibc2 + ref: 43ee5d250ad47d2bee8ec17954efb7f22d2b804c + unpetrify-ref: baserock/2.15-build-essential + build-depends: + - armv7lhf-cross-binutils + - armv7lhf-cross-gcc-nolibc + - armv7lhf-cross-linux-api-headers +- name: armv7lhf-cross-gcc + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph + repo: upstream:gcc-tarball + ref: b0254026149b13782eae26d38435a4c62a002cf0 + unpetrify-ref: baserock/build-essential-4.7 + build-depends: + - armv7lhf-cross-binutils + - armv7lhf-cross-eglibc diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph new file mode 100644 index 00000000..8e842e41 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph @@ -0,0 +1,24 @@ +name: armv7lhf-cross-binutils +kind: chunk +build-system: autotools + +configure-commands: +- | + # The TARGET used is the final triplet we expect, rather than that + # of the libc-less GCC we build, since the binutils only needs to + # be built once. + # This requires extra effort to get the stage 1 GCC to use these + # tools, but saves having an extra binutils build. + export TARGET=armv7lhf-baserock-linux-gnueabi + + # 1. Binutils gets installed in the default sysroot path of + # $PREFIX/$TARGET/{bin,lib}, with the actual sysroot at + # $PREFIX/$TARGET/sys-root and its tools also available as + # $PREFIX/bin/$TARGET-$tool + # 2. The '=' makes the path we give relative to the sysroot. + ./configure --prefix="$PREFIX" --disable-nls --disable-werror \ + --build=$(sh config.guess) \ + --host=$(sh config.guess) \ + --target="$TARGET" \ + `# [1]` --with-sysroot \ + `# [2]` --with-lib-path="=$PREFIX/lib" diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph new file mode 100644 index 00000000..ee28c9dd --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph @@ -0,0 +1,47 @@ +name: armv7lhf-cross-eglibc +kind: chunk + +configure-commands: +- mkdir o + +# Necessary for ARM port +- cd libc && ln -s ../ports ports + +# Configure flag notes: +# 1. Location of linux-api-headers, needed since eglibc doesn't +# support being given a sysroot. +# 2. Location of binutils, since we build binutils for the final +# target triplet, but our gcc of our stage 1 target triplet. +# 3. Normal flags. See eglibc.morph. +# 4. Force configuration values of certain things that can't be detected +# in a cross-compile. +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + export CFLAGS="-O2 $CFLAGS" + # eglibc looks for $TARGET-gcc, but not $TARGET_STAGE1-gcc even + # though --build is specified, so we have to override what gcc to + # use here. + export CC="$TARGET_STAGE1-gcc" + cd o && ../libc/configure \ + $(../morph-arch-config) \ + --build=$TARGET_STAGE1 --host=$TARGET \ + --prefix="$PREFIX" \ + `# [1]` --with-headers="$PREFIX/$TARGET/sys-root/$PREFIX/include" \ + `# [2]` --with-binutils="$PREFIX/$TARGET/bin" \ + `# [3]` --disable-profile --enable-kernel=2.6.25 \ + --enable-add-ons=nptl,ports --without-cvs --without-selinux \ + `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \ + libc_cv_forced_unwind=yes libc_cv_ssp=no + +build-commands: +- cd o && make localtime=UTC + +install-commands: +- | + # eglibc doesn't help with sysroots, so we need to spell out the + # full path ourselves. + export TARGET=armv7lhf-baserock-linux-gnueabi + cd o && make install_root="$DESTDIR/$PREFIX/$TARGET/sys-root/" \ + localtime=UTC install diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph new file mode 100644 index 00000000..d164a60b --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph @@ -0,0 +1,54 @@ +name: armv7lhf-cross-gcc-nolibc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Standard flags. See gcc.morph. +# 2. Our binutils is for the final $TARGET, rather than the intermediate +# target our GCC is being built for, so we need to set +# with-build-time-tools to get it to find our binutils at +# build-time and with-as and with-ld so our temporary GCC uses +# the appropriate tools when it compiles our libc, rather than +# trying to use $TARGET_STAGE1-as when producing binaries. +# 3. Disable stuff that doesn't work when building a cross compiler +# without an existing libc, and generally try to keep this build as +# simple as possible. +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + cd o && + ../configure \ + $(../morph-arch-config) \ + --build=$(sh ../config.guess) --host=$(sh ../config.guess) \ + --target="$TARGET_STAGE1" \ + --prefix="$PREFIX" \ + --disable-bootstrap --disable-nls \ + `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [2]` --with-build-time-tools="$PREFIX/$TARGET/bin" \ + --with-as="$PREFIX/$TARGET/bin/as" \ + --with-ld="$PREFIX/$TARGET/bin/ld" \ + `# [3]` --enable-languages=c --disable-decimal-float \ + --disable-libmudflap --disable-libquadmath --disable-libssp \ + --disable-shared --disable-threads --disable-target-libiberty \ + --disable-target-zlib --without-headers --with-newlib \ + --with-system-zlib + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install + +# The file libgcc_eh is required during eglibc's build, but is not created +# because we built GCC with --disable-shared. This is a workaround for +# eglibc's build system being slightly broken. +- | + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + libgcc_filename="$("$DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc" -print-libgcc-file-name)" + ln -sv libgcc.a "$(echo "$libgcc_filename" | sed 's/libgcc/&_eh/')" diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph new file mode 100644 index 00000000..50c338e5 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph @@ -0,0 +1,45 @@ +name: armv7lhf-cross-gcc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Use the default sysroot path to install to and locate headers +# 2. Recommended by Linux From Scratch; required for C++ ABI +# compatibility with other Linux distributions. +# 3. Standard flags. See gcc.morph. +# 4. Avoid having more than one copy of ZLib in use on the system +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + cd o && ../configure \ + $(../morph-arch-config) \ + --build=$(sh ../config.guess) \ + --host=$(sh ../config.guess) \ + --target="$TARGET" \ + `# [1]` --with-sysroot \ + --prefix="$PREFIX" \ + --disable-bootstrap \ + --enable-shared --enable-threads=posix \ + `# [2]` --enable-__cxa_atexit \ + --enable-languages=c,c++,fortran \ + `# [3]` --libdir="$PREFIX/lib" \ + --disable-libgomp --disable-multilib \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [4]` --with-system-zlib + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install +- | + export TARGET=armv7lhf-baserock-linux-gnueabi + for fortran_alias in f77 f90 f95; do + ln -s "$TARGET-gfortran" \ + "$DESTDIR/$PREFIX/bin/$TARGET-$fortran_alias" + done diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph new file mode 100644 index 00000000..c2654419 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph @@ -0,0 +1,10 @@ +name: armv7lhf-cross-linux-api-headers +kind: chunk +install-commands: +- ARCH=arm make INSTALL_HDR_PATH=dest headers_install +- | + # Copy headers to the sysroot where the eglibc build will find them, + # and install its own headers and libraries. + export TARGET=armv7lhf-baserock-linux-gnueabi + install -d "$DESTDIR$PREFIX/$TARGET/sys-root/$PREFIX/include" + cp -r dest/include/* "$DESTDIR/$PREFIX/$TARGET/sys-root/$PREFIX/include" diff --git a/strata/audio-bluetooth.morph b/strata/audio-bluetooth.morph new file mode 100644 index 00000000..0c67ee5c --- /dev/null +++ b/strata/audio-bluetooth.morph @@ -0,0 +1,100 @@ +name: audio-bluetooth +kind: stratum +description: Components required for audio and bluetooth. +build-depends: +- morph: strata/foundation.morph +chunks: +- name: libatomic_ops + repo: upstream:libatomic_ops + ref: 0a58f5d63969c10d2141af89cb7a53df786909ab + unpetrify-ref: baserock/morph + build-depends: [] +- name: alsa-lib + repo: upstream:alsa-lib + ref: 9cfd1faa27511edbb8bebbab85030125f33590ae + unpetrify-ref: v1.0.28 + build-depends: [] +- name: alsa-utils + morph: strata/audio-bluetooth/alsa-utils.morph + repo: upstream:alsa-utils + ref: bbf137f66b2c8ce36db73f59ee69d5c443436524 + unpetrify-ref: v1.0.28 + build-depends: + - alsa-lib +- name: libical + morph: strata/audio-bluetooth/libical.morph + repo: upstream:libical + ref: 52568782ae136e1ec4ddf3eb6da7b0f3fbd3f1b3 + unpetrify-ref: baserock/morph + build-depends: [] +- name: bluez + morph: strata/audio-bluetooth/bluez.morph + repo: upstream:bluez + ref: a18201b5321e8b41d2ee7c7bc7285d976fc433e6 + unpetrify-ref: baserock/v5.17-patched + build-depends: + - libical + - alsa-lib +- name: bluez-tools + morph: strata/audio-bluetooth/bluez-tools.morph + repo: upstream:bluez-tools + ref: 7350787e96a6ecf2cc5d4afddb3321ccad9fa461 + unpetrify-ref: baserock/morph + build-depends: [] +- name: obexd + repo: upstream:obexd + ref: 4225280022c206762c91beee47c62d05e1baeacc + unpetrify-ref: baserock/morph + build-depends: + - bluez + - libical +- name: speex + repo: upstream:speex + ref: e5dc987a403426ee3d0d81768afffa0fe74e20fa + unpetrify-ref: baserock/morph + build-depends: [] +- name: nohands + morph: strata/audio-bluetooth/nohands.morph + repo: upstream:nohands + ref: 20ec5cc245fd5e74d9a0fc21497d1ba4164f2a3a + unpetrify-ref: baserock/morph + build-depends: + - bluez + - speex +- name: mobile-broadband-provider-info + repo: upstream:mobile-broadband-provider-info + ref: 4ed19e11c2975105b71b956440acdb25d46a347d + unpetrify-ref: baserock/morph + build-depends: [] +- name: ofono + morph: strata/audio-bluetooth/ofono.morph + repo: upstream:ofono + ref: d05b718cc0b0d367227fbfbf52e60fc5462cc549 + unpetrify-ref: "1.15" + build-depends: + - mobile-broadband-provider-info + - bluez +- name: json-c + morph: strata/audio-bluetooth/json-c.morph + repo: upstream:json-c + ref: 60a5f3dedc879db3e5dacdd3b7e3e543c2e1bae7 + unpetrify-ref: baserock/morph + build-depends: [] +- name: libsndfile + morph: strata/audio-bluetooth/libsndfile.morph + repo: upstream:libsndfile + ref: 6c05c615c95ffef7a8a5a707cde0bb52bdd74244 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pulseaudio + morph: strata/audio-bluetooth/pulseaudio.morph + repo: upstream:pulseaudio + ref: e1b44688c0db505f70761fe76b4fed2ca6924a09 + unpetrify-ref: baserock/morph + build-depends: + - libsndfile + - libatomic_ops + - speex + - json-c + - alsa-lib + - bluez diff --git a/strata/audio-bluetooth/alsa-utils.morph b/strata/audio-bluetooth/alsa-utils.morph new file mode 100644 index 00000000..a6a1e041 --- /dev/null +++ b/strata/audio-bluetooth/alsa-utils.morph @@ -0,0 +1,7 @@ +name: alsa-utils +kind: chunk +description: ALSA utilities +build-system: autotools +configure-commands: +- autoreconf -ifv +- ./configure --prefix="$PREFIX" --disable-xmlto diff --git a/strata/audio-bluetooth/bluez-tools.morph b/strata/audio-bluetooth/bluez-tools.morph new file mode 100644 index 00000000..80e47ef5 --- /dev/null +++ b/strata/audio-bluetooth/bluez-tools.morph @@ -0,0 +1,10 @@ +name: bluez-tools +kind: chunk +description: A set of tools to manage Bluetooth devices for Linux +build-system: autotools +configure-commands: +- sed -i -e 's/-lreadline/-lreadline -lncurses/g' configure.ac +- ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-obex +build-commands: +- LDFLAGS="$LDFLAGS -lncurses" make diff --git a/strata/audio-bluetooth/bluez.morph b/strata/audio-bluetooth/bluez.morph new file mode 100644 index 00000000..1395b98d --- /dev/null +++ b/strata/audio-bluetooth/bluez.morph @@ -0,0 +1,12 @@ +name: bluez +kind: chunk +description: Bluetooth protocol stack for Linux +build-system: autotools +configure-commands: +- autoreconf -ivf +- ./configure --prefix="$PREFIX" --enable-tools --enable-test --enable-alsa --enable-library + --with-telephony=ofono --sysconfdir=/etc --localstatedir=/var --libexecdir=/lib +install-commands: +- make install +- mkdir -p "$DESTDIR/etc/systemd/system/bluetooth.target.wants" +- ln -s /lib/systemd/system/bluetooth.service "$DESTDIR/etc/systemd/system/bluetooth.target.wants/bluetooth.service" diff --git a/strata/audio-bluetooth/json-c.morph b/strata/audio-bluetooth/json-c.morph new file mode 100644 index 00000000..c3d9243c --- /dev/null +++ b/strata/audio-bluetooth/json-c.morph @@ -0,0 +1,7 @@ +name: json-c +kind: chunk +description: JSON C Library +build-system: autotools +install-commands: +- make DESTDIR="$DESTDIR" install +- install -m755 json_object_iterator.h "$DESTDIR/usr/include/json" diff --git a/strata/audio-bluetooth/libical.morph b/strata/audio-bluetooth/libical.morph new file mode 100644 index 00000000..1f772fd9 --- /dev/null +++ b/strata/audio-bluetooth/libical.morph @@ -0,0 +1,6 @@ +name: libical +kind: chunk +build-system: autotools +configure-commands: +- autoreconf -ivf +- ./configure --prefix="$PREFIX" diff --git a/strata/audio-bluetooth/libsndfile.morph b/strata/audio-bluetooth/libsndfile.morph new file mode 100644 index 00000000..8d6c2fe0 --- /dev/null +++ b/strata/audio-bluetooth/libsndfile.morph @@ -0,0 +1,5 @@ +name: libsndfile +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --disable-external-libs diff --git a/strata/audio-bluetooth/nohands.morph b/strata/audio-bluetooth/nohands.morph new file mode 100644 index 00000000..ebe249c0 --- /dev/null +++ b/strata/audio-bluetooth/nohands.morph @@ -0,0 +1,5 @@ +name: nohands +kind: chunk +build-system: autotools +build-commands: +- make CXXFLAGS="-fpermissive -lpthread" diff --git a/strata/audio-bluetooth/ofono.morph b/strata/audio-bluetooth/ofono.morph new file mode 100644 index 00000000..a775b0c1 --- /dev/null +++ b/strata/audio-bluetooth/ofono.morph @@ -0,0 +1,11 @@ +name: ofono +kind: chunk +description: ofono Open Source Telephony +build-system: autotools +configure-commands: +- autoreconf -ivf +- ./configure --prefix="$PREFIX" --sysconfdir=/etc --localstatedir=/var +install-commands: +- make install +- mkdir -p "$DESTDIR/etc/systemd/system/multi-user.target.wants" +- ln -s /lib/systemd/system/ofono.service "$DESTDIR/etc/systemd/system/multi-user.target.wants/ofono.service" diff --git a/strata/audio-bluetooth/pulseaudio.morph b/strata/audio-bluetooth/pulseaudio.morph new file mode 100644 index 00000000..117f3396 --- /dev/null +++ b/strata/audio-bluetooth/pulseaudio.morph @@ -0,0 +1,13 @@ +name: pulseaudio +kind: chunk +description: PulseAudio System +build-system: autotools +configure-commands: +- ./autogen.sh +- ./configure --prefix="$PREFIX" --localstatedir=/var --sysconfdir=/etc --with-database=simple +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR/lib/systemd/system" +- install -m755 pulseaudio.service "$DESTDIR/lib/systemd/system" +- mkdir -p "$DESTDIR/etc/systemd/system/multi-user.target.wants" +- ln -s /lib/systemd/system/pulseaudio.service "$DESTDIR/etc/systemd/system/multi-user.target.wants/pulseaudio.service" diff --git a/strata/baserock-import.morph b/strata/baserock-import.morph new file mode 100644 index 00000000..6e875e8c --- /dev/null +++ b/strata/baserock-import.morph @@ -0,0 +1,31 @@ +name: baserock-import +kind: stratum +description: Tools for importing software into Baserock definitions. +build-depends: +- morph: strata/morph-utils.morph +chunks: +- name: ansicolor + repo: upstream:python-packages/ansicolor + ref: 9d3adbaff35bb6cde1d63414a8cc72f572c4d0ef + unpetrify-ref: 0.2.4 + build-depends: [] +- name: python-decorator + repo: upstream:python-packages/python-decorator + ref: b02f7a254c3679dfac57a824e08dd02ced850636 + unpetrify-ref: decorator-3.4.0 + build-depends: [] +- name: networkx + repo: upstream:python-packages/networkx + ref: 8ac796aba866ade1a56b83e30f25ed392ca3512c + unpetrify-ref: networkx-1.9.1 + build-depends: [] +- name: requests-cache + repo: upstream:python-packages/requests-cache + ref: a1b5e65ccd715f1e8434f18f27913715340d6aaf + unpetrify-ref: 0.4.6 + build-depends: [] +- name: baserock-import + repo: baserock:baserock/import + ref: edd18a77973d8cd12b09bc6e3ac06fecd72a7e45 + unpetrify-ref: master + build-depends: [] diff --git a/strata/bsp-armv7-highbank.morph b/strata/bsp-armv7-highbank.morph new file mode 100644 index 00000000..d5ff1264 --- /dev/null +++ b/strata/bsp-armv7-highbank.morph @@ -0,0 +1,12 @@ +name: bsp-armv7-highbank +kind: stratum +description: The platform dependent components required to boot an ARM highbank board. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-armv7-highbank + morph: strata/bsp-armv7-highbank/linux-armv7-highbank.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] diff --git a/strata/bsp-armv7-highbank/linux-armv7-highbank.morph b/strata/bsp-armv7-highbank/linux-armv7-highbank.morph new file mode 100644 index 00000000..dfebf69c --- /dev/null +++ b/strata/bsp-armv7-highbank/linux-armv7-highbank.morph @@ -0,0 +1,47 @@ +name: linux-armv7-highbank +kind: chunk +configure-commands: +- make multi_v7_defconfig +- scripts/config -e AUTOFS4_FS +- scripts/config -e BLK_DEV_LOOP +- scripts/config -e CGROUPS +- scripts/config -e CONFIG_POSIX_MQUEUE +- scripts/config -e CPU_IDLE +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_USE_FOR_EXT23 +- scripts/config -e PACKET +- scripts/config -e UNIX +- scripts/config -e INET +- scripts/config -e IP_MULTICAST +- scripts/config -e IP_PNP +- scripts/config -e IP_PNP_DHCP +- scripts/config -e IP_PNP_BOOTP +- scripts/config -e MSDOS_FS +- scripts/config -e NETWORK_FILESYSTEMS +- scripts/config -e NET_KEY +- scripts/config -e NFS_FS +- scripts/config -e NFS_V3 +- scripts/config -e ROOT_NFS +- scripts/config -e LOCKD +- scripts/config -e LOCKD_V4 +- scripts/config -e NFS_COMMON +- scripts/config -e SUNRPC +- scripts/config -e SYSVIPC +- scripts/config -e BTRFS_FS +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e TMPFS +- scripts/config -e TMPFS_POSIX_ACL +- scripts/config -e VFAT_FS +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make zImage $MAKEFLAGS +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/arm/boot/zImage "$DESTDIR"/boot/zImage diff --git a/strata/bsp-armv7-versatile.morph b/strata/bsp-armv7-versatile.morph new file mode 100644 index 00000000..63d79667 --- /dev/null +++ b/strata/bsp-armv7-versatile.morph @@ -0,0 +1,13 @@ +name: bsp-armv7-versatile +kind: stratum +description: The platform dependent components required to boot an ARM versatile development + board. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-armv7-versatile + morph: strata/bsp-armv7-versatile/linux-armv7-versatile.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] diff --git a/strata/bsp-armv7-versatile/linux-armv7-versatile.morph b/strata/bsp-armv7-versatile/linux-armv7-versatile.morph new file mode 100644 index 00000000..1da640e7 --- /dev/null +++ b/strata/bsp-armv7-versatile/linux-armv7-versatile.morph @@ -0,0 +1,27 @@ +name: linux-armv7-versatile +kind: chunk +configure-commands: +- make ARCH=arm vexpress_defconfig +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -d BTRFS_FS_CHECK_INTEGRITY +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config -e BLK_DEV_LOOP +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e FB_VESA +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make ARCH=arm zImage $MAKEFLAGS +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/arm/boot/zImage "$DESTDIR"/boot/zImage diff --git a/strata/bsp-armv7b-highbank.morph b/strata/bsp-armv7b-highbank.morph new file mode 100644 index 00000000..16dd9a17 --- /dev/null +++ b/strata/bsp-armv7b-highbank.morph @@ -0,0 +1,12 @@ +name: bsp-armv7b-highbank +kind: stratum +description: The platform dependent components required to boot an ARM highbank board. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-armv7b-highbank + morph: strata/bsp-armv7b-highbank/linux-armv7b-highbank.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] diff --git a/strata/bsp-armv7b-highbank/linux-armv7b-highbank.morph b/strata/bsp-armv7b-highbank/linux-armv7b-highbank.morph new file mode 100644 index 00000000..ea1a2d5f --- /dev/null +++ b/strata/bsp-armv7b-highbank/linux-armv7b-highbank.morph @@ -0,0 +1,49 @@ +name: linux-armv7b-highbank +kind: chunk +configure-commands: +- make multi_v7_defconfig +- scripts/config -e CPU_BIG_ENDIAN +- scripts/config -e CPU_ENDIAN_BE8 +- scripts/config -e CPU_BE8_BOOT_LE +- scripts/config -e PACKET +- scripts/config -e UNIX +- scripts/config -e NET_KEY +- scripts/config -e INET +- scripts/config -e IP_MULTICAST +- scripts/config -e IP_PNP +- scripts/config -e IP_PNP_DHCP +- scripts/config -e IP_PNP_BOOTP +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e BLK_DEV_LOOP +- scripts/config -e BTRFS_FS +- scripts/config -e TMPFS +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config -e NETWORK_FILESYSTEMS +- scripts/config -e NFS_FS +- scripts/config -e NFS_V3 +- scripts/config -e ROOT_NFS +- scripts/config -e LOCKD +- scripts/config -e LOCKD_V4 +- scripts/config -e NFS_COMMON +- scripts/config -e SUNRPC +- scripts/config -e SYSVIPC +- scripts/config -e CONFIG_POSIX_MQUEUE +- scripts/config -e CPU_IDLE +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_USE_FOR_EXT23 +- scripts/config -e MSDOS_FS +- scripts/config -e VFAT_FS +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make zImage $MAKEFLAGS +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/arm/boot/zImage "$DESTDIR"/boot/zImage diff --git a/strata/bsp-armv7b-vexpress-tc2.morph b/strata/bsp-armv7b-vexpress-tc2.morph new file mode 100644 index 00000000..440271de --- /dev/null +++ b/strata/bsp-armv7b-vexpress-tc2.morph @@ -0,0 +1,12 @@ +name: bsp-armv7b-vexpress-tc2 +kind: stratum +description: The platform dependent components required to boot Versatile TC2 board +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-armv7b-vexpress-tc2 + morph: strata/bsp-armv7b-vexpress-tc2/linux-armv7b-vexpress-tc2.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] diff --git a/strata/bsp-armv7b-vexpress-tc2/linux-armv7b-vexpress-tc2.morph b/strata/bsp-armv7b-vexpress-tc2/linux-armv7b-vexpress-tc2.morph new file mode 100644 index 00000000..ecf6b9bc --- /dev/null +++ b/strata/bsp-armv7b-vexpress-tc2/linux-armv7b-vexpress-tc2.morph @@ -0,0 +1,52 @@ +name: linux-armv7b-vexpress-tc2 +kind: chunk +configure-commands: +- make vexpress_defconfig +- scripts/config -e CPU_BIG_ENDIAN +- scripts/config -e CPU_ENDIAN_BE8 +- scripts/config -e CPU_BE8_BOOT_LE +- scripts/config -e PACKET +- scripts/config -e UNIX +- scripts/config -e NET_KEY +- scripts/config -e INET +- scripts/config -e IP_MULTICAST +- scripts/config -e IP_PNP +- scripts/config -e IP_PNP_DHCP +- scripts/config -e IP_PNP_BOOTP +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e BLK_DEV_LOOP +- scripts/config -e BTRFS_FS +- scripts/config -e TMPFS +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e CGROUPS +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e AUTOFS4_FS +- scripts/config -e NETWORK_FILESYSTEMS +- scripts/config -e NFS_FS +- scripts/config -e NFS_V3 +- scripts/config -e ROOT_NFS +- scripts/config -e LOCKD +- scripts/config -e LOCKD_V4 +- scripts/config -e NFS_COMMON +- scripts/config -e SUNRPC +- scripts/config -e SYSVIPC +- scripts/config -e CONFIG_POSIX_MQUEUE +- scripts/config -e CPU_IDLE +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_USE_FOR_EXT23 +- scripts/config -e MSDOS_FS +- scripts/config -e VFAT_FS +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make zImage vexpress-v2p-ca15_a7.dtb +- | + cat arch/arm/boot/zImage arch/arm/boot/dts/vexpress-v2p-ca15_a7.dtb | + dd conv=sync bs=4 of=kernel.bin +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp kernel.bin "$DESTDIR"/boot/zImage diff --git a/strata/bsp-jetson.morph b/strata/bsp-jetson.morph new file mode 100644 index 00000000..111402a7 --- /dev/null +++ b/strata/bsp-jetson.morph @@ -0,0 +1,52 @@ +name: bsp-jetson +kind: stratum +description: | + Platform-specific chunks for NVIDIA Jetson TK1 + + Support for the Tegra platform is still being developed. A very recent + kernel with some patches is currently required to get a fully + accelerated graphics stack on this platform. Note that the SATA and + networking will not work unless you have flashed the bootloader on + your board to the version of U-Boot built in this stratum. Also, the + CPUs on the Jetson run at a slow speed with this version of Linux. +build-depends: +- morph: strata/core.morph +chunks: +- name: device-tree-compiler + morph: strata/bsp-jetson/device-tree-compiler.morph + repo: upstream:device-tree-compiler + ref: c92f284c3cf76d471eb27a271de3a51cb45ed058 + unpetrify-ref: baserock/morph + build-depends: [] +- name: u-boot@jetson + morph: strata/bsp-jetson/u-boot@jetson.morph + repo: upstream:u-boot + ref: c77921345b943cdf5f2f28bbe88c6d8970620d2e + unpetrify-ref: baserock/jetson/u-boot-tegra-next + build-depends: + - device-tree-compiler +- name: linux-jetson-tk1 + morph: strata/bsp-jetson/linux-jetson-tk1.morph + repo: upstream:linux + ref: 682c943b0159b1a4105f31020605bf8a0f155ffd + unpetrify-ref: baserock/v3.18-with-cpufreq + build-depends: [] +- name: bsp-support + morph: strata/bsp-jetson/bsp-support.morph + repo: baserock:baserock/bsp-support + ref: 19bc31ce3198a3c19cdd96d392bde34cb34ed525 + unpetrify-ref: baserock/arm/tegra-3.10 + build-depends: [] +- name: nouveau-drm + morph: strata/bsp-jetson/nouveau-drm.morph + repo: upstream:nouveau + ref: 4d0929aa231a0c2d2b66fa1f8ea1c8fa4d872501 + unpetrify-ref: baserock/jetson/gk20a + build-depends: + - linux-jetson-tk1 +- name: linux-firmware-jetson + morph: strata/bsp-jetson/linux-firmware-jetson.morph + repo: upstream:linux-firmware + ref: 9322ef5b14c78ec28163baa41bff240a0e098810 + unpetrify-ref: baserock/jetson + build-depends: [] diff --git a/strata/bsp-jetson/bsp-support.morph b/strata/bsp-jetson/bsp-support.morph new file mode 100644 index 00000000..23524ac7 --- /dev/null +++ b/strata/bsp-jetson/bsp-support.morph @@ -0,0 +1,6 @@ +name: bsp-support +kind: chunk +install-commands: +- install -o 0 -g 0 -m 755 -D nv-ondemand-cpufreq-governor.service "$DESTDIR/usr/lib/systemd/system/nv-ondemand-cpufreq-governor.service" +- install -d "$DESTDIR/usr/lib/systemd/system/sysinit.target.wants" +- ln -s /usr/lib/systemd/system/nv-ondemand-cpufreq-governor.service "$DESTDIR/usr/lib/systemd/system/sysinit.target.wants/nv-ondemand-cpufreq-governor.service" diff --git a/strata/bsp-jetson/device-tree-compiler.morph b/strata/bsp-jetson/device-tree-compiler.morph new file mode 100644 index 00000000..8abfafc8 --- /dev/null +++ b/strata/bsp-jetson/device-tree-compiler.morph @@ -0,0 +1,6 @@ +name: device-tree-compiler +kind: chunk +build-commands: +- make all +install-commands: +- make install DESTDIR="$DESTDIR" PREFIX="$PREFIX" diff --git a/strata/bsp-jetson/linux-firmware-jetson.morph b/strata/bsp-jetson/linux-firmware-jetson.morph new file mode 100644 index 00000000..c803eab2 --- /dev/null +++ b/strata/bsp-jetson/linux-firmware-jetson.morph @@ -0,0 +1,6 @@ +name: linux-firmware-jetson +kind: chunk +install-commands: +- install -d "$DESTDIR/lib/firmware/nvidia/tegra124" +- install -m644 nvidia/tegra124/gk20a_ctxsw.bin "$DESTDIR/lib/firmware/nvidia/tegra124" +- install -m644 nvidia/tegra124/xusb.bin "$DESTDIR/lib/firmware/nvidia/tegra124" diff --git a/strata/bsp-jetson/linux-jetson-tk1.morph b/strata/bsp-jetson/linux-jetson-tk1.morph new file mode 100644 index 00000000..42c16f01 --- /dev/null +++ b/strata/bsp-jetson/linux-jetson-tk1.morph @@ -0,0 +1,73 @@ +name: linux-jetson-tk1 +kind: chunk +configure-commands: +- make ARCH=arm tegra_defconfig +- scripts/config -d KERNEL_LZO +- scripts/config -e KERNEL_GZIP +- scripts/config -e NAMESPACES +- scripts/config -e PACKET +- scripts/config -e SATA_AHCI +- scripts/config -e ATA_GENERIC +- scripts/config -e HAVE_IDE +- scripts/config -d BLK_DEV_IDE_SATA +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e EXT2_FS +- scripts/config -e EXT2_FS_XATTR +- scripts/config -e EXT2_FS_POSIX_ACL +- scripts/config -e EXT2_FS_SECURITY +- scripts/config -e EXT2_FS_XIP +- scripts/config -e EXT3_FS +- scripts/config -d EXT3_DEFAULTS_TO_ORDERED +- scripts/config -e EXT3_FS_XATTR +- scripts/config -e EXT3_FS_POSIX_ACL +- scripts/config -e EXT3_FS_SECURITY +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_FS_XATTR +- scripts/config -e EXT4_FS_POSIX_ACL +- scripts/config -e EXT4_FS_SECURITY +- scripts/config -d EXT4_DEBUG +- scripts/config -d JBD_DEBUG +- scripts/config -d JBD2_DEBUG +- scripts/config -e BLK_DEV_LOOP +- scripts/config -d BLK_DEV_CRYPTOLOOP +- scripts/config --set-val BLK_DEV_LOOP_MIN_COUNT 8 +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e NFSD +- scripts/config -e NFSD_V3 +- scripts/config -e DRM_TEGRA_STAGING +- scripts/config -m DRM_NOUVEAU +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make ARCH=arm oldconfig +build-commands: +- make $MAKEFLAGS ARCH=arm LOADADDR=0x80200000 zImage dtbs +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/arm/boot/zImage "$DESTDIR"/boot/zImage +- cp arch/arm/boot/dts/tegra124-jetson-tk1.dtb "$DESTDIR"/boot/. +- make modules +- make INSTALL_MOD_PATH="$DESTDIR" modules_install +- install -d "$DESTDIR$PREFIX/src/linux" +- | + ( + printf 'Makefile\0' + printf 'Module.symvers\0' + find arch/arm -maxdepth 1 -name 'Makefile*' -print0 + find arch/arm \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print0 + find arch/arm \( -type d -a \( -name include -o -name scripts \) \) -o \ + \! -type d -a \( -path '*include/*' -o -path '*scripts/*' \) -print0 + find include -name 'asm*' -prune -o -print0 + find include/asm-generic -print0 + find include/uapi -print0 + find scripts -print0 + ) | cpio -0pumd "$DESTDIR$PREFIX/src/linux" diff --git a/strata/bsp-jetson/nouveau-drm.morph b/strata/bsp-jetson/nouveau-drm.morph new file mode 100644 index 00000000..e297a069 --- /dev/null +++ b/strata/bsp-jetson/nouveau-drm.morph @@ -0,0 +1,12 @@ +name: nouveau-drm +kind: chunk +build-commands: + - cd drm && make ARCH=arm M=$(pwd) -C /usr/src/linux/ modules +install-commands: + - cd drm && make ARCH=arm M="$(pwd)" -C /usr/src/linux/ INSTALL_MOD_PATH="$DESTDIR" modules_install +system-integration: + nouveau-drm-misc: + 00-earlyconf: + - (cd /lib/modules && for version in *; do rm "$version/kernel/drivers/gpu/drm/nouveau/nouveau.ko"; done) + - (cd /lib/modules && for version in *; do rm "$version/kernel/drivers/gpu/drm/nouveau/nouveau_platform.ko"; done) + - (cd /lib/modules && for version in *; do depmod -a "$version"; done) diff --git a/strata/bsp-jetson/u-boot@jetson.morph b/strata/bsp-jetson/u-boot@jetson.morph new file mode 100644 index 00000000..533f253a --- /dev/null +++ b/strata/bsp-jetson/u-boot@jetson.morph @@ -0,0 +1,20 @@ +name: u-boot@jetson +kind: chunk +configure-commands: +- make ARCH=arm jetson-tk1_config +build-commands: +- make ARCH=arm CROSS_COMPILE=/usr/bin/ +- make ARCH=arm CROSS_COMPILE=/usr/bin/ tools +install-commands: +- mkdir -p "$DESTDIR$PREFIX/bin" +- mkdir -p "$DESTDIR/boot" +- mkdir -p "$DESTDIR/boot/u-boot/" +- install -m 755 u-boot-dtb-tegra.bin "$DESTDIR/boot/u-boot.bin" +- install -m 755 u-boot-nodtb-tegra.bin "$DESTDIR/boot/u-boot/u-boot-nodtb-tegra.bin" +- install -m 755 u-boot.dtb "$DESTDIR/boot/u-boot/u-boot.dtb" +- size -A u-boot | grep -w .bss | tr -s ' ' | cut -d ' ' -f 2 > "$DESTDIR/boot/u-boot/u-boot-bss-size" +- install -m 755 tools/img2brec.sh "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/jtagconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/netconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkenvimage "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkimage "$DESTDIR$PREFIX/bin/." diff --git a/strata/bsp-ppc64-generic.morph b/strata/bsp-ppc64-generic.morph new file mode 100644 index 00000000..f109ecf2 --- /dev/null +++ b/strata/bsp-ppc64-generic.morph @@ -0,0 +1,12 @@ +name: bsp-ppc64-generic +kind: stratum +description: The platform dependent components required to boot a ppc64 board. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-ppc64 + morph: strata/bsp-ppc64-generic/linux-ppc64.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] diff --git a/strata/bsp-ppc64-generic/linux-ppc64.morph b/strata/bsp-ppc64-generic/linux-ppc64.morph new file mode 100644 index 00000000..1740a144 --- /dev/null +++ b/strata/bsp-ppc64-generic/linux-ppc64.morph @@ -0,0 +1,56 @@ +name: linux-ppc64 +kind: chunk +configure-commands: +- make ARCH=powerpc ppc64_defconfig +- scripts/config -e NAMESPACES +- scripts/config -e PACKET +- scripts/config -e SATA_AHCI +- scripts/config -e ATA_GENERIC +- scripts/config -e HAVE_IDE +- scripts/config -d BLK_DEV_IDE_SATA +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e EXT2_FS +- scripts/config -e EXT2_FS_XATTR +- scripts/config -e EXT2_FS_POSIX_ACL +- scripts/config -e EXT2_FS_SECURITY +- scripts/config -e EXT2_FS_XIP +- scripts/config -e EXT3_FS +- scripts/config -d EXT3_DEFAULTS_TO_ORDERED +- scripts/config -e EXT3_FS_XATTR +- scripts/config -e EXT3_FS_POSIX_ACL +- scripts/config -e EXT3_FS_SECURITY +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_FS_XATTR +- scripts/config -e EXT4_FS_POSIX_ACL +- scripts/config -e EXT4_FS_SECURITY +- scripts/config -d EXT4_DEBUG +- scripts/config -d JBD_DEBUG +- scripts/config -d JBD2_DEBUG +- scripts/config -e BLK_DEV_LOOP +- scripts/config -d BLK_DEV_CRYPTOLOOP +- scripts/config --set-val BLK_DEV_LOOP_MIN_COUNT 8 +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e NFSD +- scripts/config -e NFSD_V3 +- scripts/config -e IP_PNP +- scripts/config -e IP_PNP_DHCP +- scripts/config -e NFS_FS +- scripts/config -e ROOT_NFS +- scripts/config -e PCI +- scripts/config -e TIGON3 +- yes '' | make oldconfig +build-commands: +- make $MAKEFLAGS ARCH=powerpc zImage +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/powerpc/boot/zImage "$DESTDIR"/boot/zImage diff --git a/strata/bsp-wandboard.morph b/strata/bsp-wandboard.morph new file mode 100644 index 00000000..6f829802 --- /dev/null +++ b/strata/bsp-wandboard.morph @@ -0,0 +1,19 @@ +name: bsp-wandboard +kind: stratum +description: The platform dependent components required to boot an wandboard ARM board. +build-depends: +- morph: strata/core.morph +chunks: +- name: u-boot@wandboard + morph: strata/bsp-wandboard/u-boot@wandboard.morph + repo: upstream:u-boot + ref: fe57382d04b46c37f34cf8d3b3ad876554fd12bf + unpetrify-ref: baserock/morph + build-depends: [] +- name: linux-armv7-wandboard + morph: strata/bsp-wandboard/linux-armv7-wandboard.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: + - u-boot@wandboard diff --git a/strata/bsp-wandboard/linux-armv7-wandboard.morph b/strata/bsp-wandboard/linux-armv7-wandboard.morph new file mode 100644 index 00000000..15317978 --- /dev/null +++ b/strata/bsp-wandboard/linux-armv7-wandboard.morph @@ -0,0 +1,65 @@ +name: linux-armv7-wandboard +kind: chunk +configure-commands: +- make ARCH=arm imx_v6_v7_defconfig +- scripts/config -d KERNEL_LZO +- scripts/config -e KERNEL_GZIP +- scripts/config -e NAMESPACES +- scripts/config -e PACKET +- scripts/config -e SATA_AHCI +- scripts/config -e ATA_GENERIC +- scripts/config -e HAVE_IDE +- scripts/config -d BLK_DEV_IDE_SATA +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e EXT2_FS +- scripts/config -e EXT2_FS_XATTR +- scripts/config -e EXT2_FS_POSIX_ACL +- scripts/config -e EXT2_FS_SECURITY +- scripts/config -e EXT2_FS_XIP +- scripts/config -e EXT3_FS +- scripts/config -d EXT3_DEFAULTS_TO_ORDERED +- scripts/config -e EXT3_FS_XATTR +- scripts/config -e EXT3_FS_POSIX_ACL +- scripts/config -e EXT3_FS_SECURITY +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_FS_XATTR +- scripts/config -e EXT4_FS_POSIX_ACL +- scripts/config -e EXT4_FS_SECURITY +- scripts/config -d EXT4_DEBUG +- scripts/config -d JBD_DEBUG +- scripts/config -d JBD2_DEBUG +- scripts/config -e BLK_DEV_LOOP +- scripts/config -d BLK_DEV_CRYPTOLOOP +- scripts/config --set-val BLK_DEV_LOOP_MIN_COUNT 8 +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e NFSD +- scripts/config -e NFSD_V3 +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make $MAKEFLAGS ARCH=arm LOADADDR=0x10800000 uImage dtbs +- | + cat >boot.script <<'EOF' + setenv image_addr "0x12000000" + setenv bootargs "console=ttymxc0,115200 root=/dev/nfs rw ip=dhcp nfsroot=${fileserver}:${nfsroot},v3,tcp" + dhcp ${image_addr} ${fileserver}:${tfpboot}/uImage + bootm ${image_addr} + EOF +- mkimage -A arm -T script -C none -n "Wandboard TFTP Boot Script" -d boot.script + boot.scr +install-commands: +- mkdir -p "$DESTDIR"/boot +- cp arch/arm/boot/uImage "$DESTDIR"/boot/uImage +- cp boot.scr "$DESTDIR"/boot/boot.scr +- cp arch/arm/boot/dts/imx6*-wandboard.dtb "$DESTDIR"/boot/. diff --git a/strata/bsp-wandboard/u-boot@wandboard.morph b/strata/bsp-wandboard/u-boot@wandboard.morph new file mode 100644 index 00000000..8a51ee7c --- /dev/null +++ b/strata/bsp-wandboard/u-boot@wandboard.morph @@ -0,0 +1,11 @@ +name: u-boot@wandboard +kind: chunk +build-commands: +- make tools +install-commands: +- mkdir -p "$DESTDIR$PREFIX/bin" +- install -m 755 tools/img2brec.sh "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/jtagconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/netconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkenvimage "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkimage "$DESTDIR$PREFIX/bin/." diff --git a/strata/bsp-x86_32-generic.morph b/strata/bsp-x86_32-generic.morph new file mode 100644 index 00000000..480bd702 --- /dev/null +++ b/strata/bsp-x86_32-generic.morph @@ -0,0 +1,26 @@ +name: bsp-x86_32-generic +kind: stratum +description: The set of platform specific components required for booting a 32-bit + x86 based system. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-x86-32-generic + morph: strata/bsp-x86_32-generic/linux-x86-32-generic.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] +- name: nasm + morph: strata/bsp-x86_32-generic/nasm.morph + repo: upstream:nasm + ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: syslinux + morph: strata/bsp-x86_32-generic/syslinux.morph + repo: upstream:syslinux + ref: 2f6d21d2a560cb5581694fef42ee9a350d5f302f + unpetrify-ref: baserock/morph + build-depends: + - nasm diff --git a/strata/bsp-x86_32-generic/linux-x86-32-generic.morph b/strata/bsp-x86_32-generic/linux-x86-32-generic.morph new file mode 100644 index 00000000..593d9a65 --- /dev/null +++ b/strata/bsp-x86_32-generic/linux-x86-32-generic.morph @@ -0,0 +1,103 @@ +name: linux-x86-32-generic +kind: chunk +products: +- artifact: linux-x86-32-generic-devel + include: + - (usr/)?src/linux/.* +- artifact: linux-x86-32-generic-bins + include: + - boot/.* +- artifact: linux-x86-32-generic-libs + include: + - lib/.* +configure-commands: +- make defconfig +- scripts/config -e PACKET +- scripts/config -e SATA_AHCI +- scripts/config -e ATA_GENERIC +- scripts/config -e HAVE_IDE +- scripts/config -d BLK_DEV_IDE_SATA +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e EXT2_FS +- scripts/config -e EXT2_FS_XATTR +- scripts/config -e EXT2_FS_POSIX_ACL +- scripts/config -e EXT2_FS_SECURITY +- scripts/config -e EXT2_FS_XIP +- scripts/config -e EXT3_FS +- scripts/config -d EXT3_DEFAULTS_TO_ORDERED +- scripts/config -e EXT3_FS_XATTR +- scripts/config -e EXT3_FS_POSIX_ACL +- scripts/config -e EXT3_FS_SECURITY +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_FS_XATTR +- scripts/config -e EXT4_FS_POSIX_ACL +- scripts/config -e EXT4_FS_SECURITY +- scripts/config -d EXT4_DEBUG +- scripts/config -d JBD_DEBUG +- scripts/config -d JBD2_DEBUG +- scripts/config -e BLK_DEV_LOOP +- scripts/config -d BLK_DEV_CRYPTOLOOP +- scripts/config -e CEPH_FS +- scripts/config --set-val BLK_DEV_LOOP_MIN_COUNT 8 +- scripts/config -e VIRTIO +- scripts/config -e VIRTIO_RING +- scripts/config -e VIRTIO_PCI +- scripts/config -e VIRTIO_BALLOON +- scripts/config -e VIRTIO_BLK +- scripts/config -e VIRTIO_NET +- scripts/config -e VIRTIO_CONSOLE +- scripts/config -e HW_RANDOM_VIRTIO +- scripts/config -e 9P_FS +- scripts/config -e 9P_FSCACHE +- scripts/config -e 9P_FS_POSIX_ACL +- scripts/config -e NET_9P +- scripts/config -e NET_9P_VIRTIO +- scripts/config -e R8169 +- scripts/config -e 8139TOO +- scripts/config -e 8139CP +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e NFSD +- scripts/config -e NFSD_V3 +- scripts/config -e KVM +- scripts/config -e TUN +- scripts/config -e BRIDGE +- scripts/config -e VHOST_NET +- scripts/config -e NF_NAT +- scripts/config -e NF_NAT_IPV4 +- scripts/config -e IP_NF_TARGET_MASQUERADE +- scripts/config -e FB_VESA +- scripts/config -e HOTPLUG_PCI +- scripts/config -e HOTPLUG_PCI_ACPI +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make $MAKEFLAGS +install-commands: +- mkdir -p "$DESTDIR"/boot +- make INSTALL_PATH="$DESTDIR"/boot install +- make INSTALL_MOD_PATH="$DESTDIR" modules_install +- install -d "$DESTDIR$PREFIX/src/linux" +- | + ( + printf 'Makefile\0' + printf 'Module.symvers\0' + find arch/x86 -maxdepth 1 -name 'Makefile*' -print0 + find arch/x86 \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print0 + find arch/x86 \( -type d -a \( -name include -o -name scripts \) \) -o \ + \! -type d -a \( -path '*include/*' -o -path '*scripts/*' \) -print0 + find include -name 'asm*' -prune -o -print0 + find include/asm-generic -print0 + find include/uapi -print0 + find scripts -print0 + ) | cpio -0pumd "$DESTDIR$PREFIX/src/linux" diff --git a/strata/bsp-x86_32-generic/nasm.morph b/strata/bsp-x86_32-generic/nasm.morph new file mode 100644 index 00000000..0ab1a629 --- /dev/null +++ b/strata/bsp-x86_32-generic/nasm.morph @@ -0,0 +1,5 @@ +name: nasm +kind: chunk +build-system: autotools +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/bsp-x86_32-generic/syslinux.morph b/strata/bsp-x86_32-generic/syslinux.morph new file mode 100644 index 00000000..c0f15807 --- /dev/null +++ b/strata/bsp-x86_32-generic/syslinux.morph @@ -0,0 +1,8 @@ +name: syslinux +kind: chunk +build-commands: +- make clean +- make +- make installer +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/bsp-x86_64-generic.morph b/strata/bsp-x86_64-generic.morph new file mode 100644 index 00000000..a24a34c5 --- /dev/null +++ b/strata/bsp-x86_64-generic.morph @@ -0,0 +1,26 @@ +name: bsp-x86_64-generic +kind: stratum +description: The set of platform specific components required for booting a 64-bit + x86 based system. +build-depends: +- morph: strata/core.morph +chunks: +- name: linux-x86-64-generic + morph: strata/bsp-x86_64-generic/linux-x86-64-generic.morph + repo: upstream:linux + ref: b2776bf7149bddd1f4161f14f79520f17fc1d71d + unpetrify-ref: v3.18 + build-depends: [] +- name: nasm + morph: strata/bsp-x86_64-generic/nasm.morph + repo: upstream:nasm + ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: syslinux + morph: strata/bsp-x86_64-generic/syslinux.morph + repo: upstream:syslinux + ref: 2f6d21d2a560cb5581694fef42ee9a350d5f302f + unpetrify-ref: baserock/morph + build-depends: + - nasm diff --git a/strata/bsp-x86_64-generic/linux-x86-64-generic.morph b/strata/bsp-x86_64-generic/linux-x86-64-generic.morph new file mode 100644 index 00000000..fe0721cc --- /dev/null +++ b/strata/bsp-x86_64-generic/linux-x86-64-generic.morph @@ -0,0 +1,103 @@ +name: linux-x86-64-generic +kind: chunk +products: +- artifact: linux-x86-64-generic-devel + include: + - (usr/)?src/linux/.* +- artifact: linux-x86-64-generic-bins + include: + - boot/.* +- artifact: linux-x86-64-generic-libs + include: + - lib/.* +configure-commands: +- make defconfig +- scripts/config -e PACKET +- scripts/config -e SATA_AHCI +- scripts/config -e ATA_GENERIC +- scripts/config -e HAVE_IDE +- scripts/config -d BLK_DEV_IDE_SATA +- scripts/config -e BTRFS_FS +- scripts/config -e BTRFS_FS_POSIX_ACL +- scripts/config -e DEVTMPFS +- scripts/config -e DEVTMPFS_MOUNT +- scripts/config -e CONFIG_FHANDLE +- scripts/config -e CGROUPS +- scripts/config -e AUTOFS4_FS +- scripts/config --set-str UEVENT_HELPER_PATH '' +- scripts/config -e EXT2_FS +- scripts/config -e EXT2_FS_XATTR +- scripts/config -e EXT2_FS_POSIX_ACL +- scripts/config -e EXT2_FS_SECURITY +- scripts/config -e EXT2_FS_XIP +- scripts/config -e EXT3_FS +- scripts/config -d EXT3_DEFAULTS_TO_ORDERED +- scripts/config -e EXT3_FS_XATTR +- scripts/config -e EXT3_FS_POSIX_ACL +- scripts/config -e EXT3_FS_SECURITY +- scripts/config -e EXT4_FS +- scripts/config -e EXT4_FS_XATTR +- scripts/config -e EXT4_FS_POSIX_ACL +- scripts/config -e EXT4_FS_SECURITY +- scripts/config -d EXT4_DEBUG +- scripts/config -d JBD_DEBUG +- scripts/config -d JBD2_DEBUG +- scripts/config -e BLK_DEV_LOOP +- scripts/config -d BLK_DEV_CRYPTOLOOP +- scripts/config -e CEPH_FS +- scripts/config --set-val BLK_DEV_LOOP_MIN_COUNT 8 +- scripts/config -e VIRTIO +- scripts/config -e VIRTIO_RING +- scripts/config -e VIRTIO_PCI +- scripts/config -e VIRTIO_BALLOON +- scripts/config -e VIRTIO_BLK +- scripts/config -e VIRTIO_NET +- scripts/config -e VIRTIO_CONSOLE +- scripts/config -e HW_RANDOM_VIRTIO +- scripts/config -e 9P_FS +- scripts/config -e 9P_FSCACHE +- scripts/config -e 9P_FS_POSIX_ACL +- scripts/config -e NET_9P +- scripts/config -e NET_9P_VIRTIO +- scripts/config -e R8169 +- scripts/config -e 8139TOO +- scripts/config -e 8139CP +- scripts/config -e IKCONFIG +- scripts/config -e IKCONFIG_PROC +- scripts/config -e SECCOMP +- scripts/config -d DEBUG_STACK_TRACE +- scripts/config -e NFSD +- scripts/config -e NFSD_V3 +- scripts/config -e KVM +- scripts/config -e TUN +- scripts/config -e BRIDGE +- scripts/config -e VHOST_NET +- scripts/config -e NF_NAT +- scripts/config -e NF_NAT_IPV4 +- scripts/config -e IP_NF_TARGET_MASQUERADE +- scripts/config -e FB_VESA +- scripts/config -e HOTPLUG_PCI +- scripts/config -e HOTPLUG_PCI_ACPI +- scripts/config -e VLAN_8021Q +- scripts/config -e BRIDGE_VLAN_FILTERING +- yes '' | make oldconfig +build-commands: +- make $MAKEFLAGS +install-commands: +- mkdir -p "$DESTDIR"/boot +- make INSTALL_PATH="$DESTDIR"/boot install +- make INSTALL_MOD_PATH="$DESTDIR" modules_install +- install -d "$DESTDIR$PREFIX/src/linux" +- | + ( + printf 'Makefile\0' + printf 'Module.symvers\0' + find arch/x86 -maxdepth 1 -name 'Makefile*' -print0 + find arch/x86 \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print0 + find arch/x86 \( -type d -a \( -name include -o -name scripts \) \) -o \ + \! -type d -a \( -path '*include/*' -o -path '*scripts/*' \) -print0 + find include -name 'asm*' -prune -o -print0 + find include/asm-generic -print0 + find include/uapi -print0 + find scripts -print0 + ) | cpio -0pumd "$DESTDIR$PREFIX/src/linux" diff --git a/strata/bsp-x86_64-generic/nasm.morph b/strata/bsp-x86_64-generic/nasm.morph new file mode 100644 index 00000000..0ab1a629 --- /dev/null +++ b/strata/bsp-x86_64-generic/nasm.morph @@ -0,0 +1,5 @@ +name: nasm +kind: chunk +build-system: autotools +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/bsp-x86_64-generic/syslinux.morph b/strata/bsp-x86_64-generic/syslinux.morph new file mode 100644 index 00000000..c0f15807 --- /dev/null +++ b/strata/bsp-x86_64-generic/syslinux.morph @@ -0,0 +1,8 @@ +name: syslinux +kind: chunk +build-commands: +- make clean +- make +- make installer +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/bsp-x86_both-tools.morph b/strata/bsp-x86_both-tools.morph new file mode 100644 index 00000000..c1ba501c --- /dev/null +++ b/strata/bsp-x86_both-tools.morph @@ -0,0 +1,20 @@ +name: bsp-x86_both-tools +kind: stratum +description: The set of platform specific components required for configuring a bootable + x86 based system. +build-depends: +- morph: strata/core.morph +chunks: +- name: nasm + morph: strata/bsp-x86_both-tools/nasm.morph + repo: upstream:nasm + ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: syslinux + morph: strata/bsp-x86_both-tools/syslinux.morph + repo: upstream:syslinux + ref: 2f6d21d2a560cb5581694fef42ee9a350d5f302f + unpetrify-ref: baserock/morph + build-depends: + - nasm diff --git a/strata/bsp-x86_both-tools/nasm.morph b/strata/bsp-x86_both-tools/nasm.morph new file mode 100644 index 00000000..0ab1a629 --- /dev/null +++ b/strata/bsp-x86_both-tools/nasm.morph @@ -0,0 +1,5 @@ +name: nasm +kind: chunk +build-system: autotools +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/bsp-x86_both-tools/syslinux.morph b/strata/bsp-x86_both-tools/syslinux.morph new file mode 100644 index 00000000..c0f15807 --- /dev/null +++ b/strata/bsp-x86_both-tools/syslinux.morph @@ -0,0 +1,8 @@ +name: syslinux +kind: chunk +build-commands: +- make clean +- make +- make installer +install-commands: +- make INSTALLROOT="$DESTDIR" install diff --git a/strata/build-essential.morph b/strata/build-essential.morph new file mode 100644 index 00000000..d7b86648 --- /dev/null +++ b/strata/build-essential.morph @@ -0,0 +1,344 @@ +name: build-essential +kind: stratum +description: | + Toolchain stratum + + Stage 1: build a minimal cross compiler with the host's tools. + + Starting with a cross compiler ensures that (a) nothing from the host + can leak into the build-essential artifacts, and (b) cross-compiling + build-essential is fully tested and supported, since we always use the + cross code paths. + + Stage 2: cross-build the whole of build-essential, using the host's tools + but the cross-compiler toolchain. + + Stage 2 GCC outputs code for the same 'bootstrap' machine as stage 1 GCC, + but because stage 2 GCC is also built to *run* on the bootstrap machine + it can only execute inside the stage 3 chroot (due to being built against + a libc with a non-standard prefix). + + Stage 3: build the whole of build-essential again, this time using a + staging area containing only the output of stage 2. The result of this + build is fully reproducible. + + We do a switch-a-roo between stage 2 and 3: stages 2 chunks are all built + to run on a host *-bootstrap-* while stage 3 chunks are native-built for + a *-baserock-* machine. This works, because the cross build was all for + show (and cleanliness) and the binaries actually still run on the host. + + After build-essential is built we do another trick. See + stage2-fhs-dirs.morph for details. Basically, /bin is a symlink to + /tools/bin during stage 2 but in stage 3 it becomes a real directory + again. +products: +- artifact: build-essential-minimal + include: + - fhs-dirs-.* + - busybox-.* + - glibc-nss +chunks: +- name: stage1-binutils + morph: strata/build-essential/stage1-binutils.morph + repo: upstream:binutils-redhat + ref: 987eb543a034cddc4eeb103f08f566f24a5f964a + unpetrify-ref: baserock/build-essential + build-depends: [] + build-mode: bootstrap + prefix: /tools +- name: stage1-gcc + morph: strata/build-essential/stage1-gcc.morph + repo: upstream:gcc-tarball + ref: 999c918a7ad32ad436395666def22ab90b3447fe + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + build-mode: bootstrap + prefix: /tools +- name: stage2-linux-api-headers + morph: strata/build-essential/stage2-linux-api-headers.morph + repo: upstream:linux + ref: df2e1b9168a7ab5dd8149e38b5ac70cdef86d1fa + unpetrify-ref: baserock/v3.8 + build-depends: + - stage1-binutils + - stage1-gcc + build-mode: bootstrap + prefix: /tools +- name: stage2-glibc + morph: strata/build-essential/stage2-glibc.morph + repo: upstream:glibc + ref: 52cf9a0153c14df4f6ae3bd0e1e6cc5d171e586c + unpetrify-ref: baserock/glibc-2.20 + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-linux-api-headers + build-mode: bootstrap + prefix: /tools +- name: stage2-binutils + morph: strata/build-essential/stage2-binutils.morph + repo: upstream:binutils-redhat + ref: 987eb543a034cddc4eeb103f08f566f24a5f964a + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: stage2-gcc-fixed-headers + morph: strata/build-essential/stage2-gcc-fixed-headers.morph + repo: upstream:gcc-tarball + ref: 999c918a7ad32ad436395666def22ab90b3447fe + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: stage2-gcc + morph: strata/build-essential/stage2-gcc.morph + repo: upstream:gcc-tarball + ref: 999c918a7ad32ad436395666def22ab90b3447fe + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + - stage2-gcc-fixed-headers + build-mode: bootstrap + prefix: /tools +- name: stage2-busybox + morph: strata/build-essential/stage2-busybox.morph + repo: upstream:busybox + ref: 8a801e0f024f1385d8e989b80b90443546bceae7 + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: stage2-fake-bash + morph: strata/build-essential/stage2-fake-bash.morph + repo: upstream:bash + ref: 3590145af6f1c9fa321dff231f69ae696e7e740b + unpetrify-ref: baserock/bash-4.3-patch-27 + build-depends: + - stage2-busybox + build-mode: bootstrap + prefix: /tools +- name: stage2-fhs-dirs + morph: strata/build-essential/stage2-fhs-dirs.morph + repo: baserock:baserock/fhs-dirs + ref: 41bbb474cd4647ee715bc94c21c161d12a20deb4 + unpetrify-ref: master + build-depends: [] + build-mode: bootstrap + prefix: /tools +- name: stage2-gawk + morph: strata/build-essential/stage2-gawk.morph + repo: upstream:gawk + ref: 6a0eb04c3d2ac24d80d505b42a8f67799487d133 + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: stage2-make + morph: strata/build-essential/stage2-make.morph + repo: upstream:make + ref: 56968f58301e6e5157cf4c8b6deefbaff2955eba + unpetrify-ref: baserock/build-essential + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: stage2-reset-specs + morph: strata/build-essential/stage2-reset-specs.morph + repo: upstream:glibc + ref: 52cf9a0153c14df4f6ae3bd0e1e6cc5d171e586c + unpetrify-ref: baserock/glibc-2.20 + build-depends: + - stage1-binutils + - stage1-gcc + - stage2-linux-api-headers + - stage2-glibc + build-mode: bootstrap + prefix: /tools +- name: fhs-dirs + morph: strata/build-essential/fhs-dirs.morph + repo: baserock:baserock/fhs-dirs + ref: 41bbb474cd4647ee715bc94c21c161d12a20deb4 + unpetrify-ref: master + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs +- name: linux-api-headers + morph: strata/build-essential/linux-api-headers.morph + repo: upstream:linux + ref: df2e1b9168a7ab5dd8149e38b5ac70cdef86d1fa + unpetrify-ref: baserock/v3.8 + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs +- name: glibc + morph: strata/build-essential/glibc.morph + repo: upstream:glibc + ref: 52cf9a0153c14df4f6ae3bd0e1e6cc5d171e586c + unpetrify-ref: baserock/glibc-2.20 + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-fake-bash + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - linux-api-headers + artifacts: + glibc-gconv: build-essential-runtime + glibc-libs: build-essential-minimal + glibc-nss: build-essential-runtime +- name: zlib + morph: strata/build-essential/zlib.morph + repo: upstream:zlib + ref: db333af7e9b90a23fd7f9cd8dc128123b34bf698 + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc + artifacts: + zlib-libs: build-essential-minimal +- name: binutils + morph: strata/build-essential/binutils.morph + repo: upstream:binutils-redhat + ref: 987eb543a034cddc4eeb103f08f566f24a5f964a + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc + - zlib +- name: busybox + morph: strata/build-essential/busybox.morph + repo: upstream:busybox + ref: 772a98fec669cf881d7c1ea17631bc8560bccf5c + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc +- name: gawk + morph: strata/build-essential/gawk.morph + repo: upstream:gawk + ref: 6a0eb04c3d2ac24d80d505b42a8f67799487d133 + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc +- name: gcc + morph: strata/build-essential/gcc.morph + repo: upstream:gcc-tarball + ref: 5c08cea34d5562dc828b85c7c02519246823aaf0 + unpetrify-ref: baserock/build-essential-4.7 + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc + - zlib + artifacts: + gcc-libs: build-essential-minimal +- name: make + morph: strata/build-essential/make.morph + repo: upstream:make + ref: 56968f58301e6e5157cf4c8b6deefbaff2955eba + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc +- name: ccache + morph: strata/build-essential/ccache.morph + repo: upstream:ccache + ref: 567631456f0899cdf0c382f898d38aadc8901d32 + unpetrify-ref: baserock/build-essential + build-depends: + - stage2-binutils + - stage2-busybox + - stage2-glibc + - stage2-fhs-dirs + - stage2-gawk + - stage2-gcc + - stage2-linux-api-headers + - stage2-make + - stage2-reset-specs + - glibc + - zlib diff --git a/strata/build-essential/binutils.morph b/strata/build-essential/binutils.morph new file mode 100644 index 00000000..bab52672 --- /dev/null +++ b/strata/build-essential/binutils.morph @@ -0,0 +1,8 @@ +name: binutils +kind: chunk +build-system: autotools + +configure-commands: +- | + ./configure --prefix="$PREFIX" --disable-nls --disable-werror \ + --with-system-zlib diff --git a/strata/build-essential/busybox.morph b/strata/build-essential/busybox.morph new file mode 100644 index 00000000..35f57357 --- /dev/null +++ b/strata/build-essential/busybox.morph @@ -0,0 +1,85 @@ +name: busybox +kind: chunk + +configure-commands: +# Busybox's default config has everything enabled. +- make defconfig + +- sed -e 's|.*UDHCPC_DEFAULT_SCRIPT.*|CONFIG_UDHCPC_DEFAULT_SCRIPT="'"$PREFIX"/share/udhcpc/default.script'"|' -i .config +- sed -e 's|.*IFUPDOWN_IFSTATE_PATH.*|CONFIG_IFUPDOWN_IFSTATE_PATH="/run/ifstate"|' -i .config + +# Avoid dividing applets between $PREFIX/[s]bin and $PREFIX/usr/[s]bin. +- '[ "$PREFIX" = /usr ] || sed -e ''s/.*INSTALL_NO_USR.*/CONFIG_INSTALL_NO_USR=y/'' -i .config' + +# We have GAWK, but in GENIVI baseline we want to get rid of it +# - sed -e 's/CONFIG_AWK=y.*/# CONFIG_AWK is not set/' -i .config + +# Depends on stuff that was removed since eglibc 2.14. +- sed -e 's/CONFIG_INETD=y.*/# CONFIG_INETD is not set/' -i .config + +# Busybox Patch is incompatible enough with GNU Patch that it can't be +# used for GNULib projects built from Git. +- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config + +# None of this is needed because we have kmod; and it actually breaks the +# Linux build because depmod isn't compatible enough with util-linux's. +- sed -e 's/CONFIG_DEPMOD=y.*/# CONFIG_DEPMOD is not set/' -i .config +- sed -e 's/CONFIG_INSMOD=y.*/# CONFIG_INSMOD is not set/' -i .config +- sed -e 's/CONFIG_MODPROBE=y.*/# CONFIG_MODPROBE is not set/' -i .config +- sed -e 's/CONFIG_MODPROBE_SMALL=y.*/# CONFIG_MODPROBE_SMALL is not set/' -i .config +- sed -e 's/CONFIG_LSMOD=y.*/# CONFIG_LSMOD is not set/' -i .config +- sed -e 's/CONFIG_RMMOD=y.*/# CONFIG_RMMOD is not set/' -i .config + +# General features that we don't need. +- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config +- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config +- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config +- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config +- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config +- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config +- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config +- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config +- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config +- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config +- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config + +# Now turn on some little bits we do need +- sed -e 's/# CONFIG_BBCONFIG is not set/CONFIG_BBCONFIG=y/' -i .config +- sed -e 's/# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set/CONFIG_FEATURE_COMPRESS_BBCONFIG=y/' -i .config +- sed -e 's/# CONFIG_FEATURE_MOUNT_HELPERS is not set/CONFIG_FEATURE_MOUNT_HELPERS=y/' -i .config + + +build-commands: +- make + +install-commands: +- | + if [ "$PREFIX" = /usr ]; then PREFIX=; fi && + make CONFIG_PREFIX="$DESTDIR$PREFIX" install && + chmod 6755 "$DESTDIR$PREFIX"/bin/busybox + +# Set up man environment variables +- mkdir -p "$DESTDIR"/etc +- | + cat << EOF > "$DESTDIR/etc/profile" + # Set default pager to less + export MANPAGER='less -R' + EOF +- | + cat << EOF > "$DESTDIR/etc/man.conf" + # This file is used by man to provide a manpath for those without one by + # examining their PATH environment variable. + # + # Lines beginning with `#' are comments and are ignored. Any combination of + # tabs or spaces may be used as `whitespace' separators. + + MANDATORY_MANPATH /usr/man + MANDATORY_MANPATH /usr/share/man + MANDATORY_MANPATH /usr/local/share/man + EOF diff --git a/strata/build-essential/ccache.morph b/strata/build-essential/ccache.morph new file mode 100644 index 00000000..383eee8a --- /dev/null +++ b/strata/build-essential/ccache.morph @@ -0,0 +1,12 @@ +name: ccache +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR/$PREFIX/lib/ccache" +- for cc in gcc cc g++ c++; do ln -sf "$PREFIX/bin/ccache" "$DESTDIR/$PREFIX/lib/ccache/$cc"; + done +- for cc in gcc cc g++ c++; do ln -sf "$PREFIX/bin/ccache" "$DESTDIR/$PREFIX/lib/ccache/$TARGET-$cc"; + done diff --git a/strata/build-essential/fhs-dirs.morph b/strata/build-essential/fhs-dirs.morph new file mode 100644 index 00000000..64474872 --- /dev/null +++ b/strata/build-essential/fhs-dirs.morph @@ -0,0 +1,50 @@ +name: fhs-dirs +kind: chunk +description: create the FHS 2.3 directory hierarchy and the usual files +install-commands: +- sh ./create-fhs-dirs "$DESTDIR" +- install -m 644 passwd "$DESTDIR/etc/passwd" +- install -m 600 shadow "$DESTDIR/etc/shadow" +- install -m 644 interfaces "$DESTDIR/etc/network/interfaces" +- install -m 644 group "$DESTDIR/etc/group" +- install -m 644 ld.so.conf "$DESTDIR/etc/ld.so.conf" +- install -m 644 issue "$DESTDIR/etc/issue" +- install -m 644 services "$DESTDIR/etc/services" +- install -m 644 protocols "$DESTDIR/etc/protocols" +- echo baserock > "$DESTDIR"/etc/hostname +devices: +- type: c + filename: /dev/console + gid: 0 + major: 5 + minor: 1 + permissions: '0600' + uid: 0 +- type: c + filename: /dev/full + gid: 0 + major: 1 + minor: 7 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/null + gid: 0 + major: 1 + minor: 3 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/urandom + gid: 0 + major: 1 + minor: 9 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/zero + gid: 0 + major: 1 + minor: 5 + permissions: '0666' + uid: 0 diff --git a/strata/build-essential/gawk.morph b/strata/build-essential/gawk.morph new file mode 100644 index 00000000..1ad871c6 --- /dev/null +++ b/strata/build-essential/gawk.morph @@ -0,0 +1,5 @@ +name: gawk +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --disable-nls diff --git a/strata/build-essential/gcc.morph b/strata/build-essential/gcc.morph new file mode 100644 index 00000000..50e2918c --- /dev/null +++ b/strata/build-essential/gcc.morph @@ -0,0 +1,42 @@ +name: gcc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. An attempt to stop anything going in $PREFIX/lib64 (which doesn't +# fully work; we will need to hobble the multilib configuration in +# config/i386/t-linux64 if we really want to kill /lib64). +# 2. Multilib does not make sense in Baserock. +# 3. Optimisation libraries which for now we do without. +# 4. Recommended by Linux From Scratch; required for C++ ABI +# compatibility with other Linux distributions. +# 5. MPFR is built in the GCC tree, we need to locate it. +# 6. Avoid having more than one copy of ZLib in use on the system +- | + cd o && \ + ../configure \ + $(../morph-arch-config) \ + --prefix="$PREFIX" \ + `# [1]` --libdir=$PREFIX/lib \ + --disable-nls \ + --enable-languages=c,c++,fortran \ + --enable-shared --enable-threads=posix \ + `# [2]` --disable-multilib \ + `# [3]` --disable-libgomp --without-cloog --without-ppl \ + `# [4]` --enable-__cxa_atexit \ + `# [5]` --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [6]` --with-system-zlib + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install +- ln -s gcc "$DESTDIR/$PREFIX/bin/cc" +- > + for fortran_alias in f77 f90 f95; do + ln -s gfortran "$DESTDIR/$PREFIX/bin/$fortran_alias" + done diff --git a/strata/build-essential/glibc.morph b/strata/build-essential/glibc.morph new file mode 100644 index 00000000..789283eb --- /dev/null +++ b/strata/build-essential/glibc.morph @@ -0,0 +1,86 @@ +name: glibc +kind: chunk +products: +- artifact: glibc-nss + include: + - etc/nsswitch.conf + - (usr/)?lib/libnss.* +- artifact: glibc-gconv + include: + - (usr/)?lib/gconv/.* +- artifact: glibc-libs + include: + - sbin/ldconfig + - lib(32|64)?/ld-.* + - (usr/)?lib(exec)?/pt_chown +- artifact: glibc-bins + include: + - (usr/)?s?bin/.* + - (usr/)?libexec/getconf/.* + - (usr/)?lib/libSegFault\.so(\.\d+)*$ +- artifact: glibc-libs + include: + - (usr/)?lib(32|64)?/lib[^/]*\.so(\.\d+)*$ +- artifact: glibc-devel + include: + - (usr/)?include/.* + - (usr/)?lib(32|64)?/lib.*\.a + - (usr/)?lib(32|64)?/lib.*\.la + - (usr/)?(lib(32|64)?|share)/pkgconfig/.*\.pc + - (usr/)?lib(32|64)?/.*\.o +- artifact: glibc-locale + include: + - (usr/)?share/locale/.* + - (usr/)?share/i18n/.* + - (usr/)?share/zoneinfo/.* +- artifact: glibc-misc + include: + - .* +configure-commands: +- mkdir o + +- | + case "$MORPH_ARCH" in + armv7*) + ARCH_FLAGS="--without-fp" ;; + esac + + # We override the PATH here to remove /tools/bin from it. + # Thanks to this glibc finds bash in /bin/bash through the /bin + # symlink. This is important because glibc changes the path to bash + # of the shebang in some scripts and these scripts will be broken if + # they point to bash in /tools/bin/bash. + export PATH="/usr/bin:/sbin:/bin"; + export CFLAGS="-O2 $CFLAGS"; + cd o && ../configure \ + $ARCH_FLAGS \ + --prefix="$PREFIX" \ + --disable-profile \ + --enable-kernel=2.6.25 \ + --without-cvs \ + --without-selinux \ + --enable-obsolete-rpc + +build-commands: +- cd o && make localtime=UTC + +install-commands: +- cd o && make install_root="$DESTDIR" localtime=UTC install +- mkdir -p "$DESTDIR/etc" +- | + cat <<EOF > nsswitch.conf + passwd: compat + group: compat + shadow: compat + + hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4 + networks: files + + protocols: db files + services: db files + ethers: db files + rpc: db files + + netgroup: nis + EOF +- install -m 644 -o root -g root nsswitch.conf "$DESTDIR/etc/nsswitch.conf" diff --git a/strata/build-essential/linux-api-headers.morph b/strata/build-essential/linux-api-headers.morph new file mode 100644 index 00000000..e1ff2638 --- /dev/null +++ b/strata/build-essential/linux-api-headers.morph @@ -0,0 +1,6 @@ +name: linux-api-headers +kind: chunk +install-commands: +- ARCH=$(./morph-arch) make INSTALL_HDR_PATH=dest headers_install +- install -d "$DESTDIR${PREFIX-/usr}/include" +- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include" diff --git a/strata/build-essential/make.morph b/strata/build-essential/make.morph new file mode 100644 index 00000000..1259b342 --- /dev/null +++ b/strata/build-essential/make.morph @@ -0,0 +1,5 @@ +name: make +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --disable-nls diff --git a/strata/build-essential/stage1-binutils.morph b/strata/build-essential/stage1-binutils.morph new file mode 100644 index 00000000..b6670d5c --- /dev/null +++ b/strata/build-essential/stage1-binutils.morph @@ -0,0 +1,17 @@ +name: stage1-binutils +kind: chunk +build-system: autotools + +configure-commands: +# We set the sysroot location dynamically at runtime by passing -B to GCC, +# so we configure with sysroot=/. Setting the lib path is vital to avoid +# the tools we build linking to the libraries on the host system; the '=' +# makes the path we give relative to the sysroot, which we can then set +# at runtime by passing -Wl,--sysroot to GCC. + +- | + ./configure --prefix="$PREFIX" --disable-nls --disable-werror \ + --build=$(sh config.guess) \ + --host=$(sh config.guess) \ + --target=$TARGET_STAGE1 \ + --with-sysroot="/" --with-lib-path="=$PREFIX/lib" diff --git a/strata/build-essential/stage1-gcc.morph b/strata/build-essential/stage1-gcc.morph new file mode 100644 index 00000000..0cb03568 --- /dev/null +++ b/strata/build-essential/stage1-gcc.morph @@ -0,0 +1,48 @@ +name: stage1-gcc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Standard flags. See gcc.morph. +# 2. Disable searching /usr/local/include for headers +# 3. The pass 1 compiler needs to find the libraries we build in pass 2. +# Include path must be set explicility, because it defaults to +# $SYSROOT/usr/include rather than $SYSROOT/include. +# FIXME: this flag is not present until GCC 4.6.3! +# 4. Disable stuff that doesn't work when building a cross compiler +# without an existing libc, and generally try to keep this build as +# simple as possible. +- | + cd o && + ../configure \ + $(../morph-arch-config) \ + --build=$(sh ../config.guess) --host=$(sh ../config.guess) \ + --target=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + --disable-bootstrap --disable-nls \ + `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [2]` --with-local-prefix="$PREFIX" \ + `# [3]` --with-native-system-header-dir="$PREFIX/include" \ + `# [4]` --enable-languages=c --disable-decimal-float \ + --disable-libmudflap --disable-libquadmath --disable-libssp \ + --disable-shared --disable-threads --disable-target-libiberty \ + --disable-target-zlib --without-headers --with-newlib \ + --with-system-zlib + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install + +# The file libgcc_eh is required during eglibc's build, but is not created +# because we built GCC with --disable-shared. This is a workaround for +# eglibc's build system being slightly broken. +- | + libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name) + ln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/') diff --git a/strata/build-essential/stage2-binutils.morph b/strata/build-essential/stage2-binutils.morph new file mode 100644 index 00000000..bc0b18ac --- /dev/null +++ b/strata/build-essential/stage2-binutils.morph @@ -0,0 +1,24 @@ +name: stage2-binutils +kind: chunk +build-system: autotools + +configure-commands: +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" + export CXX=false + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + ./configure --prefix="$PREFIX" --disable-nls --disable-werror \ + --build=$(sh config.guess) \ + --host=$TARGET_STAGE1 \ + --target=$TARGET_STAGE1 + +build-commands: +# Nested configure scripts require that we set CPPFLAGS here as well +# (I don't think we should have to .. . at least in GCC, I think +# TARGET_CPPFLAGS may be the answer) +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + make diff --git a/strata/build-essential/stage2-busybox.morph b/strata/build-essential/stage2-busybox.morph new file mode 100644 index 00000000..dc23d09b --- /dev/null +++ b/strata/build-essential/stage2-busybox.morph @@ -0,0 +1,72 @@ +name: stage2-busybox +kind: chunk + +configure-commands: +# Explicitly setting HOSTCC is required because we have a 'gcc' earlier in +# the PATH supplied by the stage2-gcc chunk, which can't execute outside of +# the stage 3 staging area. +- make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- defconfig + +# Avoid dividing applets between $PREFIX/[s]bin and $PREFIX/usr/[s]bin. +- '[ "$PREFIX" = /usr ] || sed -e ''s/.*INSTALL_NO_USR.*/CONFIG_INSTALL_NO_USR=y/'' -i .config' + +# We have GAWK. +- sed -e 's/CONFIG_AWK=y.*/# CONFIG_AWK is not set/' -i .config + +# Depends on stuff that was removed since eglibc 2.14. +- sed -e 's/CONFIG_INETD=y.*/# CONFIG_INETD is not set/' -i .config + +# Busybox Patch is incompatible enough with GNU Patch that it can't be +# used for GNULib projects built from Git. +- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config + +# None of this is needed because we have kmod; and it actually breaks the +# Linux build because depmod isn't compatible enough with util-linux's. +- sed -e 's/CONFIG_DEPMOD=y.*/# CONFIG_DEPMOD is not set/' -i .config +- sed -e 's/CONFIG_INSMOD=y.*/# CONFIG_INSMOD is not set/' -i .config +- sed -e 's/CONFIG_MODPROBE=y.*/# CONFIG_MODPROBE is not set/' -i .config +- sed -e 's/CONFIG_MODPROBE_SMALL=y.*/# CONFIG_MODPROBE_SMALL is not set/' -i .config +- sed -e 's/CONFIG_LSMOD=y.*/# CONFIG_LSMOD is not set/' -i .config +- sed -e 's/CONFIG_RMMOD=y.*/# CONFIG_RMMOD is not set/' -i .config + +# General features that we don't need. +- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_USE_INITTAB=y.*/# CONFIG_FEATURE_USE_INITTAB is not set/' -i .config +- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config +- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config +- sed -e 's/CONFIG_HALT=y.*/# CONFIG_HALT is not set/' -i .config +- sed -e 's/CONFIG_INIT=y.*/# CONFIG_INIT is not set/' -i .config +- sed -e 's/CONFIG_INIT_TERMINAL_TYPE=y.*/CONFIG_INIT_TERMINAL_TYPE=""/' -i .config +- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config +- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config +- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config +- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config +- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config +- sed -e 's/CONFIG_RUNLEVEL=y.*/# CONFIG_RUNLEVEL is not set/' -i .config +- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config +- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config +- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config +- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config + +build-commands: +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- + +install-commands: +# We expect to be built with a non-standard prefix in stage 2 (i.e. not +# /usr). The install will break if prefix is set to /usr. +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + make CONFIG_PREFIX="$DESTDIR$PREFIX" \ + HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- install && + chmod 6755 "$DESTDIR$PREFIX"/bin/busybox diff --git a/strata/build-essential/stage2-fake-bash.morph b/strata/build-essential/stage2-fake-bash.morph new file mode 100644 index 00000000..021fd366 --- /dev/null +++ b/strata/build-essential/stage2-fake-bash.morph @@ -0,0 +1,4 @@ +name: stage2-fake-bash +kind: chunk +install-commands: +- printf '#!/bin/sh\nexec /bin/sh "$@"\n' | install -D /proc/self/fd/0 -m 755 "$DESTDIR$PREFIX/bin/bash" diff --git a/strata/build-essential/stage2-fhs-dirs.morph b/strata/build-essential/stage2-fhs-dirs.morph new file mode 100644 index 00000000..14a6e253 --- /dev/null +++ b/strata/build-essential/stage2-fhs-dirs.morph @@ -0,0 +1,52 @@ +name: stage2-fhs-dirs +kind: chunk +description: create the FHS 2.3 directory hierarchy and the usual files +install-commands: +- sh ./create-fhs-dirs "$DESTDIR" +- rmdir "$DESTDIR/bin" +- ln -s "$PREFIX/bin" "$DESTDIR/bin" +- install -m 644 passwd "$DESTDIR/etc/passwd" +- install -m 600 shadow "$DESTDIR/etc/shadow" +- install -m 644 interfaces "$DESTDIR/etc/network/interfaces" +- install -m 644 group "$DESTDIR/etc/group" +- install -m 644 ld.so.conf "$DESTDIR/etc/ld.so.conf" +- install -m 644 issue "$DESTDIR/etc/issue" +- install -m 644 services "$DESTDIR/etc/services" +- install -m 644 protocols "$DESTDIR/etc/protocols" +- echo baserock > "$DESTDIR"/etc/hostname +devices: +- type: c + filename: /dev/console + gid: 0 + major: 5 + minor: 1 + permissions: '0600' + uid: 0 +- type: c + filename: /dev/full + gid: 0 + major: 1 + minor: 7 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/null + gid: 0 + major: 1 + minor: 3 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/urandom + gid: 0 + major: 1 + minor: 9 + permissions: '0666' + uid: 0 +- type: c + filename: /dev/zero + gid: 0 + major: 1 + minor: 5 + permissions: '0666' + uid: 0 diff --git a/strata/build-essential/stage2-gawk.morph b/strata/build-essential/stage2-gawk.morph new file mode 100644 index 00000000..f644d72b --- /dev/null +++ b/strata/build-essential/stage2-gawk.morph @@ -0,0 +1,9 @@ +name: stage2-gawk +kind: chunk +build-system: autotools +configure-commands: +- STAGE2_SYSROOT="$(dirname $(pwd))" CPPFLAGS="--sysroot=$STAGE2_SYSROOT" CXX=false + LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" ./configure --prefix="$PREFIX" --disable-nls + --build=$(sh config.guess) --host=$TARGET_STAGE1 +build-commands: +- STAGE2_SYSROOT="$(dirname $(pwd))" make diff --git a/strata/build-essential/stage2-gcc-fixed-headers.morph b/strata/build-essential/stage2-gcc-fixed-headers.morph new file mode 100644 index 00000000..10794872 --- /dev/null +++ b/strata/build-essential/stage2-gcc-fixed-headers.morph @@ -0,0 +1,19 @@ +name: stage2-gcc-fixed-headers +kind: chunk +install-commands: +# Stage 1 GCC's fixincludes process created a limits.h before there was +# a real limits.h available for the target. This step (taken from Linux +# Linux From Scratch) creates a better one so that stage 2 GCC can compile. +# +# THIS IS A FRAGILE HACK! We need to replace the headers. The only way to +# overwrite files in a staging area is to install a new chunk. +# This is undesired behaviour in the long term, as we want to never +# have overlaps, so this functionality may go away. +- | + libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name)) + sysroot="$(dirname "$(pwd)")" + target_libgcc_dir="${libgcc_dir#$sysroot}" + mkdir -p "$DESTDIR/$target_libgcc_dir/include-fixed" + cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" \ + >"$DESTDIR/$target_libgcc_dir/include-fixed/limits.h" + diff --git a/strata/build-essential/stage2-gcc.morph b/strata/build-essential/stage2-gcc.morph new file mode 100644 index 00000000..bf6378c1 --- /dev/null +++ b/strata/build-essential/stage2-gcc.morph @@ -0,0 +1,68 @@ +name: stage2-gcc +kind: chunk + +configure-commands: +- mkdir o + +# In other projects we specify the sysroot location using CPPFLAGS. Here, +# that breaks because GCC compiles stuff for the *build* machine, too ... +# and this requires using the host's compiler, which cannot use the same +# set of CPPFLAGS as the target. If we specify the sysroot using CC instead +# then we don't interfere, because we are only specifying the *host* C +# compiler. +# +# Configure flag notes: +# 1. It's vital that this compiler targets the bootstrap machine +# (TARGET_STAGE1) so that the stage 1 GCC is used instead of the +# compiler of the build machine. +# 2. Disable searching /usr/local/include for headers +# 3. This flag causes the correct --sysroot flag to be passed when calling +# stage 1 GCC. +# 4. C++ is built in stage 3. +# 5. Standard flags. See gcc.morph. +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT" + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + cd o && ../configure \ + $(../morph-arch-config) \ + `# [1]` --build=$(sh ../config.guess) \ + --host=$TARGET_STAGE1 \ + --target=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + `# [2]` --with-local-prefix=$PREFIX \ + `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \ + --disable-bootstrap \ + --enable-clocale=gnu --enable-shared --enable-threads=posix \ + `# [4]` --enable-languages=c \ + `# [5]` --libdir=$PREFIX/lib \ + --disable-libgomp --disable-multilib --disable-nls \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" + +build-commands: +- | + export STAGE2_SYSROOT="$(dirname $(pwd))" + cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install + +# Stage 3 builds need to link against this file in the location that +# it will be in the final system, so we make a temporary link now. +# +# On x86_64 GCC resolutely installs its libraries into lib64. To fix this +# would require hobbling the MULTILIB_OSDIRNAMES field in +# gcc/config/i386/t-linux64 and this might break things, so for now we +# tolerate the inconsistency. +- | + if [ "$(echo $TARGET | cut -c -6)" = "x86_64" ]; then + libdir=lib64 + else + libdir=lib + fi + + install -d "$DESTDIR/lib" + ln -s "$PREFIX/$libdir/libgcc_s.so" "$DESTDIR/lib/" + ln -s "$PREFIX/$libdir/libgcc_s.so.1" "$DESTDIR/lib/" diff --git a/strata/build-essential/stage2-glibc.morph b/strata/build-essential/stage2-glibc.morph new file mode 100644 index 00000000..ffa0970b --- /dev/null +++ b/strata/build-essential/stage2-glibc.morph @@ -0,0 +1,57 @@ +name: stage2-glibc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Avoid installing to PREFIX/lib64 on x86_64. +# 2. Location of linux-api-headers. +# 3. Normal flags. See glibc.morph. +# 4. Force configuration values of certain things that can't be detected +# in a cross-compile. +- | + case "$MORPH_ARCH" in + armv7*) + ARCH_FLAGS="--without-fp" ;; + esac + + export CFLAGS="-O2 $CFLAGS"; export CXX=false; \ + cd o && ../configure \ + $ARCH_FLAGS \ + --build=$(../scripts/config.guess) --host=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + `# [1]` --libdir="$PREFIX/lib" \ + `# [2]` --with-headers="$(pwd)/../../$PREFIX/include" \ + `# [3]` --disable-profile --enable-kernel=2.6.25 \ + `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \ + libc_cv_forced_unwind=yes libc_cv_ssp=no + +build-commands: +- cd o && make localtime=UTC + +install-commands: +- cd o && make install_root="$DESTDIR" localtime=UTC install +- sh stage2-glibc-fix-specs + +# Install a symlink for the program interpreter (ld.so) so that binaries +# built in stage 3 before the stage 3 glibc is built can use it. +# FIXME: get a better way of finding the name of the loader. The lib64 +# path is hardcoded into glibc in the file +# sysdeps/unix/sysv/linux/configure. +- install -d $DESTDIR/lib +- | + cpu=$(echo $TARGET | cut -d '-' -f 1) + case "$cpu" in + x86_64) + install -d "$DESTDIR/lib64" + ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" \ + "$DESTDIR/lib64/ld-linux-x86-64.so.2" ;; + ppc64) + install -d "$DESTDIR/lib64" + ln -s "$PREFIX/lib/ld64.so.1" \ + "$DESTDIR/lib64/ld64.so.1" ;; + *) + loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*)) + ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader" + esac diff --git a/strata/build-essential/stage2-linux-api-headers.morph b/strata/build-essential/stage2-linux-api-headers.morph new file mode 100644 index 00000000..5cbf2f05 --- /dev/null +++ b/strata/build-essential/stage2-linux-api-headers.morph @@ -0,0 +1,8 @@ +name: stage2-linux-api-headers +kind: chunk +install-commands: +- | + export ARCH=$(./morph-arch) + make INSTALL_HDR_PATH=dest headers_install +- install -d "$DESTDIR${PREFIX-/usr}/include" +- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include" diff --git a/strata/build-essential/stage2-make.morph b/strata/build-essential/stage2-make.morph new file mode 100644 index 00000000..d3c8bf22 --- /dev/null +++ b/strata/build-essential/stage2-make.morph @@ -0,0 +1,9 @@ +name: stage2-make +kind: chunk +build-system: autotools +configure-commands: +- STAGE2_SYSROOT="$(dirname $(pwd))" CPPFLAGS="--sysroot=$STAGE2_SYSROOT" CXX=false + LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" ./configure --prefix="$PREFIX" --disable-nls + --build=$(sh config/config.guess) --host=$TARGET_STAGE1 +build-commands: +- STAGE2_SYSROOT="$(dirname $(pwd))" make diff --git a/strata/build-essential/stage2-reset-specs.morph b/strata/build-essential/stage2-reset-specs.morph new file mode 100644 index 00000000..8892f67c --- /dev/null +++ b/strata/build-essential/stage2-reset-specs.morph @@ -0,0 +1,21 @@ +name: stage2-reset-specs +kind: chunk + +# Nasty hack to get around being unable to reliably add configuration to gcc, +# hence the gcc specs are modified, combined with Baserock's rootfs protection +# preventing specs being modified before builds. +# The limitation is overcome by installing files as part of a chunk, which +# overwrites previous files. +# New specs were added for the bootstrap builds, but after stage2 we start +# having chrooted builds, so the old specs need to be replaced. +# Unfortunately we can't just replace the specs with the ones gcc produces, +# since gcc behaves differently without specs to with specs it produces! +# So we use a **NASTY HACK** to replace the specs symlink with one that +# points to a file that doesn't exist. +install-commands: +- | + STAGE2_SYSROOT="$(dirname "$(pwd)")" + specs_dir="$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))" + target_specs_dir="$DESTDIR/${specs_dir#$STAGE2_SYSROOT}" + mkdir -p "$target_specs_dir" + ln -s "temporary specs removed by baserock bootstrap" "$target_specs_dir/specs" diff --git a/strata/build-essential/zlib.morph b/strata/build-essential/zlib.morph new file mode 100644 index 00000000..a69eebf3 --- /dev/null +++ b/strata/build-essential/zlib.morph @@ -0,0 +1,9 @@ +name: zlib +kind: chunk +max-jobs: 1 +configure-commands: +- ./configure --prefix="$PREFIX" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/c2man/c2man.morph b/strata/c2man/c2man.morph new file mode 100644 index 00000000..93390d2d --- /dev/null +++ b/strata/c2man/c2man.morph @@ -0,0 +1,11 @@ +name: c2man +kind: chunk +configure-commands: +- ./Configure -d -e +build-commands: +- make LEX=flex +install-commands: +- mkdir -p $DESTDIR$PREFIX/bin +- mkdir -p $DESTDIR$PREFIX/lib +- mkdir -p $DESTDIR$PREFIX/man +- make install bin=$DESTDIR$PREFIX/bin privlib=$DESTDIR$PREFIX/lib/c2man mansrc=$DESTDIR$PREFIX/man diff --git a/strata/ceph-service.morph b/strata/ceph-service.morph new file mode 100644 index 00000000..25d6712d --- /dev/null +++ b/strata/ceph-service.morph @@ -0,0 +1,65 @@ +name: ceph-service +kind: stratum +build-depends: +- morph: strata/foundation.morph +- morph: strata/network-security.morph +chunks: +- name: libaio + morph: strata/ceph-service/libaio.morph + repo: upstream:libaio + ref: 262e589ea4ac3d1ff809648c8f2caa3836e69b25 + unpetrify-ref: baserock/morph + build-depends: [] +- name: keyutils + morph: strata/ceph-service/keyutils.morph + repo: upstream:keyutils + ref: 116417bce1e1df06a918de5e9e63f6ba88e2f4f5 + unpetrify-ref: baserock/morph + build-depends: [] +- name: libunwind + repo: upstream:libunwind + ref: 4b8404d153c58b95cb4420fc7603fdae62489a31 + unpetrify-ref: v0.99 + build-depends: [] +- name: gperftools + repo: upstream:gperftools + ref: 2a2d6596f8c3d62b7ec444761f4edf0c85d10d92 + unpetrify-ref: baserock/morph + build-depends: + - libunwind +- name: snappy + repo: upstream:snappy + ref: 760c6ffc67836027c5f1d307e5c6cb012dfbdf72 + unpetrify-ref: baserock/morph + build-depends: [] +- name: leveldb + morph: strata/ceph-service/leveldb.morph + repo: upstream:leveldb + ref: 0f0ed46e70967365c851243663689e156fe1b7b5 + unpetrify-ref: baserock/morph + build-depends: + - snappy + - gperftools +- name: libeditline + repo: upstream:libeditline-tarball + ref: 7503ff5f8610734521f40e276b59b3b6291830e7 + unpetrify-ref: baserock/morph + build-depends: [] +- name: boost + morph: strata/ceph-service/boost.morph + repo: upstream:boost-tarball + ref: 026fc3d84a27e84a61d0f4c26f011a68271a0d6e + unpetrify-ref: baserock/markdoffman/morph + build-depends: [] +- name: ceph + morph: strata/ceph-service/ceph.morph + repo: upstream:ceph + ref: 8fdf1df512b73bad0eb695cdf9cbf2d09f0327d4 + unpetrify-ref: baserock/morph + build-depends: + - libaio + - gperftools + - leveldb + - libeditline + - keyutils + - boost diff --git a/strata/ceph-service/boost.morph b/strata/ceph-service/boost.morph new file mode 100644 index 00000000..7c3e6cff --- /dev/null +++ b/strata/ceph-service/boost.morph @@ -0,0 +1,8 @@ +name: boost +kind: chunk +configure-commands: +- ./bootstrap.sh +build-commands: +- ./b2 || true +install-commands: +- ./b2 install --prefix=$DESTDIR$PREFIX || true diff --git a/strata/ceph-service/ceph.morph b/strata/ceph-service/ceph.morph new file mode 100644 index 00000000..5ad0d812 --- /dev/null +++ b/strata/ceph-service/ceph.morph @@ -0,0 +1,18 @@ +name: ceph +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --with-nss --prefix="$PREFIX" --sysconfdir=/etc --without-fuse --without-libatomic-ops +install-commands: +- make install +- install -D -m 755 src/init-ceph $DESTDIR/etc/init.d/ceph +- install -d $DESTDIR/etc/ceph +- install -D -d $DESTDIR/var/lib/ceph +- install -d $DESTDIR/var/lib/ceph/mon +- install -d $DESTDIR/var/lib/ceph/osd +- install -d $DESTDIR/var/lib/ceph/mds +- install -d $DESTDIR/var/lib/ceph/tmp +- install -d $DESTDIR/var/lib/ceph/bootstrap-mds +- install -d $DESTDIR/var/lib/ceph/bootstrap-osd +- install -D -d $DESTDIR/var/log/ceph diff --git a/strata/ceph-service/keyutils.morph b/strata/ceph-service/keyutils.morph new file mode 100644 index 00000000..4d47e265 --- /dev/null +++ b/strata/ceph-service/keyutils.morph @@ -0,0 +1,7 @@ +name: keyutils +kind: chunk +build-commands: +- make clean +- make +install-commands: +- make DESTDIR="$DESTDIR" LIBDIR="$PREFIX/lib" USRLIBDIR="$PREFIX/lib" install diff --git a/strata/ceph-service/leveldb.morph b/strata/ceph-service/leveldb.morph new file mode 100644 index 00000000..1385897c --- /dev/null +++ b/strata/ceph-service/leveldb.morph @@ -0,0 +1,6 @@ +name: leveldb +kind: chunk +build-commands: +- make +install-commands: +- ./install.sh diff --git a/strata/ceph-service/libaio.morph b/strata/ceph-service/libaio.morph new file mode 100644 index 00000000..62c24d37 --- /dev/null +++ b/strata/ceph-service/libaio.morph @@ -0,0 +1,7 @@ +name: libaio +kind: chunk +build-commands: +- make clean +- make +install-commands: +- make prefix="$DESTDIR$PREFIX" install diff --git a/strata/cloudinit-support.morph b/strata/cloudinit-support.morph new file mode 100644 index 00000000..399df685 --- /dev/null +++ b/strata/cloudinit-support.morph @@ -0,0 +1,57 @@ +name: cloudinit-support +kind: stratum +description: A stratum with cloudinit to fit a system in the OpenStack cloud. +build-depends: +- morph: strata/build-essential.morph +- morph: strata/core.morph +- morph: strata/foundation.morph +chunks: +- name: configobj + repo: upstream:configobj + ref: 935a78736e4eb43b9fafae87f5e9902328673f63 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-requests + repo: upstream:python-requests + ref: b891877ee6d76b0a3f8cbf2e7cd34cc4cbc40b6b + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-prettytable + morph: strata/cloudinit-support/python-prettytable.morph + repo: upstream:python-prettytable + ref: 941133673e5a0003cd5ce1b6db2a51cf3307d9c1 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-json-patch + repo: upstream:python-json-patch + ref: 27c7032de25923593fa17cc14f535fb7abd52448 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-json-pointer + repo: upstream:python-json-pointer + ref: 48dce313141ba5bf0d2f3dd2e590042c05755e53 + unpetrify-ref: baserock/morph + build-depends: + - python-json-patch +- name: python-cheetah + repo: upstream:python-cheetah + ref: 831aa6b99d9b4fb012ee644d8e80e0bc0eb6d6ed + unpetrify-ref: baserock/morph + build-depends: [] +- name: boto + repo: upstream:boto + ref: bd49c22b5a30bf58096d58efc4762f1fea3e2caf + unpetrify-ref: baserock/morph + build-depends: [] +- name: cloud-init + morph: strata/cloudinit-support/cloud-init.morph + repo: upstream:cloud-init + ref: 130d51acc5b0becd64e7007f9dfe41a6e022eaec + unpetrify-ref: baserock/morph + build-depends: + - boto + - configobj + - python-requests + - python-prettytable + - python-json-pointer + - python-cheetah diff --git a/strata/cloudinit-support/cloud-init.morph b/strata/cloudinit-support/cloud-init.morph new file mode 100644 index 00000000..5933dbf8 --- /dev/null +++ b/strata/cloudinit-support/cloud-init.morph @@ -0,0 +1,6 @@ +name: cloud-init +kind: chunk +build-system: python-distutils +post-install-commands: +- mkdir -p "$DESTDIR"/lib/systemd/system +- cp systemd/* "$DESTDIR"/lib/systemd/system/ diff --git a/strata/cloudinit-support/python-prettytable.morph b/strata/cloudinit-support/python-prettytable.morph new file mode 100644 index 00000000..cf1ac6e1 --- /dev/null +++ b/strata/cloudinit-support/python-prettytable.morph @@ -0,0 +1,6 @@ +name: python-prettytable +kind: chunk +build-commands: +- cd src && python setup.py build +install-commands: +- cd src && python setup.py install --prefix "$PREFIX" --root "$DESTDIR" diff --git a/strata/connectivity.morph b/strata/connectivity.morph new file mode 100644 index 00000000..2cc6bb69 --- /dev/null +++ b/strata/connectivity.morph @@ -0,0 +1,22 @@ +name: connectivity +kind: stratum +build-depends: +- morph: strata/foundation.morph +chunks: +- name: libnl + repo: upstream:libnl + ref: a2c4bd8f094a7247903578860a9c42049991860b + unpetrify-ref: baserock/morph + build-depends: [] +- name: wpa_supplicant + morph: strata/connectivity/wpa_supplicant.morph + repo: upstream:hostap + ref: c4a58c968044c2002706b1a69c089c4d63728e77 + unpetrify-ref: baserock/hostap_2_3 + build-depends: + - libnl +- name: iptables + repo: upstream:iptables + ref: 482c6d3731e2681cb4baae835c294840300197e6 + unpetrify-ref: v1.4.21 + build-depends: [] diff --git a/strata/connectivity/wpa_supplicant.morph b/strata/connectivity/wpa_supplicant.morph new file mode 100644 index 00000000..86a51608 --- /dev/null +++ b/strata/connectivity/wpa_supplicant.morph @@ -0,0 +1,8 @@ +name: wpa_supplicant +kind: chunk +configure-commands: +- sed -i 's/^CONFIG_READLINE=y$//' wpa_supplicant/.config +build-commands: +- make -C wpa_supplicant +install-commands: +- make -C wpa_supplicant DESTDIR="$DESTDIR" install diff --git a/strata/connman-common.morph b/strata/connman-common.morph new file mode 100644 index 00000000..f6f7ddb0 --- /dev/null +++ b/strata/connman-common.morph @@ -0,0 +1,11 @@ +name: connman-common +kind: stratum +build-depends: +- morph: strata/connectivity.morph +chunks: +- name: connman + morph: strata/connman-common/connman.morph + repo: upstream:connman + ref: 9951ba7a0353cfc884e96833c64e58c1bcae3f44 + unpetrify-ref: baserock/1.24 + build-depends: [] diff --git a/strata/connman-common/connman.morph b/strata/connman-common/connman.morph new file mode 100644 index 00000000..e468bc49 --- /dev/null +++ b/strata/connman-common/connman.morph @@ -0,0 +1,6 @@ +name: connman +kind: chunk +build-system: autotools +configure-commands: +- ./bootstrap +- ./configure --prefix="$PREFIX" --disable-wispr --disable-client LIBS=-lncurses diff --git a/strata/core.morph b/strata/core.morph new file mode 100644 index 00000000..a1fc9a10 --- /dev/null +++ b/strata/core.morph @@ -0,0 +1,305 @@ +name: core +kind: stratum +description: Core components of a Baserock base system that are build tools required + for the BSP and Foundation strata, but a step above build-essential +build-depends: +- morph: strata/build-essential.morph +chunks: +- name: sqlite3 + repo: upstream:sqlite3 + ref: f6c2a9fe49d20654c2c41844d056033692a223b7 + unpetrify-ref: baserock/morph + build-depends: [] +- name: cmake + morph: strata/core/cmake.morph + repo: upstream:cmake + ref: 0b3781e4c497566acaa504d4106d11c02a642501 + unpetrify-ref: v2.8.12.2 + build-depends: [] +- name: gdbm + morph: strata/core/gdbm.morph + repo: upstream:gdbm + ref: 51871d08a48ff781186f7a7b22ec69a1db38eb4c + unpetrify-ref: baserock/build-essential + build-depends: [] +- name: gettext + morph: strata/core/gettext.morph + repo: upstream:gettext + ref: 3898e324f07c05404b63d71f0e519f352fb1e072 + unpetrify-ref: baserock/build-essential + build-depends: [] +- name: m4 + morph: strata/core/m4.morph + repo: upstream:m4 + ref: cfbd353f3a2dc517992bcdc747281a22feb0c4db + unpetrify-ref: baserock/build-essential + build-depends: [] +- name: mini-utils + morph: strata/core/mini-utils.morph + repo: baserock:baserock/mini-utils + ref: 5293265b29bbf468ab9d7f3302b19dbc81d0f8b8 + unpetrify-ref: master + build-depends: [] +- name: ncurses + morph: strata/core/ncurses.morph + repo: upstream:ncurses + ref: 0fe89dc66ec061b839bea3ab451207e2dee757b9 + unpetrify-ref: baserock/morph + build-depends: [] +- name: perl + morph: strata/core/perl.morph + repo: upstream:perl + ref: 78f9a3c880f11578fb9ff9c7d5f7e34b602d2ad1 + unpetrify-ref: baserock/morph + build-depends: + - gdbm +- name: pkg-config + morph: strata/core/pkg-config.morph + repo: upstream:pkg-config + ref: 67a702a15cf88e270539484929ffa1f42b90c728 + unpetrify-ref: baserock/build-essential + build-depends: [] +- name: texinfo-tarball + morph: strata/core/texinfo-tarball.morph + repo: upstream:texinfo-tarball + ref: 4843a7f5ff14ac802a56f1cdd49960b25c15702b + unpetrify-ref: baserock/morph + build-depends: + - ncurses +- name: autoconf + morph: strata/core/autoconf.morph + repo: upstream:autoconf + ref: cffdb90be331111ce3fbe4a32320181ec2b92652 + unpetrify-ref: baserock/build-essential + build-depends: + - m4 + - perl +- name: automake + morph: strata/core/automake.morph + repo: upstream:automake + ref: ba4b42faff673e3e5265416dff09e59affc688fb + unpetrify-ref: v1.14.1 + build-depends: + - autoconf + - perl + - texinfo-tarball +- name: bash + morph: strata/core/bash.morph + repo: upstream:bash + ref: 3590145af6f1c9fa321dff231f69ae696e7e740b + unpetrify-ref: baserock/bash-4.3-patch-27 + build-depends: [] +- name: flex + morph: strata/core/flex.morph + repo: upstream:flex + ref: de10f98e8a2dc2a021796811490d0f30c3cd90bf + unpetrify-ref: baserock/build-essential + build-depends: + - m4 +- name: openssl-new + morph: strata/core/openssl-new.morph + repo: upstream:openssl-new + ref: 872e681c00a713e840ebed77a4e05fa0e181f16f + unpetrify-ref: OpenSSL_1_0_1j + build-depends: + - perl +- name: bzip2 + morph: strata/core/bzip2.morph + repo: upstream:bzip2 + ref: 8deafa68e52b230018c0318dc7959ff9af3ad2a5 + unpetrify-ref: baserock/morph + build-depends: [] +- name: readline + repo: upstream:readline + ref: 518937ab89be812ccd45e9b8c1ce4ad721d35ef6 + unpetrify-ref: baserock/genivi/baseline + build-depends: [] +- name: cpython + morph: strata/core/cpython.morph + repo: upstream:cpython + ref: 0b92c75574adef1e1ccf1b635a3724a86b567cd2 + unpetrify-ref: v2.7.8 + build-depends: + - openssl-new + - bzip2 + - sqlite3 + - ncurses + - readline +- name: libtool + morph: strata/core/libtool.morph + repo: upstream:libtool + ref: d388b7f2dc628b22006025d01179bc09b8aabe81 + unpetrify-ref: baserock/build-essential + build-depends: + - bash +- name: gtk-doc-stub + repo: upstream:gtk-doc-stub + ref: 58ec0d8593541ef7ae522ce42ebec6f98536c4e0 + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake + - libtool +- name: xz + morph: strata/core/xz.morph + repo: upstream:xz + ref: 581deedf9d1eadcd84c4fcd23b9fdfe2dde18cc2 + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake + - gettext + - libtool +- name: libxml2 + repo: upstream:libxml2 + ref: ee8f1d4cda8dc1a6f2c515fe234f7bc89cdc9f80 + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake + - cpython + - libtool + - xz +- name: ca-certificates + morph: strata/core/ca-certificates.morph + repo: upstream:ca-certificates + ref: e9b06b26d9e57444e74a5cb6beca3f12726fc3c6 + unpetrify-ref: baserock/debian/20140325 + build-depends: + - automake + - cpython +- name: curl + morph: strata/core/curl.morph + repo: upstream:curl + ref: 202aa9f7758636730299b86715d924f54468a908 + unpetrify-ref: curl-7_38_0 + build-depends: + - autoconf + - automake + - libtool + - openssl-new + - ca-certificates +- name: libexpat + morph: strata/core/libexpat.morph + repo: upstream:libexpat + ref: 97678ab13f6d29878997256b6ae1ded679ae5c5c + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake + - libtool +- name: XML-Parser + repo: upstream:XML-Parser + ref: e1a3ec157140a699e3020836475a0df622f70f1b + unpetrify-ref: baserock/morph + build-depends: + - libexpat + - libxml2 + - perl +- name: git + morph: strata/core/git.morph + repo: upstream:git + ref: 49c3e926349e964b311b46251bb2b97d3d669855 + unpetrify-ref: v2.1.3 + build-depends: + - autoconf + - cpython + - curl + - gettext + - libexpat + - openssl-new +- name: help2man + morph: strata/core/help2man.morph + repo: upstream:help2man + ref: 0191a5f61525f8deea2ae8bdfea88190d85b6a71 + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake +- name: bison + morph: strata/core/bison.morph + repo: upstream:bison + ref: 2ab6d1daaccf32fc4314e4b2fe44da977f11a308 + unpetrify-ref: baserock/v3.0.2 + build-depends: + - autoconf + - automake + - bash + - flex + - gettext + - git + - help2man + - mini-utils +- name: gperf + morph: strata/core/gperf.morph + repo: upstream:gperf + ref: 5094e4a539adf845111013f82c2c4fcaec637983 + unpetrify-ref: baserock/morph + build-depends: [] +- name: intltool + repo: upstream:intltool + ref: 12f04c88be9ff8a578d8fd6990ee2448c66dc5f4 + unpetrify-ref: baserock/morph + build-depends: + - XML-Parser + - autoconf + - automake + - perl +- name: util-linux + morph: strata/core/util-linux.morph + repo: upstream:util-linux + ref: c5c1033c5c7deda8abe3448ec81bbb33c72219e0 + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake + - gettext + - git + - libtool + - pkg-config +- name: nano + repo: upstream:nano-tarball + ref: 8b74abeb02c01ddc768c465a826360cf33cec063 + unpetrify-ref: baserock/morph + build-depends: + - ncurses +- name: bc + repo: upstream:bc-tarball + ref: 0956d119432ff6a2e85bae1fa336df799cad70b0 + unpetrify-ref: baserock/morph + build-depends: + - flex + - texinfo-tarball +- name: python-setuptools + morph: strata/core/python-setuptools.morph + repo: upstream:python-setuptools-bitbucket + ref: 0aa6a4de5931d02876428388678802db2371fd37 + unpetrify-ref: baserock/master + build-depends: + - cpython +- name: pyyaml + morph: strata/core/pyyaml.morph + repo: upstream:pyyaml + ref: d9fbcceaed39d955f6871b07c61dc42f824285c1 + unpetrify-ref: baserock/morph + build-depends: + - python-setuptools +- name: shadow + morph: strata/core/shadow.morph + repo: upstream:shadow + ref: 4f5000a45963c2cc2a403ad23e459f20296b29c2 + unpetrify-ref: baserock/4.2 + build-depends: + - autoconf + - automake + - gettext + - libtool + - bison +- name: patch + morph: strata/core/patch.morph + repo: upstream:patch + ref: 3bbb26c928a147cfcf0756f1cc0a1307e5cc663f + unpetrify-ref: baserock/v2.7.1 + build-depends: + - bash + - shadow diff --git a/strata/core/autoconf.morph b/strata/core/autoconf.morph new file mode 100644 index 00000000..046bfc40 --- /dev/null +++ b/strata/core/autoconf.morph @@ -0,0 +1,5 @@ +name: autoconf +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" diff --git a/strata/core/automake.morph b/strata/core/automake.morph new file mode 100644 index 00000000..282535d6 --- /dev/null +++ b/strata/core/automake.morph @@ -0,0 +1,8 @@ +name: automake +kind: chunk +build-system: autotools +configure-commands: +- ./bootstrap.sh +- ./configure --prefix="$PREFIX" +build-commands: +- unset DESTDIR; make diff --git a/strata/core/bash.morph b/strata/core/bash.morph new file mode 100644 index 00000000..9639593b --- /dev/null +++ b/strata/core/bash.morph @@ -0,0 +1,8 @@ +name: bash +kind: chunk +configure-commands: +- ./configure --prefix=/usr --bindir=/bin --without-bash-malloc --with-installed-readline +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/bison.morph b/strata/core/bison.morph new file mode 100644 index 00000000..a9497d4e --- /dev/null +++ b/strata/core/bison.morph @@ -0,0 +1,10 @@ +name: bison +kind: chunk +configure-commands: +- echo $(grep '* Noteworthy changes in release' NEWS | grep -v '?\\.?' | head -n1 | cut -d' ' -f6) > .tarball-version +- bash bootstrap --skip-po +- ./configure --prefix=/usr --disable-nls +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/bzip2.morph b/strata/core/bzip2.morph new file mode 100644 index 00000000..f4bdb794 --- /dev/null +++ b/strata/core/bzip2.morph @@ -0,0 +1,10 @@ +name: bzip2 +kind: chunk +configure-commands: +- sed -i -rf bzip2.morph-makefix.sed Makefile +build-commands: +- make -f Makefile-libbz2_so +- make +install-commands: +- make DESTDIR="$DESTDIR" PREFIX="$PREFIX" install +- install libbz2.so* "$DESTDIR$PREFIX/lib" diff --git a/strata/core/ca-certificates.morph b/strata/core/ca-certificates.morph new file mode 100644 index 00000000..3072e4f3 --- /dev/null +++ b/strata/core/ca-certificates.morph @@ -0,0 +1,18 @@ +name: ca-certificates +kind: chunk +build-system: autotools +configure-commands: [] +pre-install-commands: +- mkdir -p "$DESTDIR"/usr/share/ca-certificates +- mkdir -p "$DESTDIR"/usr/sbin +post-install-commands: +- mkdir "$DESTDIR"/etc +- | + cd "$DESTDIR"/usr/share/ca-certificates + find * -type f > "$DESTDIR"/etc/ca-certificates.conf +- | + export CERTSCONF="$DESTDIR/etc/ca-certificates.conf" + export CERTSDIR="$DESTDIR/usr/share/ca-certificates" + export ETCCERTSDIR="$DESTDIR/etc/ssl/certs" + mkdir -p "$ETCCERTSDIR" + ./sbin/update-ca-certificates diff --git a/strata/core/cmake.morph b/strata/core/cmake.morph new file mode 100644 index 00000000..1d310ef4 --- /dev/null +++ b/strata/core/cmake.morph @@ -0,0 +1,8 @@ +name: cmake +kind: chunk +configure-commands: +- ./bootstrap --prefix="$PREFIX" --docdir=/share/doc/cmake --mandir=/share/man +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/cpython.morph b/strata/core/cpython.morph new file mode 100644 index 00000000..6c9e4b3d --- /dev/null +++ b/strata/core/cpython.morph @@ -0,0 +1,7 @@ +name: cpython +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --enable-shared +post-install-commands: +- test -x "$DESTDIR"/"$PREFIX"/bin/python2 || ln -s python2.7 "$DESTDIR"/"$PREFIX"/bin/python2 diff --git a/strata/core/curl.morph b/strata/core/curl.morph new file mode 100644 index 00000000..e245688c --- /dev/null +++ b/strata/core/curl.morph @@ -0,0 +1,9 @@ +name: curl +kind: chunk +configure-commands: +- ./buildconf +- ./configure --disable-manual --prefix="$PREFIX" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/flex.morph b/strata/core/flex.morph new file mode 100644 index 00000000..7ca8f538 --- /dev/null +++ b/strata/core/flex.morph @@ -0,0 +1,12 @@ +name: flex +kind: chunk +configure-commands: +- ./configure --prefix="$PREFIX" +build-commands: +- make dist_doc_DATA= +install-commands: +- make dist_doc_DATA= DESTDIR="$DESTDIR" install +- ln -s libfl.a "$DESTDIR$PREFIX/lib/libl.a" +- echo "#!$PREFIX/bin/sh" >"$DESTDIR$PREFIX/bin/lex" +- echo 'exec '"$PREFIX"'/bin/flex -l "$@"' >>"$DESTDIR$PREFIX/bin/lex" +- chmod 755 "$DESTDIR$PREFIX/bin/lex" diff --git a/strata/core/gdbm.morph b/strata/core/gdbm.morph new file mode 100644 index 00000000..6bec33e0 --- /dev/null +++ b/strata/core/gdbm.morph @@ -0,0 +1,8 @@ +name: gdbm +kind: chunk +configure-commands: +- ./configure --prefix="$PREFIX" --enable-libgdbm-compat --disable-nls +build-commands: +- make MANS= INFO_DEPS= +install-commands: +- make MANS= INFO_DEPS= DESTDIR="$DESTDIR" install diff --git a/strata/core/gettext.morph b/strata/core/gettext.morph new file mode 100644 index 00000000..3e2c56b5 --- /dev/null +++ b/strata/core/gettext.morph @@ -0,0 +1,9 @@ +name: gettext +kind: chunk +max-jobs: 1 +configure-commands: +- ./configure --prefix=/usr +build-commands: +- make EXAMPLESPOFILES= +install-commands: +- make EXAMPLESPOFILES= DESTDIR="$DESTDIR" install diff --git a/strata/core/git.morph b/strata/core/git.morph new file mode 100644 index 00000000..765f4a5c --- /dev/null +++ b/strata/core/git.morph @@ -0,0 +1,7 @@ +name: git +kind: chunk +build-system: autotools +pre-configure-commands: +- make configure +build-commands: +- make all diff --git a/strata/core/gperf.morph b/strata/core/gperf.morph new file mode 100644 index 00000000..e4f598c5 --- /dev/null +++ b/strata/core/gperf.morph @@ -0,0 +1,3 @@ +name: gperf +kind: chunk +build-system: autotools diff --git a/strata/core/help2man.morph b/strata/core/help2man.morph new file mode 100644 index 00000000..e25a8d8e --- /dev/null +++ b/strata/core/help2man.morph @@ -0,0 +1,9 @@ +name: help2man +kind: chunk +configure-commands: +- autoreconf -i +- ./configure --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/libexpat.morph b/strata/core/libexpat.morph new file mode 100644 index 00000000..1e0fe696 --- /dev/null +++ b/strata/core/libexpat.morph @@ -0,0 +1,9 @@ +name: libexpat +kind: chunk +configure-commands: +- autoreconf -i +- ./configure --prefix="${PREFIX-/usr}" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/libtool.morph b/strata/core/libtool.morph new file mode 100644 index 00000000..f311281d --- /dev/null +++ b/strata/core/libtool.morph @@ -0,0 +1,6 @@ +name: libtool +kind: chunk +max-jobs: 1 +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" diff --git a/strata/core/m4.morph b/strata/core/m4.morph new file mode 100644 index 00000000..b76afbe4 --- /dev/null +++ b/strata/core/m4.morph @@ -0,0 +1,5 @@ +name: m4 +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --disable-nls diff --git a/strata/core/mini-utils.morph b/strata/core/mini-utils.morph new file mode 100644 index 00000000..dc915b30 --- /dev/null +++ b/strata/core/mini-utils.morph @@ -0,0 +1,6 @@ +name: mini-utils +kind: chunk +build-system: autotools +configure-commands: [] +install-commands: +- make PREFIX="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/core/ncurses.morph b/strata/core/ncurses.morph new file mode 100644 index 00000000..c75495bc --- /dev/null +++ b/strata/core/ncurses.morph @@ -0,0 +1,9 @@ +name: ncurses +kind: chunk +configure-commands: +- LDCONFIG=true ./configure --with-shared --without-debug --enable-widec +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install +- sh ncurses-morph-postinstall.sh diff --git a/strata/core/openssl-new.morph b/strata/core/openssl-new.morph new file mode 100644 index 00000000..2ed14ff2 --- /dev/null +++ b/strata/core/openssl-new.morph @@ -0,0 +1,15 @@ +name: openssl-new +kind: chunk +max-jobs: 1 +configure-commands: +- sed -i -e 's,^LIBNAMES=\\(.*\\) padlock \\(.*\\),LIBNAMES=\\1 \\2,g' engines/Makefile +- | + if [ "$(uname -m)" = "ppc64" ]; then + sh ./Configure linux-ppc64 --openssldir=/etc/ssl --prefix="${PREFIX-/usr}" --libdir=lib shared + else + ./config --openssldir=/etc/ssl --prefix="${PREFIX-/usr}" --libdir=lib shared + fi +build-commands: +- make +install-commands: +- make INSTALL_PREFIX="$DESTDIR" install_sw diff --git a/strata/core/patch.morph b/strata/core/patch.morph new file mode 100644 index 00000000..01d977c4 --- /dev/null +++ b/strata/core/patch.morph @@ -0,0 +1,9 @@ +name: patch +kind: chunk +configure-commands: +- bash bootstrap --skip-po +- ./configure --prefix="$PREFIX" --disable-nls +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/perl.morph b/strata/core/perl.morph new file mode 100644 index 00000000..ce086aa7 --- /dev/null +++ b/strata/core/perl.morph @@ -0,0 +1,16 @@ +name: perl +kind: chunk +max-jobs: 1 +configure-commands: +- sh Configure -des -Dprefix="$PREFIX" -Darchlib="$PREFIX/lib/perl" -Dprivlib="$PREFIX/share/perl" + -Dbin="$PREFIX/bin" -Dscriptdir="$PREFIX/bin" -Dman1dir="$PREFIX/share/man/man1" + -Dman3dir="$PREFIX/share/man/man3" -Dsiteprefix="$PREFIX" -Dsitearch="$PREFIX/lib/perl" + -Dsitelib="$PREFIX/share/perl" -Dsitebin="$PREFIX/bin" -Dsitescript="$PREFIX/bin" + -Dsiteman1dir="$PREFIX/share/man/man1" -Dsiteman3dir="$PREFIX/share/man/man3" -Dvendorprefix="$PREFIX" + -Dvendorarch="$PREFIX/lib/perl" -Dvendorlib="$PREFIX/share/perl" -Dvendorbin="$PREFIX/bin" + -Dvendorscript="$PREFIX/bin" -Dvendorman1dir="$PREFIX/share/man/man1" -Dvendorman3dir="$PREFIX/share/man/man3" + -Dpager="$PREFIX/bin/less -isR" -Duseshrplib +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/core/pkg-config.morph b/strata/core/pkg-config.morph new file mode 100644 index 00000000..090a65e5 --- /dev/null +++ b/strata/core/pkg-config.morph @@ -0,0 +1,5 @@ +name: pkg-config +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --with-internal-glib diff --git a/strata/core/python-setuptools.morph b/strata/core/python-setuptools.morph new file mode 100644 index 00000000..fa436c60 --- /dev/null +++ b/strata/core/python-setuptools.morph @@ -0,0 +1,6 @@ +name: python-setuptools +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/core/pyyaml.morph b/strata/core/pyyaml.morph new file mode 100644 index 00000000..8ebd7b57 --- /dev/null +++ b/strata/core/pyyaml.morph @@ -0,0 +1,6 @@ +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/core/shadow.morph b/strata/core/shadow.morph new file mode 100644 index 00000000..6887a6b3 --- /dev/null +++ b/strata/core/shadow.morph @@ -0,0 +1,5 @@ +name: shadow +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --with-selinux=no --sysconfdir=/etc diff --git a/strata/core/texinfo-tarball.morph b/strata/core/texinfo-tarball.morph new file mode 100644 index 00000000..5f784ba2 --- /dev/null +++ b/strata/core/texinfo-tarball.morph @@ -0,0 +1,9 @@ +name: texinfo-tarball +kind: chunk +configure-commands: +- ./configure --prefix="$PREFIX" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install +- make DESTDIR="$DESTDIR" TEXMF="$PREFIX/share/texmf" install-tex diff --git a/strata/core/util-linux.morph b/strata/core/util-linux.morph new file mode 100644 index 00000000..22f19529 --- /dev/null +++ b/strata/core/util-linux.morph @@ -0,0 +1,6 @@ +name: util-linux +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-use-tty-group diff --git a/strata/core/xz.morph b/strata/core/xz.morph new file mode 100644 index 00000000..8165abdc --- /dev/null +++ b/strata/core/xz.morph @@ -0,0 +1,3 @@ +name: xz +kind: chunk +build-system: autotools diff --git a/strata/coreutils-common.morph b/strata/coreutils-common.morph new file mode 100644 index 00000000..9c5c38fe --- /dev/null +++ b/strata/coreutils-common.morph @@ -0,0 +1,15 @@ +name: coreutils-common +kind: stratum +description: | + We need to split this so we can build stuff using coreutils but we can not + having it in the final systems (for example in genivi ones that do not + accept GPLv3 code) +build-depends: +- morph: strata/core.morph +chunks: +- name: coreutils + morph: strata/coreutils-common/coreutils.morph + repo: upstream:coreutils + ref: 9df9643842e4b4d8ece710fe6105f32fa38a0d22 + unpetrify-ref: baserock/8.23 + build-depends: [] diff --git a/strata/coreutils-common/coreutils.morph b/strata/coreutils-common/coreutils.morph new file mode 100644 index 00000000..479e9925 --- /dev/null +++ b/strata/coreutils-common/coreutils.morph @@ -0,0 +1,9 @@ +name: coreutils +kind: chunk +build-system: autotools +configure-commands: +- sed -i -e '/^buildreq="/,/^"/{/rsync/d}' bootstrap.conf +- bash bootstrap --skip-po +- FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix="$PREFIX" --disable-nls +install-commands: +- make INSTALL_PROGRAM=install DESTDIR="$DESTDIR" install diff --git a/strata/cross-bootstrap.morph b/strata/cross-bootstrap.morph new file mode 100644 index 00000000..9687ac7e --- /dev/null +++ b/strata/cross-bootstrap.morph @@ -0,0 +1,89 @@ +name: cross-bootstrap +kind: stratum +description: The minimal development tools to build a baserock devel system +build-depends: +- morph: strata/core.morph +chunks: +- name: six + repo: upstream:six + ref: e66d45c46afc42eb89d7d2515b79f0ededa0e0fa + unpetrify-ref: baserock/morph + build-depends: [] +- name: groff + morph: strata/cross-bootstrap/groff.morph + repo: upstream:groff + ref: c7017a099f954bb6de60e79c876935b1bf438b9a + unpetrify-ref: baserock/morph + build-depends: [] +- name: openssh + morph: strata/cross-bootstrap/openssh.morph + repo: upstream:openssh + ref: 233514106dcde5ac61a70f1043de563122e2f1c9 + unpetrify-ref: baserock/morph + build-depends: + - groff +- name: python-ttystatus + morph: strata/cross-bootstrap/python-ttystatus.morph + repo: upstream:python-ttystatus + ref: 47d871216cea6ce3b9d6efd70e9a0f38ab8604f0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-coveragepy + morph: strata/cross-bootstrap/python-coveragepy.morph + repo: upstream:python-coveragepy + ref: 77d2e3bfd8fb325092aaed37ba1378054d182d19 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-coverage-test-runner + repo: upstream:python-coverage-test-runner + ref: 8ea9421ac3384b2e88e0c36f2cfa52586c4798b7 + unpetrify-ref: baserock/morph + build-depends: + - python-coveragepy +- name: cliapp + repo: upstream:cliapp + ref: cec20cedd062a3aef1b04f997e77b45090c07806 + unpetrify-ref: baserock/morph + build-depends: + - python-coverage-test-runner +- name: python-markdown + repo: upstream:python-markdown + ref: a9ca97325e9039de90eae29fb3d8879bc9f367f6 + unpetrify-ref: baserock/morph + build-depends: [] +- name: cmdtest + morph: strata/cross-bootstrap/cmdtest.morph + repo: upstream:cmdtest + ref: ac91791842c6e7e6eda3213916af413255999c7b + unpetrify-ref: baserock/morph + build-depends: + - cliapp + - python-ttystatus + - python-markdown +- name: linux-user-chroot + repo: upstream:linux-user-chroot + ref: d25cc110f69e6e71a95b4ac532dcfc5423d4a16b + unpetrify-ref: baserock/morph + build-depends: [] +- name: pyfilesystem + morph: strata/cross-bootstrap/pyfilesystem.morph + repo: upstream:pyfilesystem + ref: 821f7db1ce3a3e1ac53fa514ddacbc2871eac0f6 + unpetrify-ref: baserock/morph + build-depends: + - six +- name: morph + repo: baserock:baserock/morph + ref: 67afd098cd297b769b1341a460d160a2902ba4e4 + unpetrify-ref: master + build-depends: + - cliapp + - cmdtest + - python-coverage-test-runner + - pyfilesystem +- name: rsync + morph: strata/cross-bootstrap/rsync.morph + repo: upstream:rsync + ref: 9faf8e0ccff2755cd019ff64d8322226a214b013 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/cross-bootstrap/cmdtest.morph b/strata/cross-bootstrap/cmdtest.morph new file mode 100644 index 00000000..3e1c71c6 --- /dev/null +++ b/strata/cross-bootstrap/cmdtest.morph @@ -0,0 +1,6 @@ +name: cmdtest +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/cross-bootstrap/groff.morph b/strata/cross-bootstrap/groff.morph new file mode 100644 index 00000000..fed35b7d --- /dev/null +++ b/strata/cross-bootstrap/groff.morph @@ -0,0 +1,11 @@ +name: groff +kind: chunk +max-jobs: 1 +configure-commands: +- PAGE=A4 ./configure --prefix="$PREFIX" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install +- ln -s eqn "$DESTDIR$PREFIX/bin/geqn" +- ln -s tbl "$DESTDIR$PREFIX/bin/gtbl" diff --git a/strata/cross-bootstrap/openssh.morph b/strata/cross-bootstrap/openssh.morph new file mode 100644 index 00000000..6c759cb0 --- /dev/null +++ b/strata/cross-bootstrap/openssh.morph @@ -0,0 +1,28 @@ +name: openssh +kind: chunk +configure-commands: +- autoreconf -if +- | + OPENSSL_SEEDS_ITSELF=yes ./configure \ + --prefix="$PREFIX" --sysconfdir=/etc/ssh \ + --datadir="$PREFIX/share/sshd" \ + --libexecdir="$PREFIX/lib/openssh" \ + --with-privsep-path=/var/lib/sshd +build-commands: +- make +- | + sed -e "s|@prefix@|$PREFIX|g" \ + -e 's|@STARTUP_SCRIPT_SHELL@|/bin/sh|g' \ + -e 's|@sysconfdir@|/etc/ssh|g' \ + -e 's|@COMMENT_OUT_ECC@||g' \ + sshd-keygen.in >sshd-keygen +- sed -e "s|@prefix@|$PREFIX|g" opensshd.service.in >opensshd.service +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR/$PREFIX/sbin" +- chmod go= "$DESTDIR"/var/lib/sshd +- install -m 744 sshd-keygen "$DESTDIR/$PREFIX/sbin/sshd-keygen" +- install -m 755 contrib/ssh-copy-id "$DESTDIR/$PREFIX/bin/ssh-copy-id" +- mkdir -p "$DESTDIR/lib/systemd/system/multi-user.target.wants" +- install -m 644 opensshd.service "$DESTDIR/lib/systemd/system/opensshd.service" +- ln -s ../opensshd.service "$DESTDIR/lib/systemd/system/multi-user.target.wants/opensshd.service" diff --git a/strata/cross-bootstrap/pyfilesystem.morph b/strata/cross-bootstrap/pyfilesystem.morph new file mode 100644 index 00000000..a4931dfa --- /dev/null +++ b/strata/cross-bootstrap/pyfilesystem.morph @@ -0,0 +1,6 @@ +name: pyfilesystem +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix="$PREFIX" --root "$DESTDIR" diff --git a/strata/cross-bootstrap/python-coveragepy.morph b/strata/cross-bootstrap/python-coveragepy.morph new file mode 100644 index 00000000..ed5e3d87 --- /dev/null +++ b/strata/cross-bootstrap/python-coveragepy.morph @@ -0,0 +1,6 @@ +name: python-coveragepy +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/cross-bootstrap/python-ttystatus.morph b/strata/cross-bootstrap/python-ttystatus.morph new file mode 100644 index 00000000..e45ef7a8 --- /dev/null +++ b/strata/cross-bootstrap/python-ttystatus.morph @@ -0,0 +1,6 @@ +name: python-ttystatus +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/cross-bootstrap/rsync.morph b/strata/cross-bootstrap/rsync.morph new file mode 100644 index 00000000..9a92878d --- /dev/null +++ b/strata/cross-bootstrap/rsync.morph @@ -0,0 +1,6 @@ +name: rsync +kind: chunk +build-system: autotools +build-commands: +- make proto +- make diff --git a/strata/cross-tools.morph b/strata/cross-tools.morph new file mode 100644 index 00000000..c3e35e6d --- /dev/null +++ b/strata/cross-tools.morph @@ -0,0 +1,11 @@ +name: cross-tools +kind: stratum +description: Tools used together with cross compilers +build-depends: +- morph: strata/core.morph +chunks: +- name: patchelf + repo: upstream:patchelf + ref: 21a85cc1c63cf3ef060ece59cdd82455e2884703 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/cxmanage.morph b/strata/cxmanage.morph new file mode 100644 index 00000000..057558b8 --- /dev/null +++ b/strata/cxmanage.morph @@ -0,0 +1,36 @@ +name: cxmanage +kind: stratum +description: All the tools for calxeda management +build-depends: +- morph: strata/tools.morph +chunks: +- name: ipmitool + repo: upstream:ipmitool + ref: 830d5a3787b265e5dde154d2f0e08b10ae9a7bcd + unpetrify-ref: baserock/morph + build-depends: [] +- name: pexpect + morph: strata/cxmanage/pexpect.morph + repo: upstream:pexpect + ref: 7a8455f21bb45020f3594c59fc8c85cf738e147c + unpetrify-ref: baserock/morph + build-depends: [] +- name: pyipmi + repo: upstream:pyipmi + ref: bb7dba84578c05ba87db3c4186a2989c89e4e519 + unpetrify-ref: baserock/morph + build-depends: [] +- name: tftpy + repo: upstream:tftpy + ref: f3d2fc4c62c1e64dd49adfaf8e65097eb8ea307b + unpetrify-ref: baserock/morph + build-depends: [] +- name: cxmanage + repo: upstream:cxmanage + ref: 54116d3c486ed7aa49f284e4cad9e6e7c293bea6 + unpetrify-ref: baserock/morph + build-depends: + - ipmitool + - pexpect + - pyipmi + - tftpy diff --git a/strata/cxmanage/pexpect.morph b/strata/cxmanage/pexpect.morph new file mode 100644 index 00000000..09254350 --- /dev/null +++ b/strata/cxmanage/pexpect.morph @@ -0,0 +1,10 @@ +name: pexpect +kind: chunk +description: | + Pexpect is a pure Python module that accomplishes behaviour similar to Expect +configure-commands: +- cd pexpect && make +build-commands: +- cd pexpect && python setup.py build +install-commands: +- cd pexpect && python setup.py install --prefix "$PREFIX" --root "$DESTDIR" diff --git a/strata/databases.morph b/strata/databases.morph new file mode 100644 index 00000000..cb09c5a3 --- /dev/null +++ b/strata/databases.morph @@ -0,0 +1,23 @@ +name: databases +kind: stratum +description: some popular databases +build-depends: +- morph: strata/tools.morph +- morph: strata/nfs.morph +chunks: +- name: postgresql + repo: upstream:postgresql + ref: d4f8dde3c1c2c90c723ab550e7f449fc75599316 + unpetrify-ref: REL9_3_4 + build-depends: [] +- name: redis + morph: strata/databases/redis.morph + repo: upstream:redis + ref: 9ee59fca9c5c429185d35779c2d5db64005091b0 + unpetrify-ref: baserock/3.0 + build-depends: [] +- name: memcached + repo: upstream:memcached + ref: d8b1047620a54443f6bdca7f0dc5ee3b4d99378e + unpetrify-ref: master + build-depends: [] diff --git a/strata/databases/redis.morph b/strata/databases/redis.morph new file mode 100644 index 00000000..51f602dd --- /dev/null +++ b/strata/databases/redis.morph @@ -0,0 +1,6 @@ +name: redis +kind: chunk +build-commands: +- make +install-commands: +- make PREFIX="$DESTDIR/$PREFIX" install diff --git a/strata/enlightenment.morph b/strata/enlightenment.morph new file mode 100644 index 00000000..845e7fab --- /dev/null +++ b/strata/enlightenment.morph @@ -0,0 +1,82 @@ +name: enlightenment +kind: stratum +description: Enlightenment Desktop and Window Manager +build-depends: +- morph: strata/tools.morph +- morph: strata/x-generic.morph +- morph: strata/lua.morph +- morph: strata/audio-bluetooth.morph +- morph: strata/multimedia.morph +- morph: strata/connman-common.morph +chunks: +- name: fribidi + repo: upstream:fribidi + ref: c9916f2ab289126a32febcc4754efc73a011fb0c + unpetrify-ref: baserock/morph/0.19.6 + build-depends: [] +- name: bullet3 + morph: strata/enlightenment/bullet3.morph + repo: upstream:bullet3 + ref: 940059ddb3c4476bb9860f79f35b0b1230857f54 + unpetrify-ref: baserock/morph + build-depends: [] +- name: efl + morph: strata/enlightenment/efl.morph + repo: upstream:enlightenment/efl + ref: 3013a7c5cbd728dd9bc5516ffb4bd4f505888bd4 + unpetrify-ref: v1.12.0 + build-depends: + - bullet3 + - fribidi + - luajit2 +- name: elementary + morph: strata/enlightenment/elementary.morph + repo: upstream:enlightenment/elementary + ref: c4fbbbf984b7bd1553191c26459bce4589122ad5 + unpetrify-ref: v1.12.0 + build-depends: + - efl +- name: evas_generic_loaders + morph: strata/enlightenment/evas_generic_loaders.morph + repo: upstream:enlightenment/evas_generic_loaders + ref: 5d4415ec1e64930452f7d17cbec4c28a0efa8402 + unpetrify-ref: v1.12.0 + build-depends: + - efl +- name: enlightenment + morph: strata/enlightenment/enlightenment.morph + repo: upstream:enlightenment/enlightenment + ref: 55165e2576823780a1053b03c5230cc8df8957b5 + unpetrify-ref: v0.19.1 + build-depends: + - efl + - elementary +- name: imlib2 + morph: strata/enlightenment/imlib2.morph + repo: upstream:enlightenment/imlib2 + ref: f2f20dc5791a175be398a17fcdc4852a79079d47 + unpetrify-ref: baserock/1.4.6 + build-depends: + - efl + - elementary + - enlightenment +- name: libast + morph: strata/enlightenment/libast.morph + repo: upstream:enlightenment/libast + ref: 0dbc0a5df55474bf61ca166be40e8de2d9e3a031 + build-depends: + - efl + - elementary + - enlightenment + - imlib2 +- name: eterm + morph: strata/enlightenment/eterm.morph + repo: upstream:enlightenment/eterm + ref: 097234f1f27709ff2444e303350764ea3b80b3ad + unpetrify-ref: baserock/morph + build-depends: + - efl + - elementary + - enlightenment + - libast + - imlib2 diff --git a/strata/enlightenment/bullet3.morph b/strata/enlightenment/bullet3.morph new file mode 100644 index 00000000..74cb097a --- /dev/null +++ b/strata/enlightenment/bullet3.morph @@ -0,0 +1,8 @@ +name: bullet +kind: chunk +configure-commands: +- cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/efl.morph b/strata/enlightenment/efl.morph new file mode 100644 index 00000000..b2a013ae --- /dev/null +++ b/strata/enlightenment/efl.morph @@ -0,0 +1,9 @@ +name: efl +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr --with-tests=none --disable-image-loader-gif --enable-systemd + --disable-image-loader-tiff +build-commands: +- make VPATH=/usr/lib64 +install-commands: +- make DESTDIR="$DESTDIR" VPATH=/usr/lib64 install diff --git a/strata/enlightenment/elementary.morph b/strata/enlightenment/elementary.morph new file mode 100644 index 00000000..3c0bda0d --- /dev/null +++ b/strata/enlightenment/elementary.morph @@ -0,0 +1,8 @@ +name: elementary +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/enlightenment.morph b/strata/enlightenment/enlightenment.morph new file mode 100644 index 00000000..90f0c646 --- /dev/null +++ b/strata/enlightenment/enlightenment.morph @@ -0,0 +1,8 @@ +name: enlightenment +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/eterm.morph b/strata/enlightenment/eterm.morph new file mode 100644 index 00000000..9a98d193 --- /dev/null +++ b/strata/enlightenment/eterm.morph @@ -0,0 +1,8 @@ +name: eterm +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/evas_generic_loaders.morph b/strata/enlightenment/evas_generic_loaders.morph new file mode 100644 index 00000000..ef36a40b --- /dev/null +++ b/strata/enlightenment/evas_generic_loaders.morph @@ -0,0 +1,8 @@ +name: evas_generic_loaders +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/imlib2.morph b/strata/enlightenment/imlib2.morph new file mode 100644 index 00000000..82617ad2 --- /dev/null +++ b/strata/enlightenment/imlib2.morph @@ -0,0 +1,8 @@ +name: imlib2 +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/enlightenment/libast.morph b/strata/enlightenment/libast.morph new file mode 100644 index 00000000..c44e274c --- /dev/null +++ b/strata/enlightenment/libast.morph @@ -0,0 +1,8 @@ +name: libast +kind: chunk +configure-commands: +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/erlang.morph b/strata/erlang.morph new file mode 100644 index 00000000..657b07be --- /dev/null +++ b/strata/erlang.morph @@ -0,0 +1,12 @@ +name: erlang +kind: stratum +description: stratum for erlang/otp and stuff +build-depends: +- morph: strata/tools.morph +chunks: +- name: erlang + morph: strata/erlang/erlang.morph + repo: upstream:erlang + ref: 9417f044ee3c291c2ea343c203aebdcc40597226 + unpetrify-ref: OTP-17.3.4 + build-depends: [] diff --git a/strata/erlang/erlang.morph b/strata/erlang/erlang.morph new file mode 100644 index 00000000..feaf04f1 --- /dev/null +++ b/strata/erlang/erlang.morph @@ -0,0 +1,9 @@ +name: erlang +kind: chunk +configure-commands: +- ./otp_build autoconf +- ./configure --prefix=$PREFIX +build-commands: +- make +install-commands: +- make install diff --git a/strata/foundation.morph b/strata/foundation.morph new file mode 100644 index 00000000..10111805 --- /dev/null +++ b/strata/foundation.morph @@ -0,0 +1,145 @@ +name: foundation +kind: stratum +description: Basic userland runtime system +build-depends: +- morph: strata/coreutils-common.morph +chunks: +- name: attr + morph: strata/foundation/attr.morph + repo: upstream:attr + ref: bf32f1769e9895f8546570f0c841a945c93a5b22 + unpetrify-ref: baserock/morph + build-depends: [] +- name: groff + morph: strata/foundation/groff.morph + repo: upstream:groff + ref: c7017a099f954bb6de60e79c876935b1bf438b9a + unpetrify-ref: baserock/morph + build-depends: [] +- name: kmod + morph: strata/foundation/kmod.morph + repo: upstream:kmod + ref: ae58de0fcb4a6528dd365e23d383bbe2eaf2d566 + unpetrify-ref: v18 + build-depends: [] +- name: libcap2 + morph: strata/foundation/libcap2.morph + repo: upstream:libcap2 + ref: 4f7cca1bc9c2a274edb39d351b65747010d3ba7b + unpetrify-ref: baserock/morph + build-depends: + - attr +- name: libffi + morph: strata/foundation/libffi.morph + repo: upstream:libffi + ref: 77d4586cc47e8f4c02278afbc220145bba0d442b + unpetrify-ref: baserock/morph + build-depends: [] +- name: libusbx + repo: upstream:libusbx + ref: 7ec94a45ed8155e7a1d4d5d75575099b09c78834 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pciutils + morph: strata/foundation/pciutils.morph + repo: upstream:pciutils + ref: bae04bd0473c68a2f21b7712a627abb08fd84b29 + unpetrify-ref: baserock/morph + build-depends: [] +- name: usbutils + repo: upstream:usbutils + ref: 410f1474af0ddb391bc6ec391777f116eee31569 + unpetrify-ref: baserock/morph + build-depends: + - libusbx +- name: glib + repo: upstream:glib + ref: 4125415e7f4d1213fc7122beac0d91af08e37b28 + build-depends: + - libffi +- name: gobject-introspection + repo: upstream:gobject-introspection + ref: a543d8563f8e9ca059afb7218c63496f577cd0fc + build-depends: + - glib +- name: dbus-pre + morph: strata/foundation/dbus-pre.morph + repo: upstream:dbus + ref: ff01faa12daa3481d6a3d2936929c5a2a1fe6fb5 + unpetrify-ref: baserock/genivi/dbus-1.8.8 + build-depends: + - glib +- name: libgpg-error + repo: upstream:libgpg-error + ref: a498812d767c59ae2b75b0c985f5280b139e7dc4 + build-depends: [] +- name: libgcrypt + repo: upstream:libgcrypt + ref: 412eed473b557ed2172d81d76fa1e1f53c973a67 + build-depends: + - libgpg-error +- name: systemd + morph: strata/foundation/systemd.morph + repo: upstream:systemd + ref: 941a643569dc6b53d0b334276d2a3cc0ed159e88 + unpetrify-ref: v217 + build-depends: + - dbus-pre + - gobject-introspection + - kmod + - libcap2 + - libgcrypt +- name: lzo + morph: strata/foundation/lzo.morph + repo: upstream:lzo + ref: 2cdfe9375f1145603d002c12be950062ae54da21 + unpetrify-ref: baserock/morph + build-depends: [] +- name: fuse + morph: strata/foundation/fuse.morph + repo: upstream:fuse + ref: 13ee8f62d4aa3360adb6956fb30da0c858928fa2 + unpetrify-ref: baserock/genivi/morph + build-depends: [] +- name: btrfs-progs + morph: strata/foundation/btrfs-progs.morph + repo: upstream:btrfs-progs + ref: 304f215abb836811e6d78e0a3da53d48aa0e7ca7 + unpetrify-ref: baserock/morph + build-depends: + - attr + - lzo +- name: dbus + morph: strata/foundation/dbus.morph + repo: upstream:dbus + ref: ff01faa12daa3481d6a3d2936929c5a2a1fe6fb5 + unpetrify-ref: baserock/genivi/dbus-1.8.8 + build-depends: + - glib + - systemd +- name: libxslt + repo: upstream:libxslt + ref: 8785a2ffd0d146df0395ab71ce4734d0a8ba0f7e + unpetrify-ref: baserock/morph + build-depends: [] +- name: openssh + morph: strata/foundation/openssh.morph + repo: upstream:openssh + ref: 233514106dcde5ac61a70f1043de563122e2f1c9 + unpetrify-ref: baserock/morph + build-depends: + - groff +- name: tbdiff + morph: strata/foundation/tbdiff.morph + repo: baserock:baserock/tbdiff + ref: 47fb728f2432929868666afc915dbc5a64836c08 + unpetrify-ref: master + build-depends: + - attr +- name: dbus-glib + repo: upstream:dbus-glib + ref: 397e8297d433547c9bf4150ddd2b9e0b4c39628c + unpetrify-ref: dbus-glib_0.102 + build-depends: + - dbus + - glib diff --git a/strata/foundation/attr.morph b/strata/foundation/attr.morph new file mode 100644 index 00000000..59158a90 --- /dev/null +++ b/strata/foundation/attr.morph @@ -0,0 +1,14 @@ +name: attr +kind: chunk +description: +- 'The DESTDIR patch idea comes from: http://pkgs.fedoraproject.org/gitweb/?p=attr.git;a=blob_plain;f=attr-2.4.32-build.patch' +configure-commands: +- sed -i -e 's,PKG_\(.*\)_DIR\t= ,PKG_\1_DIR\t= \$(DESTDIR),g' include/builddefs.in +- sed -i -e 's,\$\$LOCAL_CONFIGURE_OPTIONS,\$(LOCAL_CONFIGURE_OPTIONS),g' Makefile +- make LOCAL_CONFIGURE_OPTIONS="--prefix=/usr --exec-prefix=/usr --sbindir=/usr/sbin + --bindir=/usr/bin --libdir=/usr/lib --libexecdir=/usr/lib --enable-lib64=yes --includedir=/usr/include + --mandir=/usr/share/man --datadir=/usr/share" configure +build-commands: +- make SHELL=/bin/bash +install-commands: +- make SHELL=/bin/bash DESTDIR="$DESTDIR" install-lib install-dev diff --git a/strata/foundation/btrfs-progs.morph b/strata/foundation/btrfs-progs.morph new file mode 100644 index 00000000..356c3f06 --- /dev/null +++ b/strata/foundation/btrfs-progs.morph @@ -0,0 +1,6 @@ +name: btrfs-progs +kind: chunk +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" prefix="$PREFIX" install diff --git a/strata/foundation/dbus-pre.morph b/strata/foundation/dbus-pre.morph new file mode 100644 index 00000000..3ec008bf --- /dev/null +++ b/strata/foundation/dbus-pre.morph @@ -0,0 +1,10 @@ +name: dbus-pre +kind: chunk +build-system: autotools +configure-commands: +- sh autogen.sh --no-configure +- ./configure --prefix="$PREFIX" --localstatedir=/var --sysconfdir=/etc --disable-systemd +build-commands: +- make XMLTO_OUTPUT= +install-commands: +- make XMLTO_OUTPUT= DESTDIR="$DESTDIR" install diff --git a/strata/foundation/dbus.morph b/strata/foundation/dbus.morph new file mode 100644 index 00000000..255d2915 --- /dev/null +++ b/strata/foundation/dbus.morph @@ -0,0 +1,10 @@ +name: dbus +kind: chunk +build-system: autotools +configure-commands: +- sh autogen.sh --no-configure +- ./configure --prefix="$PREFIX" --localstatedir=/var --sysconfdir=/etc +build-commands: +- make XMLTO_OUTPUT= +install-commands: +- make XMLTO_OUTPUT= DESTDIR="$DESTDIR" install diff --git a/strata/foundation/fuse.morph b/strata/foundation/fuse.morph new file mode 100644 index 00000000..6f7fc170 --- /dev/null +++ b/strata/foundation/fuse.morph @@ -0,0 +1,6 @@ +name: fuse +kind: chunk +build-system: autotools +configure-commands: +- ./makeconf.sh +- ./configure --prefix="$PREFIX" diff --git a/strata/foundation/groff.morph b/strata/foundation/groff.morph new file mode 100644 index 00000000..fed35b7d --- /dev/null +++ b/strata/foundation/groff.morph @@ -0,0 +1,11 @@ +name: groff +kind: chunk +max-jobs: 1 +configure-commands: +- PAGE=A4 ./configure --prefix="$PREFIX" +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install +- ln -s eqn "$DESTDIR$PREFIX/bin/geqn" +- ln -s tbl "$DESTDIR$PREFIX/bin/gtbl" diff --git a/strata/foundation/kmod.morph b/strata/foundation/kmod.morph new file mode 100644 index 00000000..12ac8692 --- /dev/null +++ b/strata/foundation/kmod.morph @@ -0,0 +1,19 @@ +name: kmod +kind: chunk +configure-commands: +- rm -rf libkmod/docs +- sed -i -e'/SUBDIRS/{s/\S*doc\S*//;s/\S*man\S*//}' Makefile.am +- sed -i -e'/AC_CONFIG_FILES(\[/,/])/{/docs/d}' configure.ac +- autoreconf -fiv +- ./configure --prefix=/usr --bindir=/bin --libdir=/lib --sysconfdir=/etc --without-xz + --with-zlib --disable-manpages +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" pkgconfigdir=/usr/lib/pkgconfig install +- ln -s kmod "$DESTDIR"/bin/modprobe +- ln -s kmod "$DESTDIR"/bin/lsmod +- ln -s kmod "$DESTDIR"/bin/rmmod +- ln -s kmod "$DESTDIR"/bin/insmod +- ln -s kmod "$DESTDIR"/bin/modinfo +- ln -s kmod "$DESTDIR"/bin/depmod diff --git a/strata/foundation/libcap2.morph b/strata/foundation/libcap2.morph new file mode 100644 index 00000000..3e4f205e --- /dev/null +++ b/strata/foundation/libcap2.morph @@ -0,0 +1,6 @@ +name: libcap2 +kind: chunk +build-commands: +- make prefix="$PREFIX" +install-commands: +- make prefix="$PREFIX" DESTDIR="$DESTDIR" RAISE_SETFCAP=no install lib=lib diff --git a/strata/foundation/libffi.morph b/strata/foundation/libffi.morph new file mode 100644 index 00000000..174477af --- /dev/null +++ b/strata/foundation/libffi.morph @@ -0,0 +1,8 @@ +name: libffi +kind: chunk +build-system: autotools +install-commands: +- make DESTDIR="$DESTDIR"/ install +- mkdir -p "$DESTDIR"/usr/include +- cp "$TARGET"/include/ffi.h "$DESTDIR"/usr/include/ +- cp "$TARGET"/include/ffitarget.h "$DESTDIR"/usr/include/ diff --git a/strata/foundation/lzo.morph b/strata/foundation/lzo.morph new file mode 100644 index 00000000..a1a7bbc7 --- /dev/null +++ b/strata/foundation/lzo.morph @@ -0,0 +1,5 @@ +name: lzo +kind: chunk +build-system: autotools +configure-commands: +- ./configure --enable-shared=yes --prefix="$PREFIX" diff --git a/strata/foundation/openssh.morph b/strata/foundation/openssh.morph new file mode 100644 index 00000000..6c759cb0 --- /dev/null +++ b/strata/foundation/openssh.morph @@ -0,0 +1,28 @@ +name: openssh +kind: chunk +configure-commands: +- autoreconf -if +- | + OPENSSL_SEEDS_ITSELF=yes ./configure \ + --prefix="$PREFIX" --sysconfdir=/etc/ssh \ + --datadir="$PREFIX/share/sshd" \ + --libexecdir="$PREFIX/lib/openssh" \ + --with-privsep-path=/var/lib/sshd +build-commands: +- make +- | + sed -e "s|@prefix@|$PREFIX|g" \ + -e 's|@STARTUP_SCRIPT_SHELL@|/bin/sh|g' \ + -e 's|@sysconfdir@|/etc/ssh|g' \ + -e 's|@COMMENT_OUT_ECC@||g' \ + sshd-keygen.in >sshd-keygen +- sed -e "s|@prefix@|$PREFIX|g" opensshd.service.in >opensshd.service +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR/$PREFIX/sbin" +- chmod go= "$DESTDIR"/var/lib/sshd +- install -m 744 sshd-keygen "$DESTDIR/$PREFIX/sbin/sshd-keygen" +- install -m 755 contrib/ssh-copy-id "$DESTDIR/$PREFIX/bin/ssh-copy-id" +- mkdir -p "$DESTDIR/lib/systemd/system/multi-user.target.wants" +- install -m 644 opensshd.service "$DESTDIR/lib/systemd/system/opensshd.service" +- ln -s ../opensshd.service "$DESTDIR/lib/systemd/system/multi-user.target.wants/opensshd.service" diff --git a/strata/foundation/pciutils.morph b/strata/foundation/pciutils.morph new file mode 100644 index 00000000..8ca13bad --- /dev/null +++ b/strata/foundation/pciutils.morph @@ -0,0 +1,11 @@ +name: pciutils +kind: chunk +configure-commands: +- make ZLIB=no lib/config.mk +- echo PREFIX=$PREFIX >>lib/config.mk +- echo MANDIR=$PREFIX/share/man >>lib/config.mk +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install +- make DESTDIR="$DESTDIR" install-lib diff --git a/strata/foundation/systemd.morph b/strata/foundation/systemd.morph new file mode 100644 index 00000000..c298748a --- /dev/null +++ b/strata/foundation/systemd.morph @@ -0,0 +1,28 @@ +name: systemd +kind: chunk +max-jobs: 1 +build-system: autotools +configure-commands: +- sh autogen.sh +- ./configure --prefix="$PREFIX" --enable-xz --disable-manpages --sysconfdir=/etc + --localstatedir=/var --libdir="$PREFIX/lib" --libexecdir="$PREFIX/libexec" --with-rootprefix= + --with-rootlibdir=/lib +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR"/sbin +- ln -s /lib/systemd/systemd "$DESTDIR"/sbin/init +- for f in telinit runlevel shutdown poweroff reboot halt; do ln -s /bin/systemctl + "$DESTDIR/sbin/$f"; done +- sed -e 's|@sushell@|/bin/sh|g' units/debug-shell.service.in >"$DESTDIR/etc/systemd/system/debug-shell.service" +- sed -r -e '/Options=/s/,?strictatime//' "$DESTDIR/lib/systemd/system/tmp.mount" + >"$DESTDIR/etc/systemd/system/tmp.mount" +- touch "$DESTDIR/etc/machine-id" +post-install-commands: +- | + cat > "$DESTDIR/etc/systemd/network/10-dhcp.network" << "EOF" + [Match] + Name=e* + + [Network] + DHCP=yes + EOF diff --git a/strata/foundation/tbdiff.morph b/strata/foundation/tbdiff.morph new file mode 100644 index 00000000..a907a109 --- /dev/null +++ b/strata/foundation/tbdiff.morph @@ -0,0 +1,3 @@ +name: tbdiff +kind: chunk +build-system: autotools diff --git a/strata/genivi.morph b/strata/genivi.morph new file mode 100644 index 00000000..24050b4c --- /dev/null +++ b/strata/genivi.morph @@ -0,0 +1,78 @@ +name: genivi +kind: stratum +description: Software components designed by genivi, for genivi. +build-depends: +- morph: strata/foundation.morph +chunks: +- name: linuxquota + morph: strata/genivi/linuxquota.morph + repo: upstream:linuxquota + ref: 0804c89a16736533e440771dc42a15e5d0223902 + unpetrify-ref: baserock/genivi/morph + build-depends: [] +- name: DLT-daemon + repo: upstream:DLT-daemon + ref: 8b48e73f79b4463393916e4c6696917e3dedd026 + unpetrify-ref: v2.10.0 + build-depends: [] +- name: node-startup-controller + morph: strata/genivi/node-startup-controller.morph + repo: upstream:node-startup-controller + ref: b77fb1dbb280ec45525853e52a362eafd736b400 + unpetrify-ref: baserock/systemd_v216 + build-depends: + - DLT-daemon +- name: googletest + morph: strata/genivi/googletest.morph + repo: upstream:googletest + ref: 5e3f7d3db4c16e2ba8b42b0bf4689f7d2abbcb08 + unpetrify-ref: baserock/morph + build-depends: [] +- name: googlemock + morph: strata/genivi/googlemock.morph + repo: upstream:googlemock + ref: 0e9998c140079046c396a0e7033bb465abae79cd + unpetrify-ref: baserock/morph + build-depends: + - googletest +- name: genivi-common-api-runtime + repo: upstream:genivi-common-api-runtime + ref: 188abb5e24d6a2a7fdd7e5d150439a162621292c + unpetrify-ref: 2.1.6 + build-depends: [] +- name: genivi-common-api-dbus-runtime + repo: upstream:genivi-common-api-dbus-runtime + ref: 3372155b32a2cf3b05e1a2a13f6f8413069de33f + unpetrify-ref: 2.1.6-p1 + build-depends: + - genivi-common-api-runtime +- name: audiomanager + repo: upstream:audiomanager + ref: 00caae1e41e8891d9a1bafa76028e8119f06fd8a + unpetrify-ref: baserock/6.0 + build-depends: + - DLT-daemon + - googletest + - googlemock + - genivi-common-api-runtime + - genivi-common-api-dbus-runtime +- name: itzam-tarball + morph: strata/genivi/itzam-tarball.morph + repo: upstream:itzam-tarball + ref: 4ebcf671416927b64475da7b810b6016c847bf73 + unpetrify-ref: baserock/genivi/baseline + build-depends: [] +- name: persistence-client-library + repo: upstream:genivi/persistence-client-library + ref: 0934ba263e69be8453cc3150f997dad28489f0c7 + unpetrify-ref: baserock/genivi/baseline + build-depends: + - DLT-daemon + - itzam-tarball +- name: node-state-manager + repo: upstream:node-state-manager + ref: 30add4659e002f1df205cc36f71ef3141c10c1fb + unpetrify-ref: baserock/systemd_v216 + build-depends: + - DLT-daemon + - persistence-client-library diff --git a/strata/genivi/googlemock.morph b/strata/genivi/googlemock.morph new file mode 100644 index 00000000..b3eaa952 --- /dev/null +++ b/strata/genivi/googlemock.morph @@ -0,0 +1,8 @@ +name: googlemock +kind: chunk +build-system: autotools +configure-commands: +- mkdir -p gtest/m4 +- ln -s /usr/share/gtest/m4/acx_pthread.m4 gtest/m4/acx_pthread.m4 +- autoreconf -ivf +- ./configure --prefix="$PREFIX" diff --git a/strata/genivi/googletest.morph b/strata/genivi/googletest.morph new file mode 100644 index 00000000..7723c721 --- /dev/null +++ b/strata/genivi/googletest.morph @@ -0,0 +1,7 @@ +name: googletest +kind: chunk +build-system: autotools +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p $DESTDIR/usr/share/gtest/m4 +- install -m 644 m4/acx_pthread.m4 $DESTDIR/usr/share/gtest/m4 diff --git a/strata/genivi/itzam-tarball.morph b/strata/genivi/itzam-tarball.morph new file mode 100644 index 00000000..eaf2db61 --- /dev/null +++ b/strata/genivi/itzam-tarball.morph @@ -0,0 +1,10 @@ +name: itzam-tarball +kind: chunk +build-system: autotools +pre-configure-commands: +- sed -i 's/GENERIC_LIBRARY_NAME=libitzam/GENERIC_LIBRARY_NAME=itzam/g' configure.ac +- mkdir m4 +- touch NEWS README AUTHORS ChangeLog +- autoreconf -ivf +post-install-commands: +- install -D -m644 libitzam.pc "$DESTDIR$PREFIX/lib/pkgconfig/libitzam.pc" diff --git a/strata/genivi/linuxquota.morph b/strata/genivi/linuxquota.morph new file mode 100644 index 00000000..826696ad --- /dev/null +++ b/strata/genivi/linuxquota.morph @@ -0,0 +1,10 @@ +name: linuxquota +kind: chunk +build-system: autotools +configure-commands: +- autoreconf -ivf +- ./configure --prefix="$PREFIX" +build-commands: +- make "RPCGEN=rpcgen -Y /usr/bin" +install-commands: +- make ROOTDIR="$DESTDIR" install diff --git a/strata/genivi/node-startup-controller.morph b/strata/genivi/node-startup-controller.morph new file mode 100644 index 00000000..d3d6dc77 --- /dev/null +++ b/strata/genivi/node-startup-controller.morph @@ -0,0 +1,9 @@ +name: node-startup-controller +kind: chunk +configure-commands: +- sh autogen.sh +- ./configure --prefix="$PREFIX" --sysconfdir=/etc +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/gitlab.morph b/strata/gitlab.morph new file mode 100644 index 00000000..0a1c35bb --- /dev/null +++ b/strata/gitlab.morph @@ -0,0 +1,24 @@ +name: gitlab +kind: stratum +description: gitlab components for server, ci etc +build-depends: +- morph: strata/ruby.morph +chunks: +- name: gitlab-ce + morph: strata/gitlab/gitlab-ce.morph + repo: upstream:gitlab/gitlab-ce + ref: 53d98a77d34cbfddaef9eb25cf5f651a78550425 + unpetrify-ref: baserock/v7.0.0 + build-depends: [] +- name: gitlab-ci + morph: strata/gitlab/gitlab-ci.morph + repo: upstream:gitlab/gitlab-ci + ref: c74044d65dec2ba8311e242c84e07a67abd52d37 + unpetrify-ref: baserock/morph + build-depends: [] +- name: gitlab-shell + morph: strata/gitlab/gitlab-shell.morph + repo: upstream:gitlab/gitlab-shell + ref: 0b4106d57223c666d9360339fd3790174aa43800 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/gitlab/gitlab-ce.morph b/strata/gitlab/gitlab-ce.morph new file mode 100644 index 00000000..571881f8 --- /dev/null +++ b/strata/gitlab/gitlab-ce.morph @@ -0,0 +1,6 @@ +name: gitlab-ce +kind: chunk +install-commands: +- mkdir -p "$DESTDIR/$PREFIX/share/gitlab-ce" +- cp -R * "$DESTDIR/$PREFIX/share/gitlab-ce" +- chmod -R a+rX,g+w "$DESTDIR/$PREFIX/share/gitlab-ce" diff --git a/strata/gitlab/gitlab-ci.morph b/strata/gitlab/gitlab-ci.morph new file mode 100644 index 00000000..99d01367 --- /dev/null +++ b/strata/gitlab/gitlab-ci.morph @@ -0,0 +1,6 @@ +name: gitlab-ci +kind: chunk +install-commands: +- mkdir -p "$DESTDIR/$PREFIX/share/gitlab-ci" +- cp -R * "$DESTDIR/$PREFIX/share/gitlab-ci" +- chmod -R a+rX,g+w "$DESTDIR/$PREFIX/share/gitlab-ci" diff --git a/strata/gitlab/gitlab-shell.morph b/strata/gitlab/gitlab-shell.morph new file mode 100644 index 00000000..069c6c41 --- /dev/null +++ b/strata/gitlab/gitlab-shell.morph @@ -0,0 +1,6 @@ +name: gitlab-shell +kind: chunk +install-commands: +- mkdir -p "$DESTDIR/$PREFIX/share/gitlab-shell" +- cp -R * "$DESTDIR/$PREFIX/share/gitlab-shell" +- chmod -R a+rX,g+w "$DESTDIR/$PREFIX/share/gitlab-shell" diff --git a/strata/graphics-common.morph b/strata/graphics-common.morph new file mode 100644 index 00000000..b187df8f --- /dev/null +++ b/strata/graphics-common.morph @@ -0,0 +1,58 @@ +name: graphics-common +kind: stratum +build-depends: +- morph: strata/mesa-common.morph +chunks: +- name: pixman + repo: upstream:pixman + ref: 87eea99e443b389c978cf37efc52788bf03a0ee0 + unpetrify-ref: pixman-0.32.6 + build-depends: [] +- name: freetype2 + repo: upstream:freetype2 + ref: ec8853cd18e1a0c275372769bdad37a79550ed66 + unpetrify-ref: VER-2-5-3 + build-depends: [] +- name: fontconfig + repo: upstream:fontconfig + ref: 9260b7ec39c34ce68d74e16d47917290a8c3f35a + unpetrify-ref: 2.11.1 + build-depends: + - freetype2 +- name: freefont-otf + morph: strata/graphics-common/freefont-otf.morph + repo: upstream:freefont-otf + ref: 75fa95a912718bb94a135d4bf6b13bb38e186ce7 + unpetrify-ref: baserock/morph + build-depends: [] +- name: libpng + repo: upstream:libpng + ref: 259fb7761d747655c607efcec7a12ff1f3c24561 + unpetrify-ref: libpng-1.6.13-signed + build-depends: [] +- name: libjpeg + repo: upstream:libjpeg + ref: f57ac58ac664ede6bc6e8cd9d88e0edaa366e21a + unpetrify-ref: baserock/morph + build-depends: [] +- name: libtiff + repo: upstream:libtiff + ref: 2f83c385ff3d5493602308b62ca6d7707725b4fd + unpetrify-ref: Release-v4-0-3 + build-depends: [] +- name: cairo + morph: strata/graphics-common/cairo.morph + repo: upstream:cairo + ref: f6fd372a8b31a0bebbdfe36090d6ffc7bab9a2f8 + unpetrify-ref: 1.14.0 + build-depends: + - fontconfig + - freetype2 + - pixman + - libpng +- name: harfbuzz + repo: upstream:harfbuzz + ref: 09b5393874e56fcfd63a92d28e6c1c2ddeee0942 + unpetrify-ref: baserock/0.9.12 + build-depends: + - freetype2 diff --git a/strata/graphics-common/cairo.morph b/strata/graphics-common/cairo.morph new file mode 100644 index 00000000..f91ac385 --- /dev/null +++ b/strata/graphics-common/cairo.morph @@ -0,0 +1,5 @@ +name: cairo +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-glesv2 diff --git a/strata/graphics-common/freefont-otf.morph b/strata/graphics-common/freefont-otf.morph new file mode 100644 index 00000000..f021480d --- /dev/null +++ b/strata/graphics-common/freefont-otf.morph @@ -0,0 +1,5 @@ +name: freefont-otf +kind: chunk +install-commands: +- mkdir -p "$DESTDIR"/usr/share/fonts/opentype/freefont +- install -p *.otf "$DESTDIR"/usr/share/fonts/opentype/freefont diff --git a/strata/gtk-deps.morph b/strata/gtk-deps.morph new file mode 100644 index 00000000..799ba87a --- /dev/null +++ b/strata/gtk-deps.morph @@ -0,0 +1,48 @@ +name: gtk-deps +kind: stratum +description: the GTK+ dependencies stratum +build-depends: +- morph: strata/foundation.morph +- morph: strata/graphics-common.morph +- morph: strata/x-common.morph +chunks: +- name: pango + repo: upstream:pango + ref: e0a21abf52a0b7588b1aa3357818948816ed9103 + unpetrify-ref: 1.36.8 + build-depends: [] +- name: shared-mime-info + morph: strata/gtk-deps/shared-mime-info.morph + repo: upstream:shared-mime-info + ref: 0d440d85a126ff8d535d4f70f2203a76a21d5f71 + unpetrify-ref: baserock/morph + build-depends: [] +- name: gnome-common + repo: upstream:gnome-common + ref: d213283fcb5228d05eb2c796579f18240e8467e8 + unpetrify-ref: 3.12.0 + build-depends: [] +- name: gdk-pixbuf + morph: strata/gtk-deps/gdk-pixbuf.morph + repo: upstream:gdk-pixbuf + ref: b86959aa16e9d49ec6e286bc57d36c5249578c59 + unpetrify-ref: 2.30.8 + build-depends: [] +- name: atk + repo: upstream:atk + ref: 94766ee6f1a42f94eb9736ba8396bc90af937fe4 + unpetrify-ref: ATK_2_12_0 + build-depends: + - gnome-common +- name: at-spi2-core + repo: upstream:at-spi2-core + ref: c354b5e8d8157e1018eafeca48642116a65c4ff5 + unpetrify-ref: AT_SPI2_CORE_2_12_0 + build-depends: [] +- name: at-spi2-atk + repo: upstream:at-spi2-atk + ref: 01e49759d5d1fc22fb108fc9f80cd34d8eb814f6 + unpetrify-ref: AT_SPI2_ATK_2_12_1 + build-depends: + - at-spi2-core + - atk diff --git a/strata/gtk-deps/gdk-pixbuf.morph b/strata/gtk-deps/gdk-pixbuf.morph new file mode 100644 index 00000000..c89c75c8 --- /dev/null +++ b/strata/gtk-deps/gdk-pixbuf.morph @@ -0,0 +1,6 @@ +name: gdk-pixbuf +kind: chunk +build-system: autotools +install-commands: +- make DESTDIR=$DESTDIR install +- LD_LIBRARY_PATH=$DESTDIR/usr/lib $DESTDIR/usr/bin/gdk-pixbuf-query-loaders > $DESTDIR/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache diff --git a/strata/gtk-deps/shared-mime-info.morph b/strata/gtk-deps/shared-mime-info.morph new file mode 100644 index 00000000..e155fde0 --- /dev/null +++ b/strata/gtk-deps/shared-mime-info.morph @@ -0,0 +1,4 @@ +name: shared-mime-info +kind: chunk +max-jobs: 1 +build-system: autotools diff --git a/strata/gtk2.morph b/strata/gtk2.morph new file mode 100644 index 00000000..8ac31eaa --- /dev/null +++ b/strata/gtk2.morph @@ -0,0 +1,12 @@ +name: gtk2 +kind: stratum +description: the gtk2 stratum +build-depends: +- morph: strata/gtk-deps.morph +- morph: strata/x-generic.morph +chunks: +- name: gtk+ + morph: strata/gtk2/gtk+.morph + repo: upstream:gtk+ + ref: fbf38d16bcc26630f0f721d266509f5bc292f606 + build-depends: [] diff --git a/strata/gtk2/gtk+.morph b/strata/gtk2/gtk+.morph new file mode 100644 index 00000000..abbf2510 --- /dev/null +++ b/strata/gtk2/gtk+.morph @@ -0,0 +1,11 @@ +name: gtk+ +kind: chunk +build-system: autotools +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install DESTDIR="$DESTDIR" diff --git a/strata/gtk3.morph b/strata/gtk3.morph new file mode 100644 index 00000000..f471bf6e --- /dev/null +++ b/strata/gtk3.morph @@ -0,0 +1,19 @@ +name: gtk3 +kind: stratum +description: the gtk3 stratum +build-depends: +- morph: strata/gtk-deps.morph +- morph: strata/wayland-generic.morph +chunks: +- name: libepoxy + repo: upstream:libepoxy + ref: 7422de5b4be7b19d789136b3bb5f932de42db27c + unpetrify-ref: v1.2 + build-depends: [] +- name: gtk3 + morph: strata/gtk3/gtk3.morph + repo: upstream:gtk+ + ref: 911f3fb6d29f1570a2d30db6f2085d0202e7ad2a + unpetrify-ref: 3.15.0 + build-depends: + - libepoxy diff --git a/strata/gtk3/gtk3.morph b/strata/gtk3/gtk3.morph new file mode 100644 index 00000000..4542dc15 --- /dev/null +++ b/strata/gtk3/gtk3.morph @@ -0,0 +1,11 @@ +name: gtk3 +kind: chunk +build-system: autotools +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --enable-wayland-backend +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install DESTDIR="$DESTDIR" diff --git a/strata/initramfs-utils.morph b/strata/initramfs-utils.morph new file mode 100644 index 00000000..b6076cde --- /dev/null +++ b/strata/initramfs-utils.morph @@ -0,0 +1,12 @@ +name: initramfs-utils +kind: stratum +description: stratum for initramfs +build-depends: +- morph: strata/build-essential.morph +chunks: +- name: initramfs-scripts + morph: strata/initramfs-utils/initramfs-scripts.morph + repo: baserock:baserock/initramfs-scripts + ref: a97dea93d28ba272613029e46a8a0b1f699729d8 + unpetrify-ref: master + build-depends: [] diff --git a/strata/initramfs-utils/initramfs-scripts.morph b/strata/initramfs-utils/initramfs-scripts.morph new file mode 100644 index 00000000..68ed4a7b --- /dev/null +++ b/strata/initramfs-utils/initramfs-scripts.morph @@ -0,0 +1,4 @@ +name: initramfs-scripts +kind: chunk +install-commands: +- install -m 755 init "$DESTDIR/init" diff --git a/strata/input-common.morph b/strata/input-common.morph new file mode 100644 index 00000000..533eff22 --- /dev/null +++ b/strata/input-common.morph @@ -0,0 +1,29 @@ +name: input-common +kind: stratum +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-depends: [] +- name: xkeyboard-config + morph: strata/input-common/xkeyboard-config.morph + repo: upstream:xkeyboard-config + ref: 73aa90ce32967747c84a1b5fe32cee329bc3bbcf + unpetrify-ref: xkeyboard-config-2.13 + build-depends: [] +- name: libevdev + repo: upstream:libevdev + ref: 7ac00d7e920c56bb8617403699030a5300bfae1c + unpetrify-ref: libevdev-1.3.2 + build-depends: [] +- name: libinput + repo: upstream:libinput + ref: 06e2f522a4ab5ea0a1de68cce1b5f9fff568ed4f + unpetrify-ref: 0.7.0 + build-depends: + - mtdev + - libevdev diff --git a/strata/input-common/xkeyboard-config.morph b/strata/input-common/xkeyboard-config.morph new file mode 100644 index 00000000..ad33b422 --- /dev/null +++ b/strata/input-common/xkeyboard-config.morph @@ -0,0 +1,7 @@ +name: xkeyboard-config +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --disable-runtime-deps +install-commands: +- mkdir -p "$DESTDIR"/"$PREFIX"/share/X11/xkb/ +- make install DESTDIR="$DESTDIR" diff --git a/strata/installer-utils.morph b/strata/installer-utils.morph new file mode 100644 index 00000000..b97a7c09 --- /dev/null +++ b/strata/installer-utils.morph @@ -0,0 +1,12 @@ +name: installer-utils +kind: stratum +description: stratum for Baserock installer script. +build-depends: +- morph: strata/build-essential.morph +chunks: +- name: installer-scripts + morph: strata/installer-utils/installer-scripts.morph + repo: baserock:baserock/installer-scripts + ref: master + unpetrify-ref: master + build-depends: [] diff --git a/strata/installer-utils/installer-scripts.morph b/strata/installer-utils/installer-scripts.morph new file mode 100644 index 00000000..e42313a8 --- /dev/null +++ b/strata/installer-utils/installer-scripts.morph @@ -0,0 +1,4 @@ +name: installer-scripts +kind: chunk +install-commands: +- install -D -m 755 baserock-installer "$DESTDIR/usr/lib/baserock-installer/installer" diff --git a/strata/libdrm-common.morph b/strata/libdrm-common.morph new file mode 100644 index 00000000..e364bab2 --- /dev/null +++ b/strata/libdrm-common.morph @@ -0,0 +1,17 @@ +name: libdrm-common +kind: stratum +build-depends: +- morph: strata/xorg-util-macros-common.morph +chunks: +- name: xorg-lib-libpciaccess + repo: upstream:xorg-lib-libpciaccess + ref: 3e17f069682a226c14bb29c802e776c6e39f7e8f + unpetrify-ref: baserock/morph + build-depends: [] +- name: drm + repo: upstream:drm + morph: strata/libdrm-common/drm.morph + ref: 83b2c40922ce451f5844aae0707ae9783a78d74f + unpetrify-ref: baserock/drm_2.4.58/jetson + build-depends: + - xorg-lib-libpciaccess diff --git a/strata/libdrm-common/drm.morph b/strata/libdrm-common/drm.morph new file mode 100644 index 00000000..d3d06fd8 --- /dev/null +++ b/strata/libdrm-common/drm.morph @@ -0,0 +1,10 @@ +name: drm +kind: chunk +build-system: autotools +configure-commands: + - NOCONFIGURE=1 ./autogen.sh + - ./configure --prefix="$PREFIX" --enable-tegra-experimental-api --enable-freedreno-experimental-api +install-commands: + - make install DESTDIR="$DESTDIR" + - mkdir -p "$DESTDIR"/usr/lib/pkgconfig + - /usr/bin/install -c -m 644 tegra/libdrm_tegra.pc "$DESTDIR"/usr/lib/pkgconfig diff --git a/strata/lighttpd-server.morph b/strata/lighttpd-server.morph new file mode 100644 index 00000000..cf3dec19 --- /dev/null +++ b/strata/lighttpd-server.morph @@ -0,0 +1,13 @@ +name: lighttpd-server +kind: stratum +description: lighttpd web server +build-depends: +- morph: strata/tools.morph +- morph: strata/pcre-utils.morph +chunks: +- name: lighttpd + morph: strata/lighttpd-server/lighttpd.morph + repo: upstream:lighttpd + ref: 12e4e21763da770034267ff0a7b660876930f789 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/lighttpd-server/lighttpd.morph b/strata/lighttpd-server/lighttpd.morph new file mode 100644 index 00000000..ae371c52 --- /dev/null +++ b/strata/lighttpd-server/lighttpd.morph @@ -0,0 +1,6 @@ +name: lighttpd +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh +- ./configure --prefix="$PREFIX" --with-openssl --with-openssl-libs=/usr/lib diff --git a/strata/llvm-common.morph b/strata/llvm-common.morph new file mode 100644 index 00000000..243461d6 --- /dev/null +++ b/strata/llvm-common.morph @@ -0,0 +1,11 @@ +name: llvm-common +kind: stratum +build-depends: +- morph: strata/core.morph +chunks: +- name: llvm + morph: strata/llvm-common/llvm.morph + repo: upstream:llvm + ref: a93239b7c6f0d78cb8836768c3ffbc39fb15b79f + unpetrify-ref: release_33 + build-depends: [] diff --git a/strata/llvm-common/llvm.morph b/strata/llvm-common/llvm.morph new file mode 100644 index 00000000..9d280062 --- /dev/null +++ b/strata/llvm-common/llvm.morph @@ -0,0 +1,8 @@ +name: llvm +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 +build-commands: +- make $MAKEFLAGS diff --git a/strata/lorry.morph b/strata/lorry.morph new file mode 100644 index 00000000..158071cc --- /dev/null +++ b/strata/lorry.morph @@ -0,0 +1,129 @@ +name: lorry +kind: stratum +description: | + Lorry and tools for working with version control systems other than Git. + + Lorry is a tool for creating and maintaining Git mirrors of source code + repositories, which aims to support most version control systems in use + by software projects that are used Baserock systems. + + The commandline tools 'hg', 'bzr', 'svn', and 'cvs' are also made available + by this stratum. +build-depends: +# The 'morph-utils' stratum is required for 'cliapp', which Lorry needs at +# build-time to generate its man page. Otherwise we could simply depend on +# the 'foundation' stratum. +- morph: strata/morph-utils.morph +chunks: +- name: bzr-tarball + repo: upstream:bzr-tarball + ref: e61c7edb4789abcd0f73c30fe719fa6fea478a52 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-fastimport + repo: upstream:python-fastimport + ref: 6500a5e7d82651ade9002d44e3ecc71a50302616 + unpetrify-ref: baserock/morph + build-depends: [] +- name: bzr-fastimport + repo: upstream:bzr-fastimport + ref: b3cda9967f857127bd4dab5eb72223a95916f5ea + unpetrify-ref: baserock/morph + build-depends: + - bzr-tarball + - python-fastimport +- name: cvs-tarball + morph: strata/lorry/cvs-tarball.morph + repo: upstream:cvs-tarball + ref: ca4cd317a75ef4349563b5a9a734561beb4a4f98 + unpetrify-ref: baserock/morph + build-depends: [] +- name: libapr-tarball + repo: upstream:libapr-tarball + ref: dea1efeb7f60fc6848e1e72b3fc973d0057565db + unpetrify-ref: baserock/morph + build-depends: [] +- name: libapr-util-tarball + morph: strata/lorry/libapr-util-tarball.morph + repo: upstream:libapr-util-tarball + ref: daba269ee5a262cc23621b3ee37ed368d2a2b69b + unpetrify-ref: baserock/morph + build-depends: + - libapr-tarball +- name: perl-dbi-tarball + morph: strata/lorry/perl-dbi-tarball.morph + repo: upstream:perl-dbi-tarball + ref: 09e269cff811f0c1881ea0d6b7571173bab8377b + unpetrify-ref: baserock/morph + build-depends: [] +- name: perl-dbd-sqlite-tarball + repo: upstream:perl-dbd-sqlite-tarball + ref: 485b97be9f2f2abf5a40923b5fd85f75714a8c02 + unpetrify-ref: baserock/morph + build-depends: + - perl-dbi-tarball +- name: libserf-tarball + repo: upstream:libserf-tarball + ref: 6f61a1acd01dc2ad1d2f5c1f7458702c77c69f9c + unpetrify-ref: baserock/morph + build-depends: + - libapr-tarball + - libapr-util-tarball +- name: swig-tarball + morph: strata/lorry/swig-tarball.morph + repo: upstream:swig-tarball + ref: 1f6cb46b6a4b3ebf9352fa10198b0b286f84138b + unpetrify-ref: baserock/morph + build-depends: [] +- name: neon + morph: strata/lorry/neon.morph + repo: upstream:neon + ref: 837374e9d797e216f1de684595cefe791f67c0e4 + unpetrify-ref: baserock/morph + build-depends: [] +- name: subversion-tarball + morph: strata/lorry/subversion-tarball.morph + repo: upstream:subversion-tarball + ref: 351e074672d9aa6446d5829938b697a3d6b23266 + unpetrify-ref: baserock/morph + build-depends: + - swig-tarball + - libapr-tarball + - libapr-util-tarball + - libserf-tarball + - neon +- name: mercurial-tarball + morph: strata/lorry/mercurial-tarball.morph + repo: upstream:mercurial-tarball + ref: 4b0aa73b8c69bd5b7521337809f7bc4714209a5a + unpetrify-ref: baserock/morph + build-depends: [] +- name: hg-fast-export + morph: strata/lorry/hg-fast-export.morph + repo: upstream:hg-fast-export + ref: 09a472aa58da0417a11a22bae172785f7cb2e80f + unpetrify-ref: baserock/morph + build-depends: + - mercurial-tarball +- name: cvsps + morph: strata/lorry/cvsps.morph + repo: upstream:cvsps + ref: 71c6d1f5668f405a7b259a0aac0d423f6c9b4d49 + unpetrify-ref: baserock/morph + build-depends: [] +- name: lorry + morph: strata/lorry/lorry.morph + repo: baserock:baserock/lorry + ref: 9fe25bf02dceec04f0ffd6a05cc47146ceab9904 + unpetrify-ref: master + build-depends: + - bzr-tarball + - python-fastimport + - bzr-fastimport + - perl-dbi-tarball + - perl-dbd-sqlite-tarball + - cvs-tarball + - cvsps + - subversion-tarball + - mercurial-tarball + - hg-fast-export diff --git a/strata/lorry/cvs-tarball.morph b/strata/lorry/cvs-tarball.morph new file mode 100644 index 00000000..e8322017 --- /dev/null +++ b/strata/lorry/cvs-tarball.morph @@ -0,0 +1,6 @@ +name: cvs-tarball +kind: chunk +build-system: autotools +configure-commands: +- YACC='bison -y' ./configure --prefix "$PREFIX" --with-external-zlib --without-gssapi + --without-krb4 --disable-dependency-tracking --disable-nls --disable-rpath diff --git a/strata/lorry/cvsps.morph b/strata/lorry/cvsps.morph new file mode 100644 index 00000000..ff53784e --- /dev/null +++ b/strata/lorry/cvsps.morph @@ -0,0 +1,6 @@ +name: cvsps +kind: chunk +build-commands: +- make +install-commands: +- make install prefix="$DESTDIR$PREFIX" diff --git a/strata/lorry/hg-fast-export.morph b/strata/lorry/hg-fast-export.morph new file mode 100644 index 00000000..ef99a97a --- /dev/null +++ b/strata/lorry/hg-fast-export.morph @@ -0,0 +1,10 @@ +name: hg-fast-export +kind: chunk +install-commands: +- install -d "$DESTDIR/$PREFIX/bin" +- install -m 0755 hg-fast-export.py "$DESTDIR/$PREFIX/bin/" +- install -m 0755 hg-reset.py "$DESTDIR/$PREFIX/bin/" +- install -m 0755 hg-fast-export.sh "$DESTDIR/$PREFIX/bin/hg-fast-export" +- install -m 0755 hg-reset.sh "$DESTDIR/$PREFIX/bin/hg-reset" +- install -d "$DESTDIR/$PREFIX/lib/python2.7/site-packages" +- install -m 0644 hg2git.py "$DESTDIR/$PREFIX/lib/python2.7/site-packages/" diff --git a/strata/lorry/libapr-util-tarball.morph b/strata/lorry/libapr-util-tarball.morph new file mode 100644 index 00000000..e34e3610 --- /dev/null +++ b/strata/lorry/libapr-util-tarball.morph @@ -0,0 +1,5 @@ +name: libapr-util-tarball +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix "$PREFIX" --with-apr=/usr/bin/apr-1-config diff --git a/strata/lorry/lorry.morph b/strata/lorry/lorry.morph new file mode 100644 index 00000000..6b8cb355 --- /dev/null +++ b/strata/lorry/lorry.morph @@ -0,0 +1,3 @@ +name: lorry +kind: chunk +build-system: python-distutils diff --git a/strata/lorry/mercurial-tarball.morph b/strata/lorry/mercurial-tarball.morph new file mode 100644 index 00000000..03264f56 --- /dev/null +++ b/strata/lorry/mercurial-tarball.morph @@ -0,0 +1,6 @@ +name: mercurial-tarball +kind: chunk +build-commands: +- make build PREFIX="$PREFIX" +install-commands: +- make install-bin PREFIX="$PREFIX" DESTDIR="$DESTDIR" diff --git a/strata/lorry/neon.morph b/strata/lorry/neon.morph new file mode 100644 index 00000000..19f8e83f --- /dev/null +++ b/strata/lorry/neon.morph @@ -0,0 +1,8 @@ +name: neon +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh +- ./configure --prefix="$PREFIX" --with-ssl +install-commands: +- make install-lib install-headers install-config DESTDIR="$DESTDIR" diff --git a/strata/lorry/perl-dbi-tarball.morph b/strata/lorry/perl-dbi-tarball.morph new file mode 100644 index 00000000..9eb3a537 --- /dev/null +++ b/strata/lorry/perl-dbi-tarball.morph @@ -0,0 +1,5 @@ +name: perl-dbi-tarball +kind: chunk +build-system: cpan +build-commands: +- make -j1 diff --git a/strata/lorry/subversion-tarball.morph b/strata/lorry/subversion-tarball.morph new file mode 100644 index 00000000..cb416d53 --- /dev/null +++ b/strata/lorry/subversion-tarball.morph @@ -0,0 +1,10 @@ +name: subversion-tarball +kind: chunk +build-system: autotools +configure-commands: +- python gen-make.py build.conf +- ./configure --prefix="$PREFIX" --without-berkeley-db +install-commands: +- make install DESTDIR="$DESTDIR" +- make swig-pl +- make install-swig-pl DESTDIR="$DESTDIR" diff --git a/strata/lorry/swig-tarball.morph b/strata/lorry/swig-tarball.morph new file mode 100644 index 00000000..61f154a4 --- /dev/null +++ b/strata/lorry/swig-tarball.morph @@ -0,0 +1,5 @@ +name: swig-tarball +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --disable-ccache diff --git a/strata/lua.morph b/strata/lua.morph new file mode 100644 index 00000000..75ccad86 --- /dev/null +++ b/strata/lua.morph @@ -0,0 +1,18 @@ +name: lua +kind: stratum +description: Interpreter for the lua scripting language. +build-depends: +- morph: strata/tools.morph +chunks: +- name: lua + morph: strata/lua/lua.morph + repo: upstream:lua + ref: 948063437e0350d9ef1649ec3a76d0c24a5c8642 + unpetrify-ref: baserock/5.1-morph + build-depends: [] +- name: luajit2 + morph: strata/lua/luajit2.morph + repo: upstream:luajit2 + ref: 880ca300e8fb7b432b9d25ed377db2102e4cb63d + unpetrify-ref: v2.0.3 + build-depends: [] diff --git a/strata/lua/lua.morph b/strata/lua/lua.morph new file mode 100644 index 00000000..32aeb5c1 --- /dev/null +++ b/strata/lua/lua.morph @@ -0,0 +1,11 @@ +name: lua +kind: chunk +configure-commands: +- sed -e 's/defined(LUA_USE_READLINE)/0/g' src/luaconf.h.orig >src/luaconf.h +- sed -i -e '/^linux:/{n;s/-lreadline//g;s/-lhistory//g;s/-lncurses//g}' src/Makefile +build-commands: +- make debian_linux INSTALL_TOP="$PREFIX" RPATH="$PREFIX/lib" +install-commands: +- make INSTALL_TOP="$DESTDIR/$PREFIX" debian_install +- mkdir -p "$DESTDIR/$PREFIX/lib/pkgconfig" +- cp lua5.1.pc "$DESTDIR/$PREFIX/lib/pkgconfig/" diff --git a/strata/lua/luajit2.morph b/strata/lua/luajit2.morph new file mode 100644 index 00000000..72f34f02 --- /dev/null +++ b/strata/lua/luajit2.morph @@ -0,0 +1,7 @@ +name: luajit2 +kind: chunk +build-commands: +- make PREFIX="$PREFIX" +install-commands: +- make install PREFIX="$PREFIX" DESTDIR="$DESTDIR" + diff --git a/strata/mesa-common.morph b/strata/mesa-common.morph new file mode 100644 index 00000000..efae2449 --- /dev/null +++ b/strata/mesa-common.morph @@ -0,0 +1,13 @@ +name: mesa-common +kind: stratum +build-depends: +- morph: strata/llvm-common.morph +- morph: strata/libdrm-common.morph +- morph: strata/wayland-generic.morph +chunks: +- name: mesa + morph: strata/mesa-common/mesa.morph + repo: upstream:mesa + ref: 1a9cc5f50db5d27530a3449743b43aac389d781f + unpetrify-ref: mesa-10.3.3 + build-depends: [] diff --git a/strata/mesa-common/mesa.morph b/strata/mesa-common/mesa.morph new file mode 100644 index 00000000..4194acc2 --- /dev/null +++ b/strata/mesa-common/mesa.morph @@ -0,0 +1,23 @@ +name: mesa +kind: chunk +build-system: autotools +configure-commands: +- | + cpu=$(echo $TARGET | cut -d '-' -f 1) + case "$cpu" in + armv7lhf) + DRIDRIVERS=no + GALLIUMDRIVERS=nouveau,freedreno,svga,swrast,vc4 + ;; + *) + DRIDRIVERS=yes + GALLIUMDRIVERS=yes + ;; + esac + ./autogen.sh --prefix="$PREFIX" \ + --enable-gles2 \ + --disable-glx \ + --with-egl-platforms=drm,wayland \ + --with-gallium-drivers="$GALLIUMDRIVERS" \ + --with-dri-drivers="$DRIDRIVERS" \ + --enable-gallium-egl diff --git a/strata/morph-utils.morph b/strata/morph-utils.morph new file mode 100644 index 00000000..d2f9f364 --- /dev/null +++ b/strata/morph-utils.morph @@ -0,0 +1,82 @@ +name: morph-utils +kind: stratum +build-depends: +- morph: strata/core.morph +chunks: +- name: python-ttystatus + morph: strata/morph-utils/python-ttystatus.morph + repo: upstream:python-ttystatus + ref: 47d871216cea6ce3b9d6efd70e9a0f38ab8604f0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-markdown + repo: upstream:python-markdown + ref: a9ca97325e9039de90eae29fb3d8879bc9f367f6 + unpetrify-ref: baserock/morph + build-depends: [] +- name: git-fat + morph: strata/tools/git-fat.morph + repo: upstream:git-fat + ref: 208f88d0f0ef04c25e8a231979eb0083f57b1610 + unpetrify-ref: baserock/morph + build-depends: [] +- name: six + repo: upstream:six + ref: e66d45c46afc42eb89d7d2515b79f0ededa0e0fa + unpetrify-ref: baserock/morph + build-depends: [] +- name: pyfilesystem + morph: strata/morph-utils/pyfilesystem.morph + repo: upstream:pyfilesystem + ref: 821f7db1ce3a3e1ac53fa514ddacbc2871eac0f6 + unpetrify-ref: baserock/morph + build-depends: + - six +- name: python-coveragepy + morph: strata/morph-utils/python-coveragepy.morph + repo: upstream:python-coveragepy + ref: 77d2e3bfd8fb325092aaed37ba1378054d182d19 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-coverage-test-runner + repo: upstream:python-coverage-test-runner + ref: 8ea9421ac3384b2e88e0c36f2cfa52586c4798b7 + unpetrify-ref: baserock/morph + build-depends: + - python-coveragepy +- name: cliapp + repo: upstream:cliapp + ref: cec20cedd062a3aef1b04f997e77b45090c07806 + unpetrify-ref: baserock/morph + build-depends: + - python-coverage-test-runner +- name: cmdtest + morph: strata/morph-utils/cmdtest.morph + repo: upstream:cmdtest + ref: ac91791842c6e7e6eda3213916af413255999c7b + unpetrify-ref: baserock/morph + build-depends: + - cliapp + - python-ttystatus + - python-markdown +- name: bottle + repo: upstream:bottle + ref: 5238c615b3ec198fedebb0fcaad4458e3d68d70f + unpetrify-ref: baserock/morph + build-depends: [] +- name: flup + repo: upstream:flup + ref: 0f97c5e0ab7d9827506120efc22af3a9c21d1d70 + unpetrify-ref: baserock/morph + build-depends: [] +- name: morph + repo: baserock:baserock/morph + ref: d6a8067d6bfd929fa7505e019a4e6ea63e1210ea + unpetrify-ref: master + build-depends: + - cliapp + - cmdtest + - python-coverage-test-runner + - pyfilesystem + - bottle + - flup diff --git a/strata/morph-utils/cmdtest.morph b/strata/morph-utils/cmdtest.morph new file mode 100644 index 00000000..3e1c71c6 --- /dev/null +++ b/strata/morph-utils/cmdtest.morph @@ -0,0 +1,6 @@ +name: cmdtest +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/morph-utils/pyfilesystem.morph b/strata/morph-utils/pyfilesystem.morph new file mode 100644 index 00000000..a4931dfa --- /dev/null +++ b/strata/morph-utils/pyfilesystem.morph @@ -0,0 +1,6 @@ +name: pyfilesystem +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix="$PREFIX" --root "$DESTDIR" diff --git a/strata/morph-utils/python-coveragepy.morph b/strata/morph-utils/python-coveragepy.morph new file mode 100644 index 00000000..ed5e3d87 --- /dev/null +++ b/strata/morph-utils/python-coveragepy.morph @@ -0,0 +1,6 @@ +name: python-coveragepy +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/morph-utils/python-ttystatus.morph b/strata/morph-utils/python-ttystatus.morph new file mode 100644 index 00000000..e45ef7a8 --- /dev/null +++ b/strata/morph-utils/python-ttystatus.morph @@ -0,0 +1,6 @@ +name: python-ttystatus +kind: chunk +build-commands: +- python setup.py build +install-commands: +- python setup.py install --prefix=/usr --root "$DESTDIR" diff --git a/strata/multimedia-gstreamer-0.10.morph b/strata/multimedia-gstreamer-0.10.morph new file mode 100644 index 00000000..50917372 --- /dev/null +++ b/strata/multimedia-gstreamer-0.10.morph @@ -0,0 +1,33 @@ +name: multimedia-gstreamer-0.10 +kind: stratum +description: Codecs +build-depends: +- morph: strata/core.morph +- morph: strata/foundation.morph +- morph: strata/audio-bluetooth.morph +chunks: +- name: orc + repo: upstream:orc + ref: b4f7fcaf99a4d952e59f2a9fa9286d24cc4b3a5a + unpetrify-ref: baserock/morph + build-depends: [] +- name: gstreamer@0.10 + repo: upstream:gstreamer + ref: 1bb950008f4656f6a6153fa88a8ebb5a39fbe84f + unpetrify-ref: baserock/morph/0.10 + build-depends: + - orc +- name: gstreamer-plugins-base@0.10 + repo: upstream:gstreamer-plugins-base + ref: 960c596309dbb983a1d733259adccc45c47006a2 + unpetrify-ref: baserock/morph/0.10 + build-depends: + - gstreamer@0.10 +- name: gstreamer-plugins-good@0.10 + repo: upstream:gstreamer-plugins-good + ref: 725e80e0c6b7f8e66d9b3fcaffd283ecbd8498d3 + unpetrify-ref: baserock/morph/0.10 + build-depends: + - gstreamer@0.10 + - gstreamer-plugins-base@0.10 + - orc diff --git a/strata/multimedia.morph b/strata/multimedia.morph new file mode 100644 index 00000000..6acab0f7 --- /dev/null +++ b/strata/multimedia.morph @@ -0,0 +1,39 @@ +name: multimedia +kind: stratum +description: Codecs +build-depends: +- morph: strata/audio-bluetooth.morph +chunks: +- name: orc + repo: upstream:orc + ref: 16e053b8f2359196fd50b111f1c10b93590f5cb9 + unpetrify-ref: orc-0.4.22 + build-depends: [] +- name: gstreamer + repo: upstream:gstreamer + ref: b9b3440e323c7b32a8c3a9d52c7bf1a229850558 + unpetrify-ref: baserock/1.4 + build-depends: + - orc +- name: gstreamer-plugins-base + repo: upstream:gstreamer-plugins-base + ref: 3b38ad94a2d58c07c24e4647e08afa1fe4dd7d46 + unpetrify-ref: baserock/1.4 + build-depends: + - gstreamer +- name: gstreamer-plugins-good + repo: upstream:gstreamer-plugins-good + ref: 9d48c2f7a7b63fd967de7eec72434bc876c02667 + unpetrify-ref: baserock/1.4 + build-depends: + - gstreamer + - gstreamer-plugins-base + - orc +- name: gstreamer-plugins-bad + repo: upstream:gstreamer-plugins-bad + ref: bb2a4669ff57af90c8101c54744d3228aa060475 + unpetrify-ref: baserock/1.4 + build-depends: + - gstreamer + - gstreamer-plugins-base + - orc diff --git a/strata/network-security.morph b/strata/network-security.morph new file mode 100644 index 00000000..3d0c7814 --- /dev/null +++ b/strata/network-security.morph @@ -0,0 +1,19 @@ +name: network-security +kind: stratum +build-depends: +- morph: strata/core.morph +chunks: +- name: nspr + morph: strata/network-security/nspr.morph + repo: upstream:nspr-hg + ref: a6ee84946475c1fb7624973af28163f6da247c0d + unpetrify-ref: baserock/morph + build-depends: [] +- name: nss + morph: strata/network-security/nss.morph + repo: upstream:nss + ref: ee1c99a3c8c29f50a91ab28f2f7b7773f6355487 + unpetrify-ref: baserock/morph + build-depends: + - nspr + diff --git a/strata/network-security/nspr.morph b/strata/network-security/nspr.morph new file mode 100644 index 00000000..27613eb4 --- /dev/null +++ b/strata/network-security/nspr.morph @@ -0,0 +1,12 @@ +name: nspr +kind: chunk +build-system: autotools +configure-commands: +- | + case "$MORPH_ARCH" in + x86_64|ppc64) + EXTRA_ARGS="--enable-64bit";; + *) + EXTRA_ARGS="";; + esac + ./configure --prefix="$PREFIX" --with-mozilla --with-pthreads $EXTRA_ARGS diff --git a/strata/network-security/nss.morph b/strata/network-security/nss.morph new file mode 100644 index 00000000..c83fd174 --- /dev/null +++ b/strata/network-security/nss.morph @@ -0,0 +1,7 @@ +name: nss +kind: chunk +max-jobs: 1 +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --libdir="$PREFIX/lib" diff --git a/strata/nfs.morph b/strata/nfs.morph new file mode 100644 index 00000000..68988d54 --- /dev/null +++ b/strata/nfs.morph @@ -0,0 +1,32 @@ +name: nfs +kind: stratum +description: NFS utilities +build-depends: +- morph: strata/foundation.morph +chunks: +- name: libevent + repo: upstream:libevent + ref: 9364dff5c20e9e8c18f7f20ee1c92463e9e9c8a7 + unpetrify-ref: baserock/release-2.0.21-stable + build-depends: [] +- name: ti-rpc + morph: strata/nfs/ti-rpc.morph + repo: upstream:ti-rpc + ref: c5a7a19070e74115fc9c26aa6f3dfec1da220c1f + unpetrify-ref: baserock/master + build-depends: [] +- name: rpcbind + morph: strata/nfs/rpcbind.morph + repo: upstream:rpcbind + ref: aa3ac0d86c258d3e355ae59df31a96da795ecdfa + unpetrify-ref: baserock/master + build-depends: + - ti-rpc +- name: nfs-utils + morph: strata/nfs/nfs-utils.morph + repo: upstream:nfs-utils + ref: 08baf3bc2f66a1ca6401191e19380028d2fc2c6d + unpetrify-ref: baserock/master + build-depends: + - libevent + - ti-rpc diff --git a/strata/nfs/nfs-utils.morph b/strata/nfs/nfs-utils.morph new file mode 100644 index 00000000..c412e1d0 --- /dev/null +++ b/strata/nfs/nfs-utils.morph @@ -0,0 +1,12 @@ +name: nfs-utils +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-nfsv4 --disable-nfsv41 --disable-gss --with-rpcgen=internal --without-tcp-wrappers +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR"/lib/systemd/system +- install -m644 proc-fs-nfsd.mount "$DESTDIR"/lib/systemd/system +- install -m644 nfs-mountd.service "$DESTDIR"/lib/systemd/system +- install -m644 nfs-server.service "$DESTDIR"/lib/systemd/system diff --git a/strata/nfs/rpcbind.morph b/strata/nfs/rpcbind.morph new file mode 100644 index 00000000..0ca929dc --- /dev/null +++ b/strata/nfs/rpcbind.morph @@ -0,0 +1,11 @@ +name: rpcbind +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --with-rpcuser=nobody --enable-warmstarts +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR"/lib/systemd/system +- install -m644 rpcbind.service "$DESTDIR"/lib/systemd/system +- install -m644 rpcbind.socket "$DESTDIR"/lib/systemd/system diff --git a/strata/nfs/tcp-wrappers.morph b/strata/nfs/tcp-wrappers.morph new file mode 100644 index 00000000..c68671f6 --- /dev/null +++ b/strata/nfs/tcp-wrappers.morph @@ -0,0 +1,9 @@ +name: tcp-wrappers +kind: chunk +build-commands: +- make MAJOR=0 MINOR=7 REL=6 linux +install-commands: +- mkdir -p "$DESTDIR"/"$PREFIX"/include +- install -p -m644 tcpd.h "$DESTDIR"/"$PREFIX"/include +- mkdir -p "$DESTDIR"/"$PREFIX"/lib +- cp -a libwrap.so* "$DESTDIR"/"$PREFIX"/lib diff --git a/strata/nfs/ti-rpc.morph b/strata/nfs/ti-rpc.morph new file mode 100644 index 00000000..3fb91e1f --- /dev/null +++ b/strata/nfs/ti-rpc.morph @@ -0,0 +1,6 @@ +name: ti-rpc +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --sysconfdir=/etc diff --git a/strata/nodejs.morph b/strata/nodejs.morph new file mode 100644 index 00000000..f8955a01 --- /dev/null +++ b/strata/nodejs.morph @@ -0,0 +1,11 @@ +name: nodejs +kind: stratum +description: Stratum for nodejs related stuff +build-depends: +- morph: strata/core.morph +chunks: +- name: node + repo: upstream:node + ref: cc56c62ed879ad4f93b1fdab3235c43e60f48b7e + unpetrify-ref: v0.10.26 + build-depends: [] diff --git a/strata/openstack-clients.morph b/strata/openstack-clients.morph new file mode 100644 index 00000000..616a8762 --- /dev/null +++ b/strata/openstack-clients.morph @@ -0,0 +1,117 @@ +name: openstack-clients +kind: stratum +description: A stratum with OpenStack clients, for OpenStack deployments. +build-depends: +- morph: strata/tools.morph +chunks: +- name: jsonschema + repo: upstream:jsonschema + ref: 292a256b918af1e567982bb801c427cf4ca5b9fe + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-json-pointer + repo: upstream:python-json-pointer + ref: 48dce313141ba5bf0d2f3dd2e590042c05755e53 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-json-patch + repo: upstream:python-json-patch + ref: 27c7032de25923593fa17cc14f535fb7abd52448 + unpetrify-ref: baserock/morph + build-depends: [] +- name: warlock + repo: upstream:warlock + ref: 1a0de8a67df8282c42f71014cc871684e8d7c0cf + unpetrify-ref: baserock/morph + build-depends: + - jsonschema + - python-json-pointer + - python-json-patch +- name: python-prettytable + morph: strata/openstack-clients/python-prettytable.morph + repo: upstream:python-prettytable + ref: 941133673e5a0003cd5ce1b6db2a51cf3307d9c1 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pbr + repo: upstream:pbr + ref: 510ee9e9dcb94c5884c215fa3535a1f77f3d2a51 + unpetrify-ref: baserock/morph + build-depends: [] +- name: argparse + repo: upstream:argparse + ref: c9b3f9b32949cb7dd798e7d1aedbeeef064aa4b1 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pyopenssl + repo: upstream:pyopenssl + ref: 6bbf44a00b35fb28df1f66aa194b2fe95eab1ab2 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pyiso8601 + repo: upstream:pyiso8601 + ref: ac5470ec9e68332ebc499c4f9f21e7e3cb31ecb6 + unpetrify-ref: baserock/morph + build-depends: [] +- name: python-requests + repo: upstream:python-requests + ref: b891877ee6d76b0a3f8cbf2e7cd34cc4cbc40b6b + unpetrify-ref: baserock/morph + build-depends: [] +- name: simplejson + repo: upstream:simplejson + ref: 35816bfe2d0ddeb5ddcc68239683cbb35b7e3ff2 + unpetrify-ref: baserock/morph + build-depends: [] +- name: netaddr + repo: upstream:netaddr + ref: f64ae19e533ffa5522dcba1fc833975cb2ee88a5 + unpetrify-ref: baserock/morph + build-depends: [] +- name: pytz + morph: strata/openstack-clients/pytz.morph + repo: upstream:pytz + ref: 384207f01fd5b8bf1eb20cb64c17679084731944 + unpetrify-ref: baserock/morph + build-depends: [] +- name: babel + repo: upstream:babel + ref: d764b35bc3910b8f67ff811752df615afa7667f6 + unpetrify-ref: baserock/morph + build-depends: + - pytz +- name: python-keystoneclient + repo: upstream:python-keystoneclient + ref: 21cc66a850c5ea1d2ffffb655da0c452b919ed3b + unpetrify-ref: baserock/morph + build-depends: + - pbr + - pyiso8601 + - python-prettytable + - python-requests + - simplejson + - netaddr + - babel +- name: python-glanceclient + repo: upstream:python-glanceclient + ref: 721660612df4454726b723daf902abd23ba0109c + unpetrify-ref: baserock/morph + build-depends: + - python-prettytable + - pbr + - argparse + - pyopenssl + - python-keystoneclient + - warlock +- name: python-novaclient + repo: upstream:python-novaclient + ref: 9e4530c79e46d392ed8f3e413bca1acffe022fe6 + unpetrify-ref: baserock/morph + build-depends: + - python-prettytable + - pbr + - argparse + - pyiso8601 + - python-requests + - simplejson + - babel diff --git a/strata/openstack-clients/python-prettytable.morph b/strata/openstack-clients/python-prettytable.morph new file mode 100644 index 00000000..cf1ac6e1 --- /dev/null +++ b/strata/openstack-clients/python-prettytable.morph @@ -0,0 +1,6 @@ +name: python-prettytable +kind: chunk +build-commands: +- cd src && python setup.py build +install-commands: +- cd src && python setup.py install --prefix "$PREFIX" --root "$DESTDIR" diff --git a/strata/openstack-clients/pytz.morph b/strata/openstack-clients/pytz.morph new file mode 100644 index 00000000..f5557946 --- /dev/null +++ b/strata/openstack-clients/pytz.morph @@ -0,0 +1,6 @@ +name: pytz +kind: chunk +build-commands: +- cd src && python setup.py build +install-commands: +- cd src && python setup.py install --prefix "$PREFIX" --root "$DESTDIR" diff --git a/strata/patch-manager-gerrit.morph b/strata/patch-manager-gerrit.morph new file mode 100644 index 00000000..bcc03c86 --- /dev/null +++ b/strata/patch-manager-gerrit.morph @@ -0,0 +1,11 @@ +name: patch-manager-gerrit +kind: stratum +build-depends: +- morph: strata/tools.morph +chunks: +- name: gerrit-installation-binaries + morph: strata/patch-manager-gerrit/gerrit-installation-binaries.morph + repo: github:franred/gerrit-installation-binaries + ref: ef262c635890f19eaff8ef6bbd831ee9b0d8693e + unpetrify-ref: master + build-depends: [] diff --git a/strata/patch-manager-gerrit/gerrit-installation-binaries.morph b/strata/patch-manager-gerrit/gerrit-installation-binaries.morph new file mode 100644 index 00000000..b0d1a393 --- /dev/null +++ b/strata/patch-manager-gerrit/gerrit-installation-binaries.morph @@ -0,0 +1,28 @@ +name: gerrit-installation-binaries +kind: chunk +configure-commands: [] +build-commands: +- cat jdk-8u20-linux-x64.tar.gz_* > jdk-8u20-linux-x64.tar.gz +install-commands: +- mkdir -p "$DESTDIR$PREFIX"/bin +- mkdir -p "$DESTDIR$PREFIX"/lib +- mkdir -p "$DESTDIR$PREFIX"/share/gerrit +- cp gerrit-2.9.war "$DESTDIR$PREFIX"/share/gerrit +- tar zxf jdk-8u20-linux-x64.tar.gz -C "$DESTDIR$PREFIX"/lib +- unzip jce_policy-8.zip -d "$DESTDIR$PREFIX"/lib/jdk1.8.0_20/jre/lib/security +- ln -sfn "$PREFIX"/lib/jdk1.8.0_20/jre/bin/java "$DESTDIR$PREFIX"/bin/ +system-integration: + gerrit-installation-binaries-misc: + 01-adduser: + - adduser -D -h /home/gerrit2 -g 'Gerrit Administrator' -s /bin/sh gerrit2 + 02-install-gerrit: + - | + install -D /usr/share/gerrit/gerrit-2.9.war /home/gerrit2/gerrit/gerrit-2.9.war \ + -o gerrit2 -g gerrit2 -m 644 + chown gerrit2 /home/gerrit2/gerrit + sudo LD_LIBRARY_PATH=/usr/jdk1.8.0_20/jre/lib/amd64/jli \ + -u gerrit2 java -jar /home/gerrit2/gerrit/gerrit-2.9.war \ + init --batch -d /home/gerrit2/gerrit/.gerrit_controller \ + --no-auto-start + sed -i "s|canonicalWebUrl =.*|canonicalWebUrl = http://localhost:8080|g" \ + /home/gerrit2/gerrit/.gerrit_controller/etc/gerrit.config diff --git a/strata/pcre-utils.morph b/strata/pcre-utils.morph new file mode 100644 index 00000000..44d0bab2 --- /dev/null +++ b/strata/pcre-utils.morph @@ -0,0 +1,10 @@ +name: pcre-utils +kind: stratum +build-depends: +- morph: strata/tools.morph +chunks: +- name: pcre + repo: upstream:pcre + ref: 2720152c58e13e7cc7403642ec33127101b9971b + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/python-tools.morph b/strata/python-tools.morph new file mode 100644 index 00000000..0a707bc6 --- /dev/null +++ b/strata/python-tools.morph @@ -0,0 +1,12 @@ +name: python-tools +kind: stratum +description: "A stratum for non-essential python tools: +useful python tools that we don't want to include in core." +build-depends: +- morph: strata/core.morph +chunks: +- name: pip + repo: upstream:pip + ref: ea680f204fb0e48789710c22c8f597a9bf01bc16 + unpetrify-ref: baserock/master + build-depends: [] diff --git a/strata/qt4-sdk.morph b/strata/qt4-sdk.morph new file mode 100644 index 00000000..b260c9d9 --- /dev/null +++ b/strata/qt4-sdk.morph @@ -0,0 +1,12 @@ +name: qt4-sdk +kind: stratum +description: Qt4 Desktop Environment, IDE and Example Apps +build-depends: +- morph: strata/qt4-tools.morph +chunks: +- name: qt-creator + morph: strata/qt4-sdk/qt-creator.morph + repo: upstream:qt-creator + ref: d5a6b10634c1a3271012e9578e016772ef077d59 + unpetrify-ref: baserock/morph/2.7 + build-depends: [] diff --git a/strata/qt4-sdk/qt-creator.morph b/strata/qt4-sdk/qt-creator.morph new file mode 100644 index 00000000..76d9f7d7 --- /dev/null +++ b/strata/qt4-sdk/qt-creator.morph @@ -0,0 +1,9 @@ +name: qt-creator +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- ./qhelpgenerator.sh diff --git a/strata/qt4-tools.morph b/strata/qt4-tools.morph new file mode 100644 index 00000000..18d2cc5f --- /dev/null +++ b/strata/qt4-tools.morph @@ -0,0 +1,35 @@ +name: qt4-tools +kind: stratum +description: Qt4 Development Libraries and Tools +build-depends: +- morph: strata/tools.morph +- morph: strata/x-generic.morph +- morph: strata/multimedia-gstreamer-0.10.morph +chunks: +- name: icu + morph: strata/qt4-tools/icu.morph + repo: upstream:icu + ref: ba023548a3bff7277cbea4acade3042ce9d8949e + unpetrify-ref: baserock/morph + build-depends: [] +- name: ruby-1.8 + morph: strata/qt4-tools/ruby-1.8.morph + repo: upstream:ruby + ref: 7a24f1710028d568ad61d0aa49d5178260178d77 + unpetrify-ref: baserock/morph/ruby_1_8_7 + build-depends: [] +- name: ruby-1.9 + morph: strata/qt4-tools/ruby-1.9.morph + repo: upstream:ruby + ref: cb3ea602294b5038b5f7ac21d3875a2b52342956 + unpetrify-ref: baserock/morph/ruby_1_9_3 + build-depends: + - ruby-1.8 +- name: qt4-tools + morph: strata/qt4-tools/qt4-tools.morph + repo: upstream:qt4-tools + ref: a182f020bc1703c20d86ba18f2f6b4ea8889de84 + unpetrify-ref: baserock/morph + build-depends: + - icu + - ruby-1.9 diff --git a/strata/qt4-tools/icu.morph b/strata/qt4-tools/icu.morph new file mode 100644 index 00000000..37dec07e --- /dev/null +++ b/strata/qt4-tools/icu.morph @@ -0,0 +1,8 @@ +name: icu +kind: chunk +configure-commands: +- cd source; ./runConfigureICU Linux --prefix=/usr +build-commands: +- cd source; unset TARGET ; make +install-commands: +- cd source; unset TARGET ; make DESTDIR="$DESTDIR" install diff --git a/strata/qt4-tools/qt4-tools.morph b/strata/qt4-tools/qt4-tools.morph new file mode 100644 index 00000000..bc4cc17e --- /dev/null +++ b/strata/qt4-tools/qt4-tools.morph @@ -0,0 +1,18 @@ +name: qt4-tools +kind: chunk +max-jobs: 1 +configure-commands: +- | + arch=$(uname -m) + if [ "${arch}" != "${arch//arm/}" ] ; then + sed 's/g++-unix.conf)/&\nQMAKE_CXXFLAGS += -fno-strict-volatile-bitfields/' \ + -i mkspecs/linux-g++/qmake.conf + else + echo Running on x86, not modifying qmake.conf + fi +- ./configure -v -prefix /usr -opensource -confirm-license +build-commands: +- make +- LD_LIBRARY_PATH="$PWD"/lib QT_PLUGIN_PATH="$PWD"/plugins make docs +install-commands: +- make install INSTALL_ROOT="$DESTDIR" diff --git a/strata/qt4-tools/ruby-1.8.morph b/strata/qt4-tools/ruby-1.8.morph new file mode 100644 index 00000000..cee282c0 --- /dev/null +++ b/strata/qt4-tools/ruby-1.8.morph @@ -0,0 +1,9 @@ +name: ruby-1.8 +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --program-suffix=-1.8 +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/qt4-tools/ruby-1.9.morph b/strata/qt4-tools/ruby-1.9.morph new file mode 100644 index 00000000..bc697ada --- /dev/null +++ b/strata/qt4-tools/ruby-1.9.morph @@ -0,0 +1,9 @@ +name: ruby-1.9 +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --enable-shared --with-baseruby=/usr/bin/ruby-1.8 +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/qt5-sdk.morph b/strata/qt5-sdk.morph new file mode 100644 index 00000000..0d877a62 --- /dev/null +++ b/strata/qt5-sdk.morph @@ -0,0 +1,13 @@ +name: qt5-sdk +kind: stratum +description: Qt5 Desktop Environment, IDE and Example Apps +build-depends: +- morph: strata/qt5-tools.morph +- morph: strata/qt5-tools-qtwebkit.morph +chunks: +- name: qt-creator + morph: strata/qt5-sdk/qt-creator.morph + repo: upstream:qt-creator + ref: v3.2.1 + unpetrify-ref: baserock/morph/2.7 + build-depends: [] diff --git a/strata/qt5-sdk/qt-creator.morph b/strata/qt5-sdk/qt-creator.morph new file mode 100644 index 00000000..91fae589 --- /dev/null +++ b/strata/qt5-sdk/qt-creator.morph @@ -0,0 +1,8 @@ +name: qt-creator +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-sdk/snowshoe.morph b/strata/qt5-sdk/snowshoe.morph new file mode 100644 index 00000000..f89ab751 --- /dev/null +++ b/strata/qt5-sdk/snowshoe.morph @@ -0,0 +1,8 @@ +name: snowshoe +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools-qtmultimedia.morph b/strata/qt5-tools-qtmultimedia.morph new file mode 100644 index 00000000..6482db62 --- /dev/null +++ b/strata/qt5-tools-qtmultimedia.morph @@ -0,0 +1,13 @@ +name: qt5-tools-qtmultimedia +kind: stratum +description: Qt5 QtMultimedia Development Libraries and Tools +build-depends: +- morph: strata/qt5-tools.morph +- morph: strata/multimedia-gstreamer-0.10.morph +chunks: +- name: qtmultimedia + morph: strata/qt5-tools/qtmultimedia.morph + repo: upstream:qt5/qtmultimedia + ref: b3c2dca466042cf362ffb8d803bf05c9b8a0f95f + unpetrify-ref: v5.3.2 + build-depends: [] diff --git a/strata/qt5-tools-qtwebkit.morph b/strata/qt5-tools-qtwebkit.morph new file mode 100644 index 00000000..1d746949 --- /dev/null +++ b/strata/qt5-tools-qtwebkit.morph @@ -0,0 +1,35 @@ +name: qt5-tools-qtwebkit +kind: stratum +description: Qt5 WebKit Development Libraries and Tools +build-depends: +- morph: strata/multimedia.morph +- morph: strata/qt5-tools.morph +- morph: strata/ruby.morph +chunks: +- name: qtwebkit + morph: strata/qt5-tools/qtwebkit.morph + repo: upstream:qt5/qtwebkit + ref: 13f80d34ae84c3231118c8013beee55badab8929 + unpetrify-ref: v5.3.2 + build-depends: [] +- name: qtwebkit-examples + morph: strata/qt5-tools/qtwebkit-examples.morph + repo: upstream:qt5/qtwebkit-examples + ref: bce5056b9e16a943357e362455a46685d3f22093 + unpetrify-ref: v5.3.2 + build-depends: + - qtwebkit +- name: qttools + morph: strata/qt5-tools/qttools.morph + repo: upstream:qt5/qttools + ref: 8c79a098b8b7da4832ebca1884ee833a2c2078a7 + unpetrify-ref: v5.3.2 + build-depends: + - qtwebkit +- name: qttranslations + morph: strata/qt5-tools/qttranslations.morph + repo: upstream:qt5/qttranslations + ref: cf4d6f7e73bb410ed0aa3d64dffb2b6b242cdfe0 + unpetrify-ref: v5.3.2 + build-depends: + - qttools diff --git a/strata/qt5-tools.morph b/strata/qt5-tools.morph new file mode 100644 index 00000000..34e57bc4 --- /dev/null +++ b/strata/qt5-tools.morph @@ -0,0 +1,139 @@ +name: qt5-tools +kind: stratum +description: Qt5 Development Libraries and Tools +build-depends: +- morph: strata/tools.morph +- morph: strata/x-generic.morph +chunks: +- name: icu + morph: strata/qt5-tools/icu.morph + repo: upstream:icu + ref: ba023548a3bff7277cbea4acade3042ce9d8949e + unpetrify-ref: baserock/morph + build-depends: [] +- name: qtbase + morph: strata/qt5-tools/qtbase.morph + repo: upstream:qt5/qtbase + ref: 05670f586ffe05425b7542a27fcca31bddf231aa + unpetrify-ref: v5.3.2 + build-depends: + - icu +- name: qtsvg + morph: strata/qt5-tools/qtsvg.morph + repo: upstream:qt5/qtsvg + ref: 35a2f0880831d38c60d2b4820dac808f48f6f3a8 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtscript + morph: strata/qt5-tools/qtscript.morph + repo: upstream:qt5/qtscript + ref: 71f6dee8791c95fd862ca3651d7f4b7d6b9f440e + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtdeclarative + morph: strata/qt5-tools/qtdeclarative.morph + repo: upstream:qt5/qtdeclarative + ref: a67aa6abc6a406b00ef58a7e07fd39012bfa3eb1 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase + - qtscript +- name: qtquick1 + morph: strata/qt5-tools/qtquick1.morph + repo: upstream:qt5/qtquick1 + ref: 8e7fa2b5aa2e2e4371c4b73926d0e6ad2ebdbd96 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase + - qtscript +- name: qt3d + morph: strata/qt5-tools/qt3d.morph + repo: upstream:qt5/qt3d + ref: bdb98baf8253c69949a8c259369203da9ffb269c + unpetrify-ref: baserock/morph + build-depends: + - qtbase + - qtscript + - qtdeclarative +- name: qtquickcontrols + morph: strata/qt5-tools/qtquickcontrols.morph + repo: upstream:qt5/qtquickcontrols + ref: bc91574cca8b6f24968ab4e1cc11fe1fd10f3061 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase + - qtdeclarative +- name: qtsensors + morph: strata/qt5-tools/qtsensors.morph + repo: upstream:qt5/qtsensors + ref: fd3e65ef5ab6eb8e4b5bdad380d1f6862799856c + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtserialport + morph: strata/qt5-tools/qtserialport.morph + repo: upstream:qt5/qtserialport + ref: 286d64c202f461cb8ff5a4cc4c2320af8195b8f0 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtx11extras + morph: strata/qt5-tools/qtx11extras.morph + repo: upstream:qt5/qtx11extras + ref: 2d84caf5ef1b5dace0d678df4581db3c955be6ee + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtxmlpatterns + morph: strata/qt5-tools/qtxmlpatterns.morph + repo: upstream:qt5/qtxmlpatterns + ref: 78c2367e22d87b529610117f5b6abef6934abdcf + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtdoc + morph: strata/qt5-tools/qtdoc.morph + repo: upstream:qt5/qtdoc + ref: 688019893d2cbd9ccdc4d75c550bca4530a46ee4 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtgraphicaleffects + morph: strata/qt5-tools/qtgraphicaleffects.morph + repo: upstream:qt5/qtgraphicaleffects + ref: 82abf6975b6737259ee656564e5ec7f8ad1d0508 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase + - qtdeclarative +- name: qtimageformats + morph: strata/qt5-tools/qtimageformats.morph + repo: upstream:qt5/qtimageformats + ref: 85e621e3ecf449bb0587bd4da97ca66179b24f31 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtconnectivity + morph: strata/qt5-tools/qtconnectivity.morph + repo: upstream:qt5/qtconnectivity + ref: 8a33a9b43dcc5e7f9a77237a660a3759286e6b86 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtlocation + morph: strata/qt5-tools/qtlocation.morph + repo: upstream:qt5/qtlocation + ref: a36d9e67e3b8168cb4d1eb76eda96ebb8242fd20 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase +- name: qtwebsockets + morph: strata/qt5-tools/qtwebsockets.morph + repo: upstream:qt5/qtwebsockets + ref: 00f77bdc5beb62e980216cfee906ab7aa1d1c4f7 + unpetrify-ref: v5.3.2 + build-depends: + - qtbase + diff --git a/strata/qt5-tools/icu.morph b/strata/qt5-tools/icu.morph new file mode 100644 index 00000000..37dec07e --- /dev/null +++ b/strata/qt5-tools/icu.morph @@ -0,0 +1,8 @@ +name: icu +kind: chunk +configure-commands: +- cd source; ./runConfigureICU Linux --prefix=/usr +build-commands: +- cd source; unset TARGET ; make +install-commands: +- cd source; unset TARGET ; make DESTDIR="$DESTDIR" install diff --git a/strata/qt5-tools/qt3d.morph b/strata/qt5-tools/qt3d.morph new file mode 100644 index 00000000..d4e44d4e --- /dev/null +++ b/strata/qt5-tools/qt3d.morph @@ -0,0 +1,10 @@ +name: qt3d +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtbase.morph b/strata/qt5-tools/qtbase.morph new file mode 100644 index 00000000..9b2a20c6 --- /dev/null +++ b/strata/qt5-tools/qtbase.morph @@ -0,0 +1,17 @@ +name: qtbase +kind: chunk +configure-commands: +- ./configure -v -prefix /usr -opensource -confirm-license +build-commands: +- make +- touch /qtbase.build/src/corelib/corelib.pro +- touch /qtbase.build/qmake/qmake.pro +- touch /qtbase.build/qmake/qmake-docs.pro +- ./bin/qmake -set QDOC /qtbase.build/bin/qdoc +- make html_docs +- ./bin/qmake -unset QDOC +install-commands: +- make install INSTALL_ROOT="$DESTDIR" +- ./bin/qmake -set QDOC /qtbase.build/bin/qdoc +- make install_html_docs INSTALL_ROOT="$DESTDIR" +- ./bin/qmake -unset QDOC diff --git a/strata/qt5-tools/qtconnectivity.morph b/strata/qt5-tools/qtconnectivity.morph new file mode 100644 index 00000000..d1123711 --- /dev/null +++ b/strata/qt5-tools/qtconnectivity.morph @@ -0,0 +1,10 @@ +name: qtconnectivity +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtdeclarative.morph b/strata/qt5-tools/qtdeclarative.morph new file mode 100644 index 00000000..9eb02331 --- /dev/null +++ b/strata/qt5-tools/qtdeclarative.morph @@ -0,0 +1,10 @@ +name: qtdeclarative +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtdoc.morph b/strata/qt5-tools/qtdoc.morph new file mode 100644 index 00000000..3b449382 --- /dev/null +++ b/strata/qt5-tools/qtdoc.morph @@ -0,0 +1,8 @@ +name: qtdoc +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtgraphicaleffects.morph b/strata/qt5-tools/qtgraphicaleffects.morph new file mode 100644 index 00000000..27c42971 --- /dev/null +++ b/strata/qt5-tools/qtgraphicaleffects.morph @@ -0,0 +1,8 @@ +name: qtgraphicaleffects +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtimageformats.morph b/strata/qt5-tools/qtimageformats.morph new file mode 100644 index 00000000..08323ca1 --- /dev/null +++ b/strata/qt5-tools/qtimageformats.morph @@ -0,0 +1,10 @@ +name: qtimageformats +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtjsbackend.morph b/strata/qt5-tools/qtjsbackend.morph new file mode 100644 index 00000000..5813084c --- /dev/null +++ b/strata/qt5-tools/qtjsbackend.morph @@ -0,0 +1,10 @@ +name: qtjsbackend +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtlocation.morph b/strata/qt5-tools/qtlocation.morph new file mode 100644 index 00000000..14a527ff --- /dev/null +++ b/strata/qt5-tools/qtlocation.morph @@ -0,0 +1,10 @@ +name: qtlocation +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtmultimedia.morph b/strata/qt5-tools/qtmultimedia.morph new file mode 100644 index 00000000..537baa08 --- /dev/null +++ b/strata/qt5-tools/qtmultimedia.morph @@ -0,0 +1,10 @@ +name: qtmultimedia +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make install_html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtquick1.morph b/strata/qt5-tools/qtquick1.morph new file mode 100644 index 00000000..d4692445 --- /dev/null +++ b/strata/qt5-tools/qtquick1.morph @@ -0,0 +1,10 @@ +name: qtquick1 +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtquickcontrols.morph b/strata/qt5-tools/qtquickcontrols.morph new file mode 100644 index 00000000..12051034 --- /dev/null +++ b/strata/qt5-tools/qtquickcontrols.morph @@ -0,0 +1,10 @@ +name: qtquickcontrols +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtscript.morph b/strata/qt5-tools/qtscript.morph new file mode 100644 index 00000000..6f27842e --- /dev/null +++ b/strata/qt5-tools/qtscript.morph @@ -0,0 +1,10 @@ +name: qtscript +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtsensors.morph b/strata/qt5-tools/qtsensors.morph new file mode 100644 index 00000000..d4b4ec00 --- /dev/null +++ b/strata/qt5-tools/qtsensors.morph @@ -0,0 +1,10 @@ +name: qtsensors +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtserialport.morph b/strata/qt5-tools/qtserialport.morph new file mode 100644 index 00000000..0a623865 --- /dev/null +++ b/strata/qt5-tools/qtserialport.morph @@ -0,0 +1,10 @@ +name: qtserialport +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtsvg.morph b/strata/qt5-tools/qtsvg.morph new file mode 100644 index 00000000..40316a3c --- /dev/null +++ b/strata/qt5-tools/qtsvg.morph @@ -0,0 +1,10 @@ +name: qtsvg +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qttools.morph b/strata/qt5-tools/qttools.morph new file mode 100644 index 00000000..1baa10e7 --- /dev/null +++ b/strata/qt5-tools/qttools.morph @@ -0,0 +1,10 @@ +name: qttools +kind: chunk +configure-commands: +- qmake +build-commands: +- unset TARGET ; make +- unset TARGET ; make html_docs +install-commands: +- unset TARGET ; make install INSTALL_ROOT=$DESTDIR +- unset TARGET ; make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qttranslations.morph b/strata/qt5-tools/qttranslations.morph new file mode 100644 index 00000000..bfb61302 --- /dev/null +++ b/strata/qt5-tools/qttranslations.morph @@ -0,0 +1,8 @@ +name: qttranslations +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtwebkit-examples.morph b/strata/qt5-tools/qtwebkit-examples.morph new file mode 100644 index 00000000..b6683e65 --- /dev/null +++ b/strata/qt5-tools/qtwebkit-examples.morph @@ -0,0 +1,8 @@ +name: qtwebkit-examples +kind: chunk +configure-commands: +- qmake +build-commands: +- make +install-commands: +- make install INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtwebkit.morph b/strata/qt5-tools/qtwebkit.morph new file mode 100644 index 00000000..c9348aca --- /dev/null +++ b/strata/qt5-tools/qtwebkit.morph @@ -0,0 +1,11 @@ +name: qtwebkit +kind: chunk +max-jobs: 1 +configure-commands: +- QMAKEPATH=/qtwebkit.build/Tools/qmake/mkspecs qmake WebKit.pro +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtwebsockets.morph b/strata/qt5-tools/qtwebsockets.morph new file mode 100644 index 00000000..e1cac87f --- /dev/null +++ b/strata/qt5-tools/qtwebsockets.morph @@ -0,0 +1,10 @@ +name: qtwebsockets +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtx11extras.morph b/strata/qt5-tools/qtx11extras.morph new file mode 100644 index 00000000..edea0acf --- /dev/null +++ b/strata/qt5-tools/qtx11extras.morph @@ -0,0 +1,10 @@ +name: qtx11extras +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/qtxmlpatterns.morph b/strata/qt5-tools/qtxmlpatterns.morph new file mode 100644 index 00000000..bdd32d5f --- /dev/null +++ b/strata/qt5-tools/qtxmlpatterns.morph @@ -0,0 +1,10 @@ +name: qtxmlpatterns +kind: chunk +configure-commands: +- qmake +build-commands: +- make +- make html_docs +install-commands: +- make install INSTALL_ROOT=$DESTDIR +- make install_html_docs INSTALL_ROOT=$DESTDIR diff --git a/strata/qt5-tools/ruby-1.8.morph b/strata/qt5-tools/ruby-1.8.morph new file mode 100644 index 00000000..cee282c0 --- /dev/null +++ b/strata/qt5-tools/ruby-1.8.morph @@ -0,0 +1,9 @@ +name: ruby-1.8 +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --program-suffix=-1.8 +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/qt5-tools/ruby-1.9.morph b/strata/qt5-tools/ruby-1.9.morph new file mode 100644 index 00000000..bc697ada --- /dev/null +++ b/strata/qt5-tools/ruby-1.9.morph @@ -0,0 +1,9 @@ +name: ruby-1.9 +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --enable-shared --with-baseruby=/usr/bin/ruby-1.8 +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/ruby.morph b/strata/ruby.morph new file mode 100644 index 00000000..c5bd9993 --- /dev/null +++ b/strata/ruby.morph @@ -0,0 +1,52 @@ +name: ruby +kind: stratum +description: | + Ruby and common Ruby build dependencies. + + Most Gem dependencies are not required when building or installing the + Gem. They are needed at runtime only. Tools which extend Rake, such as + 'hoe' and 'rake-compiler', are exceptions to that rule, and are kept + in this stratum so they are always available when building other Gems. +build-depends: +- morph: strata/tools.morph +chunks: +- name: ruby-1.8 + morph: strata/ruby/ruby-1.8.morph + repo: upstream:ruby + ref: 7a24f1710028d568ad61d0aa49d5178260178d77 + unpetrify-ref: baserock/morph/ruby_1_8_7 + build-depends: [] +- name: libyaml + repo: upstream:libyaml-hg + ref: 0577078d6625a7bf06e6bc7fb26a43e27400b17e + unpetrify-ref: master + build-depends: [] +- name: ruby + morph: strata/ruby/ruby.morph + repo: upstream:ruby + ref: 05604af5a6da635b8bca51269db8b433972e82c0 + unpetrify-ref: baserock/ruby_2_0_0 + build-depends: + - ruby-1.8 + - libyaml +- name: bundler + morph: strata/ruby/bundler.morph + repo: upstream:bundler + ref: 0708fbe62617a63300e1cc3b9869cc1280c57ef6 + unpetrify-ref: baserock/v1.6.2 + build-depends: + - ruby +- name: hoe + morph: strata/ruby/hoe.morph + repo: upstream:ruby-gems/hoe + ref: 50a2706d0f70ece52922ddcc56630e1e0655b83e + unpetrify-ref: master + build-depends: + - ruby +- name: rake-compiler + morph: strata/ruby/rake-compiler.morph + repo: upstream:ruby-gems/rake-compiler + ref: aaed621f6fdb0b0395775fea5464cc83e794fbdb + unpetrify-ref: v0.9.3 + build-depends: + - ruby diff --git a/strata/ruby/bundler.morph b/strata/ruby/bundler.morph new file mode 100644 index 00000000..643ef119 --- /dev/null +++ b/strata/ruby/bundler.morph @@ -0,0 +1,6 @@ +name: bundler +kind: chunk +build-commands: +- rake build +install-commands: +- gem install ./pkg/*gem --bindir "$DESTDIR/$PREFIX/bin" --install-dir "$DESTDIR/$PREFIX/lib/ruby/gems/2.0.0" diff --git a/strata/ruby/hoe.morph b/strata/ruby/hoe.morph new file mode 100644 index 00000000..0d06a82a --- /dev/null +++ b/strata/ruby/hoe.morph @@ -0,0 +1,16 @@ +name: hoe +kind: chunk +description: | + Hoe is a rake/rubygems helper for project Rakefiles. It helps you + manage, maintain, and release your project and includes a dynamic + plug-in system allowing for easy extensibility. +products: +- artifact: hoe-doc + include: + - usr/lib/ruby/gems/\d[\w.]*/doc/.* +build-commands: +- rake gem +install-commands: +- mkdir -p "$DESTDIR/$(gem environment home)" +- gem install --install-dir "$DESTDIR/$(gem environment home)" --bindir "$DESTDIR/$PREFIX/bin" + --ignore-dependencies --local ./pkg/hoe-*.gem diff --git a/strata/ruby/rake-compiler.morph b/strata/ruby/rake-compiler.morph new file mode 100644 index 00000000..9286f14a --- /dev/null +++ b/strata/ruby/rake-compiler.morph @@ -0,0 +1,15 @@ +name: rake-compiler +kind: chunk +description: | + Provide a standard and simplified way to build and package Ruby + extensions (C, Java) using Rake as glue. +products: +- artifact: rake-compiler-doc + include: + - usr/lib/ruby/gems/\d[\w.]*/doc/.* +build-commands: +- rake gem +install-commands: +- mkdir -p "$DESTDIR/$(gem environment home)" +- gem install --install-dir "$DESTDIR/$(gem environment home)" --bindir "$DESTDIR/$PREFIX/bin" + --ignore-dependencies --local ./pkg/rake-compiler-*.gem diff --git a/strata/ruby/ruby-1.8.morph b/strata/ruby/ruby-1.8.morph new file mode 100644 index 00000000..cee282c0 --- /dev/null +++ b/strata/ruby/ruby-1.8.morph @@ -0,0 +1,9 @@ +name: ruby-1.8 +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --program-suffix=-1.8 +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/ruby/ruby.morph b/strata/ruby/ruby.morph new file mode 100644 index 00000000..c5d4afe1 --- /dev/null +++ b/strata/ruby/ruby.morph @@ -0,0 +1,9 @@ +name: ruby +kind: chunk +configure-commands: +- autoconf +- ./configure --prefix=/usr --enable-shared --with-baseruby=/usr/bin/ruby-1.8 +build-commands: +- make +install-commands: +- make DESTDIR=$DESTDIR install diff --git a/strata/tools.morph b/strata/tools.morph new file mode 100644 index 00000000..a09c24f5 --- /dev/null +++ b/strata/tools.morph @@ -0,0 +1,107 @@ +name: tools +kind: stratum +description: Extra development tools included in the devel system +build-depends: +- morph: strata/foundation.morph +chunks: +- name: distcc + morph: strata/tools/distcc.morph + repo: upstream:distcc + ref: c9691a9604fdf9d6711204999787d332b7141692 + unpetrify-ref: baserock/morph + build-depends: [] +- name: e2fsprogs + morph: strata/tools/e2fsprogs.morph + repo: upstream:e2fsprogs + ref: 6a3741ad293031447b95b88431eafa77401a8987 + unpetrify-ref: v1.42.12 + build-depends: [] +- name: file + repo: upstream:file + ref: 3b49db406667ee7189b9ea69b9d9e0bdcc43c5b7 + unpetrify-ref: baserock/morph + build-depends: [] +- name: gdb + repo: upstream:gdb + ref: c4bf5268b1a32ec475b61d2fe90e9218780c03c8 + unpetrify-ref: baserock/morph + build-depends: [] +- name: less + repo: upstream:less + ref: 09a405d8f652b56944c93ebf5c673cdfe5319b04 + unpetrify-ref: baserock/morph + build-depends: [] +- name: linux-user-chroot + repo: upstream:linux-user-chroot + ref: d25cc110f69e6e71a95b4ac532dcfc5423d4a16b + unpetrify-ref: baserock/morph + build-depends: [] +- name: lsof + morph: strata/tools/lsof.morph + repo: upstream:lsof + ref: fffb8558208586338587027c265fd0eca44466be + unpetrify-ref: baserock/morph + build-depends: [] +- name: pv + repo: upstream:pv + ref: d6ce7cfec684fa72d7a919d7b1aa817a0ca6102a + unpetrify-ref: baserock/morph + build-depends: [] +- name: rsync + morph: strata/tools/rsync.morph + repo: upstream:rsync + ref: 9faf8e0ccff2755cd019ff64d8322226a214b013 + unpetrify-ref: baserock/morph + build-depends: [] +- name: strace + repo: upstream:strace + ref: ad232c6aa0c2a07830d61dc4b9912478634b23b5 + unpetrify-ref: baserock/morph + build-depends: [] +- name: vala + morph: strata/tools/vala.morph + repo: upstream:vala + ref: 4e4a02c03445336237b36723b23a91670ef7621b + unpetrify-ref: baserock/bootstrap + build-depends: [] +- name: vim + morph: strata/tools/vim.morph + repo: upstream:vim + ref: 592b8c975bf83b4dcf608769bc664a80cb1daf9e + unpetrify-ref: baserock/morph + build-depends: [] +- name: screen + morph: strata/tools/screen.morph + repo: upstream:screen + ref: 7dd4a9e5f385c96a77e8ee5c977a1dde4c0ff467 + unpetrify-ref: baserock/morph + build-depends: [] +- name: u-boot + morph: strata/tools/u-boot.morph + repo: upstream:u-boot + ref: fe57382d04b46c37f34cf8d3b3ad876554fd12bf + unpetrify-ref: baserock/morph + build-depends: [] +- name: kexec-tools + morph: strata/tools/kexec-tools.morph + repo: upstream:kexec-tools + ref: 9359b61ca44980d33c0bee42b9bb2e36e72835dd + unpetrify-ref: baserock/morph + build-depends: [] +- name: device-tree-compiler + morph: strata/tools/device-tree-compiler.morph + repo: upstream:device-tree-compiler + ref: c92f284c3cf76d471eb27a271de3a51cb45ed058 + unpetrify-ref: baserock/morph + build-depends: [] +- name: sudo + repo: upstream:sudo + ref: a4769dc7999b53260325fb89945bef85714fb338 + unpetrify-ref: baserock/morph + build-depends: [] +- name: procps-ng + repo: upstream:procps-ng + ref: 85fff468fa263cdd2ff1c0144579527c32333695 + unpetrify-ref: v3.3.9 + build-depends: [] + prefix: / diff --git a/strata/tools/device-tree-compiler.morph b/strata/tools/device-tree-compiler.morph new file mode 100644 index 00000000..8abfafc8 --- /dev/null +++ b/strata/tools/device-tree-compiler.morph @@ -0,0 +1,6 @@ +name: device-tree-compiler +kind: chunk +build-commands: +- make all +install-commands: +- make install DESTDIR="$DESTDIR" PREFIX="$PREFIX" diff --git a/strata/tools/distcc.morph b/strata/tools/distcc.morph new file mode 100644 index 00000000..9f42b50e --- /dev/null +++ b/strata/tools/distcc.morph @@ -0,0 +1,6 @@ +name: distcc +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-Werror diff --git a/strata/tools/e2fsprogs.morph b/strata/tools/e2fsprogs.morph new file mode 100644 index 00000000..801f8abe --- /dev/null +++ b/strata/tools/e2fsprogs.morph @@ -0,0 +1,21 @@ +name: e2fsprogs +kind: chunk +build-system: autotools +configure-commands: +# Configure with the usual paths for binaries and config +# but also disable whatever we can that is already provided by util-linux +# Disabling e2fsprofs' libblkid does not work, but we don't have to +# install it. +- | + ./configure --prefix="$PREFIX" --sysconfdir=/etc \ + --disable-libuuid --disable-uuidd --disable-fsck +install-commands: +# e2fsprogs also includes tools that are provided by util-linux, so we +# need to selectively exclude them. Removing them directly from DESTDIR +# causes problems, so we need to remove them beforehand. +- | + td="$(mktemp -d)" + make DESTDIR="$td" install + find "$td" \( -name blkid -o -name findfs -o -name fsck \) -delete + find "$td" \( -name blkid.8 -o -name findfs.8 \) -delete + mv "$td"/* "$DESTDIR" diff --git a/strata/tools/git-fat.morph b/strata/tools/git-fat.morph new file mode 100644 index 00000000..c971b07f --- /dev/null +++ b/strata/tools/git-fat.morph @@ -0,0 +1,4 @@ +name: git-fat +kind: chunk +install-commands: +- install -D -m 755 git-fat "$DESTDIR/usr/bin/git-fat" diff --git a/strata/tools/kexec-tools.morph b/strata/tools/kexec-tools.morph new file mode 100644 index 00000000..118c1ac2 --- /dev/null +++ b/strata/tools/kexec-tools.morph @@ -0,0 +1,6 @@ +name: kexec-tools +kind: chunk +build-system: autotools +configure-commands: +- ./bootstrap +- ./configure --prefix="$PREFIX" diff --git a/strata/tools/lsof.morph b/strata/tools/lsof.morph new file mode 100644 index 00000000..5fabcd64 --- /dev/null +++ b/strata/tools/lsof.morph @@ -0,0 +1,12 @@ +name: lsof +kind: chunk +configure-commands: +- tar xf lsof_*_src.tar +- cd lsof_*_src/ && ./Configure -n linux +build-commands: +- cd lsof_*_src/ && make +install-commands: +- mkdir -p "$DESTDIR$PREFIX"/bin +- mv lsof_*_src/lsof "$DESTDIR$PREFIX"/bin/lsof +- mkdir -p "$DESTDIR$PREFIX"/man/man8 +- mv lsof_*_src/lsof.8 "$DESTDIR$PREFIX"/man/man8 diff --git a/strata/tools/rsync.morph b/strata/tools/rsync.morph new file mode 100644 index 00000000..9a92878d --- /dev/null +++ b/strata/tools/rsync.morph @@ -0,0 +1,6 @@ +name: rsync +kind: chunk +build-system: autotools +build-commands: +- make proto +- make diff --git a/strata/tools/screen.morph b/strata/tools/screen.morph new file mode 100644 index 00000000..0b23c5d4 --- /dev/null +++ b/strata/tools/screen.morph @@ -0,0 +1,11 @@ +name: screen +kind: chunk +description: A terminal multiplexer and sanity tool for many +max-jobs: 1 +configure-commands: +- cd ./src && sh autogen.sh +- cd ./src && ./configure --prefix="$PREFIX" +build-commands: +- cd ./src && make +install-commands: +- cd ./src && make DESTDIR="$DESTDIR" install diff --git a/strata/tools/u-boot.morph b/strata/tools/u-boot.morph new file mode 100644 index 00000000..9be30bc7 --- /dev/null +++ b/strata/tools/u-boot.morph @@ -0,0 +1,11 @@ +name: u-boot +kind: chunk +build-commands: +- make tools +install-commands: +- mkdir -p "$DESTDIR$PREFIX/bin" +- install -m 755 tools/img2brec.sh "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/jtagconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/netconsole "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkenvimage "$DESTDIR$PREFIX/bin/." +- install -m 755 tools/mkimage "$DESTDIR$PREFIX/bin/." diff --git a/strata/tools/vala.morph b/strata/tools/vala.morph new file mode 100644 index 00000000..dcac5d49 --- /dev/null +++ b/strata/tools/vala.morph @@ -0,0 +1,5 @@ +name: vala +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" diff --git a/strata/tools/vim.morph b/strata/tools/vim.morph new file mode 100644 index 00000000..58e1403f --- /dev/null +++ b/strata/tools/vim.morph @@ -0,0 +1,10 @@ +name: vim +kind: chunk +build-system: autotools +configure-commands: +- echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >>src/feature.h +- ./configure --prefix="$PREFIX" --enable-multibyte +install-commands: +- make DESTDIR="$DESTDIR" install +- mkdir -p "$DESTDIR"/etc +- install -m 644 runtime/vimrc_example.vim "$DESTDIR"/etc/vimrc diff --git a/strata/trove.morph b/strata/trove.morph new file mode 100644 index 00000000..7eaa204a --- /dev/null +++ b/strata/trove.morph @@ -0,0 +1,90 @@ +name: trove +kind: stratum +description: Trove software +build-depends: +- morph: strata/tools.morph +- morph: strata/morph-utils.morph +- morph: strata/pcre-utils.morph +chunks: +- name: lua + morph: strata/trove/lua.morph + repo: upstream:lua + ref: 948063437e0350d9ef1649ec3a76d0c24a5c8642 + unpetrify-ref: baserock/5.1-morph + build-depends: [] +- name: lace + morph: strata/trove/lace.morph + repo: upstream:gitano/lace + ref: d1b540b6d361d6a1f51e53cdaab69f053340efbb + unpetrify-ref: baserock/morph + build-depends: + - lua +- name: luxio + morph: strata/trove/luxio.morph + repo: upstream:luxio + ref: be9d125080b9ff2376273e21b75669b65dc88d46 + unpetrify-ref: baserock/morph + build-depends: + - lua +- name: supple + morph: strata/trove/supple.morph + repo: upstream:gitano/supple + ref: 0963e5706d78d0ae7446ea91af986de1e196eb39 + unpetrify-ref: baserock/morph + build-depends: + - lua + - luxio +- name: clod + morph: strata/trove/clod.morph + repo: upstream:gitano/clod + ref: da15894f42f48d15db997c4355d6b672371a4163 + unpetrify-ref: baserock/morph + build-depends: + - lua +- name: gall + morph: strata/trove/gall.morph + repo: upstream:gitano/gall + ref: f58c7526fbb0421d7f5446644f01f4cf57035ee2 + unpetrify-ref: baserock/morph + build-depends: + - lua + - luxio +- name: lrexlib-pcre + morph: strata/trove/lrexlib-pcre.morph + repo: upstream:lrexlib + ref: 0524a6e3ab6d50cba63c8642a875e246de53d651 + unpetrify-ref: baserock/morph + build-depends: + - lua +- name: gitano + morph: strata/trove/gitano.morph + repo: upstream:gitano/gitano + ref: 4b8ce6875266fdd6609a217dcf2924d7d4815cc2 + unpetrify-ref: baserock/morph + build-depends: + - lua +- name: cgit + morph: strata/trove/cgit.morph + repo: upstream:cgit + ref: acbf4a15e260c711094455dbef7c024f2553fd32 + unpetrify-ref: baserock/morph + build-depends: [] +- name: trove-setup + morph: strata/trove/trove-setup.morph + repo: baserock:baserock/trove-setup + ref: 5f2dab59ff6e70edf6ffbcd65fe64b487c4380c2 + unpetrify-ref: master + build-depends: [] +- name: lorry-controller + morph: strata/trove/lorry-controller.morph + repo: baserock:baserock/lorry-controller + ref: 4b1fcab140d940470c342c6857cdc8682406f0b7 + unpetrify-ref: master + build-depends: [] +- name: lua-scrypt + morph: strata/trove/lua-scrypt.morph + repo: upstream:lua-scrypt + ref: 0d7f74cd3eab7d54fbb13294194de7ea70ac34a5 + unpetrify-ref: baserock/morph + build-depends: + - lua diff --git a/strata/trove/cgit.morph b/strata/trove/cgit.morph new file mode 100644 index 00000000..bd373a51 --- /dev/null +++ b/strata/trove/cgit.morph @@ -0,0 +1,6 @@ +name: cgit +kind: chunk +build-commands: +- make prefix="$PREFIX" +install-commands: +- make prefix="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/trove/clod.morph b/strata/trove/clod.morph new file mode 100644 index 00000000..e31ca4fb --- /dev/null +++ b/strata/trove/clod.morph @@ -0,0 +1,7 @@ +name: clod +kind: chunk +description: Configuration Language Organised (by) Dots. +build-commands: +- make +install-commands: +- make INST_BASE="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/trove/gall.morph b/strata/trove/gall.morph new file mode 100644 index 00000000..c1f2fd47 --- /dev/null +++ b/strata/trove/gall.morph @@ -0,0 +1,7 @@ +name: gall +kind: chunk +description: Git Abstraction Layer for Lua +build-commands: +- make +install-commands: +- make INST_BASE="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/trove/gitano.morph b/strata/trove/gitano.morph new file mode 100644 index 00000000..962224d5 --- /dev/null +++ b/strata/trove/gitano.morph @@ -0,0 +1,5 @@ +name: gitano +kind: chunk +install-commands: +- make install INST_ROOT="$PREFIX" DESTDIR="$DESTDIR" +- cp scripts/htpasswd "$DESTDIR/$PREFIX/bin" diff --git a/strata/trove/lace.morph b/strata/trove/lace.morph new file mode 100644 index 00000000..70752397 --- /dev/null +++ b/strata/trove/lace.morph @@ -0,0 +1,7 @@ +name: lace +kind: chunk +description: Lua Access Control Engine. +build-commands: +- make +install-commands: +- make INST_BASE="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/trove/lorry-controller.morph b/strata/trove/lorry-controller.morph new file mode 100644 index 00000000..2f90a9a1 --- /dev/null +++ b/strata/trove/lorry-controller.morph @@ -0,0 +1,10 @@ +name: lorry-controller +kind: chunk +build-system: python-distutils +post-install-commands: +- install -d 0755 "$DESTDIR/etc/lighttpd" +- install -m 0644 -D etc/lighttpd/*.conf "$DESTDIR/etc/lighttpd/." +- | + TGT="$DESTDIR/usr/lib/systemd/system" + install -d "$TGT/multi-user.target.wants" + install -m 0644 units/*.service units/*.timer "$TGT/." diff --git a/strata/trove/lrexlib-pcre.morph b/strata/trove/lrexlib-pcre.morph new file mode 100644 index 00000000..63f3b034 --- /dev/null +++ b/strata/trove/lrexlib-pcre.morph @@ -0,0 +1,9 @@ +name: lrexlib-pcre +kind: chunk +description: Lua regular expression library - PCRE build only +build-commands: +- gcc -fPIC -DPIC -DVERSION=\"2.7.2\" -o rex_pcre.so -shared src/common.c src/pcre/lpcre.c + src/pcre/lpcre_f.c -lpcre +install-commands: +- mkdir -p $DESTDIR/usr/lib/lua/5.1/ +- cp rex_pcre.so $DESTDIR/usr/lib/lua/5.1/ diff --git a/strata/trove/lua-scrypt.morph b/strata/trove/lua-scrypt.morph new file mode 100644 index 00000000..141b8ec3 --- /dev/null +++ b/strata/trove/lua-scrypt.morph @@ -0,0 +1,4 @@ +name: lua-scrypt +kind: chunk +install-commands: +- make lua-5.1-install DESTDIR="$DESTDIR" diff --git a/strata/trove/lua.morph b/strata/trove/lua.morph new file mode 100644 index 00000000..32aeb5c1 --- /dev/null +++ b/strata/trove/lua.morph @@ -0,0 +1,11 @@ +name: lua +kind: chunk +configure-commands: +- sed -e 's/defined(LUA_USE_READLINE)/0/g' src/luaconf.h.orig >src/luaconf.h +- sed -i -e '/^linux:/{n;s/-lreadline//g;s/-lhistory//g;s/-lncurses//g}' src/Makefile +build-commands: +- make debian_linux INSTALL_TOP="$PREFIX" RPATH="$PREFIX/lib" +install-commands: +- make INSTALL_TOP="$DESTDIR/$PREFIX" debian_install +- mkdir -p "$DESTDIR/$PREFIX/lib/pkgconfig" +- cp lua5.1.pc "$DESTDIR/$PREFIX/lib/pkgconfig/" diff --git a/strata/trove/luxio.morph b/strata/trove/luxio.morph new file mode 100644 index 00000000..29aabfaf --- /dev/null +++ b/strata/trove/luxio.morph @@ -0,0 +1,7 @@ +name: luxio +kind: chunk +description: Lua Unix IO (and related stuff). +build-commands: +- make lua-5.1 +install-commands: +- make DESTDIR="$DESTDIR" lua-5.1-install diff --git a/strata/trove/supple.morph b/strata/trove/supple.morph new file mode 100644 index 00000000..6470ba28 --- /dev/null +++ b/strata/trove/supple.morph @@ -0,0 +1,7 @@ +name: supple +kind: chunk +description: Sandbox (for) Untrusted Procedure Partitioning (in) Lua Engine. +build-commands: +- make +install-commands: +- make INST_BASE="$PREFIX" DESTDIR="$DESTDIR" install diff --git a/strata/trove/trove-setup.morph b/strata/trove/trove-setup.morph new file mode 100644 index 00000000..1f49760f --- /dev/null +++ b/strata/trove/trove-setup.morph @@ -0,0 +1,4 @@ +name: trove-setup +kind: chunk +install-commands: +- make install DESTDIR="$DESTDIR" diff --git a/strata/virtualbox-guest-x86_64.morph b/strata/virtualbox-guest-x86_64.morph new file mode 100644 index 00000000..7ac14158 --- /dev/null +++ b/strata/virtualbox-guest-x86_64.morph @@ -0,0 +1,23 @@ +name: virtualbox-guest-x86_64 +kind: stratum +description: | + VirtualBox Guest Additions for x86_64 +build-depends: +- morph: strata/tools.morph +- morph: strata/bsp-x86_64-generic.morph +- morph: strata/x-common.morph +- morph: strata/x-generic.morph +chunks: +- name: yasm + morph: strata/virtualbox-guest-x86_64/yasm.morph + repo: upstream:yasm + ref: fefefe262eb29081f0bcb4d48f2d476ce5730562 + unpetrify-ref: baserock/morph + build-depends: [] +- name: vboxguest + morph: strata/virtualbox-guest-x86_64/vboxguest.morph + repo: upstream:VirtualBox + ref: 617aeb5a3c13f4a46423e8c2fb560449403ad56d + unpetrify-ref: baserock/morph + build-depends: + - yasm diff --git a/strata/virtualbox-guest-x86_64/vboxguest.morph b/strata/virtualbox-guest-x86_64/vboxguest.morph new file mode 100644 index 00000000..f31c9944 --- /dev/null +++ b/strata/virtualbox-guest-x86_64/vboxguest.morph @@ -0,0 +1,34 @@ +name: vboxguest +kind: chunk +description: | + VirtualBox guest additions +max-jobs: 1 +build-commands: +- truncate -s0 src/VBox/Additions/common/pam/Makefile.kmk +- env PATH="${PATH}:$(pwd)/kBuild/bin/linux.amd64/" VBOX_ONLY_ADDITIONS=1 VBOX_ONLY_BUILD=1 + kmk +- cd out/linux.amd64/release/bin/additions/src/ && make M="$(pwd)" -C /usr/src/linux + modules +install-commands: +- cd out/linux.amd64/release/bin/additions/src && make M="$(pwd)" -C /usr/src/linux + INSTALL_MOD_PATH="$DESTDIR" modules_install +- install -m 755 -D -o 0 -g 0 out/linux.amd64/release/bin/additions/mount.vboxsf "$DESTDIR/sbin/mount.vboxsf" +- install -m 755 -D -o 0 -g 0 out/linux.amd64/release/bin/additions/VBoxService "$DESTDIR/sbin/VBoxService" +- install -m 755 -D -o 0 -g 0 out/linux.amd64/release/bin/additions/VBoxControl "$DESTDIR/sbin/VBoxControl" +- | + install -m 644 -D -o 0 -g 0 /proc/self/fd/0 "$DESTDIR/lib/systemd/system/virtualbox-guest.service" <<EOS + [Unit] + Description=VirtualBox Guest Additions + + [Service] + ExecStart=/sbin/VBoxService -f + Restart=always + EOS +- mkdir -p "$DESTDIR/lib/systemd/system/basic.target.wants" +- ln -s "/lib/systemd/system/virtualbox-guest.service" "$DESTDIR/lib/systemd/system/basic.target.wants/virtualbox-guest.service" +- mkdir -p "$DESTDIR/etc/modules-load.d" +- echo vboxsf > "$DESTDIR/etc/modules-load.d/virtualbox-guest-filesystem.conf" +system-integration: + vboxguest-misc: + 00-depmod: + - depmod -a $(cd /lib/modules; ls | head -n 1) diff --git a/strata/virtualbox-guest-x86_64/yasm.morph b/strata/virtualbox-guest-x86_64/yasm.morph new file mode 100644 index 00000000..437ae97d --- /dev/null +++ b/strata/virtualbox-guest-x86_64/yasm.morph @@ -0,0 +1,4 @@ +name: yasm +kind: chunk +max-jobs: 1 +build-system: autotools diff --git a/strata/virtualization.morph b/strata/virtualization.morph new file mode 100644 index 00000000..e3261f84 --- /dev/null +++ b/strata/virtualization.morph @@ -0,0 +1,123 @@ +name: virtualization +kind: stratum +description: virtualization for baserock +build-depends: +- morph: strata/connman-common.morph +chunks: +- name: yajl + morph: strata/virtualization/yajl.morph + repo: upstream:yajl + ref: 52fc681857228c65c1cb439782da485554875481 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xml-catalog + morph: strata/virtualization/xml-catalog.morph + repo: baserock:baserock/xml-catalog + ref: 1d4a2abc875c4dda1b5eadc0a097a48a8d2ec82b + unpetrify-ref: master + build-depends: [] +- name: lvm2 + morph: strata/virtualization/lvm2.morph + repo: upstream:lvm2 + ref: 8c5b90b50bdf9f1a7ae1d3c4cf58ce4b0d7c2768 + unpetrify-ref: baserock/morph + build-depends: [] +- name: dnsmasq + morph: strata/virtualization/dnsmasq.morph + repo: upstream:dnsmasq + ref: 8471cd938ca41fbe4fee8ae3f657625c92cfb954 + unpetrify-ref: baserock/morph + build-depends: + - lvm2 +- name: qemu + morph: strata/virtualization/qemu.morph + repo: upstream:qemu + ref: f8d1fb61e65575011a67d7ba97b690feb5630c91 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-util-macros + repo: upstream:xorg-util-macros + ref: c98b41de5596c675c603ef43ae9570133f1a9921 + unpetrify-ref: baserock/morph + build-depends: [] +- name: libpciaccess + repo: upstream:libpciaccess + ref: b9c068896914b4132a24839c9ef7f9fcd6282d88 + unpetrify-ref: master + build-depends: + - xorg-util-macros +- name: libvirt + morph: strata/virtualization/libvirt.morph + repo: upstream:libvirt + ref: 13b7bb4acba9b70e015b7faa020b08018885aad8 + unpetrify-ref: baserock/morph + build-depends: + - libpciaccess + - dnsmasq + - qemu + - xml-catalog + - yajl +- name: pycurl + repo: upstream:pycurl + ref: 5ca370827d88817eeca3c56cbb37e4ddccc16c6e + unpetrify-ref: baserock/morph + build-depends: [] +- name: urlgrabber + repo: upstream:urlgrabber + ref: bf0a0be71373dec515bbb54e0613a3b9b0c00b04 + unpetrify-ref: master + build-depends: + - pycurl +- name: cython + repo: upstream:cython + ref: 005d38d5921a603d5f4d413aae72f98a6d33192f + unpetrify-ref: master + build-depends: [] +- name: python-lxml + repo: upstream:python-lxml + ref: 8fc99f8ef3e2f12e74fb407ae62c5db50cfe7b92 + unpetrify-ref: baserock/morph + build-depends: + - cython +- name: libvirt-python + repo: upstream:libvirt-python + ref: 4382fc518cbd11d9af5727fb403e175818c25db5 + unpetrify-ref: v1.2.2 + build-depends: + - libvirt + - python-lxml + - urlgrabber +- name: gnome-common + repo: upstream:gnome-common + ref: 766c35359ef924ceb2288c14c2d6239fcc0618f8 + unpetrify-ref: 3.7.4 + build-depends: [] +- name: pygobject + morph: strata/virtualization/pygobject.morph + repo: upstream:pygobject + ref: 276341d7ddab180020c31e6837bd28fd25784de0 + unpetrify-ref: baserock/morph + build-depends: + - gnome-common +- name: libsoup + morph: strata/virtualization/libsoup.morph + repo: upstream:libsoup + ref: ce764489e358bad6b49418f5c8bc7b25a4b1815e + unpetrify-ref: baserock/morph + build-depends: + - gnome-common +- name: libosinfo + morph: strata/virtualization/libosinfo.morph + repo: upstream:libosinfo + ref: a86c74c4d3f62bb0e315ab7fc78ec9f7746bdd12 + unpetrify-ref: baserock/morph + build-depends: + - libsoup + - pygobject +- name: virt-manager + repo: upstream:virt-manager + ref: 8b7ebd4538ffbd2d246fdeee4f1bb1c452585575 + unpetrify-ref: v1.0.1 + build-depends: + - libvirt-python + - libosinfo diff --git a/strata/virtualization/dnsmasq.morph b/strata/virtualization/dnsmasq.morph new file mode 100644 index 00000000..4db0bf09 --- /dev/null +++ b/strata/virtualization/dnsmasq.morph @@ -0,0 +1,6 @@ +name: dnsmasq +kind: chunk +build-system: autotools +configure-commands: [] +install-commands: +- make install PREFIX="$PREFIX" DESTDIR="$DESTDIR" diff --git a/strata/virtualization/libosinfo.morph b/strata/virtualization/libosinfo.morph new file mode 100644 index 00000000..d5679965 --- /dev/null +++ b/strata/virtualization/libosinfo.morph @@ -0,0 +1,6 @@ +name: libosinfo +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --disable-gtk-doc --disable-tests --disable-vala + --with-usb-ids-path=usb.ids --with-pci-ids-path=pci.ids diff --git a/strata/virtualization/libsoup.morph b/strata/virtualization/libsoup.morph new file mode 100644 index 00000000..0a5ebef6 --- /dev/null +++ b/strata/virtualization/libsoup.morph @@ -0,0 +1,6 @@ +name: libsoup +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-tls-check diff --git a/strata/virtualization/libvirt.morph b/strata/virtualization/libvirt.morph new file mode 100644 index 00000000..63b5d768 --- /dev/null +++ b/strata/virtualization/libvirt.morph @@ -0,0 +1,6 @@ +name: libvirt +kind: chunk +build-system: autotools +configure-commands: +- | + GNULIB_SRCDIR=gnulib-src ./autogen.sh --without-apparmor --with-attr --without-audit --without-avahi --with-blkid --without-capng --with-curl --with-dbus --with-fuse --without-glusterfs --without-hal --without-netcf --without-numactl --without-openwsman --with-pciaccess --without-readline --without-sanlock --without-sasl --without-selinux --without-ssh2 --with-systemd-daemon --with-udev --with-yajl --without-xen --with-qemu --without-uml --without-openvz --without-vmware --without-phyp --without-xenapi --without-libxl --without-vbox --without-lxc --without-esx --without-hyperv --without-parallels --with-test --with-remote --with-libvirtd --with-init-script=systemd --without-bhyve --without-gnutls --without-polkit --without-firewalld --without-dtrace --without-numad --with-network --with-secrets --with-storage-dir --with-storage-fs --with-storage-lvm --without-storage-iscsi --without-storage-scsi --without-storage-mpath --without-storage-disk --with-storage-rbd --without-storage-sheepdog --without-storage-gluster --without-wireshark-dissector --with-python --prefix="$PREFIX" diff --git a/strata/virtualization/lvm2.morph b/strata/virtualization/lvm2.morph new file mode 100644 index 00000000..49c166dc --- /dev/null +++ b/strata/virtualization/lvm2.morph @@ -0,0 +1,6 @@ +name: lvm2 +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" --enable-applib --enable-cmdlib --enable-pkgconfig + --enable-dmeventd --enable-udev_sync diff --git a/strata/virtualization/pygobject.morph b/strata/virtualization/pygobject.morph new file mode 100644 index 00000000..a423537e --- /dev/null +++ b/strata/virtualization/pygobject.morph @@ -0,0 +1,5 @@ +name: pygobject +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --disable-cairo diff --git a/strata/virtualization/qemu.morph b/strata/virtualization/qemu.morph new file mode 100644 index 00000000..17ffbeb6 --- /dev/null +++ b/strata/virtualization/qemu.morph @@ -0,0 +1,5 @@ +name: qemu +kind: chunk +build-system: autotools +configure-commands: +- ./configure --prefix="$PREFIX" diff --git a/strata/virtualization/xml-catalog.morph b/strata/virtualization/xml-catalog.morph new file mode 100644 index 00000000..34ba0306 --- /dev/null +++ b/strata/virtualization/xml-catalog.morph @@ -0,0 +1,6 @@ +name: xml-catalog +kind: chunk +install-commands: +- make DESTDIR="$DESTDIR" install +post-install-commands: +- ./post-install.sh diff --git a/strata/virtualization/yajl.morph b/strata/virtualization/yajl.morph new file mode 100644 index 00000000..3fac99db --- /dev/null +++ b/strata/virtualization/yajl.morph @@ -0,0 +1,8 @@ +name: yajl +kind: chunk +configure-commands: +- ./configure -p "$PREFIX" +build-commands: +- make distro +install-commands: +- make install DESTDIR="$DESTDIR" diff --git a/strata/wayland-generic.morph b/strata/wayland-generic.morph new file mode 100644 index 00000000..890489dc --- /dev/null +++ b/strata/wayland-generic.morph @@ -0,0 +1,19 @@ +name: wayland-generic +kind: stratum +build-depends: +- morph: strata/foundation.morph +- morph: strata/xorg-util-macros-common.morph +chunks: +- name: libxkbcommon + morph: strata/wayland-generic/libxkbcommon.morph + repo: upstream:xorg-lib-libxkbcommon + ref: c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 + unpetrify-ref: xkbcommon-0.5.0 + build-depends: [] +- name: wayland + morph: strata/wayland-generic/wayland.morph + repo: upstream:wayland + ref: 339e83aa579569711cd14623ca4b2db46256b766 + unpetrify-ref: 1.6.0 + build-depends: + - libxkbcommon diff --git a/strata/wayland-generic/libxkbcommon.morph b/strata/wayland-generic/libxkbcommon.morph new file mode 100644 index 00000000..04048abb --- /dev/null +++ b/strata/wayland-generic/libxkbcommon.morph @@ -0,0 +1,5 @@ +name: libxkbcommon +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --disable-x11 diff --git a/strata/wayland-generic/wayland.morph b/strata/wayland-generic/wayland.morph new file mode 100644 index 00000000..752a5d6e --- /dev/null +++ b/strata/wayland-generic/wayland.morph @@ -0,0 +1,7 @@ +name: wayland +kind: chunk +description: Wayland server +build-system: autotools +configure-commands: +- autoreconf -ivf +- ./configure --prefix="$PREFIX" --disable-documentation diff --git a/strata/webtools.morph b/strata/webtools.morph new file mode 100644 index 00000000..39175747 --- /dev/null +++ b/strata/webtools.morph @@ -0,0 +1,30 @@ +name: webtools +kind: stratum +description: web things +build-depends: +- morph: strata/tools.morph +- morph: strata/pcre-utils.morph +chunks: +- name: icu + morph: strata/webtools/icu.morph + repo: upstream:icu + ref: ba023548a3bff7277cbea4acade3042ce9d8949e + unpetrify-ref: baserock/morph + build-depends: [] +- name: libgit2 + repo: upstream:libgit2 + ref: 4b0a36e881506a02b43a4ae3c19c93c919b36eeb + unpetrify-ref: master + build-depends: [] +- name: tar + morph: strata/webtools/tar.morph + repo: upstream:tar + ref: 9a58d148c26c220cb1b163c71e7a51a2e41f6b37 + unpetrify-ref: baserock/release_1_28 + build-depends: [] +- name: nginx + morph: strata/webtools/nginx.morph + repo: upstream:nginx + ref: 37a582c9ea3e731c115e560d31b26f78535b8fca + unpetrify-ref: baserock/v1.7.0 + build-depends: [] diff --git a/strata/webtools/icu.morph b/strata/webtools/icu.morph new file mode 100644 index 00000000..37dec07e --- /dev/null +++ b/strata/webtools/icu.morph @@ -0,0 +1,8 @@ +name: icu +kind: chunk +configure-commands: +- cd source; ./runConfigureICU Linux --prefix=/usr +build-commands: +- cd source; unset TARGET ; make +install-commands: +- cd source; unset TARGET ; make DESTDIR="$DESTDIR" install diff --git a/strata/webtools/nginx.morph b/strata/webtools/nginx.morph new file mode 100644 index 00000000..08949ec9 --- /dev/null +++ b/strata/webtools/nginx.morph @@ -0,0 +1,13 @@ +name: nginx +kind: chunk +configure-commands: +- | + ./configure --prefix=$PREFIX \ + --conf-path=/etc/nginx/nginx.conf \ + --pid-path=/etc/nginx/nginx.pid \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log +build-commands: +- make +install-commands: +- make install diff --git a/strata/webtools/tar.morph b/strata/webtools/tar.morph new file mode 100644 index 00000000..9219abeb --- /dev/null +++ b/strata/webtools/tar.morph @@ -0,0 +1,10 @@ +name: tar +kind: chunk +configure-commands: +- bash bootstrap --skip-po +- FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/sbin + --disable-nls --disable-gcc-warnings +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/weston-common.morph b/strata/weston-common.morph new file mode 100644 index 00000000..1d5b015c --- /dev/null +++ b/strata/weston-common.morph @@ -0,0 +1,21 @@ +name: weston-common +kind: stratum +build-depends: +- morph: strata/graphics-common.morph +- morph: strata/input-common.morph +- morph: strata/mesa-common.morph +- morph: strata/libdrm-common.morph +- morph: strata/wayland-generic.morph +chunks: +- name: linux-pam + repo: upstream:linux-pam + ref: b1521c97e73b10469f7b34c0571d51c647eca83c + unpetrify-ref: Linux-PAM-1.1.8 + build-depends: [] +- name: weston + morph: strata/weston-common/weston.morph + repo: upstream:weston + ref: 463b914d4f1efbf5de6d1f45e9037b88a1eb107f + unpetrify-ref: baserock/weston-1.6.0/tegra + build-depends: + - linux-pam diff --git a/strata/weston-common/weston.morph b/strata/weston-common/weston.morph new file mode 100644 index 00000000..2efd662e --- /dev/null +++ b/strata/weston-common/weston.morph @@ -0,0 +1,9 @@ +name: weston +kind: chunk +build-system: autotools +configure-commands: +- | + ./autogen.sh --prefix="$PREFIX" \ + --disable-xwayland \ + --disable-x11-compositor \ + --enable-demo-clients-install diff --git a/strata/weston-genivi.morph b/strata/weston-genivi.morph new file mode 100644 index 00000000..d47d0ac4 --- /dev/null +++ b/strata/weston-genivi.morph @@ -0,0 +1,28 @@ +name: weston-genivi +kind: stratum +build-depends: +- morph: strata/graphics-common.morph +- morph: strata/input-common.morph +- morph: strata/mesa-common.morph +- morph: strata/libdrm-common.morph +- morph: strata/wayland-generic.morph +chunks: +- name: linux-pam + repo: upstream:linux-pam + ref: b1521c97e73b10469f7b34c0571d51c647eca83c + unpetrify-ref: Linux-PAM-1.1.8 + build-depends: [] +- name: weston + morph: strata/weston-genivi/weston.morph + repo: upstream:weston + ref: 5d7a71cb941ed419ec042ea28be56c87ea407db6 + unpetrify-ref: baserock/genivi/1.3.0 + build-depends: + - linux-pam +- name: wayland-ivi-extension + morph: strata/weston-genivi/wayland-ivi-extension.morph + repo: upstream:genivi/wayland-ivi-extension + ref: 43fa65ede93cef9e6c902df2248229ad204b510a + unpetrify-ref: master + build-depends: + - weston diff --git a/strata/weston-genivi/wayland-ivi-extension.morph b/strata/weston-genivi/wayland-ivi-extension.morph new file mode 100644 index 00000000..bceb2a88 --- /dev/null +++ b/strata/weston-genivi/wayland-ivi-extension.morph @@ -0,0 +1,8 @@ +name: wayland-ivi-extension +kind: chunk +configure-commands: +- cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_C_FLAGS="-I/usr/include/weston" +build-commands: +- make +install-commands: +- make install DESTDIR="$DESTDIR" diff --git a/strata/weston-genivi/weston.morph b/strata/weston-genivi/weston.morph new file mode 100644 index 00000000..810ce5e9 --- /dev/null +++ b/strata/weston-genivi/weston.morph @@ -0,0 +1,53 @@ +name: weston +kind: chunk +description: weston compositor +build-system: autotools +configure-commands: +- autoreconf -ivf +- | + LDFLAGS='-L/lib64 -lrt' \ + ./configure --prefix=$PREFIX --disable-xwayland \ + --disable-x11-compositor \ + --disable-wayland-compositor --enable-egl \ + --enable-clients --enable-demo-clients-install --enable-fbdev-compositor +post-install-commands: +- install -d "$DESTDIR/usr/share/weston" +- install -m 0644 data/*.png "$DESTDIR/usr/share/weston/" +- sed -i 's,/weston.build/data/,/usr/share/weston/,g' ivi-shell/weston.ini +- sed -i 's,/weston.build/clients/,/usr/bin/,g' ivi-shell/weston.ini +- sed -i 's,/weston.build/,/usr/libexec/,g' ivi-shell/weston.ini +- sed -i '/^\[ivi-launcher\]/,$d' ivi-shell/weston.ini +- | + cat <<EOF >> ivi-shell/weston.ini + [ivi-launcher] + workspace-id=0 + icon-id=4001 + icon=/usr/share/weston/icon_ivi_flower.png + path=/usr/bin/weston-flower + + [ivi-launcher] + workspace-id=0 + icon-id=4002 + icon=/usr/share/weston/icon_ivi_clickdot.png + path=/usr/bin/weston-clickdot + + [ivi-launcher] + workspace-id=1 + icon-id=4003 + icon=/usr/share/weston/icon_ivi_simple-egl.png + path=/usr/bin/weston-simple-egl + + [ivi-launcher] + workspace-id=1 + icon-id=4004 + icon=/usr/share/weston/icon_ivi_simple-shm.png + path=/usr/bin/weston-simple-shm + + [ivi-launcher] + workspace-id=2 + 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/weston.ini "$DESTDIR/usr/share/doc/weston/ivi-shell-weston.ini" diff --git a/strata/x-common.morph b/strata/x-common.morph new file mode 100644 index 00000000..8c0bba1d --- /dev/null +++ b/strata/x-common.morph @@ -0,0 +1,312 @@ +name: x-common +kind: stratum +build-depends: +- morph: strata/xorg-util-macros-common.morph +chunks: +- name: xorg-proto-bigreqsproto + repo: upstream:xorg-proto-bigreqsproto + ref: d6ed3e927a756900ad4c9fd7235f8f7f34f376db + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-compositeproto + repo: upstream:xorg-proto-compositeproto + ref: 39738dbe9438dc80fc6b9e221d9ed26a6d42da6b + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-damageproto + repo: upstream:xorg-proto-damageproto + ref: 015b980e5091492dbe681af59569768ba89fbfe0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-dmxproto + repo: upstream:xorg-proto-dmxproto + ref: 395f6fcc0a5635907b5e45829e86b29431316184 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-fixesproto + repo: upstream:xorg-proto-fixesproto + ref: b6c6bc2aa4b83f8763c75c90e6671052272a2af2 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-fontsproto + repo: upstream:xorg-proto-fontsproto + ref: df8c05f7c0253a36589d96efa52938215eff9d4d + unpetrify-ref: fontsproto-2.1.3 + build-depends: [] +- name: xorg-proto-glproto + repo: upstream:xorg-proto-glproto + ref: f84853d97d5749308992412a215fa518b6536eb3 + unpetrify-ref: glproto-1.4.17 + build-depends: [] +- name: xorg-proto-inputproto + repo: upstream:xorg-proto-inputproto + ref: 343ff0938f592876b9d82c966f166bf45a78c3c8 + unpetrify-ref: inputproto-2.3.1 + build-depends: [] +- name: xorg-proto-kbproto + repo: upstream:xorg-proto-kbproto + ref: f7022f5775350dce3348b7151845a32390e98791 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xineramaproto + repo: upstream:xorg-proto-xineramaproto + ref: 4e77b45e0d6b42a448dab2ec316eeb5c490ecfed + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-randrproto + repo: upstream:xorg-proto-randrproto + ref: ca7cc541c2e43e6c784df19b4583ac35829d2f72 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-recordproto + repo: upstream:xorg-proto-recordproto + ref: 0fd4f8e57c1e637b2aaaaa0f539ddbac8cc50575 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-renderproto + repo: upstream:xorg-proto-renderproto + ref: 935f5ec95a3718c184ff685f5b79b467483b7844 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-resourceproto + repo: upstream:xorg-proto-resourceproto + ref: ada91f54c98b5a61d3e116fca6bf239a8604730f + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-scrnsaverproto + repo: upstream:xorg-proto-scrnsaverproto + ref: 614532026e8ec7496216316fb584d6f2af6a7f7b + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-videoproto + repo: upstream:xorg-proto-videoproto + ref: e42cf822e230cff5c6550ca2c050dfa27d2c9611 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xcmiscproto + repo: upstream:xorg-proto-xcmiscproto + ref: 83549077a3c2140b9862709004cd873f1c55e395 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xextproto + repo: upstream:xorg-proto-xextproto + ref: 66afec3f49e8eb0d4c2e9af7088fc3116d4bafd7 + unpetrify-ref: xextproto-7.3.0 + build-depends: [] +- name: xorg-proto-xf86bigfontproto + repo: upstream:xorg-proto-xf86bigfontproto + ref: f805b328b2195de384c0fb6b82ef5f88c179b2c0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xf86dgaproto + repo: upstream:xorg-proto-xf86dgaproto + ref: c52b205c3175309be7952774668c87dd2d5ce30e + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xf86driproto + repo: upstream:xorg-proto-xf86driproto + ref: cb03b8d49bf063860859c1ed8bcecd055551e93a + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-xf86vidmodeproto + repo: upstream:xorg-proto-xf86vidmodeproto + ref: 15c05b263eb6cc0eaa7ab49c39fe489613d6d796 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-x11proto + repo: upstream:xorg-proto-x11proto + ref: 03cbbf6c3e811c026c86e3a60d2f9af56606e155 + unpetrify-ref: xproto-7.0.26 + build-depends: [] +- name: xorg-proto-dri2proto + repo: upstream:xorg-proto-dri2proto + ref: ead89ad84877551cc15d26b95cb19a3e205df71f + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-proto-dri3proto + repo: upstream:xorg-proto-dri3proto + ref: 91df0f88b70c268f3580385a7b37543ab8c544c8 + build-depends: [] +- name: xorg-proto-presentproto + repo: upstream:xorg-proto-presentproto + ref: ef84007fc4a23d3897b4776906139de9d0698c2a + build-depends: [] +- name: xcb-proto + repo: upstream:xcb-proto + ref: 4b384d2a015c50d0e93dcacda4b8260a3fd37640 + unpetrify-ref: "1.11" + build-depends: [] +- name: xorg-lib-libxshmfence + repo: upstream:xorg-lib-libxshmfence + ref: 9c4f070e1304a3503cfab08f68573443025fc4c9 + build-depends: + - xorg-proto-x11proto +- name: xorg-lib-libXau + repo: upstream:xorg-lib-libXau + ref: 1a8a1b2c68967b48c07b56142799b1020f017027 + unpetrify-ref: baserock/morph + build-depends: + - xorg-proto-x11proto +- name: xcb-libxcb + repo: upstream:xcb-libxcb + ref: d1e8ec96fca4862f37ec9f0e9407bb989c4c161a + unpetrify-ref: "1.11" + build-depends: + - xcb-proto + - xorg-lib-libXau +- name: xorg-lib-libxtrans + repo: upstream:xorg-lib-libxtrans + ref: 7cbad9fe2e61cd9d5caeaf361826a6f4bd320f03 + unpetrify-ref: xtrans-1.3.5 + build-depends: [] +- name: xorg-lib-libX11 + repo: upstream:xorg-lib-libX11 + ref: cb107760df33ffc8630677e66e2e50aa37950a5c + unpetrify-ref: libX11-1.6.2 + build-depends: + - xcb-libxcb + - xorg-lib-libXau + - xorg-lib-libxtrans + - xorg-proto-bigreqsproto + - xorg-proto-inputproto + - xorg-proto-kbproto + - xorg-proto-x11proto + - xorg-proto-xcmiscproto + - xorg-proto-xextproto + - xorg-proto-xf86bigfontproto +- name: xorg-lib-libXext + repo: upstream:xorg-lib-libXext + ref: 8eee1236041d46a21faba32e0d27c26985267d89 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXau + - xorg-proto-x11proto + - xorg-proto-xextproto +- name: xorg-lib-libXi + repo: upstream:xorg-lib-libXi + ref: 9b26b81477cf3486e5aa0ef8d81af68a0f04df1b + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-proto-inputproto + - xorg-proto-x11proto + - xorg-proto-xextproto +- name: xorg-util-makedepend + repo: upstream:xorg-util-makedepend + ref: 87fd28cd5a5acfe6e91c97c4af0a469e1e86cbd5 + unpetrify-ref: baserock/morph + build-depends: + - xorg-proto-x11proto +- name: xorg-lib-libXfixes + repo: upstream:xorg-lib-libXfixes + ref: 0cb446962381f750e05d97bfb974ca1e32481d5d + unpetrify-ref: libXfixes-5.0.1 + build-depends: + - xorg-lib-libXext + - xorg-proto-fixesproto +- name: xorg-lib-libXcomposite + repo: upstream:xorg-lib-libXcomposite + ref: eda48b1bedaa344ada8e13930c9ab3058b836190 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXfixes + - xorg-proto-compositeproto +- name: xorg-lib-libXrender + repo: upstream:xorg-lib-libXrender + ref: 1af52cb334377611233d7dc156bc1e6f7923756d + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-proto-renderproto +- name: xorg-lib-libXrandr + repo: upstream:xorg-lib-libXrandr + ref: 99a63d10cbbab7d69a52d25d78795a3278506ea9 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-lib-libXrender + - xorg-proto-randrproto + - xorg-proto-renderproto + - xorg-proto-xextproto +- name: xorg-lib-libXinerama + repo: upstream:xorg-lib-libXinerama + ref: 470b9356af961ff7d3968b164aa73872b49a5dcc + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-proto-xextproto + - xorg-proto-xineramaproto +- name: xorg-lib-libdmx + repo: upstream:xorg-lib-libdmx + ref: 9f470c92bc2d194c8abb9154f42864e6c82f43ef + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-proto-dmxproto + - xorg-proto-xextproto +- name: xorg-lib-libXtst + repo: upstream:xorg-lib-libXtst + ref: 2aafac9474a0a0a0c39797862f823255918cf368 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-lib-libXi + - xorg-proto-inputproto + - xorg-proto-recordproto + - xorg-proto-xextproto +- name: xorg-lib-libXRes + repo: upstream:xorg-lib-libXRes + ref: 83e7693515369d57dcd11c2bb1f03563f51bc500 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libX11 + - xorg-lib-libXext + - xorg-proto-resourceproto + - xorg-proto-xextproto +- name: xorg-lib-libXdamage + repo: upstream:xorg-lib-libXdamage + ref: 0d35761dc39409b70e04dd0786aef6537f92976a + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXfixes + - xorg-proto-damageproto +- name: xorg-lib-libXcursor + repo: upstream:xorg-lib-libXcursor + ref: 1b98fd6a2e8c00a563187849a585e68c7344468b + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXrender + - xorg-lib-libXfixes + - xorg-proto-fixesproto + - xorg-lib-libXau + - xorg-lib-libX11 +- name: xorg-proto-printproto + repo: upstream:xorg-proto-printproto + ref: cca2ca69d2a6b4b133dba69d5330499fbfe88257 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-lib-libXp + repo: upstream:xorg-lib-libXp + ref: 41aab7d289aba2aaf3839e96d0c9e2f15ede4bd1 + unpetrify-ref: baserock/morph + build-depends: + - xorg-proto-printproto + - xorg-proto-xextproto + - xorg-lib-libXext + - xorg-lib-libX11 +- name: xorg-lib-libXScrnSaver + repo: upstream:xorg-lib-libXScrnSaver + ref: f388a2ff259ee1c1c6058762e900bb29550e8246 + unpetrify-ref: baserock/morph + build-depends: + - xorg-proto-scrnsaverproto + - xorg-proto-xextproto + - xorg-lib-libXext + - xorg-lib-libX11 diff --git a/strata/x-generic.morph b/strata/x-generic.morph new file mode 100644 index 00000000..84f685b0 --- /dev/null +++ b/strata/x-generic.morph @@ -0,0 +1,180 @@ +name: x-generic +kind: stratum +build-depends: +- morph: strata/foundation.morph +- morph: strata/libdrm-common.morph +- morph: strata/x-common.morph +- morph: strata/graphics-common.morph +chunks: +- name: xorg-lib-libxkbfile + repo: upstream:xorg-lib-libxkbfile + ref: 7381c2f9013ef7784c78091fa671e652a62ca706 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-font-util + repo: upstream:xorg-font-util + ref: 5f01ea79f1cb2328bfc4130b1e693f71be916b87 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-lib-libfontenc + repo: upstream:xorg-lib-libfontenc + ref: f5d1208172e965fdd7fae8927bd3e29b3cc3a975 + unpetrify-ref: baserock/morph + build-depends: + - xorg-font-util +- name: xorg-lib-libXfont + repo: upstream:xorg-lib-libXfont + ref: ad4f4d8a2d0730c0ea3c09210bf921638b4682bc + unpetrify-ref: libXfont-1.5.0 + build-depends: + - xorg-lib-libfontenc +- name: xorg-lib-libICE + repo: upstream:xorg-lib-libICE + ref: 1b1cf8072b2559e15ac440d5484a29a81d6918c6 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-lib-libSM + repo: upstream:xorg-lib-libSM + ref: 77ddd273239a629eeed7bd1d5b4509b1bd6d4e37 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libICE +- name: xorg-lib-libXt + repo: upstream:xorg-lib-libXt + ref: ead50a9a274aa96bef94e57c4625be8e9288af4e + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libSM +- name: xorg-lib-libXmu + repo: upstream:xorg-lib-libXmu + ref: 474d22468c90f99104873b4c5fd7b0f0d2cbf823 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXt +- name: xorg-lib-libXpm + repo: upstream:xorg-lib-libXpm + ref: 81608285e11f2455800001a965dfece878861162 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXt +- name: xorg-lib-libXaw + repo: upstream:xorg-lib-libXaw + ref: a5630e166921b5b5322b30fb152df01bb6536e42 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXmu + - xorg-lib-libXpm + - xorg-lib-libXt +- name: libsha1 + repo: upstream:libsha1 + ref: 17173732b9f1b2d4142de27913250b4563db2436 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xserver + morph: strata/x-generic/xserver.morph + repo: upstream:xserver + ref: 4393c7f1ba6140a02232f04fbb434a80d663a99d + unpetrify-ref: xorg-server-1.16.2 + build-depends: + - libsha1 + - xorg-font-util + - xorg-lib-libXaw + - xorg-lib-libXfont + - xorg-lib-libXmu + - xorg-lib-libXpm + - xorg-lib-libXt + - xorg-lib-libfontenc + - xorg-lib-libxkbfile +- name: xorg-driver-xf86-video-cirrus + repo: upstream:xorg-driver-xf86-video-cirrus + ref: 6504929481eab616f064b5d661a057de74b8b488 + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-driver-xf86-video-fbdev + repo: upstream:xorg-driver-xf86-video-fbdev + ref: ac293412a01d87f87eb61f4adb9db7486a75d3fc + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-driver-xf86-video-vesa + repo: upstream:xorg-driver-xf86-video-vesa + ref: 29a149544e2120a582043738d5b09dd80e896345 + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-driver-xf86-input-evdev + repo: upstream:xorg-driver-xf86-input-evdev + ref: 2b8b0df62ec554952784f2820fb4143c495232b0 + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-driver-xf86-input-keyboard + repo: upstream:xorg-driver-xf86-input-keyboard + ref: 4a954bc6a8fbc4aa50dfcabec011274252713204 + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-driver-xf86-input-mouse + repo: upstream:xorg-driver-xf86-input-mouse + ref: 585f4030d77accf2a4ba115729ca08da82217863 + unpetrify-ref: baserock/morph + build-depends: + - xserver +- name: xorg-app-xkbcomp + repo: upstream:xorg-app-xkbcomp + ref: 705b9bbb426410f9510601c7010da51184919b36 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libxkbfile +- name: xkeyboard-config + repo: upstream:xkeyboard-config + ref: b4be67b48fb11989f1824dd0b1c8c399430162b0 + unpetrify-ref: baserock/morph + build-depends: + - xorg-app-xkbcomp +- name: xorg-app-xinit + repo: upstream:xorg-app-xinit + ref: 4e85bce64acef1fa0ddff04d59737444e942ff12 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xorg-lib-libXft + repo: upstream:xorg-lib-libXft + ref: 214f9b5306d833e2787c75fe41dfdc9228fcb738 + unpetrify-ref: libXft-2.3.2 + build-depends: [] +- name: xcb-util + repo: upstream:xcb-util + ref: 45215e6f56bf57efdf5469567c00eba7a991d3a3 + unpetrify-ref: baserock/morph + build-depends: [] +- name: util-wm + repo: upstream:util-wm + ref: 18bde07dc7cb44617c0d159ccd9ef640804296e3 + unpetrify-ref: baserock/morph + build-depends: [] +- name: util-keysyms + morph: strata/x-generic/util-keysyms.morph + repo: upstream:util-keysyms + ref: 0be179eff4eadb99ee303891d1c29c4e4dd6fbab + unpetrify-ref: baserock/morph + build-depends: [] +- name: util-image + repo: upstream:util-image + ref: 66b0caa72eb5011d89d0346424ea40b9e8e93816 + unpetrify-ref: baserock/morph + build-depends: + - xcb-util +- name: xterm + repo: upstream:xterm + ref: 7fc0a9529babac61d9a0b30e6ddb3c79e44af0e5 + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXaw + - xorg-lib-libxkbfile +- name: xorg-app-xauth + repo: upstream:xorg-app-xauth + ref: 6dda11c17f2fdc47d43f269dccee98ec66cc8c4b + unpetrify-ref: baserock/morph + build-depends: + - xorg-lib-libXmu diff --git a/strata/x-generic/util-keysyms.morph b/strata/x-generic/util-keysyms.morph new file mode 100644 index 00000000..ddae3707 --- /dev/null +++ b/strata/x-generic/util-keysyms.morph @@ -0,0 +1,9 @@ +name: util-keysyms +kind: chunk +configure-commands: +- git submodule update --init +- ./autogen.sh --prefix=/usr +build-commands: +- make +install-commands: +- make DESTDIR="$DESTDIR" install diff --git a/strata/x-generic/xserver.morph b/strata/x-generic/xserver.morph new file mode 100644 index 00000000..f8495057 --- /dev/null +++ b/strata/x-generic/xserver.morph @@ -0,0 +1,5 @@ +name: xserver +kind: chunk +build-system: autotools +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --with-sha1=libsha1 --disable-glx diff --git a/strata/xfce.morph b/strata/xfce.morph new file mode 100644 index 00000000..5678c1fc --- /dev/null +++ b/strata/xfce.morph @@ -0,0 +1,171 @@ +name: xfce +kind: stratum +description: xfce stratum +build-depends: +- morph: strata/gtk2.morph +- morph: strata/x-generic.morph +chunks: +- name: libcroco + repo: upstream:libcroco + ref: 611f624a6e15065792b41eb5ce14811293f3fb0a + unpetrify-ref: baserock/morph + build-depends: [] +- name: librsvg + morph: strata/xfce/librsvg.morph + repo: upstream:librsvg + ref: 61171ca59d02b58b7da1697ca1d924bff93e66cb + unpetrify-ref: baserock/morph + build-depends: [] +- name: xfce-dev-tools + repo: upstream:xfce/xfce4-dev-tools + ref: 9244250ac0c15ba160688758c5dccf97f3f160ef + unpetrify-ref: baserock/morph + build-depends: [] +- name: libxfce4util + morph: strata/xfce/libxfce4util.morph + repo: upstream:xfce/libxfce4util + ref: fc0437fe503c3eaa5ccd4fa68f098bc428f27cad + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools +- name: xfconf + morph: strata/xfce/xfconf.morph + repo: upstream:xfce/xfconf + ref: ed6ed2f7656a0d5d8cb453cb643061c9a157f2ae + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools + - libxfce4util +- name: libxfce4ui + morph: strata/xfce/libxfce4ui.morph + repo: upstream:xfce/libxfce4ui + ref: a9c2a379709915dfda255d3ca9181fac3f8484d8 + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools + - libxfce4util + - xfconf +- name: garcon + morph: strata/xfce/garcon.morph + repo: upstream:xfce/garcon + ref: febd4136365714556f6afbccf4302e8f4550e5d1 + unpetrify-ref: baserock/morph + build-depends: + - libxfce4util +- name: perl-uri + repo: upstream:libwww-perl/uri + ref: 3dd72ded7f043a4f6973781fe594722e2e95f491 + unpetrify-ref: baserock/morph + build-depends: [] +- name: exo + morph: strata/xfce/exo.morph + repo: upstream:xfce/exo + ref: b985c4b5c72ef116d55bbf746c16a05f26afc045 + unpetrify-ref: baserock/morph + build-depends: + - libxfce4util + - libxfce4ui + - perl-uri +- name: libwnck + morph: strata/xfce/libwnck.morph + repo: upstream:libwnck + ref: 6792abcdf27aceba1012406d51606e84b065a526 + unpetrify-ref: baserock/xfce-build + build-depends: [] +- name: xfce4-panel + morph: strata/xfce/xfce4-panel.morph + repo: upstream:xfce/xfce4-panel + ref: 6ac8bfcb481781e8e23b101f5c5fdd70cf6d083b + unpetrify-ref: baserock/morph + build-depends: + - libxfce4ui + - garcon + - exo + - libwnck +- name: thunar + morph: strata/xfce/thunar.morph + repo: upstream:xfce/thunar + ref: 8289f48c200b91cc1e9932e13defb8e6a4765054 + unpetrify-ref: baserock/morph + build-depends: + - libxfce4ui + - exo + - garcon + - libwnck +- name: xfce4-settings + morph: strata/xfce/xfce4-settings.morph + repo: upstream:xfce/xfce4-settings + ref: 697ce5cd4bf4860a0a20c27b557be296c9adf469 + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools + - xfconf + - exo + - libxfce4ui + - garcon +- name: iceauth + repo: upstream:iceauth + ref: c07d443d43e53cfe21b53a9a0eafcd6189432867 + unpetrify-ref: baserock/morph + build-depends: [] +- name: xfce4-session + morph: strata/xfce/xfce4-session.morph + repo: upstream:xfce/xfce4-session + ref: 2c89b2f12409ca617fc094e2942cb0d69318c7b5 + unpetrify-ref: baserock/morph + build-depends: + - iceauth + - exo + - xfce-dev-tools + - libxfce4ui + - libwnck +- name: gtk-xfce-engine-2 + morph: strata/xfce/gtk-xfce-engine-2.morph + repo: upstream:xfce/gtk-xfce-engine + ref: ed44a71f1a4d76ae850483ece41638bb9a3e7781 + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools +- name: xfdesktop + morph: strata/xfce/xfdesktop.morph + repo: upstream:xfce/xfdesktop + ref: d2f7404da32f29cfec4a704389112fe7183edda5 + unpetrify-ref: baserock/morph + build-depends: + - exo + - libxfce4ui + - xfconf + - libwnck +- name: xfwm4 + morph: strata/xfce/xfwm4.morph + repo: upstream:xfce/xfwm4 + ref: 523ef8a6861af772be3468cd700ad14172c86768 + unpetrify-ref: baserock/morph + build-depends: + - exo + - libxfce4util + - libxfce4ui + - xfconf + - libwnck +- name: xfce4-appfinder + morph: strata/xfce/xfce4-appfinder.morph + repo: upstream:xfce/xfce4-appfinder + ref: 5c069f13fde648913a59f022957b2c83b5764f39 + unpetrify-ref: baserock/morph + build-depends: + - exo + - libxfce4ui + - garcon +- name: tumbler + morph: strata/xfce/tumbler.morph + repo: upstream:xfce/tumbler + ref: f8191f286227a045fbdabd7684c9da81ade518c8 + unpetrify-ref: baserock/morph + build-depends: + - xfce-dev-tools +- name: elementary-xfce + morph: strata/xfce/elementary-xfce.morph + repo: upstream:elementary-xfce + ref: 81e683bb46f8ba58c49c60ed75124951b7ba0779 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/strata/xfce/elementary-xfce.morph b/strata/xfce/elementary-xfce.morph new file mode 100644 index 00000000..978cfdc4 --- /dev/null +++ b/strata/xfce/elementary-xfce.morph @@ -0,0 +1,10 @@ +name: elementary-xfce +kind: chunk +install-commands: +- mkdir -p $DESTDIR/usr/share/icons/ +- cp -R elementary-xfce $DESTDIR/usr/share/icons/ +- cp -R elementary-xfce-* $DESTDIR/usr/share/icons/ +- gtk-update-icon-cache -t -f $DESTDIR/usr/share/icons/elementary-xfce +- gtk-update-icon-cache -t -f $DESTDIR/usr/share/icons/elementary-xfce-dark +- gtk-update-icon-cache -t -f $DESTDIR/usr/share/icons/elementary-xfce-darker +- gtk-update-icon-cache -t -f $DESTDIR/usr/share/icons/elementary-xfce-darkest diff --git a/strata/xfce/exo.morph b/strata/xfce/exo.morph new file mode 100644 index 00000000..f5096213 --- /dev/null +++ b/strata/xfce/exo.morph @@ -0,0 +1,8 @@ +name: exo +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/garcon.morph b/strata/xfce/garcon.morph new file mode 100644 index 00000000..569197ff --- /dev/null +++ b/strata/xfce/garcon.morph @@ -0,0 +1,8 @@ +name: garcon +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/gtk-xfce-engine-2.morph b/strata/xfce/gtk-xfce-engine-2.morph new file mode 100644 index 00000000..cf1c2530 --- /dev/null +++ b/strata/xfce/gtk-xfce-engine-2.morph @@ -0,0 +1,8 @@ +name: gtk-xfce-engine-2 +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/librsvg.morph b/strata/xfce/librsvg.morph new file mode 100644 index 00000000..f4d880ed --- /dev/null +++ b/strata/xfce/librsvg.morph @@ -0,0 +1,6 @@ +name: librsvg +kind: chunk +build-system: autotools +configure-commands: +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --disable-gtk-theme diff --git a/strata/xfce/libwnck.morph b/strata/xfce/libwnck.morph new file mode 100644 index 00000000..bb8d7afa --- /dev/null +++ b/strata/xfce/libwnck.morph @@ -0,0 +1,11 @@ +name: libwnck +kind: chunk +build-system: autotools +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install DESTDIR="$DESTDIR" diff --git a/strata/xfce/libxfce4ui.morph b/strata/xfce/libxfce4ui.morph new file mode 100644 index 00000000..5fbd342e --- /dev/null +++ b/strata/xfce/libxfce4ui.morph @@ -0,0 +1,8 @@ +name: libxfce4ui +kind: chunk +configure-commands: +- ./autogen.sh --prefix=${PREFIX} +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/libxfce4util.morph b/strata/xfce/libxfce4util.morph new file mode 100644 index 00000000..60a59126 --- /dev/null +++ b/strata/xfce/libxfce4util.morph @@ -0,0 +1,8 @@ +name: libxfce4util +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/thunar.morph b/strata/xfce/thunar.morph new file mode 100644 index 00000000..51f76ac5 --- /dev/null +++ b/strata/xfce/thunar.morph @@ -0,0 +1,9 @@ +name: thunar +kind: chunk +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install diff --git a/strata/xfce/tumbler.morph b/strata/xfce/tumbler.morph new file mode 100644 index 00000000..fe27a783 --- /dev/null +++ b/strata/xfce/tumbler.morph @@ -0,0 +1,8 @@ +name: tumbler +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfce4-appfinder.morph b/strata/xfce/xfce4-appfinder.morph new file mode 100644 index 00000000..f8d1fcbe --- /dev/null +++ b/strata/xfce/xfce4-appfinder.morph @@ -0,0 +1,8 @@ +name: xfce4-appfinder +kind: chunk +configure-commands: +- ./autogen.sh --prefix=${PREFIX} +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfce4-panel.morph b/strata/xfce/xfce4-panel.morph new file mode 100644 index 00000000..fe85e172 --- /dev/null +++ b/strata/xfce/xfce4-panel.morph @@ -0,0 +1,8 @@ +name: xfce4-panel +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfce4-session.morph b/strata/xfce/xfce4-session.morph new file mode 100644 index 00000000..87ffac22 --- /dev/null +++ b/strata/xfce/xfce4-session.morph @@ -0,0 +1,9 @@ +name: xfce4-session +kind: chunk +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install diff --git a/strata/xfce/xfce4-settings.morph b/strata/xfce/xfce4-settings.morph new file mode 100644 index 00000000..6063dbc1 --- /dev/null +++ b/strata/xfce/xfce4-settings.morph @@ -0,0 +1,8 @@ +name: xfce4-settings +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfconf.morph b/strata/xfce/xfconf.morph new file mode 100644 index 00000000..cfbe741b --- /dev/null +++ b/strata/xfce/xfconf.morph @@ -0,0 +1,8 @@ +name: xfconf +kind: chunk +configure-commands: +- ./autogen.sh --prefix=${PREFIX} +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfdesktop.morph b/strata/xfce/xfdesktop.morph new file mode 100644 index 00000000..4af5a905 --- /dev/null +++ b/strata/xfce/xfdesktop.morph @@ -0,0 +1,8 @@ +name: xfdesktop +kind: chunk +configure-commands: +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- make +install-commands: +- make install diff --git a/strata/xfce/xfwm4.morph b/strata/xfce/xfwm4.morph new file mode 100644 index 00000000..0c4e2273 --- /dev/null +++ b/strata/xfce/xfwm4.morph @@ -0,0 +1,11 @@ +name: xfwm4 +kind: chunk +configure-commands: +- gdk-pixbuf-query-loaders > loader.cache +- ./autogen.sh --prefix="$PREFIX" --enable-debug=yes +build-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make +install-commands: +- GDK_PIXBUF_MODULE_FILE="$(pwd)/loader.cache" make install +- install -m 0644 index.theme $DESTDIR/usr/share/icons/hicolor +- gtk-update-icon-cache $DESTDIR/usr/share/icons/hicolor diff --git a/strata/xorg-util-macros-common.morph b/strata/xorg-util-macros-common.morph new file mode 100644 index 00000000..b8e67888 --- /dev/null +++ b/strata/xorg-util-macros-common.morph @@ -0,0 +1,16 @@ +name: xorg-util-macros-common +kind: stratum +build-depends: +- morph: strata/core.morph +chunks: +- name: xorg-util-macros + repo: upstream:xorg-util-macros + ref: 9a54b858601bd305de2737b06e609084a2a114c2 + unpetrify-ref: util-macros-1.19.0 + build-depends: [] +- name: xcb-pthread-stubs + repo: upstream:xcb-pthread-stubs + ref: 431d2c0be218d878b9dd3862e4232243c599df4b + unpetrify-ref: baserock/morph + build-depends: + - xorg-util-macros diff --git a/strip-gplv3.configure b/strip-gplv3.configure new file mode 100755 index 00000000..75143d08 --- /dev/null +++ b/strip-gplv3.configure @@ -0,0 +1,100 @@ +#!/usr/bin/python +# Copyright (C) 2013 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. + +''' A Morph configuration extension for removing gplv3 chunks from a system + +Using a hard-coded list of chunks, it will read the system's /baserock metadata +to find the files created by that chunk, then remove them. + +''' + +import cliapp +import re +import os +import json + +class StripGPLv3ConfigureExtension(cliapp.Application): + gplv3_chunks = [ + ['autoconf', ''], + ['automake', ''], + ['bash', ''], + ['binutils', ''], + ['bison', ''], + ['ccache', ''], + ['cmake', ''], + ['flex', ''], + ['gawk', ''], + ['gcc', r'^.*lib.*\.so(\.\d+)*$'], + ['gdbm', ''], + ['gettext', ''], + ['gperf', ''], + ['groff', ''], + ['libtool', r'^.*lib.*\.so(\.\d+)*$'], + ['m4', ''], + ['make', ''], + ['nano', ''], + ['patch', ''], + ['texinfo-tarball', ''], + ] + + def process_args(self, args): + target_root = args[0] + meta_dir = os.path.join(target_root, 'baserock') + + for chunk in self.gplv3_chunks: + regex = os.path.join(meta_dir, "%s-[^-]\+\.meta" % chunk[0]) + artifacts = self.runcmd(['find', meta_dir, '-regex', regex]) + + for artifact in artifacts.split(): + self.remove_chunk(target_root, artifact, chunk[1]) + + os.symlink(os.path.join(os.sep, 'bin', 'busybox'), + os.path.join(target_root, 'usr', 'bin', 'awk')) + + def remove_chunk(self, target_root, chunk, pattern): + chunk_meta_path = os.path.join(target_root, 'baserock', chunk) + + with open(chunk_meta_path, 'r') as f: + chunk_meta_data = json.load(f) + + if not 'contents' in chunk_meta_data: + raise cliapp.AppError('Chunk %s does not have a "contents" list' + % chunk) + updated_contents = [] + for content_entry in reversed(chunk_meta_data['contents']): + pat = re.compile(pattern) + if len(pattern) == 0 or not pat.match(content_entry): + self.remove_content_entry(target_root, content_entry) + else: + updated_contents.append(content_entry) + + def remove_content_entry(self, target_root, content_entry): + entry_path = os.path.join(target_root, './' + content_entry) + if not entry_path.startswith(target_root): + raise cliapp.AppException('%s is not in %s' + % (entry_path, target_root)) + if os.path.exists(entry_path): + if os.path.islink(entry_path): + os.unlink(entry_path) + elif os.path.isfile(entry_path): + os.remove(entry_path) + elif os.path.isdir(entry_path): + if not os.listdir(entry_path): + os.rmdir(entry_path) + else: + raise cliapp.AppException('%s is not a link, file or directory' + % entry_path) +StripGPLv3ConfigureExtension().run() diff --git a/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph b/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph new file mode 100644 index 00000000..e983ba7a --- /dev/null +++ b/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph @@ -0,0 +1,18 @@ +name: armv7lhf-cross-toolchain-system-x86_32-generic +kind: system +description: A system that contains an ARM cross compiler, intended to be used as + a sysroot. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: armv7lhf-cross-toolchain + morph: strata/armv7lhf-cross-toolchain.morph +- name: cross-tools + morph: strata/cross-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- simple-network +- nfsboot +- install-files diff --git a/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph b/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph new file mode 100644 index 00000000..1a8c20bb --- /dev/null +++ b/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph @@ -0,0 +1,18 @@ +name: armv7lhf-cross-toolchain-system-x86_64-generic +kind: system +description: A system that contains an ARM cross compiler, intended to be used as + a sysroot. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: armv7lhf-cross-toolchain + morph: strata/armv7lhf-cross-toolchain.morph +- name: cross-tools + morph: strata/cross-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- simple-network +- nfsboot +- install-files diff --git a/systems/base-system-armv7-highbank.morph b/systems/base-system-armv7-highbank.morph new file mode 100644 index 00000000..47c69bad --- /dev/null +++ b/systems/base-system-armv7-highbank.morph @@ -0,0 +1,19 @@ +name: base-system-armv7-highbank +kind: system +description: The set of strata required to have a minimal system for an ARM highbank + system. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-highbank + morph: strata/bsp-armv7-highbank.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-armv7-versatile.morph b/systems/base-system-armv7-versatile.morph new file mode 100644 index 00000000..e5b9d7f5 --- /dev/null +++ b/systems/base-system-armv7-versatile.morph @@ -0,0 +1,19 @@ +name: base-system-armv7-versatile +kind: system +description: The set of strata required to have a minimal system for an ARM versatile + system. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-versatile + morph: strata/bsp-armv7-versatile.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-armv7b-highbank.morph b/systems/base-system-armv7b-highbank.morph new file mode 100644 index 00000000..169d490e --- /dev/null +++ b/systems/base-system-armv7b-highbank.morph @@ -0,0 +1,19 @@ +name: base-system-armv7b-highbank +kind: system +description: The set of strata required to have a minimal system for an ARM highbank + system. +arch: armv7b +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7b-highbank + morph: strata/bsp-armv7b-highbank.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-armv7b-vexpress-tc2.morph b/systems/base-system-armv7b-vexpress-tc2.morph new file mode 100644 index 00000000..76d5c006 --- /dev/null +++ b/systems/base-system-armv7b-vexpress-tc2.morph @@ -0,0 +1,18 @@ +name: base-system-armv7b-vexpress-tc2 +kind: system +description: A small system for Versatile TC2 boards system. +arch: armv7b +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7b-vexpress-tc2 + morph: strata/bsp-armv7b-vexpress-tc2.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-armv7lhf-highbank.morph b/systems/base-system-armv7lhf-highbank.morph new file mode 100644 index 00000000..b889278d --- /dev/null +++ b/systems/base-system-armv7lhf-highbank.morph @@ -0,0 +1,19 @@ +name: base-system-armv7lhf-highbank +kind: system +description: The set of strata required to have a minimal system for an ARM highbank + system. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-highbank + morph: strata/bsp-armv7-highbank.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-ppc64-generic.morph b/systems/base-system-ppc64-generic.morph new file mode 100644 index 00000000..488bf5e4 --- /dev/null +++ b/systems/base-system-ppc64-generic.morph @@ -0,0 +1,19 @@ +name: base-system-ppc64-generic +kind: system +description: The set of strata required to have a minimal system for a 64-bit ppc64 + system. +arch: ppc64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-ppc64-generic + morph: strata/bsp-ppc64-generic.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/base-system-x86_32-generic.morph b/systems/base-system-x86_32-generic.morph new file mode 100644 index 00000000..40e62cad --- /dev/null +++ b/systems/base-system-x86_32-generic.morph @@ -0,0 +1,21 @@ +name: base-system-x86_32-generic +kind: system +description: The set of strata required to have a basic system for a 32-bit x86 system. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_32-generic + morph: strata/bsp-x86_32-generic.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- cloud-init diff --git a/systems/base-system-x86_64-generic.morph b/systems/base-system-x86_64-generic.morph new file mode 100644 index 00000000..a3346a44 --- /dev/null +++ b/systems/base-system-x86_64-generic.morph @@ -0,0 +1,22 @@ +name: base-system-x86_64-generic +kind: system +description: The set of strata required to have a minimal system for a 64-bit x86 + system. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- cloud-init diff --git a/systems/build-system-armv7lhf-highbank.morph b/systems/build-system-armv7lhf-highbank.morph new file mode 100644 index 00000000..8b92f267 --- /dev/null +++ b/systems/build-system-armv7lhf-highbank.morph @@ -0,0 +1,34 @@ +name: build-system-armv7lhf-highbank +kind: system +description: The system that should be used for building all other Baserock systems for ARMv7 little-endian hard-float Calxeda Highbank computers. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-highbank + morph: strata/bsp-armv7-highbank.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-armv7lhf-jetson.morph b/systems/build-system-armv7lhf-jetson.morph new file mode 100644 index 00000000..d28b94df --- /dev/null +++ b/systems/build-system-armv7lhf-jetson.morph @@ -0,0 +1,34 @@ +name: build-system-armv7lhf-jetson +kind: system +description: The system that should be used for building all other Baserock systems for ARMv7 little-endian hard-float NVIDIA Jetson TK1 computers. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-jetson + morph: strata/bsp-jetson.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-ppc64.morph b/systems/build-system-ppc64.morph new file mode 100644 index 00000000..14762a6e --- /dev/null +++ b/systems/build-system-ppc64.morph @@ -0,0 +1,34 @@ +name: build-system-ppc64 +kind: system +description: The system that should be used for building all other Baserock systems for 64-bit POWER computers. +arch: ppc64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-ppc64-generic + morph: strata/bsp-ppc64-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-x86_32-chroot.morph b/systems/build-system-x86_32-chroot.morph new file mode 100644 index 00000000..089a26c8 --- /dev/null +++ b/systems/build-system-x86_32-chroot.morph @@ -0,0 +1,32 @@ +name: build-system-x86_32-chroot +kind: system +description: The system that should be used for building all other Baserock systems for 32-bit Intel x86 computers, chroot variant. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-x86_32.morph b/systems/build-system-x86_32.morph new file mode 100644 index 00000000..35a86e11 --- /dev/null +++ b/systems/build-system-x86_32.morph @@ -0,0 +1,34 @@ +name: build-system-x86_32 +kind: system +description: The system that should be used for building all other Baserock systems for 32-bit Intel x86 computers. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_32-generic + morph: strata/bsp-x86_32-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-x86_64-chroot.morph b/systems/build-system-x86_64-chroot.morph new file mode 100644 index 00000000..db3a38db --- /dev/null +++ b/systems/build-system-x86_64-chroot.morph @@ -0,0 +1,32 @@ +name: build-system-x86_64-chroot +kind: system +description: The system that should be used for building all other Baserock systems for 64-bit Intel x86 computers, chroot variant. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/build-system-x86_64.morph b/systems/build-system-x86_64.morph new file mode 100644 index 00000000..06868fed --- /dev/null +++ b/systems/build-system-x86_64.morph @@ -0,0 +1,34 @@ +name: build-system-x86_64 +kind: system +description: The system that should be used for building all other Baserock systems for 64-bit Intel x86 computers. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- distbuild +- fstab +- mason +- cloud-init diff --git a/systems/ceph-service-x86_64-generic.morph b/systems/ceph-service-x86_64-generic.morph new file mode 100644 index 00000000..f54af0f7 --- /dev/null +++ b/systems/ceph-service-x86_64-generic.morph @@ -0,0 +1,26 @@ +name: ceph-service-x86_64-generic +kind: system +description: The set of strata required to have a minimal system for a 64-bit x86 + system + the service daemons for ceph object, block and file storage. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: network-security + morph: strata/network-security.morph +- name: ceph-service + morph: strata/ceph-service.morph +- name: tools + morph: strata/tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- ceph diff --git a/systems/cross-bootstrap-system-armv7lhf-generic.morph b/systems/cross-bootstrap-system-armv7lhf-generic.morph new file mode 100644 index 00000000..4eecf7fe --- /dev/null +++ b/systems/cross-bootstrap-system-armv7lhf-generic.morph @@ -0,0 +1,11 @@ +name: cross-bootstrap-system-armv7lhf-generic +kind: system +description: A system that produces the minimum needed to build a devel system +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: cross-bootstrap + morph: strata/cross-bootstrap.morph diff --git a/systems/cross-bootstrap-system-ppc64-generic.morph b/systems/cross-bootstrap-system-ppc64-generic.morph new file mode 100644 index 00000000..8b274e80 --- /dev/null +++ b/systems/cross-bootstrap-system-ppc64-generic.morph @@ -0,0 +1,11 @@ +name: cross-bootstrap-system-ppc64-generic +kind: system +description: A system that produces the minimum needed to build a devel system +arch: ppc64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: cross-bootstrap + morph: strata/cross-bootstrap.morph diff --git a/systems/cross-bootstrap-system-x86_64-generic.morph b/systems/cross-bootstrap-system-x86_64-generic.morph new file mode 100644 index 00000000..bdd42cf3 --- /dev/null +++ b/systems/cross-bootstrap-system-x86_64-generic.morph @@ -0,0 +1,11 @@ +name: cross-bootstrap-system-x86_64-generic +kind: system +description: A system that produces the minimum needed to build a devel system +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: cross-bootstrap + morph: strata/cross-bootstrap.morph diff --git a/systems/cxmanage-system-x86_64-generic.morph b/systems/cxmanage-system-x86_64-generic.morph new file mode 100644 index 00000000..d75fbd14 --- /dev/null +++ b/systems/cxmanage-system-x86_64-generic.morph @@ -0,0 +1,23 @@ +name: cxmanage-system-x86_64-generic +kind: system +description: A baserock development system with calxeda management tools added +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: cxmanage + morph: strata/cxmanage.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- fstab diff --git a/systems/devel-system-armv7-chroot.morph b/systems/devel-system-armv7-chroot.morph new file mode 100644 index 00000000..466df31f --- /dev/null +++ b/systems/devel-system-armv7-chroot.morph @@ -0,0 +1,36 @@ +name: devel-system-armv7-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use as a chroot inside a Linux-based operating system on ARMv7 + computers using little-endian word order. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7-highbank.morph b/systems/devel-system-armv7-highbank.morph new file mode 100644 index 00000000..ed111387 --- /dev/null +++ b/systems/devel-system-armv7-highbank.morph @@ -0,0 +1,39 @@ +name: devel-system-armv7-highbank +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 Calxeda Highbank computers using little-endian word order. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-highbank + morph: strata/bsp-armv7-highbank.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7-versatile.morph b/systems/devel-system-armv7-versatile.morph new file mode 100644 index 00000000..6b24e603 --- /dev/null +++ b/systems/devel-system-armv7-versatile.morph @@ -0,0 +1,39 @@ +name: devel-system-armv7-versatile +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on generic ARMv7 versatile computers using little-endian word order. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-versatile + morph: strata/bsp-armv7-versatile.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7-wandboard.morph b/systems/devel-system-armv7-wandboard.morph new file mode 100644 index 00000000..70c6f1cc --- /dev/null +++ b/systems/devel-system-armv7-wandboard.morph @@ -0,0 +1,39 @@ +name: devel-system-armv7-wandboard +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 Wandboard computers using little-endian word order. +arch: armv7l +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-wandboard + morph: strata/bsp-wandboard.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7b-chroot.morph b/systems/devel-system-armv7b-chroot.morph new file mode 100644 index 00000000..1f5bf1cf --- /dev/null +++ b/systems/devel-system-armv7b-chroot.morph @@ -0,0 +1,30 @@ +name: devel-system-armv7b-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use as a chroot inside a Linux-based operating system on ARMv7 computers + using big-endian word order. +arch: armv7b +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7b-highbank.morph b/systems/devel-system-armv7b-highbank.morph new file mode 100644 index 00000000..7e703134 --- /dev/null +++ b/systems/devel-system-armv7b-highbank.morph @@ -0,0 +1,33 @@ +name: devel-system-armv7b-highbank +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 Calxeda Highbank computers using big-endian word order. +arch: armv7b +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7b-highbank + morph: strata/bsp-armv7b-highbank.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7lhf-chroot.morph b/systems/devel-system-armv7lhf-chroot.morph new file mode 100644 index 00000000..02358014 --- /dev/null +++ b/systems/devel-system-armv7lhf-chroot.morph @@ -0,0 +1,36 @@ +name: devel-system-armv7lhf-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 computers using little-endian word order and hardware + floating point support. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7lhf-highbank.morph b/systems/devel-system-armv7lhf-highbank.morph new file mode 100644 index 00000000..8fe3737b --- /dev/null +++ b/systems/devel-system-armv7lhf-highbank.morph @@ -0,0 +1,40 @@ +name: devel-system-armv7lhf-highbank +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 Calxeda Highbank computers using little-endian word order + and hardware floating-point support. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-highbank + morph: strata/bsp-armv7-highbank.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7lhf-jetson.morph b/systems/devel-system-armv7lhf-jetson.morph new file mode 100644 index 00000000..550c361a --- /dev/null +++ b/systems/devel-system-armv7lhf-jetson.morph @@ -0,0 +1,40 @@ +name: devel-system-armv7lhf-jetson +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 NVIDIA Jetson TK1 computers using little-endian word order + and hardware floating-point support. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nfs + morph: strata/nfs.morph +- name: bsp-jetson + morph: strata/bsp-jetson.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-armv7lhf-wandboard.morph b/systems/devel-system-armv7lhf-wandboard.morph new file mode 100644 index 00000000..9e8f0bc6 --- /dev/null +++ b/systems/devel-system-armv7lhf-wandboard.morph @@ -0,0 +1,40 @@ +name: devel-system-armv7lhf-wandboard +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on ARMv7 Wandboard computers using little-endian word order and + hardware floating point support. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-wandboard + morph: strata/bsp-wandboard.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-ppc64-chroot.morph b/systems/devel-system-ppc64-chroot.morph new file mode 100644 index 00000000..a60f35fc --- /dev/null +++ b/systems/devel-system-ppc64-chroot.morph @@ -0,0 +1,34 @@ +name: devel-system-ppc64-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use as a chroot inside a Linux operating system on 64-bit POWER + computers. +arch: ppc64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-ppc64-generic.morph b/systems/devel-system-ppc64-generic.morph new file mode 100644 index 00000000..6f7fd319 --- /dev/null +++ b/systems/devel-system-ppc64-generic.morph @@ -0,0 +1,37 @@ +name: devel-system-ppc64-generic +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on 64-bit POWER computers. +arch: ppc64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-ppc64-generic + morph: strata/bsp-ppc64-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-x86_32-chroot.morph b/systems/devel-system-x86_32-chroot.morph new file mode 100644 index 00000000..52e64847 --- /dev/null +++ b/systems/devel-system-x86_32-chroot.morph @@ -0,0 +1,38 @@ +name: devel-system-x86_32-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use as a chroot inside a Linux operating system on 32-bit Intel x86 + computers. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: bsp-x86_both-tools + morph: strata/bsp-x86_both-tools.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-x86_32-generic.morph b/systems/devel-system-x86_32-generic.morph new file mode 100644 index 00000000..8d484e81 --- /dev/null +++ b/systems/devel-system-x86_32-generic.morph @@ -0,0 +1,42 @@ +name: devel-system-x86_32-generic +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on 32-bit Intel x86 computers. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_32-generic + morph: strata/bsp-x86_32-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- cloud-init diff --git a/systems/devel-system-x86_64-chroot.morph b/systems/devel-system-x86_64-chroot.morph new file mode 100644 index 00000000..e77aa5d1 --- /dev/null +++ b/systems/devel-system-x86_64-chroot.morph @@ -0,0 +1,38 @@ +name: devel-system-x86_64-chroot +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use as a chroot inside a Linux operating system on 64-bit Intel x86 + computers. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: bsp-x86_both-tools + morph: strata/bsp-x86_both-tools.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/devel-system-x86_64-generic.morph b/systems/devel-system-x86_64-generic.morph new file mode 100644 index 00000000..143ceb82 --- /dev/null +++ b/systems/devel-system-x86_64-generic.morph @@ -0,0 +1,43 @@ +name: devel-system-x86_64-generic +kind: system +description: | + A system with useful tools for doing Baserock development. + + For use on 64-bit Intel x86 computers. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: nfs + morph: strata/nfs.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- simple-network +- nfsboot +- install-files +- cloud-init diff --git a/systems/devel-system-x86_64-vagrant.morph b/systems/devel-system-x86_64-vagrant.morph new file mode 100644 index 00000000..a7731cad --- /dev/null +++ b/systems/devel-system-x86_64-vagrant.morph @@ -0,0 +1,40 @@ +name: devel-system-x86_64-vagrant +kind: system +description: | + A system with useful tools for doing Baserock development, using Vagrant. + + For use with the Vagrant tool for x86_64 virtual machines. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: virtualbox-guest-x86_64 + morph: strata/virtualbox-guest-x86_64.morph +- name: nodejs + morph: strata/nodejs.morph +- name: ruby + morph: strata/ruby.morph +- name: lorry + morph: strata/lorry.morph +- name: baserock-import + morph: strata/baserock-import.morph +- name: python-tools + morph: strata/python-tools.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- vagrant diff --git a/systems/genivi-baseline-system-armv7lhf-jetson.morph b/systems/genivi-baseline-system-armv7lhf-jetson.morph new file mode 100644 index 00000000..5cbfddbe --- /dev/null +++ b/systems/genivi-baseline-system-armv7lhf-jetson.morph @@ -0,0 +1,42 @@ +name: genivi-baseline-system-armv7lhf-jetson +kind: system +description: A GENIVI baseline system for a Jetson TK. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-jetson + morph: strata/bsp-jetson.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: libdrm-common + morph: strata/libdrm-common.morph +- name: multimedia + morph: strata/multimedia.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-common + morph: strata/input-common.morph +- name: mesa-common + morph: strata/mesa-common.morph +- name: weston-genivi + morph: strata/weston-genivi.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- strip-gplv3 +- fstab diff --git a/systems/genivi-baseline-system-armv7lhf-versatile.morph b/systems/genivi-baseline-system-armv7lhf-versatile.morph new file mode 100644 index 00000000..a5f07750 --- /dev/null +++ b/systems/genivi-baseline-system-armv7lhf-versatile.morph @@ -0,0 +1,40 @@ +name: genivi-baseline-system-armv7lhf-versatile +kind: system +description: A GENIVI baseline system for an ARMv7 system. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-armv7-versatile + morph: strata/bsp-armv7-versatile.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: libdrm-common + morph: strata/libdrm-common.morph +- name: multimedia + morph: strata/multimedia.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-common + morph: strata/input-common.morph +- name: weston-genivi + morph: strata/weston-genivi.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- strip-gplv3 +- fstab diff --git a/systems/genivi-baseline-system-x86_64-generic.morph b/systems/genivi-baseline-system-x86_64-generic.morph new file mode 100644 index 00000000..f5fb571e --- /dev/null +++ b/systems/genivi-baseline-system-x86_64-generic.morph @@ -0,0 +1,43 @@ +name: genivi-baseline-system-x86_64-generic +kind: system +description: A GENIVI baseline system for a 64-bit x86 system. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: libdrm-common + morph: strata/libdrm-common.morph +- name: multimedia + morph: strata/multimedia.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-common + morph: strata/input-common.morph +- name: llvm-common + morph: strata/llvm-common.morph +- name: mesa-common + morph: strata/mesa-common.morph +- name: weston-genivi + morph: strata/weston-genivi.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- strip-gplv3 diff --git a/systems/gerrit-x86_64.morph b/systems/gerrit-x86_64.morph new file mode 100644 index 00000000..91d4c701 --- /dev/null +++ b/systems/gerrit-x86_64.morph @@ -0,0 +1,32 @@ +name: gerrit-x86_64 +kind: system +description: system to install gerrit on it +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: foundation + morph: strata/foundation.morph +- name: core + morph: strata/core.morph +- name: tools + morph: strata/tools.morph +- name: nfs + morph: strata/nfs.morph +- name: databases + morph: strata/databases.morph +- name: network-security + morph: strata/network-security.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: patch-manager-gerrit + morph: strata/patch-manager-gerrit.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- cloud-init +- gerrit diff --git a/systems/gitlab-ci-runner.morph b/systems/gitlab-ci-runner.morph new file mode 100644 index 00000000..9eabc403 --- /dev/null +++ b/systems/gitlab-ci-runner.morph @@ -0,0 +1,48 @@ +name: gitlab-ci-runner +kind: system +description: A system to run build tests as part of GitLab CI architecture. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: x-common + morph: strata/x-common.morph +- name: x-generic + morph: strata/x-generic.morph +- name: multimedia + morph: strata/multimedia.morph +- name: genivi + morph: strata/genivi.morph +- name: tools + morph: strata/tools.morph +- name: virtualization + morph: strata/virtualization.morph +- name: openstack-clients + morph: strata/openstack-clients.morph +- name: databases + morph: strata/databases.morph +- name: pcre-utils + morph: strata/pcre-utils.morph +- name: webtools + morph: strata/webtools.morph +- name: ruby + morph: strata/ruby.morph +- name: nfs + morph: strata/nfs.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/gitlab-server.morph b/systems/gitlab-server.morph new file mode 100644 index 00000000..83093ac1 --- /dev/null +++ b/systems/gitlab-server.morph @@ -0,0 +1,34 @@ +name: gitlab-server +kind: system +description: system which hosts a gitlab server +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: foundation + morph: strata/foundation.morph +- name: core + morph: strata/core.morph +- name: tools + morph: strata/tools.morph +- name: nfs + morph: strata/nfs.morph +- name: databases + morph: strata/databases.morph +- name: pcre-utils + morph: strata/pcre-utils.morph +- name: webtools + morph: strata/webtools.morph +- name: ruby + morph: strata/ruby.morph +- name: gitlab + morph: strata/gitlab.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files +- gitlab +- fstab diff --git a/systems/initramfs-x86_64.morph b/systems/initramfs-x86_64.morph new file mode 100644 index 00000000..4bb0020d --- /dev/null +++ b/systems/initramfs-x86_64.morph @@ -0,0 +1,11 @@ +name: initramfs-x86_64 +kind: system +description: Initramfs for x86_64 +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph + artifacts: + - build-essential-minimal +- name: initramfs-utils + morph: strata/initramfs-utils.morph diff --git a/systems/installer-system-x86_64.morph b/systems/installer-system-x86_64.morph new file mode 100644 index 00000000..0b5e4709 --- /dev/null +++ b/systems/installer-system-x86_64.morph @@ -0,0 +1,22 @@ +name: installer-system-x86_64 +kind: system +description: The system that should be used as an Installer to install other Baserock systems. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: installer-utils + morph: strata/installer-utils.morph +configuration-extensions: +- set-hostname +- install-files +- fstab +- installer diff --git a/systems/minimal-system-x86_32-generic.morph b/systems/minimal-system-x86_32-generic.morph new file mode 100644 index 00000000..6c48361f --- /dev/null +++ b/systems/minimal-system-x86_32-generic.morph @@ -0,0 +1,20 @@ +name: minimal-system-x86_32-generic +kind: system +description: The set of strata required to have a minimal system for a 32-bit x86 + system. +arch: x86_32 +strata: +- name: build-essential + morph: strata/build-essential.morph + artifacts: + - build-essential-minimal +- name: bsp-x86_32-generic + morph: strata/bsp-x86_32-generic.morph + artifacts: + - bsp-x86_32-generic-runtime +configuration-extensions: +- set-hostname +- simple-network +- nfsboot +- install-files +- busybox-init diff --git a/systems/minimal-system-x86_64-generic.morph b/systems/minimal-system-x86_64-generic.morph new file mode 100644 index 00000000..02fb7deb --- /dev/null +++ b/systems/minimal-system-x86_64-generic.morph @@ -0,0 +1,20 @@ +name: minimal-system-x86_64-generic +kind: system +description: The set of strata required to have a minimal system for a 64-bit x86 + system. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph + artifacts: + - build-essential-minimal +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph + artifacts: + - bsp-x86_64-generic-runtime +configuration-extensions: +- set-hostname +- simple-network +- nfsboot +- install-files +- busybox-init diff --git a/systems/nodejs-system-x86_64.morph b/systems/nodejs-system-x86_64.morph new file mode 100644 index 00000000..2692e2fc --- /dev/null +++ b/systems/nodejs-system-x86_64.morph @@ -0,0 +1,21 @@ +name: nodejs-system-x86_64 +kind: system +description: A system that is able to build other systems based on the 64-bit x86 + architecture. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: nodejs + morph: strata/nodejs.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/qt4-devel-system-x86_64-generic.morph b/systems/qt4-devel-system-x86_64-generic.morph new file mode 100644 index 00000000..9a23bdeb --- /dev/null +++ b/systems/qt4-devel-system-x86_64-generic.morph @@ -0,0 +1,41 @@ +name: qt4-devel-system-x86_64-generic +kind: system +description: A system that is able to build other systems based on the 64-bit x86 + architecture. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: multimedia-gstreamer-0.10 + morph: strata/multimedia-gstreamer-0.10.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: x-common + morph: strata/x-common.morph +- name: x-generic + morph: strata/x-generic.morph +- name: qt4-tools + morph: strata/qt4-tools.morph +- name: qt4-sdk + morph: strata/qt4-sdk.morph +- name: lua + morph: strata/lua.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: enlightenment + morph: strata/enlightenment.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/qt5-devel-system-x86_64-generic.morph b/systems/qt5-devel-system-x86_64-generic.morph new file mode 100644 index 00000000..1a78ff4f --- /dev/null +++ b/systems/qt5-devel-system-x86_64-generic.morph @@ -0,0 +1,43 @@ +name: qt5-devel-system-x86_64-generic +kind: system +description: A system that is able to build other systems based on the 64-bit x86 + architecture. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: multimedia + morph: strata/multimedia.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: tools + morph: strata/tools.morph +- name: x-common + morph: strata/x-common.morph +- name: x-generic + morph: strata/x-generic.morph +- name: qt5-tools + morph: strata/qt5-tools.morph +- name: qt5-tools-qtwebkit + morph: strata/qt5-tools-qtwebkit.morph +- name: qt5-sdk + morph: strata/qt5-sdk.morph +- name: lua + morph: strata/lua.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: enlightenment + morph: strata/enlightenment.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/trove-system-x86_64.morph b/systems/trove-system-x86_64.morph new file mode 100644 index 00000000..e305c723 --- /dev/null +++ b/systems/trove-system-x86_64.morph @@ -0,0 +1,38 @@ +name: trove-system-x86_64 +kind: system +description: Trove server +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: foundation + morph: strata/foundation.morph +- name: core + morph: strata/core.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: pcre-utils + morph: strata/pcre-utils.morph +- name: lorry + morph: strata/lorry.morph +- name: trove + morph: strata/trove.morph +- name: lighttpd-server + morph: strata/lighttpd-server.morph +- name: nfs + morph: strata/nfs.morph +- name: ansible + morph: strata/ansible.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +configuration-extensions: +- set-hostname +- trove +- nfsboot-server +- fstab +- install-files +- cloud-init diff --git a/systems/web-system-x86_64-generic.morph b/systems/web-system-x86_64-generic.morph new file mode 100644 index 00000000..22aa88c0 --- /dev/null +++ b/systems/web-system-x86_64-generic.morph @@ -0,0 +1,36 @@ +name: web-system-x86_64-generic +kind: system +description: system with web tools +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: foundation + morph: strata/foundation.morph +- name: core + morph: strata/core.morph +- name: tools + morph: strata/tools.morph +- name: nfs + morph: strata/nfs.morph +- name: databases + morph: strata/databases.morph +- name: pcre-utils + morph: strata/pcre-utils.morph +- name: lighttpd-server + morph: strata/lighttpd-server.morph +- name: webtools + morph: strata/webtools.morph +- name: erlang + morph: strata/erlang.morph +- name: ruby + morph: strata/ruby.morph +- name: nodejs + morph: strata/nodejs.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/weston-system-armv7lhf-jetson.morph b/systems/weston-system-armv7lhf-jetson.morph new file mode 100644 index 00000000..a51bd810 --- /dev/null +++ b/systems/weston-system-armv7lhf-jetson.morph @@ -0,0 +1,40 @@ +name: weston-system-armv7lhf-jetson +kind: system +description: A weston system for ARMv7 little-endian hard-float NVIDIA Jetson TK1 computers. +arch: armv7lhf +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: coreutils-common + morph: strata/coreutils-common.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-jetson + morph: strata/bsp-jetson.morph +- name: connectivity + morph: strata/connectivity.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: libdrm-common + morph: strata/libdrm-common.morph +- name: multimedia + morph: strata/multimedia.morph +- name: wayland-generic + morph: strata/wayland-generic.morph +- name: graphics-common + morph: strata/graphics-common.morph +- name: input-common + morph: strata/input-common.morph +- name: llvm-common + morph: strata/llvm-common.morph +- name: mesa-common + morph: strata/mesa-common.morph +- name: weston-common + morph: strata/weston-common.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/weston-system-x86_64-generic.morph b/systems/weston-system-x86_64-generic.morph new file mode 100644 index 00000000..491a34bc --- /dev/null +++ b/systems/weston-system-x86_64-generic.morph @@ -0,0 +1,40 @@ +name: weston-system-x86_64-generic +kind: system +description: A weston system for a 64-bit x86 system. +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: coreutils-common + morph: strata/coreutils-common.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: connectivity + morph: strata/connectivity.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: libdrm-common + morph: strata/libdrm-common.morph +- name: multimedia + morph: strata/multimedia.morph +- name: wayland-generic + morph: strata/wayland-generic.morph +- name: graphics-common + morph: strata/graphics-common.morph +- name: input-common + morph: strata/input-common.morph +- name: llvm-common + morph: strata/llvm-common.morph +- name: mesa-common + morph: strata/mesa-common.morph +- name: weston-common + morph: strata/weston-common.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/systems/xfce-system.morph b/systems/xfce-system.morph new file mode 100644 index 00000000..152bf16b --- /dev/null +++ b/systems/xfce-system.morph @@ -0,0 +1,40 @@ +name: xfce-system +kind: system +description: A GENIVI devel with XFCE +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: core + morph: strata/core.morph +- name: foundation + morph: strata/foundation.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: connectivity + morph: strata/connectivity.morph +- name: connman-common + morph: strata/connman-common.morph +- name: audio-bluetooth + morph: strata/audio-bluetooth.morph +- name: x-common + morph: strata/x-common.morph +- name: x-generic + morph: strata/x-generic.morph +- name: multimedia + morph: strata/multimedia.morph +- name: genivi + morph: strata/genivi.morph +- name: gtk2 + morph: strata/gtk2.morph +- name: tools + morph: strata/tools.morph +- name: morph-utils + morph: strata/morph-utils.morph +- name: xfce + morph: strata/xfce.morph +configuration-extensions: +- set-hostname +- add-config-files +- nfsboot +- install-files diff --git a/trove.configure b/trove.configure new file mode 100755 index 00000000..f823762c --- /dev/null +++ b/trove.configure @@ -0,0 +1,148 @@ +#!/bin/sh +# +# Copyright (C) 2013 - 2014 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. +# +# This is a "morph deploy" configuration extension to fully configure +# a Trove instance at deployment time. It uses the following variables +# from the environment (run `morph help trove.configure` to see a description +# of them): +# +# * TROVE_ID +# * TROVE_HOSTNAME (optional, defaults to TROVE_ID) +# * TROVE_COMPANY +# * LORRY_SSH_KEY +# * UPSTREAM_TROVE +# * UPSTREAM_TROVE_PROTOCOL +# * TROVE_ADMIN_USER +# * TROVE_ADMIN_EMAIL +# * TROVE_ADMIN_NAME +# * TROVE_ADMIN_SSH_PUBKEY +# * LORRY_CONTROLLER_MINIONS (optional, defaults to 4) +# * TROVE_BACKUP_KEYS - a space-separated list of paths to SSH keys. +# (optional) +# * TROVE_GENERIC (optional) +# +# The configuration of a Trove is slightly tricky: part of it has to +# be run on the configured system after it has booted. We accomplish +# this by copying in all the relevant data to the target system +# (in /var/lib/trove-setup), and creating a systemd unit file that +# runs on the first boot. The first boot will be detected by the +# existence of the /var/lib/trove-setup/needed file. + +set -e + +if [ "$TROVE_GENERIC" ] +then + echo "Not configuring the trove, it will be generic" + exit 0 +fi + + +# Check that all the variables needed are present: + +error_vars=false +if test "x$TROVE_ID" = "x"; then + echo "ERROR: TROVE_ID needs to be defined." + error_vars=true +fi + +if test "x$TROVE_COMPANY" = "x"; then + echo "ERROR: TROVE_COMPANY needs to be defined." + error_vars=true +fi + +if test "x$TROVE_ADMIN_USER" = "x"; then + echo "ERROR: TROVE_ADMIN_USER needs to be defined." + error_vars=true +fi + +if test "x$TROVE_ADMIN_NAME" = "x"; then + echo "ERROR: TROVE_ADMIN_NAME needs to be defined." + error_vars=true +fi + +if test "x$TROVE_ADMIN_EMAIL" = "x"; then + echo "ERROR: TROVE_ADMIN_EMAIL needs to be defined." + error_vars=true +fi + +if ! ssh-keygen -lf $LORRY_SSH_KEY > /dev/null 2>&1 +then + echo "ERROR: LORRY_SSH_KEY is not a vaild ssh key." + error_vars=true +fi + +if ! ssh-keygen -lf $WORKER_SSH_PUBKEY > /dev/null 2>&1 +then + echo "ERROR: WORKER_SSH_PUBKEY is not a vaild ssh key." + error_vars=true +fi + +if ! ssh-keygen -lf $TROVE_ADMIN_SSH_PUBKEY > /dev/null 2>&1 +then + echo "ERROR: TROVE_ADMIN_SSH_PUBKEY is not a vaild ssh key." + error_vars=true +fi + +if "$error_vars"; then + exit 1 +fi + +ROOT="$1" + + +TROVE_DATA="$ROOT/etc/trove" +mkdir -p "$TROVE_DATA" + +install -m 0600 "$LORRY_SSH_KEY" "$TROVE_DATA/lorry.key" +install -m 0644 "${LORRY_SSH_KEY}.pub" "$TROVE_DATA/lorry.key.pub" +install -m 0644 "$TROVE_ADMIN_SSH_PUBKEY" "$TROVE_DATA/admin.key.pub" +install -m 0644 "$WORKER_SSH_PUBKEY" "$TROVE_DATA/worker.key.pub" + + +python <<'EOF' >"$TROVE_DATA/trove.conf" +import os, sys, yaml + +trove_configuration={ + 'TROVE_ID': os.environ['TROVE_ID'], + 'TROVE_COMPANY': os.environ['TROVE_COMPANY'], + 'TROVE_ADMIN_USER': os.environ['TROVE_ADMIN_USER'], + 'TROVE_ADMIN_EMAIL': os.environ['TROVE_ADMIN_EMAIL'], + 'TROVE_ADMIN_NAME': os.environ['TROVE_ADMIN_NAME'], + 'LORRY_SSH_KEY': '/etc/trove/lorry.key', + 'LORRY_SSH_PUBKEY': '/etc/trove/lorry.key.pub', + 'TROVE_ADMIN_SSH_PUBKEY': '/etc/trove/admin.key.pub', + 'WORKER_SSH_PUBKEY': '/etc/trove/worker.key.pub', +} + + + +optional_keys = ('MASON_ID', 'HOSTNAME', 'TROVE_HOSTNAME', + 'LORRY_CONTROLLER_MINIONS', 'TROVE_BACKUP_KEYS', + 'UPSTREAM_TROVE', 'UPSTREAM_TROVE_PROTOCOL') + +for key in optional_keys: + if key in os.environ: + trove_configuration[key]=os.environ[key] + +yaml.dump(trove_configuration, sys.stdout, default_flow_style=False) +EOF + +if [ -n "$TROVE_BACKUP_KEYS" ]; then + mkdir -p "$TROVE_DATA/backup-keys" + cp -- $TROVE_BACKUP_KEYS "$TROVE_DATA/backup-keys" + echo "TROVE_BACKUP_KEYS: /etc/trove/backup-keys/*" >> "$TROVE_DATA/trove.conf" +fi diff --git a/trove.configure.help b/trove.configure.help new file mode 100644 index 00000000..c96bdf74 --- /dev/null +++ b/trove.configure.help @@ -0,0 +1,126 @@ +help: | + This is a "morph deploy" configuration extension to fully configure + a Trove instance at deployment time. It uses the following + configuration variables: + + * `TROVE_ID` + * `TROVE_HOSTNAME` (optional, defaults to `TROVE_ID`) + * `TROVE_COMPANY` + * `LORRY_SSH_KEY` + * `UPSTREAM_TROVE` + * `TROVE_ADMIN_USER` + * `TROVE_ADMIN_EMAIL` + * `TROVE_ADMIN_NAME` + * `TROVE_ADMIN_SSH_PUBKEY` + * `LORRY_CONTROLLER_MINIONS` (optional, defaults to 4) + * `TROVE_BACKUP_KEYS` - a space-separated list of paths to SSH keys. + (optional) + + The variables are described in more detail below. + + A Trove deployment needs to know the following things: + + * The Trove's ID and public name. + * The Trove's administrator name and access details. + * Private and public SSH keys for the Lorry user on the Trove. + * Which upstream Trove it should be set to mirror upon initial deploy. + + These are specified with the configuration variables described in this + help. + + * `TROVE_GENERIC` -- boolean. If it's true the trove will be generic + and it won't be configured with any of the other variables listed + here. + + * `TROVE_ID` -- the identifier of the Trove. This separates it from + other Troves, and allows mirroring of Troves to happen without local + changes getting overwritten. + + The Trove ID is used in several ways. Any local repositories (those not + mirrored from elsewhere) get created under a prefix that is the ID. + Thus, the local repositories on the `git.baserock.org` Trove, whose + Trove ID is `baserock`, are named + `baserock/baserock/definitions.git` and similar. The ID is used + there twice: first as a prefix and then as a "project name" within + that prefix. There can be more projects under the prefix. For + example, there is a `baserock/local-config/lorries.git` repository, + where `local-config` is a separate project from `baserock`. Projects + here are a concept for the Trove's git access control language. + + The Trove ID also used as the prefix for any branch and tag names + created locally for repositories that are not local. Thus, in the + `delta/linux.git` repository, any local branches would be called + something like `baserock/morph`, instead of just `morph`. The + Trove's git access control prevents normal uses from pushing + branches and tags that do not have the Trove ID as the prefix. + + * `TROVE_HOSTNAME` -- the public name of the Trove. This is an + optional setting, and defaults to `TROVE_ID`. The public name is + typically the domain name of the server (e.g., `git.baserock.org`), + but can also be an IP address. This setting is used when Trove needs + to generate URLs that point to itself, such as the `git://` and + `http://` URLs for each git repository that is viewed via the web + interface. + + Note that this is _not_ the system hostname. That is set separately, + with the `HOSTNAME` configuration setting (see the + `set-hostname.configure` extension). + + * `TROVE_COMPANY` -- a description of the organisation who own the + Trove. This is shown in various parts of the web interface of the + Trove. It is for descriptive purposes only. + + * `LORRY_SSH_KEY` -- ssh key pair that the Trove's Lorry will use to + access an upstream Trove, and to push updates to the Trove's git + server. + + The value is a filename on the system doing the deployment (where + `morph deploy` is run). The file contains the _private_ key, and the + public key is in a file with the `.pub` suffix added to the name. + + The upstream Trove needs to be configured to allow this key to + access it. This configuration does not do that automatically. + + * `UPSTREAM_TROVE` -- public name of the upstream Trove (domain + name or IP address). This is an optional setting. If it's set, + the new Trove will be configured to mirror that Trove. + + * `TROVE_ADMIN_USER`, `TROVE_ADMIN_EMAIL`, `TROVE_ADMIN_NAME`, + `TROVE_ADMIN_SSH_PUBKEY` -- details of the Trove's (initial) + administrator. + + Each Trove needs at least one administrator user, and one is created + upon initial deployment. `TROVE_ADMIN_USER` is the username of the + account to be created, `TROVE_ADMIN_EMAIL` should be the e-mail of + the user, and `TROVE_ADMIN_NAME` is their name. If more + administrators are needed, the initial person should create them + using the usual Gitano commands. + + * `LORRY_CONTROLLER_MINIONS` -- the number of Lorry Controller worker + processes to start. This is an optional setting and defaults to 4. + The more workers are running, the more Lorry jobs can run at the same + time, but the more resources they require. + + * `TROVE_BACKUP_KEYS` -- a space-separated list of paths to SSH keys. + If this is set, the Trove will have a backup user that can be accessed + with rsync using the SSH keys provided. + + Example + ------- + + The following set of variables could be to deploy a Trove instance: + + TROVE_ID: my-trove + TROVE_HOSTNAME: my-trove.example.com + TROVE_COMPANY: My Personal Trove for Me, Myself and I + LORRY_SSH_KEY: my-trove/lorry.key + UPSTREAM_TROVE: git.baserock.org + UPSTREAM_TROVE_USER: my-trove + UPSTREAM_TROVE_EMAIL: my-trove@example.com + TROVE_ADMIN_USER: tomjon + TROVE_ADMIN_EMAIL: tomjon@example.com + TROVE_ADMIN_NAME: Tomjon of Lancre + TROVE_ADMIN_SSH_PUBKEY: my-trove/tomjon.key.pub + + These would be put into the cluster morphology used to do the + deployment. diff --git a/vagrant-files/home/vagrant/.ssh/authorized_keys b/vagrant-files/home/vagrant/.ssh/authorized_keys new file mode 100644 index 00000000..18a9c00f --- /dev/null +++ b/vagrant-files/home/vagrant/.ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key diff --git a/vagrant-files/manifest b/vagrant-files/manifest new file mode 100644 index 00000000..67168341 --- /dev/null +++ b/vagrant-files/manifest @@ -0,0 +1,4 @@ +0040755 0 0 /home +0040755 1000 0000 /home/vagrant +0040700 1000 1000 /home/vagrant/.ssh +0100600 1000 1000 /home/vagrant/.ssh/authorized_keys diff --git a/vagrant.configure b/vagrant.configure new file mode 100644 index 00000000..abc3ea0c --- /dev/null +++ b/vagrant.configure @@ -0,0 +1,55 @@ +#!/bin/sh +# Copyright (C) 2014 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.5 +# +# 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. + +set -e + +ROOT="$1" + +if test "x$VAGRANT" = "x"; then + exit 0 +fi + +for needed in etc/ssh/sshd_config etc/sudoers; do + if ! test -e "$ROOT/$needed"; then + echo >&2 "Unable to find $needed" + echo >&2 "Cannot continue configuring as Vagrant basebox" + exit 1 + fi +done + +# SSH daemon needs to be configured to not use DNS... +sed -i -e's/^(.*[Uu]][Ss][Ee][Dd][Nn][Ss].*)$/#\1/' "$ROOT/etc/ssh/sshd_config" +echo "UseDNS no" >> "$ROOT/etc/ssh/sshd_config" + +# We need to add a vagrant user with "vagrant" as the password We're doing this +# manually because chrooting in to run adduser is not really allowed for +# deployment time since we wouldn't be able to run the adduser necessarily. In +# practice for now we'd be able to because we can't deploy raw disks +# cross-platform and expect extlinux to install but we won't, for good +# practice and to hilight this deficiency. +echo 'vagrant:x:1000:1000:Vagrant User:/home/vagrant:/bin/bash' >> "$ROOT/etc/passwd" +echo 'vagrant:/6PTOoWylhw3w:16198:0:99999:7:::' >> "$ROOT/etc/shadow" +echo 'vagrant:x:1000:' >> "$ROOT/etc/group" +mkdir -p "$ROOT/home/vagrant" +chown -R 1000:1000 "$ROOT/home/vagrant" + +# Next, the vagrant user is meant to have sudo access +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> "$ROOT/etc/sudoers" + +# And ensure that we get sbin in our path +echo 'PATH="$PATH:/sbin:/usr/sbin"' >> "$ROOT/etc/profile" +echo 'export PATH' >> "$ROOT/etc/profile" + |