diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-11-02 17:33:45 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-11-02 17:33:45 +0000 |
commit | 398a7fa93a05b44adba1d7557b1ad4a24f466369 (patch) | |
tree | 0d29311eecdb4dd8dade15b88884b991fec0f82e | |
parent | 8a575a776e7476cb3beb22bb6b71e269c6b55580 (diff) | |
parent | 6cb63998328664c5c234b5a5da7ea3a9026e4d2a (diff) | |
download | infrastructure-398a7fa93a05b44adba1d7557b1ad4a24f466369.tar.gz |
Merge tag 'baserock-15.34'
Conflicts:
README
clusters/release.morph
scripts/release-build
Change-Id: If289bcb168478405400c66717d7f33dcdde63cb6
237 files changed, 4310 insertions, 1076 deletions
@@ -1 +1 @@ -version: 3 +version: 5 diff --git a/clusters/cephclient.morph b/clusters/cephclient.morph index 2585fbdf..9eaf92ee 100644 --- a/clusters/cephclient.morph +++ b/clusters/cephclient.morph @@ -3,18 +3,18 @@ kind: cluster systems: - morph: systems/ceph-service-x86_64-generic.morph deploy: - ceph-node-virtualbox-image: - type: extensions/virtualbox-ssh - SYSTEM: systems/ceph-service-x86_64-generic.morph - location: vbox+ssh://user@machine/ChefNode4/home/user/chefnode4.vdi - # HOST_IPADDR and NETMASK should be set to the IP address and netmask of the virtualbox host on the host-only interface. - #HOST_IPADDR: 10.0.100.100 - #NETMASK: 255.255.255.0 + ceph-node-virtualbox-image: + type: extensions/virtualbox-ssh + SYSTEM: systems/ceph-service-x86_64-generic.morph + location: vbox+ssh://user@machine/ChefNode4/home/user/chefnode4.vdi + # HOST_IPADDR and NETMASK should be set to the IP address and netmask of the virtualbox host on the host-only interface. + #HOST_IPADDR: 10.0.100.100 + #NETMASK: 255.255.255.0 - # This is an example of how to configure the three interfaces necessary to support ceph in the BCPC configuration. - #NETWORK_CONFIG: lo:loopback;enp0s3:static,address=10.0.100.14,netmask=255.255.255.0;enp0s8:static,address=172.16.100.14,netmask=255.255.255.0;enp0s9:static,address=192.168.100.14,netmask=255.255.255.0 - DISK_SIZE: 8G - HOSTNAME: CephNode4 + # This is an example of how to configure the three interfaces necessary to support ceph in the BCPC configuration. + #NETWORK_CONFIG: lo:loopback;enp0s3:static,address=10.0.100.14,netmask=255.255.255.0;enp0s8:static,address=172.16.100.14,netmask=255.255.255.0;enp0s9:static,address=192.168.100.14,netmask=255.255.255.0 + DISK_SIZE: 8G + HOSTNAME: CephNode4 - # You must install authorized_keys in chef/root/.ssh/ before this will work. - INSTALL_FILES: install-files/chef/manifest + # You must install authorized_keys in chef/root/.ssh/ before this will work. + INSTALL_FILES: install-files/chef/manifest diff --git a/clusters/ci.morph b/clusters/ci.morph index 69b7c76a..fc3e50a7 100644 --- a/clusters/ci.morph +++ b/clusters/ci.morph @@ -24,12 +24,13 @@ systems: type: extensions/rawdisk location: build-system-armv7lhf-jetson.img DISK_SIZE: 2G - BOOT_DEVICE: "/dev/mmcblk0p1" - ROOT_DEVICE: "/dev/mmcblk0p2" - 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 + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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: @@ -43,12 +44,13 @@ systems: type: extensions/rawdisk location: weston-system-armv7lhf-jetson.img DISK_SIZE: 4G - BOOT_DEVICE: "/dev/mmcblk0p1" - ROOT_DEVICE: "/dev/mmcblk0p2" - 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 + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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: @@ -62,12 +64,13 @@ systems: type: extensions/rawdisk location: genivi-baseline-system-armv7lhf-jetson.img DISK_SIZE: 4G - BOOT_DEVICE: "/dev/mmcblk0p1" - ROOT_DEVICE: "/dev/mmcblk0p2" - 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 + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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/openstack-system-x86_64.morph deploy: openstack-system-x86_64: diff --git a/clusters/example-swift-storage-cluster.morph b/clusters/example-swift-storage-cluster.morph index e5e7b6ab..ddab6481 100644 --- a/clusters/example-swift-storage-cluster.morph +++ b/clusters/example-swift-storage-cluster.morph @@ -11,13 +11,13 @@ systems: SWIFT_REPLICAS: 3 SWIFT_MIN_PART_HOURS: 1 - SWIFT_STORAGE_DEVICES: [{ ip: <node0 management ip>, device: sdb, weight: 100 }, - { ip: <node0 management ip>, device: sdc, weight: 100 }, - { ip: <node0 management ip>, device: sdd, weight: 100 }, - - { ip: <node1 management ip>, device: sdb, weight: 100 }, - { ip: <node1 management ip>, device: sdc, weight: 100 }, - { ip: <node1 management ip>, device: sdd, weight: 100 }] + SWIFT_STORAGE_DEVICES: + - {ip: <node0 management ip>, device: sdb, weight: 100} + - {ip: <node0 management ip>, device: sdc, weight: 100} + - {ip: <node0 management ip>, device: sdd, weight: 100} + - {ip: <node1 management ip>, device: sdb, weight: 100} + - {ip: <node1 management ip>, device: sdc, weight: 100} + - {ip: <node1 management ip>, device: sdd, weight: 100} # This value can be any random string or number # but each node in your swift cluster must have the same value diff --git a/clusters/jetson-upgrade.morph b/clusters/jetson-upgrade.morph index e6ec97e0..c8ac0681 100644 --- a/clusters/jetson-upgrade.morph +++ b/clusters/jetson-upgrade.morph @@ -3,16 +3,15 @@ kind: cluster systems: - morph: systems/devel-system-armv7lhf-jetson.morph deploy-defaults: - TROVE_HOST: TROVE_HOST - TROVE_ID: TROVE_ID - BOOT_DEVICE: "/dev/mmcblk0p1" - ROOT_DEVICE: "/dev/mmcblk0p2" - 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 + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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: extensions/ssh-rsync - location: root@127.0.0.1 + upgrade-type: extensions/ssh-rsync + upgrade-location: root@127.0.0.1 diff --git a/clusters/mason-openstack.morph b/clusters/mason-openstack.morph index 935e2496..cc7c1d4d 100644 --- a/clusters/mason-openstack.morph +++ b/clusters/mason-openstack.morph @@ -34,6 +34,6 @@ systems: OPENSTACK_TENANT_ID: 7d7ebfe23367490b973a10fa426c3aec OPENSTACK_IMAGENAME: mason-openstack OPENSTACK_NETWORK_ID: 71f5151a-b7c3-405d-a841-d1b07e5db099 - CLOUD_INIT: yes + CLOUD_INIT: true KERNEL_ARGS: console=ttyS0 console=tty0 TEST_INFRASTRUCTURE_TYPE: openstack diff --git a/clusters/minimal-system-armv5l-openbmc-aspeed-deploy.morph b/clusters/minimal-system-armv5l-openbmc-aspeed-deploy.morph index 9647e7a7..3154fa26 100644 --- a/clusters/minimal-system-armv5l-openbmc-aspeed-deploy.morph +++ b/clusters/minimal-system-armv5l-openbmc-aspeed-deploy.morph @@ -6,8 +6,8 @@ systems: minimal-system-armv5l-openbmc-aspeed: type: extensions/jffs2 location: minimal-system-armv5l-openbmc-aspeed.img - ROOT_DEVICE: "/dev/mtdblock" - BOOTLOADER_CONFIG_FORMAT: "extlinux" - BOOTLOADER_INSTALL: "none" + ROOT_DEVICE: /dev/mtdblock + BOOTLOADER_CONFIG_FORMAT: extlinux + BOOTLOADER_INSTALL: none ERASE_BLOCK: 64 INIT_SYSTEM: busybox diff --git a/clusters/moonshot-m2-armv8b64.morph b/clusters/moonshot-m2-armv8b64.morph index c6d62ca2..caa460c3 100644 --- a/clusters/moonshot-m2-armv8b64.morph +++ b/clusters/moonshot-m2-armv8b64.morph @@ -14,32 +14,32 @@ systems: PXEBOOT_CONFIG_TFTP_ADDRESS: sftp://192.168.0.1/srv/nfsboot/tftp/ PXEBOOT_ROOTFS_RSYNC_ADDRESS: rsync://192.168.0.1/srv/nfsboot/ PXEBOOT_PXE_REBOOT_COMMAND: | - ssh Administrator@10.0.1.10 set node power off force c31n1 - ssh Administrator@10.0.1.10 set node boot pxe c31n1 - # Nodes are powered on twice as sometimes powering them on - # once is not enough - ssh Administrator@10.0.1.10 set node power on c31n1 - ssh Administrator@10.0.1.10 set node power on c31n1 + ssh Administrator@10.0.1.10 set node power off force c31n1 + ssh Administrator@10.0.1.10 set node boot pxe c31n1 + # Nodes are powered on twice as sometimes powering them on + # once is not enough + ssh Administrator@10.0.1.10 set node power on c31n1 + ssh Administrator@10.0.1.10 set node power on c31n1 PXEBOOT_REBOOT_COMMAND: | - ssh Administrator@10.0.1.10 set node power off force c31n1 - ssh Administrator@10.0.1.10 set node boot m.2 c31n1 - ssh Administrator@10.0.1.10 set node power on c31n1 - ssh Administrator@10.0.1.10 set node power on c31n1 + ssh Administrator@10.0.1.10 set node power off force c31n1 + ssh Administrator@10.0.1.10 set node boot m.2 c31n1 + ssh Administrator@10.0.1.10 set node power on c31n1 + ssh Administrator@10.0.1.10 set node power on c31n1 INSTALLER_TARGET_STORAGE_DEVICE: /dev/sda INSTALLER_ROOTFS_TO_INSTALL: /rootfs INSTALLER_POST_INSTALL_COMMAND: | - while : ; do - echo "enter 'installed' in your deployment machine to finish the installation" - sleep 2 - done - INSTALLER_CREATE_BOOT_PARTITION: yes + while : ; do + echo "enter 'installed' in your deployment machine to finish the installation" + sleep 2 + done + INSTALLER_CREATE_BOOT_PARTITION: true HOSTNAME: installer-system-c31n1 DTB_PATH: boot/m400-1003.dtb KERNEL_ARGS: console=ttyS0,9600n8r init=/usr/lib/baserock-installer/installer INSTALL_FILES: install-files/moonshot/manifest - MOONSHOT_KERNEL: yes + MOONSHOT_KERNEL: true subsystems: - morph: systems/devel-system-armv8b64.morph deploy: @@ -49,8 +49,8 @@ systems: HOSTNAME: baserock-c31n1 DTB_PATH: boot/m400-1003.dtb INSTALL_FILES: install-files/moonshot/manifest - MOONSHOT_KERNEL: yes + MOONSHOT_KERNEL: true BOOT_DEVICE: /dev/sda1 ROOT_DEVICE: /dev/sda2 BOOTLOADER_CONFIG_FORMAT: extlinux - BOOTLOADER_INSTALL: "none" + BOOTLOADER_INSTALL: none diff --git a/clusters/moonshot-pxe-armv8b64.morph b/clusters/moonshot-pxe-armv8b64.morph index ffee0392..af59817a 100644 --- a/clusters/moonshot-pxe-armv8b64.morph +++ b/clusters/moonshot-pxe-armv8b64.morph @@ -15,16 +15,16 @@ systems: PXEBOOT_CONFIG_TFTP_ADDRESS: sftp://192.168.0.1/srv/nfsboot/tftp/ PXEBOOT_ROOTFS_RSYNC_ADDRESS: rsync://192.168.0.1/srv/nfsboot/ PXEBOOT_PXE_REBOOT_COMMAND: | - ssh Administrator@10.0.1.10 set node power off force c31n1 - ssh Administrator@10.0.1.10 set node boot pxe c31n1 - # Nodes are powered on twice as sometimes powering them on - # once is not enough - ssh Administrator@10.0.1.10 set node power on c31n1 - ssh Administrator@10.0.1.10 set node power on c31n1 - PXE_INSTALLER: no + ssh Administrator@10.0.1.10 set node power off force c31n1 + ssh Administrator@10.0.1.10 set node boot pxe c31n1 + # Nodes are powered on twice as sometimes powering them on + # once is not enough + ssh Administrator@10.0.1.10 set node power on c31n1 + ssh Administrator@10.0.1.10 set node power on c31n1 + PXE_INSTALLER: false HOSTNAME: baserock-c31n1 DTB_PATH: boot/m400-1003.dtb KERNEL_ARGS: console=ttyS0,9600n8r rw INSTALL_FILES: install-files/moonshot/manifest - MOONSHOT_KERNEL: yes + MOONSHOT_KERNEL: true diff --git a/clusters/moonshot-pxe-armv8l64.morph b/clusters/moonshot-pxe-armv8l64.morph index 62ee92a2..80771d52 100644 --- a/clusters/moonshot-pxe-armv8l64.morph +++ b/clusters/moonshot-pxe-armv8l64.morph @@ -17,6 +17,6 @@ systems: KERNEL_ARGS: console=ttyS0,9600n8r rw DTB_PATH: boot/m400-1003.dtb HOSTNAME: baserock-m400-node31 - MOONSHOT_KERNEL: yes + MOONSHOT_KERNEL: true INSTALL_FILES: install-files/moonshot/manifest - PXE_INSTALLER: no + PXE_INSTALLER: false diff --git a/clusters/openstack-one-node-swift.morph b/clusters/openstack-one-node-swift.morph index de7066d6..fc289538 100644 --- a/clusters/openstack-one-node-swift.morph +++ b/clusters/openstack-one-node-swift.morph @@ -51,7 +51,7 @@ systems: ## Swift config options ######################################################################### - SWIFT_CONTROLLER: True + SWIFT_CONTROLLER: true SWIFT_ADMIN_PASSWORD: insecure @@ -59,13 +59,13 @@ systems: SWIFT_REPLICAS: 3 SWIFT_MIN_PART_HOURS: 1 - SWIFT_STORAGE_DEVICES: [{ ip: <storage node 0 management ip>, device: sdb, weight: 100 }, - { ip: <storage node 0 management ip>, device: sdc, weight: 100 }, - { ip: <storage node 0 management ip>, device: sdd, weight: 100 }, - - { ip: <storage node 1 management ip>, device: sdb, weight: 100 }, - { ip: <storage node 1 management ip>, device: sdc, weight: 100 }, - { ip: <storage node 1 management ip>, device: sdd, weight: 100 }] + SWIFT_STORAGE_DEVICES: + - {ip: <storage node 0 management ip>, device: sdb, weight: 100} + - {ip: <storage node 0 management ip>, device: sdc, weight: 100} + - {ip: <storage node 0 management ip>, device: sdd, weight: 100} + - {ip: <storage node 1 management ip>, device: sdb, weight: 100} + - {ip: <storage node 1 management ip>, device: sdc, weight: 100} + - {ip: <storage node 1 management ip>, device: sdd, weight: 100} # This value can be any random string or number # but each node in your swift cluster must have the same values @@ -91,13 +91,13 @@ systems: CONTROLLER_HOST_ADDRESS: onenode MANAGEMENT_INTERFACE_IP_ADDRESS: <management ip> - KEYSTONE_ENABLE_SERVICE: True + KEYSTONE_ENABLE_SERVICE: true KEYSTONE_TEMPORARY_ADMIN_TOKEN: 22f3aa1cf538e3f6d5e8 KEYSTONE_ADMIN_PASSWORD: veryinsecure KEYSTONE_DB_USER: keystoneDB KEYSTONE_DB_PASSWORD: veryinsecure - GLANCE_ENABLE_SERVICE: True + GLANCE_ENABLE_SERVICE: true GLANCE_SERVICE_USER: glance GLANCE_SERVICE_PASSWORD: veryinsecure GLANCE_DB_USER: glanceDB @@ -108,7 +108,7 @@ systems: NOVA_DB_USER: novaDB NOVA_DB_PASSWORD: veryinsecure NOVA_VIRT_TYPE: qemu - NOVA_BAREMETAL_SCHEDULING: no + NOVA_BAREMETAL_SCHEDULING: false CINDER_SERVICE_USER: cinder CINDER_SERVICE_PASSWORD: veryinsecure @@ -123,7 +123,7 @@ systems: NEUTRON_DB_PASSWORD: veryinsecure METADATA_PROXY_SHARED_SECRET: novaneutronmetasecret - IRONIC_ENABLE_SERVICE: True + IRONIC_ENABLE_SERVICE: true IRONIC_SERVICE_USER: ironic IRONIC_SERVICE_PASSWORD: veryinsecure IRONIC_DB_USER: ironicDB diff --git a/clusters/openstack-one-node.morph b/clusters/openstack-one-node.morph index ab12f9b3..12985463 100644 --- a/clusters/openstack-one-node.morph +++ b/clusters/openstack-one-node.morph @@ -55,13 +55,13 @@ systems: CONTROLLER_HOST_ADDRESS: onenode MANAGEMENT_INTERFACE_IP_ADDRESS: <management ip> - KEYSTONE_ENABLE_SERVICE: True + KEYSTONE_ENABLE_SERVICE: true KEYSTONE_TEMPORARY_ADMIN_TOKEN: 22f3aa1cf538e3f6d5e8 KEYSTONE_ADMIN_PASSWORD: veryinsecure KEYSTONE_DB_USER: keystoneDB KEYSTONE_DB_PASSWORD: veryinsecure - GLANCE_ENABLE_SERVICE: True + GLANCE_ENABLE_SERVICE: true GLANCE_SERVICE_USER: glance GLANCE_SERVICE_PASSWORD: veryinsecure GLANCE_DB_USER: glanceDB @@ -72,7 +72,7 @@ systems: NOVA_DB_USER: novaDB NOVA_DB_PASSWORD: veryinsecure NOVA_VIRT_TYPE: qemu - NOVA_BAREMETAL_SCHEDULING: no + NOVA_BAREMETAL_SCHEDULING: false CINDER_SERVICE_USER: cinder CINDER_SERVICE_PASSWORD: veryinsecure @@ -87,7 +87,7 @@ systems: NEUTRON_DB_PASSWORD: veryinsecure METADATA_PROXY_SHARED_SECRET: novaneutronmetasecret - IRONIC_ENABLE_SERVICE: True + IRONIC_ENABLE_SERVICE: true IRONIC_SERVICE_USER: ironic IRONIC_SERVICE_PASSWORD: veryinsecure IRONIC_DB_USER: ironicDB @@ -99,8 +99,6 @@ systems: CEILOMETER_DB_PASSWORD: veryinsecure METERING_SECRET: insecureceilometersecret - HOSTS_CONTROLLER: <management ip> onenode - # Network interface to be used, only needed if there are more # than one available. # EXTERNAL_INTERFACE: eno1 diff --git a/clusters/openstack-three-node-installer.morph b/clusters/openstack-three-node-installer.morph index a316a56c..144f29f2 100644 --- a/clusters/openstack-three-node-installer.morph +++ b/clusters/openstack-three-node-installer.morph @@ -1,59 +1,58 @@ name: openstack-three-node-installer kind: cluster description: | - - This is a cluster morphology for deploying an installer for an x86_64 - OpenStack system spread across three nodes. - - This cluster creates disk images that may be `dd`'d onto install media to - produce an OpenStack cluster when instantiated. - - Alternatively it may be used to install directly onto a physical disk by - running: - - morph deploy clusters/openstack-three-node-installer.morph \ - network-installer network-installer.location=/dev/vdb - - Substituting network-installer for either compute-installer or - controller-installer will produce different configurations, and it is possible - to substitue /dev/vdb for a different path to a disk image to install to a - different disk image. - - Substitute the values of HOSTNAME, NETWORK_CONFIG, EXTERNAL_INTERFACE, - MANAGEMENT_IP_ADDRESS, CONTROLLER_HOST_ADDRESS, RABBITMQ_HOST and HOSTS_* to - match your hardware and networking configuration. - - Requirements to be able to run and test the system: - - - DISK_SIZE should be bigger than 5G - - The system has to have available at least 4G of RAM, but once - you start instantiating VMs you will need more. - - The IP of the system can't change, and you need to know it beforehand, - that is, the system needs a static IP address. - - This cluster is configurable, but with the following constraints: - - - The hostname in RABBITMQ_HOST has to match CONTROLLER_HOST_ADDRESS, - and HOST_CONTROLLER. - - HOSTS_CONTROLLER is only needed if the hostname (see previous point) - is not a FQDN. - - The IP listed in MANAGEMENT_INTERFACE_IP_ADDRESS has to match the one - used in HOSTS_CONTROLLER. - - CINDER_DEVICE should be a path to a storage device ready to be - used/formated for cinder data. - - EXTERNAL_INTERFACE is required when the system has more than one network - interface. - - You can also have a look at the following suggestions: - - - NOVA_VIRT_TYPE can be either 'kvm' or 'qemu', depending on where the - system is being deployed to. - - We recommend changing all the PASSWORDs variables, also the - KEYSTONE_TEMPORARY_ADMIN_TOKEN, METADATA_PROXY_SHARED_SECRET and - METERING_SECRET. - - Setting NOVA_BAREMETAL_SCHEDULING with an YAML truth value will configure - Nova to schedule baremetal machines through the Ironic driver, instead of - sheduling virtual machines. + This is a cluster morphology for deploying an installer for an x86_64 + OpenStack system spread across three nodes. + + This cluster creates disk images that may be `dd`'d onto install media to + produce an OpenStack cluster when instantiated. + + Alternatively it may be used to install directly onto a physical disk by + running: + + morph deploy clusters/openstack-three-node-installer.morph \ + network-installer network-installer.location=/dev/vdb + + Substituting network-installer for either compute-installer or + controller-installer will produce different configurations, and it is possible + to substitue /dev/vdb for a different path to a disk image to install to a + different disk image. + + Substitute the values of HOSTNAME, NETWORK_CONFIG, EXTERNAL_INTERFACE, + MANAGEMENT_IP_ADDRESS, CONTROLLER_HOST_ADDRESS, RABBITMQ_HOST and HOSTS_* to + match your hardware and networking configuration. + + Requirements to be able to run and test the system: + + - DISK_SIZE should be bigger than 5G + - The system has to have available at least 4G of RAM, but once + you start instantiating VMs you will need more. + - The IP of the system can't change, and you need to know it beforehand, + that is, the system needs a static IP address. + + This cluster is configurable, but with the following constraints: + + - The hostname in RABBITMQ_HOST has to match CONTROLLER_HOST_ADDRESS, + and HOST_CONTROLLER. + - HOSTS_CONTROLLER is only needed if the hostname (see previous point) + is not a FQDN. + - The IP listed in MANAGEMENT_INTERFACE_IP_ADDRESS has to match the one + used in HOSTS_CONTROLLER. + - CINDER_DEVICE should be a path to a storage device ready to be + used/formated for cinder data. + - EXTERNAL_INTERFACE is required when the system has more than one network + interface. + + You can also have a look at the following suggestions: + + - NOVA_VIRT_TYPE can be either 'kvm' or 'qemu', depending on where the + system is being deployed to. + - We recommend changing all the PASSWORDs variables, also the + KEYSTONE_TEMPORARY_ADMIN_TOKEN, METADATA_PROXY_SHARED_SECRET and + METERING_SECRET. + - Setting NOVA_BAREMETAL_SCHEDULING with an YAML truth value will configure + Nova to schedule baremetal machines through the Ironic driver, instead of + sheduling virtual machines. systems: - morph: systems/installer-system-x86_64.morph @@ -66,7 +65,7 @@ systems: HOSTNAME: installer-x86_64 INSTALLER_TARGET_STORAGE_DEVICE: /dev/sda INSTALLER_ROOTFS_TO_INSTALL: /rootfs - INSTALLER_POST_INSTALL_COMMAND: 'sync; poweroff -f' + INSTALLER_POST_INSTALL_COMMAND: sync; poweroff -f INITRAMFS_PATH: boot/initramfs.gz subsystems: - morph: systems/initramfs-x86_64.morph @@ -90,30 +89,30 @@ systems: RABBITMQ_PASSWORD: veryinsecure # This token needs to be unique and secret - KEYSTONE_ENABLE_SERVICE: False + KEYSTONE_ENABLE_SERVICE: false KEYSTONE_TEMPORARY_ADMIN_TOKEN: 22f3aa1cf538e3f6d5e8 KEYSTONE_ADMIN_PASSWORD: veryinsecure KEYSTONE_DB_USER: keystoneDB KEYSTONE_DB_PASSWORD: veryinsecure - GLANCE_ENABLE_SERVICE: False + GLANCE_ENABLE_SERVICE: false GLANCE_SERVICE_USER: glance GLANCE_SERVICE_PASSWORD: veryinsecure GLANCE_DB_USER: glanceDB GLANCE_DB_PASSWORD: veryinsecure - NOVA_ENABLE_CONTROLLER: False - NOVA_ENABLE_COMPUTE: False + NOVA_ENABLE_CONTROLLER: false + NOVA_ENABLE_COMPUTE: false NOVA_SERVICE_USER: nova NOVA_SERVICE_PASSWORD: veryinsecure NOVA_DB_USER: novaDB NOVA_DB_PASSWORD: veryinsecure NOVA_VIRT_TYPE: kvm - NOVA_BAREMETAL_SCHEDULING: no + NOVA_BAREMETAL_SCHEDULING: false - CINDER_ENABLE_CONTROLLER: False - CINDER_ENABLE_COMPUTE: False - CINDER_ENABLE_STORAGE: False + CINDER_ENABLE_CONTROLLER: false + CINDER_ENABLE_COMPUTE: false + CINDER_ENABLE_STORAGE: false CINDER_SERVICE_USER: cinder CINDER_SERVICE_PASSWORD: veryinsecure CINDER_DB_USER: cinderDB @@ -121,16 +120,16 @@ systems: # Storage device to be used by Cinder CINDER_DEVICE: /dev/sdb - NEUTRON_ENABLE_AGENT: False - NEUTRON_ENABLE_MANAGER: True - NEUTRON_ENABLE_CONTROLLER: False + NEUTRON_ENABLE_AGENT: false + NEUTRON_ENABLE_MANAGER: true + NEUTRON_ENABLE_CONTROLLER: false NEUTRON_SERVICE_USER: neutron NEUTRON_SERVICE_PASSWORD: veryinsecure NEUTRON_DB_USER: neutronDB NEUTRON_DB_PASSWORD: veryinsecure METADATA_PROXY_SHARED_SECRET: novaneutronmetasecret - IRONIC_ENABLE_SERVICE: False + IRONIC_ENABLE_SERVICE: false IRONIC_SERVICE_USER: ironic IRONIC_SERVICE_PASSWORD: veryinsecure IRONIC_DB_USER: ironicDB @@ -140,20 +139,20 @@ systems: CEILOMETER_SERVICE_PASSWORD: veryinsecure CEILOMETER_DB_USER: ceilometerDB CEILOMETER_DB_PASSWORD: veryinsecure - CEILOMETER_ENABLE_CONTROLLER: False - CEILOMETER_ENABLE_COMPUTE: False + CEILOMETER_ENABLE_CONTROLLER: false + CEILOMETER_ENABLE_COMPUTE: false METERING_SECRET: insecureceilometersecret CONTROLLER_HOST_ADDRESS: threenode-controller.os-mgmt MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.1 - HOSTS_SELF: 10.0.0.1 threenode-network HOSTS_NETWORK: 10.0.0.1 threenode-network.os-mgmt HOSTS_CONTROL: 10.0.0.2 threenode-controller.os-mgmt HOSTS_COMPUTE: 10.0.0.3 threenode-compute.os-mgmt EXTERNAL_INTERFACE: enp3s0 NETWORK_CONFIG: enp3s0:dhcp;enp2s0:static,address=10.0.0.1,netmask=255.255.255.0 + SYNC_TIME_WITH_CONTROLLER: true subsystems: - morph: systems/initramfs-x86_64.morph deploy: @@ -173,30 +172,30 @@ systems: <<: *stack-node HOSTNAME: threenode-controller - KEYSTONE_ENABLE_SERVICE: True + KEYSTONE_ENABLE_SERVICE: true - GLANCE_ENABLE_SERVICE: True + GLANCE_ENABLE_SERVICE: true - NOVA_ENABLE_CONTROLLER: True + NOVA_ENABLE_CONTROLLER: true - CINDER_ENABLE_CONTROLLER: True - CINDER_ENABLE_COMPUTE: False - CINDER_ENABLE_STORAGE: False + CINDER_ENABLE_CONTROLLER: true + CINDER_ENABLE_COMPUTE: false + CINDER_ENABLE_STORAGE: false - NEUTRON_ENABLE_AGENT: False - NEUTRON_ENABLE_MANAGER: False - NEUTRON_ENABLE_CONTROLLER: True + NEUTRON_ENABLE_AGENT: false + NEUTRON_ENABLE_MANAGER: false + NEUTRON_ENABLE_CONTROLLER: true METADATA_PROXY_SHARED_SECRET: novaneutronmetasecret - IRONIC_ENABLE_SERVICE: True + IRONIC_ENABLE_SERVICE: true - CEILOMETER_ENABLE_CONTROLLER: True - CEILOMETER_ENABLE_COMPUTE: False + CEILOMETER_ENABLE_CONTROLLER: true + CEILOMETER_ENABLE_COMPUTE: false MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.2 - HOSTS_SELF: 10.0.0.2 threenode-controller EXTERNAL_INTERFACE: enp2s0 NETWORK_CONFIG: enp2s0:dhcp;enp0s26u1u2:static,address=10.0.0.2,netmask=255.255.255.0 + SYNC_TIME_WITH_CONTROLLER: false subsystems: - morph: systems/initramfs-x86_64.morph deploy: @@ -216,23 +215,23 @@ systems: <<: *stack-node HOSTNAME: threenode-compute - NOVA_ENABLE_COMPUTE: True + NOVA_ENABLE_COMPUTE: true - CINDER_ENABLE_CONTROLLER: False - CINDER_ENABLE_COMPUTE: True - CINDER_ENABLE_STORAGE: True + CINDER_ENABLE_CONTROLLER: false + CINDER_ENABLE_COMPUTE: true + CINDER_ENABLE_STORAGE: true - NEUTRON_ENABLE_AGENT: True - NEUTRON_ENABLE_MANAGER: False - NEUTRON_ENABLE_CONTROLLER: False + NEUTRON_ENABLE_AGENT: true + NEUTRON_ENABLE_MANAGER: false + NEUTRON_ENABLE_CONTROLLER: false - CEILOMETER_ENABLE_CONTROLLER: False - CEILOMETER_ENABLE_COMPUTE: True + CEILOMETER_ENABLE_CONTROLLER: false + CEILOMETER_ENABLE_COMPUTE: true MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.3 - HOSTS_SELF: 10.0.0.3 threenode-compute EXTERNAL_INTERFACE: eno1 NETWORK_CONFIG: eno1:dhcp;enp0s29u1u3:static,address=10.0.0.3,netmask=255.255.255.0 + SYNC_TIME_WITH_CONTROLLER: true subsystems: - morph: systems/initramfs-x86_64.morph deploy: diff --git a/clusters/openstack-two-node-installer.morph b/clusters/openstack-two-node-installer.morph index d4f94cfb..0c08bd4f 100644 --- a/clusters/openstack-two-node-installer.morph +++ b/clusters/openstack-two-node-installer.morph @@ -1,58 +1,57 @@ name: openstack-two-node-installer kind: cluster description: | - - This is a cluster morphology for deploying an installer for an x86_64 - OpenStack system spread across three nodes. - - This cluster creates disk images that may be `dd`'d onto install media to - produce an OpenStack cluster when instantiated. - - Alternatively it may be used to install directly onto a physical disk by - running: - - morph deploy clusters/openstack-two-node-installer.morph \ - controller-installer controller-installer.location=/dev/vdb - - Substituting contrller-installer for compute-installer will produce - different configurations, and it is possible to substitue /dev/vdb for a - different path to a disk image to install to a different disk image. - - Substitute the values of HOSTNAME, NETWORK_CONFIG, EXTERNAL_INTERFACE, - MANAGEMENT_IP_ADDRESS, CONTROLLER_HOST_ADDRESS, RABBITMQ_HOST and HOSTS_* to - match your hardware and networking configuration. - - Requirements to be able to run and test the system: - - - DISK_SIZE should be bigger than 5G - - The system has to have available at least 4G of RAM, but once - you start instantiating VMs you will need more. - - The IP of the system can't change, and you need to know it beforehand, - that is, the system needs a static IP address. - - This cluster is configurable, but with the following constraints: - - - The hostname in RABBITMQ_HOST has to match CONTROLLER_HOST_ADDRESS, - and HOST_CONTROLLER. - - HOSTS_CONTROLLER is only needed if the hostname (see previous point) - is not a FQDN. - - The IP listed in MANAGEMENT_INTERFACE_IP_ADDRESS has to match the one - used in HOSTS_CONTROLLER. - - CINDER_DEVICE should be a path to a storage device ready to be - used/formated for cinder data. - - EXTERNAL_INTERFACE is required when the system has more than one network - interface. - - You can also have a look at the following suggestions: - - - NOVA_VIRT_TYPE can be either 'kvm' or 'qemu', depending on where the - system is being deployed to. - - We recommend changing all the PASSWORDs variables, also the - KEYSTONE_TEMPORARY_ADMIN_TOKEN, METADATA_PROXY_SHARED_SECRET and - METERING_SECRET. - - Setting NOVA_BAREMETAL_SCHEDULING with a YAML truth value will configure - Nova to schedule baremetal machines through the Ironic driver, instead of - sheduling virtual machines. + This is a cluster morphology for deploying an installer for an x86_64 + OpenStack system spread across three nodes. + + This cluster creates disk images that may be `dd`'d onto install media to + produce an OpenStack cluster when instantiated. + + Alternatively it may be used to install directly onto a physical disk by + running: + + morph deploy clusters/openstack-two-node-installer.morph \ + controller-installer controller-installer.location=/dev/vdb + + Substituting contrller-installer for compute-installer will produce + different configurations, and it is possible to substitue /dev/vdb for a + different path to a disk image to install to a different disk image. + + Substitute the values of HOSTNAME, NETWORK_CONFIG, EXTERNAL_INTERFACE, + MANAGEMENT_IP_ADDRESS, CONTROLLER_HOST_ADDRESS, RABBITMQ_HOST and HOSTS_* to + match your hardware and networking configuration. + + Requirements to be able to run and test the system: + + - DISK_SIZE should be bigger than 5G + - The system has to have available at least 4G of RAM, but once + you start instantiating VMs you will need more. + - The IP of the system can't change, and you need to know it beforehand, + that is, the system needs a static IP address. + + This cluster is configurable, but with the following constraints: + + - The hostname in RABBITMQ_HOST has to match CONTROLLER_HOST_ADDRESS, + and HOST_CONTROLLER. + - HOSTS_CONTROLLER is only needed if the hostname (see previous point) + is not a FQDN. + - The IP listed in MANAGEMENT_INTERFACE_IP_ADDRESS has to match the one + used in HOSTS_CONTROLLER. + - CINDER_DEVICE should be a path to a storage device ready to be + used/formated for cinder data. + - EXTERNAL_INTERFACE is required when the system has more than one network + interface. + + You can also have a look at the following suggestions: + + - NOVA_VIRT_TYPE can be either 'kvm' or 'qemu', depending on where the + system is being deployed to. + - We recommend changing all the PASSWORDs variables, also the + KEYSTONE_TEMPORARY_ADMIN_TOKEN, METADATA_PROXY_SHARED_SECRET and + METERING_SECRET. + - Setting NOVA_BAREMETAL_SCHEDULING with a YAML truth value will configure + Nova to schedule baremetal machines through the Ironic driver, instead of + sheduling virtual machines. systems: - morph: systems/installer-system-x86_64.morph @@ -65,7 +64,7 @@ systems: HOSTNAME: installer-x86_64 INSTALLER_TARGET_STORAGE_DEVICE: /dev/sda INSTALLER_ROOTFS_TO_INSTALL: /rootfs - INSTALLER_POST_INSTALL_COMMAND: 'sync; poweroff -f' + INSTALLER_POST_INSTALL_COMMAND: sync; poweroff -f INITRAMFS_PATH: boot/initramfs.gz subsystems: - morph: systems/initramfs-x86_64.morph @@ -89,30 +88,30 @@ systems: RABBITMQ_PASSWORD: veryinsecure # This token needs to be unique and secret - KEYSTONE_ENABLE_SERVICE: True + KEYSTONE_ENABLE_SERVICE: true KEYSTONE_TEMPORARY_ADMIN_TOKEN: 22f3aa1cf538e3f6d5e8 KEYSTONE_ADMIN_PASSWORD: veryinsecure KEYSTONE_DB_USER: keystoneDB KEYSTONE_DB_PASSWORD: veryinsecure - GLANCE_ENABLE_SERVICE: True + GLANCE_ENABLE_SERVICE: true GLANCE_SERVICE_USER: glance GLANCE_SERVICE_PASSWORD: veryinsecure GLANCE_DB_USER: glanceDB GLANCE_DB_PASSWORD: veryinsecure - NOVA_ENABLE_CONTROLLER: True - NOVA_ENABLE_COMPUTE: False + NOVA_ENABLE_CONTROLLER: true + NOVA_ENABLE_COMPUTE: false NOVA_SERVICE_USER: nova NOVA_SERVICE_PASSWORD: veryinsecure NOVA_DB_USER: novaDB NOVA_DB_PASSWORD: veryinsecure NOVA_VIRT_TYPE: kvm - NOVA_BAREMETAL_SCHEDULING: no + NOVA_BAREMETAL_SCHEDULING: false - CINDER_ENABLE_CONTROLLER: True - CINDER_ENABLE_COMPUTE: False - CINDER_ENABLE_STORAGE: False + CINDER_ENABLE_CONTROLLER: true + CINDER_ENABLE_COMPUTE: false + CINDER_ENABLE_STORAGE: false CINDER_SERVICE_USER: cinder CINDER_SERVICE_PASSWORD: veryinsecure CINDER_DB_USER: cinderDB @@ -120,16 +119,16 @@ systems: # Storage device to be used by Cinder CINDER_DEVICE: /dev/sdb - NEUTRON_ENABLE_AGENT: False - NEUTRON_ENABLE_MANAGER: True - NEUTRON_ENABLE_CONTROLLER: True + NEUTRON_ENABLE_AGENT: false + NEUTRON_ENABLE_MANAGER: true + NEUTRON_ENABLE_CONTROLLER: true NEUTRON_SERVICE_USER: neutron NEUTRON_SERVICE_PASSWORD: veryinsecure NEUTRON_DB_USER: neutronDB NEUTRON_DB_PASSWORD: veryinsecure METADATA_PROXY_SHARED_SECRET: novaneutronmetasecret - IRONIC_ENABLE_SERVICE: True + IRONIC_ENABLE_SERVICE: true IRONIC_SERVICE_USER: ironic IRONIC_SERVICE_PASSWORD: veryinsecure IRONIC_DB_USER: ironicDB @@ -139,18 +138,18 @@ systems: CEILOMETER_SERVICE_PASSWORD: veryinsecure CEILOMETER_DB_USER: ceilometerDB CEILOMETER_DB_PASSWORD: veryinsecure - CEILOMETER_ENABLE_CONTROLLER: True - CEILOMETER_ENABLE_COMPUTE: False + CEILOMETER_ENABLE_CONTROLLER: true + CEILOMETER_ENABLE_COMPUTE: false METERING_SECRET: insecureceilometersecret CONTROLLER_HOST_ADDRESS: twonode-controller.os-mgmt MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.1 - HOSTS_SELF: 10.0.0.1 twonode-controller HOSTS_CONTROL: 10.0.0.1 twonode-controller.os-mgmt HOSTS_COMPUTE: 10.0.0.3 twonode-compute.os-mgmt EXTERNAL_INTERFACE: enp3s0 NETWORK_CONFIG: enp3s0:dhcp;enp2s0:static,address=10.0.0.1,netmask=255.255.255.0 + SYNC_TIME_WITH_CONTROLLER: false subsystems: - morph: systems/initramfs-x86_64.morph deploy: @@ -170,30 +169,30 @@ systems: <<: *stack-node HOSTNAME: twonode-compute - KEYSTONE_ENABLE_SERVICE: False + KEYSTONE_ENABLE_SERVICE: false - GLANCE_ENABLE_SERVICE: False + GLANCE_ENABLE_SERVICE: false - NOVA_ENABLE_COMPUTE: True - NOVA_ENABLE_CONTROLLER: False + NOVA_ENABLE_COMPUTE: true + NOVA_ENABLE_CONTROLLER: false - CINDER_ENABLE_CONTROLLER: False - CINDER_ENABLE_COMPUTE: True - CINDER_ENABLE_STORAGE: True + CINDER_ENABLE_CONTROLLER: false + CINDER_ENABLE_COMPUTE: true + CINDER_ENABLE_STORAGE: true - NEUTRON_ENABLE_AGENT: True - NEUTRON_ENABLE_MANAGER: False - NEUTRON_ENABLE_CONTROLLER: False + NEUTRON_ENABLE_AGENT: true + NEUTRON_ENABLE_MANAGER: false + NEUTRON_ENABLE_CONTROLLER: false - IRONIC_ENABLE_SERVICE: False + IRONIC_ENABLE_SERVICE: false - CEILOMETER_ENABLE_CONTROLLER: False - CEILOMETER_ENABLE_COMPUTE: True + CEILOMETER_ENABLE_CONTROLLER: false + CEILOMETER_ENABLE_COMPUTE: true MANAGEMENT_INTERFACE_IP_ADDRESS: 10.0.0.3 - HOSTS_SELF: 10.0.0.3 twonode-compute EXTERNAL_INTERFACE: eno1 NETWORK_CONFIG: eno1:dhcp;enp0s29u1u3:static,address=10.0.0.3,netmask=255.255.255.0 + SYNC_TIME_WITH_CONTROLLER: true subsystems: - morph: systems/initramfs-x86_64.morph deploy: diff --git a/clusters/release.morph b/clusters/release.morph index 85ea9c39..3f597a38 100644 --- a/clusters/release.morph +++ b/clusters/release.morph @@ -33,7 +33,7 @@ systems: location: build-system-x86_64.img DISK_SIZE: 6G INITRAMFS_PATH: boot/initramfs.gz - HOSTNAME: build-system-x86_64 + HOSTNAME: build-system-x86-64 subsystems: - morph: systems/initramfs-x86_64.morph deploy: @@ -46,10 +46,40 @@ systems: type: extensions/rawdisk location: build-system-armv7lhf-jetson.img DISK_SIZE: 2G - BOOT_DEVICE: "/dev/mmcblk0p1" - ROOT_DEVICE: "/dev/mmcblk0p2" - 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 + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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 HOSTNAME: build-system-armv7lhf-jetson +- morph: systems/genivi-baseline-system-x86_64-generic.morph + deploy: + genivi-baseline-system-x86_64-generic: + type: extensions/rawdisk + location: genivi-baseline-system-x86_64-generic.img + DISK_SIZE: 4G + KERNEL_ARGS: vga=788 + INITRAMFS_PATH: boot/initramfs.gz + HOSTNAME: genivi-baseline-system-x86-64-generic + subsystems: + - morph: systems/initramfs-x86_64.morph + deploy: + initramfs-genivi-baseline-system-x86_64-generic: + type: extensions/initramfs + location: boot/initramfs.gz +- morph: systems/genivi-baseline-system-armv7lhf-jetson.morph + deploy: + genivi-baseline-system-armv7lhf-jetson: + type: extensions/rawdisk + location: genivi-baseline-system-armv7lhf-jetson.img + DISK_SIZE: 4G + BOOT_DEVICE: /dev/mmcblk0p1 + ROOT_DEVICE: /dev/mmcblk0p2 + 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 + HOSTNAME: genivi-baseline-system-armv7lhf-jetson diff --git a/clusters/upgrade-devel.morph b/clusters/upgrade-devel.morph index 3efbb36a..dcf1cd8d 100644 --- a/clusters/upgrade-devel.morph +++ b/clusters/upgrade-devel.morph @@ -18,7 +18,7 @@ description: | 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 + morph upgrade clusters/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 @@ -35,5 +35,5 @@ systems: - morph: systems/devel-system-x86_64-generic.morph deploy: self: - type: extensions/ssh-rsync - location: root@127.0.0.1 + upgrade-type: extensions/ssh-rsync + upgrade-location: root@127.0.0.1 diff --git a/clusters/zookeeper.morph b/clusters/zookeeper.morph index cca6db81..80197726 100644 --- a/clusters/zookeeper.morph +++ b/clusters/zookeeper.morph @@ -1,21 +1,21 @@ name: zookeeper kind: cluster systems: - - morph: systems/zookeeper-client-x86_64.morph - deploy: - my-client-system: - type: extensions/kvm - location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-client.img - DISK_SIZE: 4G - RAM_SIZE: 1G - VCPUS: 1 - HOSTNAME: zkclient - - morph: systems/zookeeper-server-x86_64.morph - deploy: - my-server-system: - type: extensions/kvm - location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-server.img - DISK_SIZE: 4G - RAM_SIZE: 1G - VCPUS: 1 - HOSTNAME: zkserver +- morph: systems/zookeeper-client-x86_64.morph + deploy: + my-client-system: + type: extensions/kvm + location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-client.img + DISK_SIZE: 4G + RAM_SIZE: 1G + VCPUS: 1 + HOSTNAME: zkclient +- morph: systems/zookeeper-server-x86_64.morph + deploy: + my-server-system: + type: extensions/kvm + location: kvm+ssh://username@HOSTNAME/machinename/path/to/zookeeper-server.img + DISK_SIZE: 4G + RAM_SIZE: 1G + VCPUS: 1 + HOSTNAME: zkserver diff --git a/extensions/ceph.configure b/extensions/ceph.configure index c3cd92d1..190dda97 100644 --- a/extensions/ceph.configure +++ b/extensions/ceph.configure @@ -14,13 +14,13 @@ # 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 import stat +import sys +import re + +import writeexts systemd_monitor_template = """ [Unit] @@ -75,7 +75,7 @@ executable_file_permissions = stat.S_IRUSR | stat.S_IXUSR | stat.S_IWUSR | \ stat.S_IXGRP | stat.S_IRGRP | \ stat.S_IXOTH | stat.S_IROTH -class CephConfigurationExtension(cliapp.Application): +class CephConfigurationExtension(writeexts.Extension): """ Set up ceph server daemons. diff --git a/extensions/distbuild-trove-nfsboot.check b/extensions/distbuild-trove-nfsboot.check index 38c491e5..780d5e0a 100755 --- a/extensions/distbuild-trove-nfsboot.check +++ b/extensions/distbuild-trove-nfsboot.check @@ -15,14 +15,14 @@ '''Preparatory checks for Morph 'distbuild-trove-nfsboot' write extension''' -import cliapp import logging import os +import sys -import morphlib.writeexts +import writeexts -class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): +class DistbuildTroveNFSBootCheckExtension(writeexts.WriteExtension): nfsboot_root = '/srv/nfsboot' remote_user = 'root' @@ -45,7 +45,8 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') nfs_host = args[0] nfs_netloc = '%s@%s' % (self.remote_user, nfs_host) @@ -55,17 +56,19 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): missing_vars = [var for var in self.required_vars if not var in os.environ] if missing_vars: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Please set: %s' % ', '.join(missing_vars)) controllers = os.getenv('DISTBUILD_CONTROLLER').split() workers = os.getenv('DISTBUILD_WORKERS').split() if len(controllers) != 1: - raise cliapp.AppException('Please specify exactly one controller.') + raise writeexts.ExtensionError( + 'Please specify exactly one controller.') if len(workers) == 0: - raise cliapp.AppException('Please specify at least one worker.') + raise writeexts.ExtensionError( + 'Please specify at least one worker.') upgrade = self.get_environment_boolean('UPGRADE') @@ -80,7 +83,7 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): if self.remote_directory_exists(nfs_netloc, system_path): if self.get_environment_boolean('OVERWRITE') == False: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'System %s already exists at %s:%s. Try `morph ' 'upgrade` instead of `morph deploy`.' % ( system_name, nfs_netloc, system_path)) @@ -91,27 +94,27 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): # Is an NFS server try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( netloc, ['test', '-e', '/etc/exports']) - except cliapp.AppException: - raise cliapp.AppException('server %s is not an nfs server' - % netloc) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s is not an nfs server' + % netloc) try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( netloc, ['systemctl', 'is-enabled', 'nfs-server.service']) - except cliapp.AppException: - raise cliapp.AppException('server %s does not control its ' - 'nfs server by systemd' % netloc) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s does not control its ' + 'nfs server by systemd' % netloc) # TFTP server exports /srv/nfsboot/tftp tftp_root = os.path.join(self.nfsboot_root, 'tftp') try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( netloc, ['test' , '-d', tftp_root]) - except cliapp.AppException: - raise cliapp.AppException('server %s does not export %s' % - (netloc, tftp_root)) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s does not export %s' % + (netloc, tftp_root)) def check_upgradeable(self, nfs_netloc, system_name, version_label): '''Check that there is already a version of the system present. @@ -124,7 +127,7 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): system_version_path = self.system_path(system_name, version_label) if not self.remote_directory_exists(nfs_netloc, system_path): - raise cliapp.AppException( + raise writeexts.ExtensionError( 'System %s not found at %s:%s, cannot deploy an upgrade.' % ( system_name, nfs_netloc, system_path)) @@ -132,15 +135,15 @@ class DistbuildTroveNFSBootCheckExtension(morphlib.writeexts.WriteExtension): if self.get_environment_boolean('OVERWRITE'): pass else: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'System %s version %s already exists at %s:%s.' % ( system_name, version_label, nfs_netloc, system_version_path)) def remote_directory_exists(self, nfs_netloc, path): try: - cliapp.ssh_runcmd(nfs_netloc, ['test', '-d', path]) - except cliapp.AppException as e: + writeexts.ssh_runcmd(nfs_netloc, ['test', '-d', path]) + except writeexts.ExtensionError as e: logging.debug('SSH exception: %s', e) return False diff --git a/extensions/distbuild-trove-nfsboot.write b/extensions/distbuild-trove-nfsboot.write index a5a5b094..86291794 100755 --- a/extensions/distbuild-trove-nfsboot.write +++ b/extensions/distbuild-trove-nfsboot.write @@ -20,14 +20,14 @@ import os +import subprocess import sys import tempfile -import cliapp -import morphlib.writeexts +import writeexts -class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): +class DistbuildTroveNFSBootWriteExtension(writeexts.WriteExtension): '''Create an NFS root and kernel on TFTP during Morph's deployment. @@ -54,7 +54,7 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError('Wrong number of command line args') local_system_path, nfs_host = args @@ -111,17 +111,17 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): ''' pairs = host_map_string.split(' ') - return morphlib.util.parse_environment_pairs({}, pairs) + return writeexts.parse_environment_pairs({}, pairs) def transfer_system(self, nfs_netloc, local_system_path, remote_system_path): self.status(msg='Copying rootfs to %(nfs_netloc)s', nfs_netloc=nfs_netloc) - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( nfs_netloc, ['mkdir', '-p', remote_system_path]) # The deployed rootfs may have been created by OSTree, so definitely # don't pass --hard-links to `rsync`. - cliapp.runcmd( + subprocess.check_call( ['rsync', '--archive', '--delete', '--info=progress2', '--protect-args', '--partial', '--sparse', '--xattrs', local_system_path + '/', @@ -131,13 +131,13 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): target_system_path): self.status(msg='Duplicating rootfs to %(target_system_path)s', target_system_path=target_system_path) - cliapp.ssh_runcmd(nfs_netloc, + writeexts.ssh_runcmd(nfs_netloc, ['mkdir', '-p', target_system_path]) # We can't pass --info=progress2 here, because it may not be available # in the remote 'rsync'. The --info setting was added in RSync 3.1.0, # old versions of Baserock have RSync 3.0.9. So the user doesn't get # any progress info on stdout for the 'duplicate' stage. - cliapp.ssh_runcmd(nfs_netloc, + writeexts.ssh_runcmd(nfs_netloc, ['rsync', '--archive', '--delete', '--protect-args', '--partial', '--sparse', '--xattrs', source_system_path + '/', target_system_path], stdout=sys.stdout) @@ -152,7 +152,7 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): kernel_path = os.path.relpath(try_path, local_system_path) break else: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Could not find a kernel in the system: none of ' '%s found' % ', '.join(image_names)) return kernel_path @@ -171,11 +171,11 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): versioned_kernel_name = "%s-%s" % (system_name, version_label) kernel_name = system_name - cliapp.ssh_runcmd(nfs_netloc, + writeexts.ssh_runcmd(nfs_netloc, ['ln', '-f', kernel_dest, os.path.join(tftp_dir, versioned_kernel_name)]) - cliapp.ssh_runcmd(nfs_netloc, + writeexts.ssh_runcmd(nfs_netloc, ['ln', '-sf', versioned_kernel_name, os.path.join(tftp_dir, kernel_name)]) @@ -183,7 +183,7 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): with tempfile.NamedTemporaryFile() as f: f.write(text) f.flush() - cliapp.runcmd( + subprocess.check_call( ['scp', f.name, '%s:%s' % (nfs_netloc, path)]) def set_hostname(self, nfs_netloc, system_name, system_path): @@ -223,9 +223,9 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): '# Generated by distbuild-trove-nfsboot.write\n' + \ config_text + '\n' path = os.path.join(system_path, 'etc', 'distbuild') - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( nfs_netloc, ['mkdir', '-p', path]) - cliapp.runcmd( + subprocess.check_call( ['scp', worker_ssh_key_path, '%s:%s' % (nfs_netloc, path)]) self.set_remote_file_contents( nfs_netloc, os.path.join(path, 'distbuild.conf'), config_text) @@ -244,9 +244,9 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): # Rather ugly SSH hackery follows to ensure each system path is # listed in /etc/exports. try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( nfs_netloc, ['grep', '-q', exported_path, exports_path]) - except cliapp.AppException: + except writeexts.ExtensionError: ip_mask = '*' options = 'rw,no_subtree_check,no_root_squash,async' exports_string = '%s %s(%s)\n' % (exported_path, ip_mask, @@ -259,12 +259,12 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): cat >> "$temp" mv "$temp" "$target" ''' - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( nfs_netloc, ['sh', '-c', exports_append_sh, '--', exports_path], feed_stdin=exports_string) - cliapp.ssh_runcmd(nfs_netloc, + writeexts.ssh_runcmd(nfs_netloc, ['systemctl', 'restart', 'nfs-server.service']) def update_default_version(self, remote_netloc, system_name, @@ -276,7 +276,7 @@ class DistbuildTroveNFSBootWriteExtension(morphlib.writeexts.WriteExtension): version_label) default_path = os.path.join(system_path, 'systems', 'default') - cliapp.ssh_runcmd(remote_netloc, + writeexts.ssh_runcmd(remote_netloc, ['ln', '-sfn', system_version_path, default_path]) diff --git a/extensions/fstab.configure b/extensions/fstab.configure index b9154eee..3e67b585 100755 --- a/extensions/fstab.configure +++ b/extensions/fstab.configure @@ -20,9 +20,9 @@ import os import sys -import morphlib +import writeexts envvars = {k: v for (k, v) in os.environ.iteritems() if k.startswith('FSTAB_')} conf_file = os.path.join(sys.argv[1], 'etc/fstab') -morphlib.util.write_from_dict(conf_file, envvars) +writeexts.write_from_dict(conf_file, envvars) diff --git a/extensions/hosts.configure b/extensions/hosts.configure index 6b068d04..11fcf573 100755 --- a/extensions/hosts.configure +++ b/extensions/hosts.configure @@ -22,27 +22,29 @@ import os import sys import socket -import morphlib +import writeexts def validate(var, line): xs = line.split() if len(xs) == 0: - raise morphlib.Error("`%s: %s': line is empty" % (var, line)) + raise writeexts.ExtensionError( + "`%s: %s': line is empty" % (var, line)) ip = xs[0] hostnames = xs[1:] if len(hostnames) == 0: - raise morphlib.Error("`%s: %s': missing hostname" % (var, line)) + raise writeexts.ExtensionError( + "`%s: %s': missing hostname" % (var, line)) family = socket.AF_INET6 if ':' in ip else socket.AF_INET try: socket.inet_pton(family, ip) except socket.error: - raise morphlib.Error("`%s: %s' invalid ip" % (var, ip)) + raise writeexts.ExtensionError("`%s: %s' invalid ip" % (var, ip)) envvars = {k: v for (k, v) in os.environ.iteritems() if k.startswith('HOSTS_')} conf_file = os.path.join(sys.argv[1], 'etc/hosts') -morphlib.util.write_from_dict(conf_file, envvars, validate) +writeexts.write_from_dict(conf_file, envvars, validate) diff --git a/extensions/image-package-example/README b/extensions/image-package-example/README index c1322f25..f6b66cd9 100644 --- a/extensions/image-package-example/README +++ b/extensions/image-package-example/README @@ -5,5 +5,5 @@ 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. +extension; see writeexts.WriteExtension.create_local_system() for +a similar, python implementation. diff --git a/extensions/install-essential-files.configure b/extensions/install-essential-files.configure index bed394df..3d33fe03 100755 --- a/extensions/install-essential-files.configure +++ b/extensions/install-essential-files.configure @@ -22,20 +22,11 @@ to install into the target system. ''' -import subprocess import os +import subprocess +import sys -import cliapp - -class InstallEssentialFilesConfigureExtension(cliapp.Application): - - def process_args(self, args): - target_root = args[0] - os.environ["INSTALL_FILES"] = "install-files/essential-files/manifest" - self.install_essential_files(target_root) - - def install_essential_files(self, target_root): - command = os.path.join("extensions/install-files.configure") - subprocess.check_call([command, target_root]) - -InstallEssentialFilesConfigureExtension().run() +target_root = sys.argv[1] +os.environ["INSTALL_FILES"] = "install-files/essential-files/manifest" +command = os.path.join("extensions/install-files.configure") +subprocess.check_call([command, target_root]) diff --git a/extensions/install-files.configure b/extensions/install-files.configure index 341cce61..64fcecca 100755 --- a/extensions/install-files.configure +++ b/extensions/install-files.configure @@ -22,9 +22,8 @@ to install into the target system. ''' -import cliapp -import os import errno +import os import re import sys import shlex @@ -37,7 +36,9 @@ try: except ImportError: jinja_available = False -class InstallFilesConfigureExtension(cliapp.Application): +import writeexts + +class InstallFilesConfigureExtension(writeexts.Extension): def process_args(self, args): if not 'INSTALL_FILES' in os.environ: @@ -74,7 +75,8 @@ class InstallFilesConfigureExtension(cliapp.Application): gid = int(m.group(5)) path = m.group(6) else: - raise cliapp.AppException('Invalid manifest entry, ' + raise writeexts.ExtensionError( + 'Invalid manifest entry, ' 'format: [template] [overwrite] ' '<octal mode> <uid decimal> <gid decimal> <filename>') @@ -85,9 +87,9 @@ class InstallFilesConfigureExtension(cliapp.Application): if (mode != dest_stat.st_mode or uid != dest_stat.st_uid or gid != dest_stat.st_gid): - raise cliapp.AppException('"%s" exists and is not ' - 'identical to directory ' - '"%s"' % (dest_path, entry)) + raise writeexts.ExtensionError( + '"%s" exists and is not identical to directory ' + '"%s"' % (dest_path, entry)) else: os.mkdir(dest_path, mode) os.chown(dest_path, uid, gid) @@ -95,8 +97,8 @@ class InstallFilesConfigureExtension(cliapp.Application): elif stat.S_ISLNK(mode): if os.path.lexists(dest_path) and not overwrite: - raise cliapp.AppException('Symlink already exists at %s' - % dest_path) + raise writeexts.ExtensionError('Symlink already exists at %s' + % dest_path) else: linkdest = os.readlink(os.path.join(manifest_root, './' + path)) @@ -105,12 +107,12 @@ class InstallFilesConfigureExtension(cliapp.Application): elif stat.S_ISREG(mode): if os.path.lexists(dest_path) and not overwrite: - raise cliapp.AppException('File already exists at %s' - % dest_path) + raise writeexts.ExtensionError('File already exists at %s' + % dest_path) else: if template: if not jinja_available: - raise cliapp.AppException( + raise writeexts.ExtensionError( "Failed to install template file `%s': " 'install-files templates require jinja2' % path) @@ -128,7 +130,7 @@ class InstallFilesConfigureExtension(cliapp.Application): os.chmod(dest_path, mode) else: - raise cliapp.AppException('Mode given in "%s" is not a file,' - ' symlink or directory' % entry) + raise writeexts.ExtensionError('Mode given in "%s" is not a file,' + ' symlink or directory' % entry) InstallFilesConfigureExtension().run() diff --git a/extensions/jffs2.write b/extensions/jffs2.write index 46b69a53..ad68204d 100644 --- a/extensions/jffs2.write +++ b/extensions/jffs2.write @@ -19,34 +19,34 @@ as the root filesystem.''' -import cliapp import os +import subprocess -import morphlib.writeexts +import writeexts -class Jffs2WriteExtension(morphlib.writeexts.WriteExtension): +class Jffs2WriteExtension(writeexts.WriteExtension): '''See jffs2.write.help for documentation.''' def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError('Wrong number of command line args') temp_root, location = args try: self.create_jffs2_system(temp_root, location) self.status(msg='Disk image has been created at %(location)s', - location = location) + location=location) except Exception: self.status(msg='Failure to deploy system to %(location)s', - location = location) + location=location) raise def create_jffs2_system(self, temp_root, location): erase_block = self.get_erase_block_size() - cliapp.runcmd( + subprocess.check_call( ['mkfs.jffs2', '--pad', '--no-cleanmarkers', '--eraseblock='+erase_block, '-d', temp_root, '-o', location]) @@ -54,10 +54,10 @@ class Jffs2WriteExtension(morphlib.writeexts.WriteExtension): erase_block = os.environ.get('ERASE_BLOCK', '') if erase_block == '': - raise cliapp.AppException('ERASE_BLOCK was not given') + raise writeexts.ExtensionError('ERASE_BLOCK was not given') if not erase_block.isdigit(): - raise cliapp.AppException('ERASE_BLOCK must be a whole number') + raise writeexts.ExtensionError('ERASE_BLOCK must be a whole number') return erase_block diff --git a/extensions/kvm.check b/extensions/kvm.check index 67cb3d38..84a343a5 100755 --- a/extensions/kvm.check +++ b/extensions/kvm.check @@ -15,27 +15,27 @@ '''Preparatory checks for Morph 'kvm' write extension''' -import cliapp import os import re import urlparse -import morphlib.writeexts +import writeexts -class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): +class KvmPlusSshCheckExtension(writeexts.WriteExtension): location_pattern = '^/(?P<guest>[^/]+)(?P<path>/.+)$' def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') self.require_btrfs_in_deployment_host_kernel() upgrade = self.get_environment_boolean('UPGRADE') if upgrade: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Use the `ssh-rsync` write extension to deploy upgrades to an ' 'existing remote system.') @@ -55,23 +55,24 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): x = urlparse.urlparse(location) if x.scheme != 'kvm+ssh': - raise cliapp.AppException( + raise writeexts.ExtensionError( 'URL schema must be kvm+ssh in %s' % location) m = re.match(self.location_pattern, x.path) if not m: - raise cliapp.AppException('Cannot parse location %s' % location) + raise writeexts.ExtensionError( + 'Cannot parse location %s' % location) return x.netloc, m.group('guest'), m.group('path') def check_no_existing_libvirt_vm(self, ssh_host, vm_name): try: - cliapp.ssh_runcmd(ssh_host, + writeexts.ssh_runcmd(ssh_host, ['virsh', '--connect', 'qemu:///system', 'domstate', vm_name]) - except cliapp.AppException as e: + except writeexts.ExtensionError as e: pass else: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Host %s already has a VM named %s. You can use the ssh-rsync ' 'write extension to deploy upgrades to existing machines.' % (ssh_host, vm_name)) @@ -80,35 +81,35 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): def check_can_write_to_given_path(): try: - cliapp.ssh_runcmd(ssh_host, ['touch', vm_path]) - except cliapp.AppException as e: - raise cliapp.AppException("Can't write to location %s on %s" - % (vm_path, ssh_host)) + writeexts.ssh_runcmd(ssh_host, ['touch', vm_path]) + except writeexts.ExtensionError as e: + raise writeexts.ExtensionError( + "Can't write to location %s on %s" % (vm_path, ssh_host)) else: - cliapp.ssh_runcmd(ssh_host, ['rm', vm_path]) + writeexts.ssh_runcmd(ssh_host, ['rm', vm_path]) try: - cliapp.ssh_runcmd(ssh_host, ['test', '-e', vm_path]) - except cliapp.AppException as e: + writeexts.ssh_runcmd(ssh_host, ['test', '-e', vm_path]) + except writeexts.ExtensionError as e: # vm_path doesn't already exist, so let's test we can write check_can_write_to_given_path() else: - raise cliapp.AppException('%s already exists on %s' - % (vm_path, ssh_host)) + raise writeexts.ExtensionError('%s already exists on %s' + % (vm_path, ssh_host)) def check_extra_disks_exist(self, ssh_host, filename_list): for filename in filename_list: try: - cliapp.ssh_runcmd(ssh_host, ['ls', filename]) - except cliapp.AppException as e: - raise cliapp.AppException('Did not find file %s on host %s' % - (filename, ssh_host)) + writeexts.ssh_runcmd(ssh_host, ['ls', filename]) + except writeexts.ExtensionError as e: + raise writeexts.ExtensionError( + 'Did not find file %s on host %s' % (filename, ssh_host)) def check_virtual_networks_are_started(self, ssh_host): def check_virtual_network_is_started(network_name): cmd = ['virsh', '-c', 'qemu:///system', 'net-info', network_name] - net_info = cliapp.ssh_runcmd(ssh_host, cmd).split('\n') + net_info = writeexts.ssh_runcmd(ssh_host, cmd).split('\n') def pretty_concat(lines): return '\n'.join(['\t%s' % line for line in lines]) @@ -118,15 +119,15 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): if m: break else: - raise cliapp.AppException( + raise writeexts.ExtensionError( "Got unexpected output parsing output of `%s':\n%s" % (' '.join(cmd), pretty_concat(net_info))) network_active = m.group(1) == 'yes' if not network_active: - raise cliapp.AppException("Network '%s' is not started" - % network_name) + raise writeexts.ExtensionError("Network '%s' is not started" + % network_name) def name(nic_entry): if ',' in nic_entry: @@ -142,9 +143,10 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): if not (n.startswith('network=') or n.startswith('bridge=') or n == 'user'): - raise cliapp.AppException('malformed NIC_CONFIG: %s\n' - " (expected 'bridge=BRIDGE' 'network=NAME'" - " or 'user')" % n) + raise writeexts.ExtensionError( + "malformed NIC_CONFIG: %s\n" + " (expected 'bridge=BRIDGE' 'network=NAME'" + " or 'user')" % n) # --network bridge= is used to specify a bridge # --network user is used to specify a form of NAT @@ -159,9 +161,9 @@ class KvmPlusSshCheckExtension(morphlib.writeexts.WriteExtension): def check_host_has_virtinstall(self, ssh_host): try: - cliapp.ssh_runcmd(ssh_host, ['which', 'virt-install']) - except cliapp.AppException: - raise cliapp.AppException( + writeexts.ssh_runcmd(ssh_host, ['which', 'virt-install']) + except writeexts.ExtensionError: + raise writeexts.ExtensionError( 'virt-install does not seem to be installed on host %s' % ssh_host) diff --git a/extensions/kvm.write b/extensions/kvm.write index 0d0c095b..c7ed7b87 100755 --- a/extensions/kvm.write +++ b/extensions/kvm.write @@ -21,23 +21,24 @@ See file kvm.write.help for documentation ''' -import cliapp import os import re +import subprocess import sys import tempfile import urlparse -import morphlib.writeexts +import writeexts -class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension): +class KvmPlusSshWriteExtension(writeexts.WriteExtension): location_pattern = '^/(?P<guest>[^/]+)(?P<path>/.+)$' def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args ssh_host, vm_name, vm_path = self.parse_location(location) @@ -53,7 +54,7 @@ class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension): except BaseException: sys.stderr.write('Error deploying to libvirt') os.remove(raw_disk) - cliapp.ssh_runcmd(ssh_host, ['rm', '-f', vm_path]) + writeexts.ssh_runcmd(ssh_host, ['rm', '-f', vm_path]) raise else: os.remove(raw_disk) @@ -74,17 +75,21 @@ class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Transferring disk image') - xfer_hole_path = morphlib.util.get_data_path('xfer-hole') - recv_hole = morphlib.util.get_data('recv-hole') + xfer_hole_path = writeexts.get_data_path('xfer-hole') + recv_hole = writeexts.get_data('recv-hole') ssh_remote_cmd = [ 'sh', '-c', recv_hole, 'dummy-argv0', 'file', vm_path ] - cliapp.runcmd( + xfer_hole_proc = subprocess.Popen( ['python', xfer_hole_path, raw_disk], - ['ssh', ssh_host] + map(cliapp.shell_quote, ssh_remote_cmd), - stdout=None, stderr=None) + stdout=subprocess.PIPE) + recv_hole_proc = subprocess.Popen( + ['ssh', ssh_host] + map(writeexts.shell_quote, ssh_remote_cmd), + stdin=xfer_hole_proc.stdout) + xfer_hole_proc.stdout.close() + recv_hole_proc.communicate() def create_libvirt_guest(self, ssh_host, vm_name, vm_path, autostart): '''Create the libvirt virtual machine.''' @@ -111,10 +116,11 @@ class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension): '--disk', 'path=%s,bus=ide' % vm_path] + attach_opts if not autostart: cmdline += ['--noreboot'] - cliapp.ssh_runcmd(ssh_host, cmdline) + writeexts.ssh_runcmd(ssh_host, cmdline) if autostart: - cliapp.ssh_runcmd(ssh_host, - ['virsh', '--connect', 'qemu:///system', 'autostart', vm_name]) + writeexts.ssh_runcmd(ssh_host, + ['virsh', '--connect', 'qemu:///system', + 'autostart', vm_name]) KvmPlusSshWriteExtension().run() diff --git a/extensions/mason/mason-report.sh b/extensions/mason/mason-report.sh index 9c20b65b..31745b93 100755 --- a/extensions/mason/mason-report.sh +++ b/extensions/mason/mason-report.sh @@ -6,6 +6,7 @@ set -x REPORT_PATH=/var/mason/report.html SERVER_PATH=/srv/mason +SERVER_REPORT_PATH="$SERVER_PATH/index.html" sed_escape() { printf "%s\n" "$1" | sed -e 's/\W/\\&/g' @@ -63,6 +64,12 @@ table tr.nonet { table tr.nonet:hover { background: #ffeeaa; } +table tr.progress { + background: #00CCFF; +} +table tr.progress:hover { + background: #91E9FF; +} table tr.headings th { font-weight: bold; text-align: left; @@ -99,6 +106,12 @@ tr.nonet td.result a { tr.nonet td.result a:hover { color: #962; } +tr.progress td.result a { + color: #000066; +} +tr.progress td.result a:hover { + color: #0000CC; +} td.ref { font-family: monospace; } @@ -177,6 +190,8 @@ update_report() { build_sha1="$4" build_duration="$5" build_result="$6" + report_path="$7" + build_log="$8" # Generate template if report file is not there if [ ! -f $REPORT_PATH ]; then @@ -185,13 +200,13 @@ update_report() { # 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>' + 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="'"${build_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>' + 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="'"${build_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 + sed -i 's/<!--INSERTION POINT-->/<!--INSERTION POINT-->\n'"$(sed_escape "$msg")"'/' $report_path } update_report_time() { @@ -210,6 +225,23 @@ update_report_time "$START_TIME" cp "$REPORT_PATH" "$SERVER_PATH/index.html" logfile="$(mktemp)" + +#Update current.log symlink to point to the current build log +ln -sf "$logfile" "$SERVER_PATH"/current.log + +#Copy current server report, to restore when result is "skip" +cp "$SERVER_REPORT_PATH" "$SERVER_REPORT_PATH".bak + +update_report "$START_TIME" \ + "$UPSTREAM_TROVE_ADDRESS" \ + "$DEFINITIONS_REF" \ + "" \ + " - " \ + "progress" \ + "$SERVER_REPORT_PATH" \ + "current.log" + + /usr/lib/mason/mason.sh 2>&1 | tee "$logfile" case "${PIPESTATUS[0]}" in 0) @@ -228,25 +260,32 @@ esac # TODO: Update page with last executed time if [ "$RESULT" = skip ]; then + # Restore copied server report, otherwise the 'progress' row will + # be still present with a broken link after we remove the $logfile + mv "$SERVER_REPORT_PATH".bak "$SERVER_REPORT_PATH" + 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)" +BUILD_LOG="log/${SHA1}--${START_TIME}.log" update_report "$START_TIME" \ "$UPSTREAM_TROVE_ADDRESS" \ "$DEFINITIONS_REF" \ "$SHA1" \ "$DURATION" \ - "$RESULT" + "$RESULT" \ + "$REPORT_PATH" \ + "$BUILD_LOG" # # Copy report into server directory # -cp "$REPORT_PATH" "$SERVER_PATH/index.html" +cp "$REPORT_PATH" "$SERVER_REPORT_PATH" mkdir "$SERVER_PATH/log" -mv "$logfile" "$SERVER_PATH/log/$SHA1--$START_TIME.log" +mv "$logfile" "$SERVER_PATH/$BUILD_LOG" diff --git a/extensions/nfsboot.check b/extensions/nfsboot.check index e273f61c..979f5b1b 100755 --- a/extensions/nfsboot.check +++ b/extensions/nfsboot.check @@ -15,33 +15,34 @@ '''Preparatory checks for Morph 'nfsboot' write extension''' -import cliapp import os -import morphlib.writeexts +import writeexts -class NFSBootCheckExtension(morphlib.writeexts.WriteExtension): +class NFSBootCheckExtension(writeexts.WriteExtension): _nfsboot_root = '/srv/nfsboot' def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') location = args[0] upgrade = self.get_environment_boolean('UPGRADE') if upgrade: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Upgrading is not currently supported for NFS deployments.') hostname = os.environ.get('HOSTNAME', None) if hostname is None: - raise cliapp.AppException('You must specify a HOSTNAME.') + raise writeexts.ExtensionError('You must specify a HOSTNAME.') if hostname == 'baserock': - raise cliapp.AppException('It is forbidden to nfsboot a system ' - 'with hostname "%s"' % hostname) + raise writeexts.ExtensionError('It is forbidden to nfsboot a ' + 'system with hostname "%s"' + % hostname) self.test_good_server(location) @@ -49,7 +50,7 @@ class NFSBootCheckExtension(morphlib.writeexts.WriteExtension): versioned_root = os.path.join(self._nfsboot_root, hostname, 'systems', version_label) if self.version_exists(versioned_root, location): - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Root file system for host %s (version %s) already exists on ' 'the NFS server %s. Deployment aborted.' % (hostname, version_label, location)) @@ -59,34 +60,34 @@ class NFSBootCheckExtension(morphlib.writeexts.WriteExtension): # Is an NFS server try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % server, ['test', '-e', '/etc/exports']) - except cliapp.AppException: - raise cliapp.AppException('server %s is not an nfs server' - % server) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s is not an nfs server' + % server) try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % server, ['systemctl', 'is-enabled', 'nfs-server.service']) - except cliapp.AppException: - raise cliapp.AppException('server %s does not control its ' - 'nfs server by systemd' % server) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s does not control its ' + 'nfs server by systemd' % server) # TFTP server exports /srv/nfsboot/tftp tftp_root = os.path.join(self._nfsboot_root, 'tftp') try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % server, ['test' , '-d', tftp_root]) - except cliapp.AppException: - raise cliapp.AppException('server %s does not export %s' % - (tftp_root, server)) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('server %s does not export %s' % + (tftp_root, server)) def version_exists(self, versioned_root, location): try: - cliapp.ssh_runcmd('root@%s' % location, - ['test', '-d', versioned_root]) - except cliapp.AppException: + writeexts.ssh_runcmd('root@%s' % location, + ['test', '-d', versioned_root]) + except writeexts.ExtensionError: return False return True diff --git a/extensions/nfsboot.write b/extensions/nfsboot.write index d928775e..281b83c3 100755 --- a/extensions/nfsboot.write +++ b/extensions/nfsboot.write @@ -34,14 +34,14 @@ in /srv/nfsboot/nfs/ ''' -import cliapp -import os import glob +import os +import subprocess -import morphlib.writeexts +import writeexts -class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): +class NFSBootWriteExtension(writeexts.WriteExtension): '''Create an NFS root and kernel on TFTP during Morph's deployment. @@ -66,7 +66,8 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args @@ -86,8 +87,8 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): subdirs = [os.path.join(statedir, 'home'), os.path.join(statedir, 'opt'), os.path.join(statedir, 'srv')] - cliapp.ssh_runcmd('root@%s' % location, - ['mkdir', '-p'] + subdirs) + writeexts.ssh_runcmd('root@%s' % location, + ['mkdir', '-p'] + subdirs) def copy_kernel(self, temp_root, location, versioned_root, version, hostname): @@ -99,14 +100,14 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): kernel_src = try_path break else: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Could not find a kernel in the system: none of ' '%s found' % ', '.join(image_names)) kernel_dest = os.path.join(versioned_root, 'orig', 'kernel') rsync_dest = 'root@%s:%s' % (location, kernel_dest) self.status(msg='Copying kernel') - cliapp.runcmd( + subprocess.check_call( ['rsync', '-s', kernel_src, rsync_dest]) # Link the kernel to the right place @@ -115,17 +116,17 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): versioned_kernel_name = "%s-%s" % (hostname, version) kernel_name = hostname try: - cliapp.ssh_runcmd('root@%s' % location, + writeexts.ssh_runcmd('root@%s' % location, ['ln', '-f', kernel_dest, os.path.join(tftp_dir, versioned_kernel_name)]) - cliapp.ssh_runcmd('root@%s' % location, + writeexts.ssh_runcmd('root@%s' % location, ['ln', '-sf', versioned_kernel_name, os.path.join(tftp_dir, kernel_name)]) - except cliapp.AppException: - raise cliapp.AppException('Could not create symlinks to the ' - 'kernel at %s in %s on %s' - % (kernel_dest, tftp_dir, location)) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('Could not create symlinks to the ' + 'kernel at %s in %s on %s' % + (kernel_dest, tftp_dir, location)) def copy_rootfs(self, temp_root, location, versioned_root, hostname): rootfs_src = temp_root + '/' @@ -134,51 +135,54 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Creating destination directories') try: - cliapp.ssh_runcmd('root@%s' % location, - ['mkdir', '-p', orig_path, run_path]) - except cliapp.AppException: - raise cliapp.AppException('Could not create dirs %s and %s on %s' - % (orig_path, run_path, location)) + writeexts.ssh_runcmd('root@%s' % location, + ['mkdir', '-p', orig_path, run_path]) + except writeexts.ExtensionError: + raise writexts.ExtensionError( + 'Could not create dirs %s and %s on %s' + % (orig_path, run_path, location)) self.status(msg='Creating \'orig\' rootfs') - cliapp.runcmd( + subprocess.check_call( ['rsync', '-asXSPH', '--delete', rootfs_src, 'root@%s:%s' % (location, orig_path)]) self.status(msg='Creating \'run\' rootfs') try: - cliapp.ssh_runcmd('root@%s' % location, - ['rm', '-rf', run_path]) - cliapp.ssh_runcmd('root@%s' % location, - ['cp', '-al', orig_path, run_path]) - cliapp.ssh_runcmd('root@%s' % location, - ['rm', '-rf', os.path.join(run_path, 'etc')]) - cliapp.ssh_runcmd('root@%s' % location, - ['cp', '-a', os.path.join(orig_path, 'etc'), - os.path.join(run_path, 'etc')]) - except cliapp.AppException: - raise cliapp.AppException('Could not create \'run\' rootfs' - ' from \'orig\'') + writeexts.ssh_runcmd('root@%s' % location, + ['rm', '-rf', run_path]) + writeexts.ssh_runcmd('root@%s' % location, + ['cp', '-al', orig_path, run_path]) + writeexts.ssh_runcmd('root@%s' % location, + ['rm', '-rf', + os.path.join(run_path, 'etc')]) + writeexts.ssh_runcmd('root@%s' % location, + ['cp', '-a', + os.path.join(orig_path, 'etc'), + os.path.join(run_path, 'etc')]) + except writeexts.ExtensionError: + raise writeexts.ExtensionError('Could not create \'run\' rootfs' + ' from \'orig\'') self.status(msg='Linking \'default\' to latest system') try: - cliapp.ssh_runcmd('root@%s' % location, + writeexts.ssh_runcmd('root@%s' % location, ['ln', '-sfn', versioned_root, os.path.join(self._nfsboot_root, hostname, 'systems', 'default')]) - except cliapp.AppException: - raise cliapp.AppException('Could not link \'default\' to %s' - % versioned_root) + except writeexts.ExtensionError: + raise writeexts.ExtensionError("Could not link 'default' to %s" + % versioned_root) def configure_nfs(self, location, hostname): exported_path = os.path.join(self._nfsboot_root, hostname) exports_path = '/etc/exports' # If that path is not already exported: try: - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % location, ['grep', '-q', exported_path, exports_path]) - except cliapp.AppException: + except writeexts.ExtensionError: ip_mask = '*' options = 'rw,no_subtree_check,no_root_squash,async' exports_string = '%s %s(%s)\n' % (exported_path, ip_mask, options) @@ -190,11 +194,11 @@ cat "$target" > "$temp" cat >> "$temp" mv "$temp" "$target" ''' - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % location, ['sh', '-c', exports_append_sh, '--', exports_path], feed_stdin=exports_string) - cliapp.ssh_runcmd( + writeexts.ssh_runcmd( 'root@%s' % location, ['systemctl', 'restart', 'nfs-server.service']) diff --git a/extensions/openstack-ironic.configure b/extensions/openstack-ironic.configure index 962bbcd1..c77b1288 100644 --- a/extensions/openstack-ironic.configure +++ b/extensions/openstack-ironic.configure @@ -153,3 +153,5 @@ r ^/tftpboot/ $tftp_root\2 EOF cp "$ROOT"/usr/share/syslinux/pxelinux.0 "$ROOT/$tftp_root" +cp "$ROOT"/usr/share/syslinux/chain.c32 "$ROOT/$tftp_root" + diff --git a/extensions/openstack-network.configure b/extensions/openstack-network.configure index 10be5a1c..9128f845 100644 --- a/extensions/openstack-network.configure +++ b/extensions/openstack-network.configure @@ -23,6 +23,36 @@ enable(){ "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service" } +unnaceptable(){ + eval echo Unexpected value \$$1 for $1 >&2 + exit 1 +} + +check_bool(){ + case "$(eval echo \"\$$1\")" in + True|'') + eval "$1=true" + ;; + False) + eval "$1=false" + ;; + *) + unnaceptable "$1" + ;; + esac +} + +########################################################################## +# Check variables +########################################################################## + +check_bool NEUTRON_ENABLE_MANAGER +check_bool NEUTRON_ENABLE_AGENT + +if ! "$NEUTRON_ENABLE_MANAGER" && ! "$NEUTRON_ENABLE_AGENT"; then + exit 0 +fi + ################### # Enable services # ################### diff --git a/extensions/openstack-nova.configure b/extensions/openstack-nova.configure index 9e77305d..241d94c2 100644 --- a/extensions/openstack-nova.configure +++ b/extensions/openstack-nova.configure @@ -115,6 +115,7 @@ case "$NOVA_BAREMETAL_SCHEDULING" in export SCHEDULER_HOST_MANAGER=nova.scheduler.ironic_host_manager.IronicHostManager export RAM_ALLOCATION_RATIO=1.0 export COMPUTE_DRIVER=nova.virt.ironic.IronicDriver + export SCHEDULER_USE_BAREMETAL_FILTERS=true ;; *) export COMPUTE_MANAGER=nova.compute.manager.ComputeManager @@ -122,6 +123,7 @@ case "$NOVA_BAREMETAL_SCHEDULING" in export SCHEDULER_HOST_MANAGER=nova.scheduler.host_manager.HostManager export RAM_ALLOCATION_RATIO=1.5 export COMPUTE_DRIVER=libvirt.LibvirtDriver + export SCHEDULER_USE_BAREMETAL_FILTERS=false ;; esac @@ -141,6 +143,7 @@ nova_configuration={ 'RESERVED_HOST_MEMORY_MB': os.environ['RESERVED_HOST_MEMORY_MB'], 'SCHEDULER_HOST_MANAGER': os.environ['SCHEDULER_HOST_MANAGER'], 'RAM_ALLOCATION_RATIO': os.environ['RAM_ALLOCATION_RATIO'], + 'SCHEDULER_USE_BAREMETAL_FILTERS': os.environ['SCHEDULER_USE_BAREMETAL_FILTERS'], 'COMPUTE_DRIVER': os.environ['COMPUTE_DRIVER'], 'NEUTRON_SERVICE_USER': os.environ['NEUTRON_SERVICE_USER'], 'NEUTRON_SERVICE_PASSWORD': os.environ['NEUTRON_SERVICE_PASSWORD'], diff --git a/extensions/openstack-time.configure b/extensions/openstack-time.configure new file mode 100644 index 00000000..4f5c8fbd --- /dev/null +++ b/extensions/openstack-time.configure @@ -0,0 +1,61 @@ +#!/bin/sh + +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +set -e + +ROOT="$1" + +unnaceptable(){ + eval echo Unexpected value \$$1 for $1 >&2 + exit 1 +} + +check_bool(){ + case "$(eval echo \"\$$1\")" in + True) + eval "$1=true" + ;; + False|'') + eval "$1=false" + ;; + *) + unnaceptable "$1" + ;; + esac +} +check_bool SYNC_TIME_WITH_CONTROLLER + +if "$SYNC_TIME_WITH_CONTROLLER"; then + + cat << EOF > "$ROOT"/etc/ntpd.conf +# We use iburst here to reduce the potential initial delay to set the clock +server $CONTROLLER_HOST_ADDRESS iburst + +# kod - notify client when packets are denied service, +# rather than just dropping the packets +# +# nomodify - deny queries which attempt to modify the state of the server +# +# notrap - decline to provide mode 6 control message trap service to +# matching hosts +# +# see ntp.conf(5) for more details +restrict -4 default limited limited nomodify +restrict -6 default limited limited notrap nomodify +EOF + +fi diff --git a/extensions/openstack.check b/extensions/openstack.check index a3379763..f3ad43b7 100755 --- a/extensions/openstack.check +++ b/extensions/openstack.check @@ -15,25 +15,26 @@ '''Preparatory checks for Morph 'openstack' write extension''' -import cliapp import os import urlparse + import keystoneclient -import morphlib.writeexts +import writeexts -class OpenStackCheckExtension(morphlib.writeexts.WriteExtension): +class OpenStackCheckExtension(writeexts.WriteExtension): def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') self.require_btrfs_in_deployment_host_kernel() upgrade = self.get_environment_boolean('UPGRADE') if upgrade: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Use the `ssh-rsync` write extension to deploy upgrades to an ' 'existing remote system.') @@ -55,7 +56,7 @@ class OpenStackCheckExtension(morphlib.writeexts.WriteExtension): for key in auth_keys: if os.environ.get(key, '') == '': - raise cliapp.AppException(key + ' was not given') + raise writeexts.ExtensionError(key + ' was not given') auth_params = {auth_keys[key]: os.environ[key] for key in auth_keys} auth_params['auth_url'] = location @@ -63,16 +64,17 @@ class OpenStackCheckExtension(morphlib.writeexts.WriteExtension): def check_imagename(self): if os.environ.get('OPENSTACK_IMAGENAME', '') == '': - raise cliapp.AppException('OPENSTACK_IMAGENAME was not given') + raise writeexts.ExtensionError( + 'OPENSTACK_IMAGENAME was not given') def check_location(self, location): x = urlparse.urlparse(location) if x.scheme not in ['http', 'https']: - raise cliapp.AppException('URL schema must be http or https in %s'\ - % location) + raise writeexts.ExtensionError( + 'URL schema must be http or https in %s' % location) if (x.path != '/v2.0' and x.path != '/v2.0/'): - raise cliapp.AppException('API version must be v2.0 in %s'\ - % location) + raise writeexts.ExtensionError( + 'API version must be v2.0 in %s' % location) def check_openstack_parameters(self, auth_params): ''' Check that we can connect to and authenticate with openstack ''' @@ -84,7 +86,7 @@ class OpenStackCheckExtension(morphlib.writeexts.WriteExtension): except keystoneclient.exceptions.Unauthorized: errmsg = ('Failed to authenticate with OpenStack ' '(are your credentials correct?)') - raise cliapp.AppException(errmsg) + raise writeexts.ExtensionError(errmsg) OpenStackCheckExtension().run() diff --git a/extensions/openstack.write b/extensions/openstack.write index 67e07c18..f1233560 100755 --- a/extensions/openstack.write +++ b/extensions/openstack.write @@ -17,21 +17,22 @@ '''A Morph deployment write extension for deploying to OpenStack.''' -import cliapp import os +import subprocess import tempfile import urlparse -import morphlib.writeexts +import writeexts -class OpenStackWriteExtension(morphlib.writeexts.WriteExtension): +class OpenStackWriteExtension(writeexts.WriteExtension): '''See openstack.write.help for documentation''' def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args @@ -86,7 +87,7 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension): '--disk-format=raw', '--container-format', 'bare', '--file', raw_disk] - cliapp.runcmd(cmdline) + subprocess.check_call(cmdline) self.status(msg='Image configured.') diff --git a/extensions/pxeboot.write b/extensions/pxeboot.write index 3a12ebcc..20e4f6bd 100644 --- a/extensions/pxeboot.write +++ b/extensions/pxeboot.write @@ -19,10 +19,7 @@ import tempfile import textwrap import urlparse -import cliapp - -import morphlib - +import writeexts def _int_to_quad_dot(i): return '.'.join(( @@ -143,7 +140,7 @@ def grouper(iterable, n, fillvalue=None): return itertools.izip_longest(*args, fillvalue=fillvalue) -class PXEBoot(morphlib.writeexts.WriteExtension): +class PXEBoot(writeexts.WriteExtension): @contextlib.contextmanager def _vlan(self, interface, vlan): viface = '%s.%s' % (interface, vlan) @@ -224,12 +221,13 @@ class PXEBoot(morphlib.writeexts.WriteExtension): @contextlib.contextmanager def _remote_tempdir(self, hostname, template): persist = os.environ.get('PXE_INSTALLER') in ('no', 'False') - td = cliapp.ssh_runcmd(hostname, ['mktemp', '-d', template]).strip() + td = writeexts.ssh_runcmd( + hostname, ['mktemp', '-d', template]).strip() try: yield td finally: if not persist: - cliapp.ssh_runcmd(hostname, ['find', td, '-delete']) + writeexts.ssh_runcmd(hostname, ['find', td, '-delete']) def _serve_tftpd(self, sock, host, port, interface, tftproot): self.settings.progname = 'tftp server' @@ -333,26 +331,27 @@ class PXEBoot(morphlib.writeexts.WriteExtension): def _remote_copy(self, hostname, src, dst): persist = os.environ.get('PXE_INSTALLER') in ('no', 'False') with open(src, 'r') as f: - cliapp.ssh_runcmd(hostname, - ['install', '-D', '-m644', '/proc/self/fd/0', - dst], stdin=f, stdout=None, stderr=None) + writeexts.ssh_runcmd(hostname, + ['install', '-D', '-m644', + '/proc/self/fd/0', dst], + stdin=f, stdout=None, stderr=None) try: yield finally: if not persist: - cliapp.ssh_runcmd(hostname, ['rm', dst]) + writeexts.ssh_runcmd(hostname, ['rm', dst]) @contextlib.contextmanager def _remote_symlink(self, hostname, src, dst): persist = os.environ.get('PXE_INSTALLER') in ('no', 'False') - cliapp.ssh_runcmd(hostname, - ['ln', '-s', '-f', src, dst], - stdin=None, stdout=None, stderr=None) + writeexts.ssh_runcmd(hostname, + ['ln', '-s', '-f', src, dst], + stdin=None, stdout=None, stderr=None) try: yield finally: if not persist: - cliapp.ssh_runcmd(hostname, ['rm', '-f', dst]) + writeexts.ssh_runcmd(hostname, ['rm', '-f', dst]) @contextlib.contextmanager def remote_kernel(self, rootfs, tftp_url, macaddr): @@ -361,7 +360,7 @@ class PXEBoot(morphlib.writeexts.WriteExtension): if os.path.exists(kernel_path): break else: - raise cliapp.AppException('Failed to locate kernel') + raise writeexts.ExtensionError('Failed to locate kernel') url = urlparse.urlsplit(tftp_url) basename = '{}-kernel'.format(_normalise_macaddr(macaddr)) target_path = os.path.join(url.path, basename) @@ -376,7 +375,8 @@ class PXEBoot(morphlib.writeexts.WriteExtension): yield fdt_abs_path = os.path.join(rootfs, fdt_rel_path) if not fdt_abs_path: - raise cliapp.AppException('Failed to locate Flattened Device Tree') + raise writeexts.ExtensionError( + 'Failed to locate Flattened Device Tree') url = urlparse.urlsplit(tftp_url) basename = '{}-fdt'.format(_normalise_macaddr(macaddr)) target_path = os.path.join(url.path, basename) @@ -389,14 +389,14 @@ class PXEBoot(morphlib.writeexts.WriteExtension): 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]) + subprocess.check_call(['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]) + subprocess.check_call(['exportfs', '-u', nfsroot]) @contextlib.contextmanager def remote_nfsroot(self, rootfs, rsync_url, macaddr): @@ -407,9 +407,10 @@ class PXEBoot(morphlib.writeexts.WriteExtension): as tempdir: nfsroot = urlparse.urlunsplit((url.scheme, url.netloc, tempdir, url.query, url.fragment)) - cliapp.runcmd(['rsync', '-asSPH', '--delete', rootfs, nfsroot], - stdin=None, stdout=open(os.devnull, 'w'), - stderr=None) + subprocess.check_call(['rsync', '-asSPH', '--delete', + rootfs, nfsroot], + stdin=None, stdout=open(os.devnull, 'w'), + stderr=None) yield os.path.join(os.path.basename(tempdir), os.path.basename(rootfs)) @@ -517,8 +518,8 @@ class PXEBoot(morphlib.writeexts.WriteExtension): def get_interface_ip(self, interface): ip_addresses = [] - info = cliapp.runcmd(['ip', '-o', '-f', 'inet', - 'addr', 'show', interface]).rstrip('\n') + info = subprocess.check_output(['ip', '-o', '-f', 'inet', 'addr', + 'show', interface]).rstrip('\n') if info: tokens = collections.deque(info.split()[1:]) ifname = tokens.popleft() @@ -535,8 +536,8 @@ class PXEBoot(morphlib.writeexts.WriteExtension): else: continue if not ip_addresses: - raise cliapp.AppException('Interface %s has no addresses' - % interface) + raise writeexts.ExtensionError('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])) @@ -750,6 +751,6 @@ class PXEBoot(morphlib.writeexts.WriteExtension): self.wait_for_target_to_install() self.ipmi_reboot_target() else: - cliapp.AppException('Invalid PXEBOOT_MODE: %s' % mode) + writeexts.ExtensionError('Invalid PXEBOOT_MODE: %s' % mode) PXEBoot().run() diff --git a/extensions/rawdisk.check b/extensions/rawdisk.check index 9be0ce91..61619a21 100755 --- a/extensions/rawdisk.check +++ b/extensions/rawdisk.check @@ -15,17 +15,16 @@ '''Preparatory checks for Morph 'rawdisk' write extension''' -import cliapp - -import morphlib.writeexts - import os +import writeexts + -class RawdiskCheckExtension(morphlib.writeexts.WriteExtension): +class RawdiskCheckExtension(writeexts.WriteExtension): def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') self.require_btrfs_in_deployment_host_kernel() @@ -34,19 +33,19 @@ class RawdiskCheckExtension(morphlib.writeexts.WriteExtension): if upgrade: if not self.is_device(location): if not os.path.isfile(location): - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Cannot upgrade %s: it is not an existing disk image' % location) version_label = os.environ.get('VERSION_LABEL') if version_label is None: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'VERSION_LABEL was not given. It is required when ' 'upgrading an existing system.') else: if not self.is_device(location): if os.path.exists(location): - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Target %s already exists. Use `morph upgrade` if you ' 'want to update an existing image.' % location) diff --git a/extensions/rawdisk.write b/extensions/rawdisk.write index 6f2d45ba..49d0a1e8 100755 --- a/extensions/rawdisk.write +++ b/extensions/rawdisk.write @@ -17,22 +17,23 @@ '''A Morph deployment write extension for raw disk images.''' -import cliapp import os +import subprocess import sys import time import tempfile -import morphlib.writeexts +import writeexts -class RawDiskWriteExtension(morphlib.writeexts.WriteExtension): +class RawDiskWriteExtension(writeexts.WriteExtension): '''See rawdisk.write.help for documentation''' def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args upgrade = self.get_environment_boolean('UPGRADE') @@ -69,10 +70,10 @@ class RawDiskWriteExtension(morphlib.writeexts.WriteExtension): old_orig = os.path.join(mp, 'systems', 'default', 'orig') new_orig = os.path.join(version_root, 'orig') - cliapp.runcmd( + subprocess.check_call( ['btrfs', 'subvolume', 'snapshot', old_orig, new_orig]) - cliapp.runcmd( + subprocess.check_call( ['rsync', '-a', '--checksum', '--numeric-ids', '--delete', temp_root + os.path.sep, new_orig]) @@ -96,11 +97,11 @@ class RawDiskWriteExtension(morphlib.writeexts.WriteExtension): version_label = os.environ.get('VERSION_LABEL') if version_label is None: - raise cliapp.AppException('VERSION_LABEL was not given') + raise writeexts.ExtensionError('VERSION_LABEL was not given') if os.path.exists(os.path.join(mp, 'systems', version_label)): - raise cliapp.AppException('VERSION_LABEL %s already exists' - % version_label) + raise writeexts.ExtensionError('VERSION_LABEL %s already exists' + % version_label) return version_label diff --git a/extensions/recv-hole b/extensions/recv-hole new file mode 100755 index 00000000..fe69f304 --- /dev/null +++ b/extensions/recv-hole @@ -0,0 +1,158 @@ +#!/bin/sh +# +# Copyright (C) 2014-2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# =*= License: GPL-2 =*= + + +# Receive a data stream describing a sparse file, and reproduce it, +# either to a named file or stdout. +# +# The data stream is simple: it's a sequence of DATA or HOLE records: +# +# DATA +# 123 +# <123 bytes of binary data, NOT including newline at the end> +# +# HOLE +# 123 +# +# This shell script can be executed over ssh (given to ssh as an arguemnt, +# with suitable escaping) on a different computer. This allows a large +# sparse file (e.g., disk image) be transferred quickly. +# +# This script should be called in one of the following ways: +# +# recv-hole file FILENAME +# recv-hole vbox FILENAME DISKSIZE +# +# In both cases, FILENAME is the pathname of the disk image on the +# receiving end. DISKSIZE is the size of the disk image in bytes. The +# first form is used when transferring a disk image to become an +# identical file on the receiving end. +# +# The second form is used when the disk image should be converted for +# use by VirtualBox. In this case, we want to avoid writing a +# temporary file on disk, and then calling the VirtualBox VBoxManage +# tool to do the conversion, since that would involve large amounts of +# unnecessary I/O and disk usage. Instead we pipe the file directly to +# VBoxManage, avoiding those issues. The piping is done here in this +# script, instead of in the caller, to make it easier to run things +# over ssh. +# +# However, since it's not possible seek in a Unix pipe, we have to +# explicitly write the zeroes into the pipe. This is not +# super-efficient, but the way to avoid that would be to avoid sending +# a sparse file, and do the conversion to a VDI on the sending end. +# That is out of scope for xfer-hole and recv-hole. + + +set -eu + + +die() +{ + echo "$@" 1>&2 + exit 1 +} + + +recv_hole_to_file() +{ + local n + + read n + truncate --size "+$n" "$1" +} + + +recv_data_to_file() +{ + local n + read n + + local blocksize=1048576 + local blocks=$(($n / $blocksize)) + local extra=$(($n % $blocksize)) + + xfer_data_to_stdout "$blocksize" "$blocks" >> "$1" + xfer_data_to_stdout 1 "$extra" >> "$1" +} + + +recv_hole_to_stdout() +{ + local n + read n + (echo "$n"; cat /dev/zero) | recv_data_to_stdout +} + + +recv_data_to_stdout() +{ + local n + read n + + local blocksize=1048576 + local blocks=$(($n / $blocksize)) + local extra=$(($n % $blocksize)) + + xfer_data_to_stdout "$blocksize" "$blocks" + xfer_data_to_stdout 1 "$extra" +} + + +xfer_data_to_stdout() +{ + local log="$(mktemp)" + if ! dd "bs=$1" count="$2" iflag=fullblock status=noxfer 2> "$log" + then + cat "$log" 1>&2 + rm -f "$log" + exit 1 + else + rm -f "$log" + fi +} + + +type="$1" +case "$type" in + file) + output="$2" + truncate --size=0 "$output" + while read what + do + case "$what" in + DATA) recv_data_to_file "$output" ;; + HOLE) recv_hole_to_file "$output" ;; + *) die "Unknown instruction: $what" ;; + esac + done + ;; + vbox) + output="$2" + disk_size="$3" + while read what + do + case "$what" in + DATA) recv_data_to_stdout ;; + HOLE) recv_hole_to_stdout ;; + *) die "Unknown instruction: $what" ;; + esac + done | + VBoxManage convertfromraw stdin "$output" "$disk_size" + ;; +esac diff --git a/extensions/simple-network.configure b/extensions/simple-network.configure index 4a70f311..61d5774d 100755 --- a/extensions/simple-network.configure +++ b/extensions/simple-network.configure @@ -25,27 +25,26 @@ for DHCP ''' +import errno import os import sys -import errno -import cliapp -import morphlib +import writeexts -class SimpleNetworkError(morphlib.Error): +class SimpleNetworkError(writeexts.ExtensionError): '''Errors associated with simple network setup''' pass -class SimpleNetworkConfigurationExtension(cliapp.Application): +class SimpleNetworkConfigurationExtension(object): '''Configure /etc/network/interfaces and generate networkd .network files Reading NETWORK_CONFIG, this extension sets up /etc/network/interfaces and .network files in /etc/systemd/network/. ''' - def process_args(self, args): + def run(self, args): network_config = os.environ.get("NETWORK_CONFIG") self.rename_networkd_chunk_file(args) @@ -206,7 +205,8 @@ class SimpleNetworkConfigurationExtension(cliapp.Application): address_line = address + '/' + str(network_suffix) lines += ["Address=%s" % address_line] elif address or netmask: - raise Exception('address and netmask must be specified together') + raise SimpleNetworkError( + 'address and netmask must be specified together') if gateway: lines += ["Gateway=%s" % gateway] @@ -287,6 +287,10 @@ class SimpleNetworkConfigurationExtension(cliapp.Application): ''' - self.output.write('%s\n' % (kwargs['msg'] % kwargs)) + sys.stdout.write('%s\n' % (kwargs['msg'] % kwargs)) -SimpleNetworkConfigurationExtension().run() +try: + SimpleNetworkConfigurationExtension().run(sys.argv[1:]) +except SimpleNetworkError as e: + sys.stdout.write('ERROR: %s\n' % e) + sys.exit(1) diff --git a/extensions/ssh-rsync.check b/extensions/ssh-rsync.check index c3bdfd29..fc9bf62d 100755 --- a/extensions/ssh-rsync.check +++ b/extensions/ssh-rsync.check @@ -15,30 +15,35 @@ '''Preparatory checks for Morph 'ssh-rsync' write extension''' -import cliapp import os +import json +import logging -import morphlib.writeexts +import writeexts -class SshRsyncCheckExtension(morphlib.writeexts.WriteExtension): + +class SshRsyncCheckExtension(writeexts.WriteExtension): def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') upgrade = self.get_environment_boolean('UPGRADE') if not upgrade: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'The ssh-rsync write is for upgrading existing remote ' 'Baserock machines. It cannot be used for an initial ' 'deployment.') if os.environ.get('VERSION_LABEL', '') == '': - raise cliapp.AppException( + raise writeexts.ExtensionError( 'A VERSION_LABEL must be set when deploying an upgrade.') location = args[0] self.check_ssh_connectivity(location) + + self.check_version_label(location, os.environ['VERSION_LABEL']) self.check_is_baserock_system(location) # The new system that being deployed as an upgrade must contain @@ -47,18 +52,33 @@ class SshRsyncCheckExtension(morphlib.writeexts.WriteExtension): self.check_command_exists(location, 'rsync') def check_is_baserock_system(self, location): - output = cliapp.ssh_runcmd(location, ['sh', '-c', - 'test -d /baserock || echo -n dirnotfound']) + output = writeexts.ssh_runcmd( + location, + ['sh', '-c', 'test -d /baserock || echo -n dirnotfound']) if output == 'dirnotfound': - raise cliapp.AppException('%s is not a baserock system' - % location) + raise writeexts.ExtensionError('%s is not a baserock system' + % location) def check_command_exists(self, location, command): test = 'type %s > /dev/null 2>&1 || echo -n cmdnotfound' % command - output = cliapp.ssh_runcmd(location, ['sh', '-c', test]) + output = writeexts.ssh_runcmd(location, ['sh', '-c', test]) if output == 'cmdnotfound': - raise cliapp.AppException( + raise writeexts.ExtensionError( "%s does not have %s" % (location, command)) + def check_version_label(self, location, version_label): + args = ['system-version-manager', 'list', '--json'] + + try: + output = writeexts.ssh_runcmd(location, args) + except writeexts.ExtensionError: + msg = ("Couldn't get system list from system-version-manager, " + "skipping version label check") + logging.exception(msg) + return + + if version_label in json.loads(output): + raise writeexts.ExtensionError( + "There is already a system called `%s'" % version_label) SshRsyncCheckExtension().run() diff --git a/extensions/ssh-rsync.write b/extensions/ssh-rsync.write index 6d596500..46c16662 100755 --- a/extensions/ssh-rsync.write +++ b/extensions/ssh-rsync.write @@ -18,23 +18,23 @@ import contextlib -import cliapp import os +import subprocess import sys -import time import tempfile +import time -import morphlib.writeexts +import writeexts def ssh_runcmd_ignore_failure(location, command, **kwargs): try: - return cliapp.ssh_runcmd(location, command, **kwargs) - except cliapp.AppException: + return writeexts.ssh_runcmd(location, command, **kwargs) + except writeexts.ExtensionError: pass -class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): +class SshRsyncWriteExtension(writeexts.WriteExtension): '''See ssh-rsync.write.help for documentation''' @@ -43,7 +43,8 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): '''Read /proc/mounts on location to find which device contains "/"''' self.status(msg='Finding device that contains "/"') - contents = cliapp.ssh_runcmd(location, ['cat', '/proc/mounts']) + contents = writeexts.ssh_runcmd(location, + ['cat', '/proc/mounts']) for line in contents.splitlines(): line_words = line.split() if (line_words[1] == '/' and line_words[0] != 'rootfs'): @@ -52,28 +53,29 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): @contextlib.contextmanager def _remote_mount_point(self, location): self.status(msg='Creating remote mount point') - remote_mnt = cliapp.ssh_runcmd(location, ['mktemp', '-d']).strip() + remote_mnt = writeexts.ssh_runcmd(location, + ['mktemp', '-d']).strip() try: yield remote_mnt finally: self.status(msg='Removing remote mount point') - cliapp.ssh_runcmd(location, ['rmdir', remote_mnt]) + writeexts.ssh_runcmd(location, ['rmdir', remote_mnt]) @contextlib.contextmanager def _remote_mount(self, location, root_disk, mountpoint): self.status(msg='Mounting root disk') - cliapp.ssh_runcmd(location, ['mount', root_disk, mountpoint]) + writeexts.ssh_runcmd(location, ['mount', root_disk, mountpoint]) try: yield finally: self.status(msg='Unmounting root disk') - cliapp.ssh_runcmd(location, ['umount', mountpoint]) + writeexts.ssh_runcmd(location, ['umount', mountpoint]) @contextlib.contextmanager def _created_version_root(self, location, remote_mnt, version_label): version_root = os.path.join(remote_mnt, 'systems', version_label) self.status(msg='Creating %(root)s', root=version_root) - cliapp.ssh_runcmd(location, ['mkdir', version_root]) + writeexts.ssh_runcmd(location, ['mkdir', version_root]) try: yield version_root except BaseException as e: @@ -93,8 +95,8 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Creating "orig" subvolume') old_orig = self.get_old_orig(location, remote_mnt) new_orig = os.path.join(version_root, 'orig') - cliapp.ssh_runcmd(location, ['btrfs', 'subvolume', 'snapshot', - old_orig, new_orig]) + writeexts.ssh_runcmd(location, ['btrfs', 'subvolume', 'snapshot', + old_orig, new_orig]) try: yield new_orig except BaseException as e: @@ -106,30 +108,30 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): '''Populate the subvolume version_root/orig on location''' self.status(msg='Populating "orig" subvolume') - cliapp.runcmd(['rsync', '-as', '--checksum', '--numeric-ids', - '--delete', temp_root + os.path.sep, - '%s:%s' % (location, new_orig)]) + subprocess.check_call(['rsync', '-as', '--checksum', '--numeric-ids', + '--delete', temp_root + os.path.sep, + '%s:%s' % (location, new_orig)]) @contextlib.contextmanager def _deployed_version(self, location, version_label, system_config_sync, system_version_manager): self.status(msg='Calling system-version-manager to deploy upgrade') deployment = os.path.join('/systems', version_label, 'orig') - cliapp.ssh_runcmd(location, + writeexts.ssh_runcmd(location, ['env', 'BASEROCK_SYSTEM_CONFIG_SYNC='+system_config_sync, system_version_manager, 'deploy', deployment]) try: yield deployment except BaseException as e: self.status(msg='Cleaning up failed version installation') - cliapp.ssh_runcmd(location, + writeexts.ssh_runcmd(location, [system_version_manager, 'remove', version_label]) raise def upgrade_remote_system(self, location, temp_root): root_disk = self.find_root_disk(location) - uuid = cliapp.ssh_runcmd(location, ['blkid', '-s', 'UUID', '-o', - 'value', root_disk]).strip() + uuid = writeexts.ssh_runcmd(location, + ['blkid', '-s', 'UUID', '-o', 'value', root_disk]).strip() self.complete_fstab_for_btrfs_layout(temp_root, uuid) @@ -153,8 +155,8 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): config_sync, version_manager): self.status(msg='Setting %(v)s as the new default system', v=version_label) - cliapp.ssh_runcmd(location, [version_manager, - 'set-default', version_label]) + writeexts.ssh_runcmd(location, + [version_manager, 'set-default', version_label]) if autostart: self.status(msg="Rebooting into new system ...") @@ -162,7 +164,8 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args diff --git a/extensions/strip-gplv3.configure b/extensions/strip-gplv3.configure index c08061ad..bf28223d 100755 --- a/extensions/strip-gplv3.configure +++ b/extensions/strip-gplv3.configure @@ -21,12 +21,15 @@ to find the files created by that chunk, then remove them. ''' -import cliapp -import re -import os import json +import os +import re +import subprocess +import sys + +import writeexts -class StripGPLv3ConfigureExtension(cliapp.Application): +class StripGPLv3ConfigureExtension(writeexts.Extension): gplv3_chunks = [ ['autoconf', ''], ['automake', ''], @@ -57,7 +60,8 @@ class StripGPLv3ConfigureExtension(cliapp.Application): for chunk in self.gplv3_chunks: regex = os.path.join(meta_dir, "%s-[^-]\+\.meta" % chunk[0]) - artifacts = self.runcmd(['find', meta_dir, '-regex', regex]) + artifacts = subprocess.check_output(['busybox', 'find', meta_dir, + '-regex', regex]) for artifact in artifacts.split(): self.remove_chunk(target_root, artifact, chunk[1]) @@ -72,8 +76,8 @@ class StripGPLv3ConfigureExtension(cliapp.Application): 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) + raise writeexts.ExtensionError( + 'Chunk %s does not have a "contents" list' % chunk) updated_contents = [] for content_entry in reversed(chunk_meta_data['contents']): pat = re.compile(pattern) @@ -85,8 +89,8 @@ class StripGPLv3ConfigureExtension(cliapp.Application): 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)) + raise writeexts.ExtensionError( + '%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) @@ -96,6 +100,7 @@ class StripGPLv3ConfigureExtension(cliapp.Application): 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() + raise writeexts.ExtensionError( + '%s is not a link, file or directory' % entry_path) + +StripGPLv3ConfigureExtension().run(sys.argv[1:]) diff --git a/extensions/virtualbox-ssh.check b/extensions/virtualbox-ssh.check index a97f3294..e82d58a1 100755 --- a/extensions/virtualbox-ssh.check +++ b/extensions/virtualbox-ssh.check @@ -15,21 +15,21 @@ '''Preparatory checks for Morph 'virtualbox-ssh' write extension''' -import cliapp -import morphlib.writeexts +import writeexts -class VirtualBoxPlusSshCheckExtension(morphlib.writeexts.WriteExtension): +class VirtualBoxPlusSshCheckExtension(writeexts.WriteExtension): def process_args(self, args): if len(args) != 1: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') self.require_btrfs_in_deployment_host_kernel() upgrade = self.get_environment_boolean('UPGRADE') if upgrade: - raise cliapp.AppException( + raise writeexts.ExtensionError( 'Use the `ssh-rsync` write extension to deploy upgrades to an ' 'existing remote system.') diff --git a/extensions/virtualbox-ssh.write b/extensions/virtualbox-ssh.write index 774f2b4f..86b813cc 100755 --- a/extensions/virtualbox-ssh.write +++ b/extensions/virtualbox-ssh.write @@ -24,22 +24,23 @@ See file virtualbox-ssh.write.help for documentation ''' -import cliapp import os import re +import subprocess import sys -import time import tempfile +import time import urlparse -import morphlib.writeexts +import writeexts -class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): +class VirtualBoxPlusSshWriteExtension(writeexts.WriteExtension): def process_args(self, args): if len(args) != 2: - raise cliapp.AppException('Wrong number of command line args') + raise writeexts.ExtensionError( + 'Wrong number of command line args') temp_root, location = args ssh_host, vm_name, vdi_path = self.parse_location(location) @@ -59,7 +60,7 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): except BaseException: sys.stderr.write('Error deploying to VirtualBox') os.remove(raw_disk) - cliapp.ssh_runcmd(ssh_host, ['rm', '-f', vdi_path]) + writeexts.ssh_runcmd(ssh_host, ['rm', '-f', vdi_path]) raise else: os.remove(raw_disk) @@ -72,11 +73,12 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): x = urlparse.urlparse(location) if x.scheme != 'vbox+ssh': - raise cliapp.AppException( + raise writeexts.ExtensionError( 'URL schema must be vbox+ssh in %s' % location) m = re.match('^/(?P<guest>[^/]+)(?P<path>/.+)$', x.path) if not m: - raise cliapp.AppException('Cannot parse location %s' % location) + raise writeexts.ExtensionError( + 'Cannot parse location %s' % location) return x.netloc, m.group('guest'), m.group('path') def transfer_and_convert_to_vdi(self, raw_disk, ssh_host, vdi_path): @@ -85,18 +87,23 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Transfer disk and convert to VDI') st = os.lstat(raw_disk) - xfer_hole_path = morphlib.util.get_data_path('xfer-hole') - recv_hole = morphlib.util.get_data('recv-hole') + # TODO: Something! + xfer_hole_path = writeexts.get_data_path('xfer-hole') + recv_hole = writeexts.get_data('recv-hole') ssh_remote_cmd = [ 'sh', '-c', recv_hole, 'dummy-argv0', 'vbox', vdi_path, str(st.st_size), ] - cliapp.runcmd( + xfer_hole_proc = subprocess.Popen( ['python', xfer_hole_path, raw_disk], - ['ssh', ssh_host] + map(cliapp.shell_quote, ssh_remote_cmd), - stdout=None, stderr=None) + stdout=subprocess.PIPE) + recv_hole_proc = subprocess.Popen( + ['ssh', ssh_host] + map(writeexts.shell_quote, ssh_remote_cmd), + stdin=xfer_hole_proc.stdout) + xfer_hole_proc.stdout.close() + recv_hole_proc.communicate() def virtualbox_version(self, ssh_host): 'Get the version number of the VirtualBox running on the remote host.' @@ -107,7 +114,8 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): # tuple is more reliable than a string and more convenient than # comparing against the major, minor and patch numbers directly self.status(msg='Checking version of remote VirtualBox') - build_id = cliapp.ssh_runcmd(ssh_host, ['VBoxManage', '--version']) + build_id = writeexts.ssh_runcmd(ssh_host, + ['VBoxManage', '--version']) version_string = re.match(r"^([0-9\.]+).*$", build_id.strip()).group(1) return tuple(int(s or '0') for s in version_string.split('.')) @@ -163,17 +171,17 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): for command in commands: argv = ['VBoxManage'] + command - cliapp.ssh_runcmd(ssh_host, argv) + writeexts.ssh_runcmd(ssh_host, argv) def get_host_interface(self, ssh_host): host_ipaddr = os.environ.get('HOST_IPADDR') netmask = os.environ.get('NETMASK') if host_ipaddr is None: - raise cliapp.AppException('HOST_IPADDR was not given') + raise writeexts.ExtensionError('HOST_IPADDR was not given') if netmask is None: - raise cliapp.AppException('NETMASK was not given') + raise writeexts.ExtensionError('NETMASK was not given') # 'VBoxManage list hostonlyifs' retrieves a list with the hostonly # interfaces on the host. For each interface, the following lines @@ -187,7 +195,7 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): # The following command tries to retrieve the hostonly interface # name (e.g. vboxnet0) associated with the given ip address. iface = None - lines = cliapp.ssh_runcmd(ssh_host, + lines = writeexts.ssh_runcmd(ssh_host, ['VBoxManage', 'list', 'hostonlyifs']).splitlines() for i, v in enumerate(lines): if host_ipaddr in v: @@ -195,12 +203,12 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension): break if iface is None: - iface = cliapp.ssh_runcmd(ssh_host, + iface = writeexts.ssh_runcmd(ssh_host, ['VBoxManage', 'hostonlyif', 'create']) # 'VBoxManage hostonlyif create' shows the name of the # created hostonly interface inside single quotes iface = iface[iface.find("'") + 1 : iface.rfind("'")] - cliapp.ssh_runcmd(ssh_host, + writeexts.ssh_runcmd(ssh_host, ['VBoxManage', 'hostonlyif', 'ipconfig', iface, '--ip', host_ipaddr, diff --git a/extensions/writeexts.py b/extensions/writeexts.py new file mode 100644 index 00000000..000c8270 --- /dev/null +++ b/extensions/writeexts.py @@ -0,0 +1,746 @@ +# Copyright (C) 2012-2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +import contextlib +import errno +import fcntl +import logging +import os +import re +import select +import shutil +import stat +import subprocess +import sys +import time +import tempfile + + +if sys.version_info >= (3, 3, 0): + import shlex + shell_quote = shlex.quote +else: + import pipes + shell_quote = pipes.quote + + +def get_data_path(relative_path): + extensions_dir = os.path.dirname(__file__) + return os.path.join(extensions_dir, relative_path) + + +def get_data(relative_path): + with open(get_data_path(relative_path)) as f: + return f.read() + + +def ssh_runcmd(host, args, **kwargs): + '''Run command over ssh''' + command = ['ssh', host, '--'] + [shell_quote(arg) for arg in args] + + feed_stdin = kwargs.get('feed_stdin') + stdin = kwargs.get('stdin', subprocess.PIPE) + stdout = kwargs.get('stdout', subprocess.PIPE) + stderr = kwargs.get('stderr', subprocess.PIPE) + + p = subprocess.Popen(command, stdin=stdin, stdout=stdout, stderr=stderr) + out, err = p.communicate(input=feed_stdin) + if p.returncode != 0: + raise ExtensionError('ssh command `%s` failed' % ' '.join(command)) + return out + + +def write_from_dict(filepath, d, validate=lambda x, y: True): + """Takes a dictionary and appends the contents to a file + + An optional validation callback can be passed to perform validation on + each value in the dictionary. + + e.g. + + def validation_callback(dictionary_key, dictionary_value): + if not dictionary_value.isdigit(): + raise Exception('value contains non-digit character(s)') + + Any callback supplied to this function should raise an exception + if validation fails. + + """ + # Sort items asciibetically + # the output of the deployment should not depend + # on the locale of the machine running the deployment + items = sorted(d.iteritems(), key=lambda (k, v): [ord(c) for c in v]) + + for (k, v) in items: + validate(k, v) + + with open(filepath, 'a') as f: + for (_, v) in items: + f.write('%s\n' % v) + + os.fchown(f.fileno(), 0, 0) + os.fchmod(f.fileno(), 0644) + + +def parse_environment_pairs(env, pairs): + '''Add key=value pairs to the environment dict. + + Given a dict and a list of strings of the form key=value, + set dict[key] = value, unless key is already set in the + environment, at which point raise an exception. + + This does not modify the passed in dict. + + Returns the extended dict. + + ''' + extra_env = dict(p.split('=', 1) for p in pairs) + conflicting = [k for k in extra_env if k in env] + if conflicting: + raise ExtensionError('Environment already set: %s' + % ', '.join(conflicting)) + + # Return a dict that is the union of the two + # This is not the most performant, since it creates + # 3 unnecessary lists, but I felt this was the most + # easy to read. Using itertools.chain may be more efficicent + return dict(env.items() + extra_env.items()) + + +class ExtensionError(Exception): + + def __init__(self, msg): + self.msg = msg + + def __str__(self): + return self.msg + + +class Fstab(object): + '''Small helper class for parsing and adding lines to /etc/fstab.''' + + # There is an existing Python helper library for editing of /etc/fstab. + # However it is unmaintained and has an incompatible license (GPL3). + # + # https://code.launchpad.net/~computer-janitor-hackers/python-fstab/trunk + + def __init__(self, filepath='/etc/fstab'): + if os.path.exists(filepath): + with open(filepath, 'r') as f: + self.text= f.read() + else: + self.text = '' + self.filepath = filepath + self.lines_added = 0 + + def get_mounts(self): + '''Return list of mount devices and targets in /etc/fstab. + + Return value is a dict of target -> device. + ''' + mounts = dict() + for line in self.text.splitlines(): + words = line.split() + if len(words) >= 2 and not words[0].startswith('#'): + device, target = words[0:2] + mounts[target] = device + return mounts + + def add_line(self, line): + '''Add a new entry to /etc/fstab. + + Lines are appended, and separated from any entries made by configure + extensions with a comment. + + ''' + if self.lines_added == 0: + if len(self.text) == 0 or self.text[-1] is not '\n': + self.text += '\n' + self.text += '# Morph default system layout\n' + self.lines_added += 1 + + self.text += line + '\n' + + def write(self): + '''Rewrite the fstab file to include all new entries.''' + with tempfile.NamedTemporaryFile(delete=False) as f: + f.write(self.text) + tmp = f.name + shutil.move(os.path.abspath(tmp), os.path.abspath(self.filepath)) + + +class Extension(object): + + '''A base class for deployment extensions. + + A subclass should subclass this class, and add a + ``process_args`` method. + + Note that it is not necessary to subclass this class for write + extensions. This class is here just to collect common code for + write extensions. + + ''' + + def setup_logging(self): + '''Direct all logging output to MORPH_LOG_FD, if set. + + This file descriptor is read by Morph and written into its own log + file. + + ''' + log_write_fd = int(os.environ.get('MORPH_LOG_FD', 0)) + + if log_write_fd == 0: + return + + formatter = logging.Formatter('%(message)s') + + handler = logging.StreamHandler(os.fdopen(log_write_fd, 'w')) + handler.setFormatter(formatter) + + logger = logging.getLogger() + logger.addHandler(handler) + logger.setLevel(logging.DEBUG) + + def process_args(self, args): + raise NotImplementedError() + + def run(self, args=None): + if args is None: + args = sys.argv[1:] + try: + self.setup_logging() + self.process_args(args) + except ExtensionError as e: + sys.stdout.write('ERROR: %s\n' % e) + sys.exit(1) + + def status(self, **kwargs): + '''Provide status output. + + The ``msg`` keyword argument is the actual message, + the rest are values for fields in the message as interpolated + by %. + + ''' + sys.stdout.write('%s\n' % (kwargs['msg'] % kwargs)) + sys.stdout.flush() + + +class WriteExtension(Extension): + + '''A base class for deployment write extensions. + + A subclass should subclass this class, and add a + ``process_args`` method. + + Note that it is not necessary to subclass this class for write + extensions. This class is here just to collect common code for + write extensions. + + ''' + + def check_for_btrfs_in_deployment_host_kernel(self): + with open('/proc/filesystems') as f: + text = f.read() + return '\tbtrfs\n' in text + + def require_btrfs_in_deployment_host_kernel(self): + if not self.check_for_btrfs_in_deployment_host_kernel(): + raise ExtensionError( + 'Error: Btrfs is required for this deployment, but was not ' + 'detected in the kernel of the machine that is running Morph.') + + def create_local_system(self, temp_root, raw_disk): + '''Create a raw system image locally.''' + + with self.created_disk_image(raw_disk): + self.format_btrfs(raw_disk) + self.create_system(temp_root, raw_disk) + + @contextlib.contextmanager + def created_disk_image(self, location): + size = self.get_disk_size() + if not size: + raise ExtensionError('DISK_SIZE is not defined') + self.create_raw_disk_image(location, size) + try: + yield + except BaseException: + os.unlink(location) + raise + + def format_btrfs(self, raw_disk): + try: + self.mkfs_btrfs(raw_disk) + except BaseException: + sys.stderr.write('Error creating disk image') + raise + + def create_system(self, temp_root, raw_disk): + with self.mount(raw_disk) as mp: + try: + self.create_btrfs_system_layout( + temp_root, mp, version_label='factory', + disk_uuid=self.get_uuid(raw_disk)) + except BaseException as e: + sys.stderr.write('Error creating Btrfs system layout') + raise + + def _parse_size(self, size): + '''Parse a size from a string. + + Return size in bytes. + + ''' + + m = re.match('^(\d+)([kmgKMG]?)$', size) + if not m: + return None + + factors = { + '': 1, + 'k': 1024, + 'm': 1024**2, + 'g': 1024**3, + } + factor = factors[m.group(2).lower()] + + return int(m.group(1)) * factor + + def _parse_size_from_environment(self, env_var, default): + '''Parse a size from an environment variable.''' + + size = os.environ.get(env_var, default) + if size is None: + return None + bytes = self._parse_size(size) + if bytes is None: + raise ExtensionError('Cannot parse %s value %s' + % (env_var, size)) + return bytes + + def get_disk_size(self): + '''Parse disk size from environment.''' + return self._parse_size_from_environment('DISK_SIZE', None) + + def get_ram_size(self): + '''Parse RAM size from environment.''' + return self._parse_size_from_environment('RAM_SIZE', '1G') + + def get_vcpu_count(self): + '''Parse the virtual cpu count from environment.''' + return self._parse_size_from_environment('VCPUS', '1') + + def create_raw_disk_image(self, filename, size): + '''Create a raw disk image.''' + + self.status(msg='Creating empty disk image') + with open(filename, 'wb') as f: + if size > 0: + f.seek(size-1) + f.write('\0') + + def mkfs_btrfs(self, location): + '''Create a btrfs filesystem on the disk.''' + + self.status(msg='Creating btrfs filesystem') + try: + # The following command disables some new filesystem features. We + # need to do this because at the time of writing, SYSLINUX has not + # been updated to understand these new features and will fail to + # boot if the kernel is on a filesystem where they are enabled. + subprocess.check_output( + ['mkfs.btrfs','-f', '-L', 'baserock', + '--features', '^extref', + '--features', '^skinny-metadata', + '--features', '^mixed-bg', + '--nodesize', '4096', + location], stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + if 'unrecognized option \'--features\'' in e.output: + # Old versions of mkfs.btrfs (including v0.20, present in many + # Baserock releases) don't support the --features option, but + # also don't enable the new features by default. So we can + # still create a bootable system in this situation. + logging.debug( + 'Assuming mkfs.btrfs failure was because the tool is too ' + 'old to have --features flag.') + subprocess.check_call(['mkfs.btrfs','-f', + '-L', 'baserock', location]) + else: + raise + + def get_uuid(self, location): + '''Get the UUID of a block device's file system.''' + # Requires util-linux blkid; busybox one ignores options and + # lies by exiting successfully. + return subprocess.check_output(['blkid', '-s', 'UUID', '-o', 'value', + location]).strip() + + @contextlib.contextmanager + def mount(self, location): + self.status(msg='Mounting filesystem') + try: + mount_point = tempfile.mkdtemp() + if self.is_device(location): + subprocess.check_call(['mount', location, mount_point]) + else: + subprocess.check_call(['mount', '-o', 'loop', + location, mount_point]) + except BaseException as e: + sys.stderr.write('Error mounting filesystem') + os.rmdir(mount_point) + raise + try: + yield mount_point + finally: + self.status(msg='Unmounting filesystem') + subprocess.check_call(['umount', mount_point]) + os.rmdir(mount_point) + + def create_btrfs_system_layout(self, temp_root, mountpoint, version_label, + disk_uuid): + '''Separate base OS versions from state using subvolumes. + + ''' + initramfs = self.find_initramfs(temp_root) + version_root = os.path.join(mountpoint, 'systems', version_label) + state_root = os.path.join(mountpoint, 'state') + + os.makedirs(version_root) + os.makedirs(state_root) + + self.create_orig(version_root, temp_root) + system_dir = os.path.join(version_root, 'orig') + + state_dirs = self.complete_fstab_for_btrfs_layout(system_dir, + disk_uuid) + + for state_dir in state_dirs: + self.create_state_subvolume(system_dir, mountpoint, state_dir) + + self.create_run(version_root) + + os.symlink( + version_label, os.path.join(mountpoint, 'systems', 'default')) + + if self.bootloader_config_is_wanted(): + self.install_kernel(version_root, temp_root) + if self.get_dtb_path() != '': + self.install_dtb(version_root, temp_root) + self.install_syslinux_menu(mountpoint, version_root) + if initramfs is not None: + self.install_initramfs(initramfs, version_root) + self.generate_bootloader_config(mountpoint, disk_uuid) + else: + self.generate_bootloader_config(mountpoint) + self.install_bootloader(mountpoint) + + def create_orig(self, version_root, temp_root): + '''Create the default "factory" system.''' + + orig = os.path.join(version_root, 'orig') + + self.status(msg='Creating orig subvolume') + subprocess.check_call(['btrfs', 'subvolume', 'create', orig]) + self.status(msg='Copying files to orig subvolume') + subprocess.check_call(['cp', '-a', temp_root + '/.', orig + '/.']) + + def create_run(self, version_root): + '''Create the 'run' snapshot.''' + + self.status(msg='Creating run subvolume') + orig = os.path.join(version_root, 'orig') + run = os.path.join(version_root, 'run') + subprocess.check_call( + ['btrfs', 'subvolume', 'snapshot', orig, run]) + + def create_state_subvolume(self, system_dir, mountpoint, state_subdir): + '''Create a shared state subvolume. + + We need to move any files added to the temporary rootfs by the + configure extensions to their correct home. For example, they might + have added keys in `/root/.ssh` which we now need to transfer to + `/state/root/.ssh`. + + ''' + self.status(msg='Creating %s subvolume' % state_subdir) + subvolume = os.path.join(mountpoint, 'state', state_subdir) + subprocess.check_call(['btrfs', 'subvolume', 'create', subvolume]) + os.chmod(subvolume, 0o755) + + existing_state_dir = os.path.join(system_dir, state_subdir) + files = [] + if os.path.exists(existing_state_dir): + files = os.listdir(existing_state_dir) + if len(files) > 0: + self.status(msg='Moving existing data to %s subvolume' % subvolume) + for filename in files: + filepath = os.path.join(existing_state_dir, filename) + subprocess.check_call(['mv', filepath, subvolume]) + + def complete_fstab_for_btrfs_layout(self, system_dir, rootfs_uuid=None): + '''Fill in /etc/fstab entries for the default Btrfs disk layout. + + In the future we should move this code out of the write extension and + in to a configure extension. To do that, though, we need some way of + informing the configure extension what layout should be used. Right now + a configure extension doesn't know if the system is going to end up as + a Btrfs disk image, a tarfile or something else and so it can't come + up with a sensible default fstab. + + Configuration extensions can already create any /etc/fstab that they + like. This function only fills in entries that are missing, so if for + example the user configured /home to be on a separate partition, that + decision will be honoured and /state/home will not be created. + + ''' + shared_state_dirs = {'home', 'root', 'opt', 'srv', 'var'} + + fstab = Fstab(os.path.join(system_dir, 'etc', 'fstab')) + existing_mounts = fstab.get_mounts() + + if '/' in existing_mounts: + root_device = existing_mounts['/'] + else: + root_device = (self.get_root_device() if rootfs_uuid is None else + 'UUID=%s' % rootfs_uuid) + fstab.add_line('%s / btrfs defaults,rw,noatime 0 1' % root_device) + + state_dirs_to_create = set() + for state_dir in shared_state_dirs: + if '/' + state_dir not in existing_mounts: + state_dirs_to_create.add(state_dir) + state_subvol = os.path.join('/state', state_dir) + fstab.add_line( + '%s /%s btrfs subvol=%s,defaults,rw,noatime 0 2' % + (root_device, state_dir, state_subvol)) + + fstab.write() + return state_dirs_to_create + + def find_initramfs(self, temp_root): + '''Check whether the rootfs has an initramfs. + + Uses the INITRAMFS_PATH option to locate it. + ''' + if 'INITRAMFS_PATH' in os.environ: + initramfs = os.path.join(temp_root, os.environ['INITRAMFS_PATH']) + if not os.path.exists(initramfs): + raise ExtensionError('INITRAMFS_PATH specified, ' + 'but file does not exist') + return initramfs + return None + + def install_initramfs(self, initramfs_path, version_root): + '''Install the initramfs outside of 'orig' or 'run' subvolumes. + + This is required because syslinux doesn't traverse subvolumes when + loading the kernel or initramfs. + ''' + self.status(msg='Installing initramfs') + initramfs_dest = os.path.join(version_root, 'initramfs') + subprocess.check_call(['cp', '-a', initramfs_path, initramfs_dest]) + + def install_kernel(self, version_root, temp_root): + '''Install the kernel outside of 'orig' or 'run' subvolumes''' + + self.status(msg='Installing kernel') + image_names = ['vmlinuz', 'zImage', 'uImage'] + kernel_dest = os.path.join(version_root, 'kernel') + for name in image_names: + try_path = os.path.join(temp_root, 'boot', name) + if os.path.exists(try_path): + subprocess.check_call(['cp', '-a', try_path, kernel_dest]) + break + + def install_dtb(self, version_root, temp_root): + '''Install the device tree outside of 'orig' or 'run' subvolumes''' + + self.status(msg='Installing devicetree') + device_tree_path = self.get_dtb_path() + dtb_dest = os.path.join(version_root, 'dtb') + try_path = os.path.join(temp_root, device_tree_path) + if os.path.exists(try_path): + subprocess.check_call(['cp', '-a', try_path, dtb_dest]) + else: + logging.error("Failed to find device tree %s", device_tree_path) + raise ExtensionError( + 'Failed to find device tree %s' % device_tree_path) + + def get_dtb_path(self): + return os.environ.get('DTB_PATH', '') + + def get_bootloader_install(self): + # Do we actually want to install the bootloader? + # Set this to "none" to prevent the install + return os.environ.get('BOOTLOADER_INSTALL', 'extlinux') + + def get_bootloader_config_format(self): + # The config format for the bootloader, + # if not set we default to extlinux for x86 + return os.environ.get('BOOTLOADER_CONFIG_FORMAT', 'extlinux') + + def get_extra_kernel_args(self): + return os.environ.get('KERNEL_ARGS', '') + + def get_root_device(self): + return os.environ.get('ROOT_DEVICE', '/dev/sda') + + def generate_bootloader_config(self, real_root, disk_uuid=None): + '''Install extlinux on the newly created disk image.''' + config_function_dict = { + 'extlinux': self.generate_extlinux_config, + } + + config_type = self.get_bootloader_config_format() + if config_type in config_function_dict: + config_function_dict[config_type](real_root, disk_uuid) + else: + raise ExtensionError( + 'Invalid BOOTLOADER_CONFIG_FORMAT %s' % config_type) + + def generate_extlinux_config(self, real_root, disk_uuid=None): + '''Install extlinux on the newly created disk image.''' + + self.status(msg='Creating extlinux.conf') + config = os.path.join(real_root, 'extlinux.conf') + + ''' Please also update the documentation in the following files + if you change these default kernel args: + - kvm.write.help + - rawdisk.write.help + - virtualbox-ssh.write.help ''' + kernel_args = ( + 'rw ' # ro ought to work, but we don't test that regularly + 'init=/sbin/init ' # default, but it doesn't hurt to be explicit + 'rootfstype=btrfs ' # required when using initramfs, also boots + # faster when specified without initramfs + 'rootflags=subvol=systems/default/run ') # boot runtime subvol + kernel_args += 'root=%s ' % (self.get_root_device() + if disk_uuid is None + else 'UUID=%s' % disk_uuid) + kernel_args += self.get_extra_kernel_args() + with open(config, 'w') as f: + f.write('default linux\n') + f.write('timeout 1\n') + f.write('label linux\n') + f.write('kernel /systems/default/kernel\n') + if disk_uuid is not None: + f.write('initrd /systems/default/initramfs\n') + if self.get_dtb_path() != '': + f.write('devicetree /systems/default/dtb\n') + f.write('append %s\n' % kernel_args) + + def install_bootloader(self, real_root): + install_function_dict = { + 'extlinux': self.install_bootloader_extlinux, + } + + install_type = self.get_bootloader_install() + if install_type in install_function_dict: + install_function_dict[install_type](real_root) + elif install_type != 'none': + raise ExtensionError( + 'Invalid BOOTLOADER_INSTALL %s' % install_type) + + def install_bootloader_extlinux(self, real_root): + self.status(msg='Installing extlinux') + subprocess.check_call(['extlinux', '--install', real_root]) + + # FIXME this hack seems to be necessary to let extlinux finish + subprocess.check_call(['sync']) + time.sleep(2) + + def install_syslinux_menu(self, real_root, version_root): + '''Make syslinux/extlinux menu binary available. + + The syslinux boot menu is compiled to a file named menu.c32. Extlinux + searches a few places for this file but it does not know to look inside + our subvolume, so we copy it to the filesystem root. + + If the file is not available, the bootloader will still work but will + not be able to show a menu. + + ''' + menu_file = os.path.join(version_root, 'orig', + 'usr', 'share', 'syslinux', 'menu.c32') + if os.path.isfile(menu_file): + self.status(msg='Copying menu.c32') + shutil.copy(menu_file, real_root) + + def parse_attach_disks(self): + '''Parse $ATTACH_DISKS into list of disks to attach.''' + + if 'ATTACH_DISKS' in os.environ: + s = os.environ['ATTACH_DISKS'] + return s.split(':') + else: + return [] + + def bootloader_config_is_wanted(self): + '''Does the user want to generate a bootloader config? + + The user may set $BOOTLOADER_CONFIG_FORMAT to the desired + format. 'extlinux' is the only allowed value, and is the default + value for x86-32 and x86-64. + + ''' + + def is_x86(arch): + return (arch == 'x86_64' or + (arch.startswith('i') and arch.endswith('86'))) + + value = os.environ.get('BOOTLOADER_CONFIG_FORMAT', '') + if value == '': + if not is_x86(os.uname()[-1]): + return False + + return True + + def get_environment_boolean(self, variable): + '''Parse a yes/no boolean passed through the environment.''' + + value = os.environ.get(variable, 'no').lower() + if value in ['no', '0', 'false']: + return False + elif value in ['yes', '1', 'true']: + return True + else: + raise ExtensionError('Unexpected value for %s: %s' % + (variable, value)) + + def check_ssh_connectivity(self, ssh_host): + try: + output = ssh_runcmd(ssh_host, ['echo', 'test']) + except ExtensionError as e: + logging.error("Error checking SSH connectivity: %s", str(e)) + raise ExtensionError( + 'Unable to SSH to %s: %s' % (ssh_host, e)) + + if output.strip() != 'test': + raise ExtensionError( + 'Unexpected output from remote machine: %s' % output.strip()) + + def is_device(self, location): + try: + st = os.stat(location) + return stat.S_ISBLK(st.st_mode) + except OSError as e: + if e.errno == errno.ENOENT: + return False + raise diff --git a/extensions/xfer-hole b/extensions/xfer-hole new file mode 100755 index 00000000..91f1be01 --- /dev/null +++ b/extensions/xfer-hole @@ -0,0 +1,137 @@ +#!/usr/bin/env python +# +# Send a sparse file more space-efficiently. +# See recv-hole for a description of the protocol. +# +# Note that xfer-hole requires a version of Linux with support for +# SEEK_DATA and SEEK_HOLE. +# +# +# Copyright (C) 2014-2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# =*= License: GPL-2 =*= + + + +import errno +import os +import sys + + +SEEK_DATA = 3 +SEEK_HOLE = 4 + + +filename = sys.argv[1] +fd = os.open(filename, os.O_RDONLY) +pos = 0 + + +DATA = 'data' +HOLE = 'hole' +EOF = 'eof' + + +def safe_lseek(fd, pos, whence): + try: + return os.lseek(fd, pos, whence) + except OSError as e: + if e.errno == errno.ENXIO: + return -1 + raise + + +def current_data_or_pos(fd, pos): + length = safe_lseek(fd, 0, os.SEEK_END) + next_data = safe_lseek(fd, pos, SEEK_DATA) + next_hole = safe_lseek(fd, pos, SEEK_HOLE) + + if pos == length: + return EOF, pos + elif pos == next_data: + return DATA, pos + elif pos == next_hole: + return HOLE, pos + else: + assert False, \ + ("Do not understand: pos=%d next_data=%d next_hole=%d" % + (pos, next_data, next_hole)) + + +def next_data_or_hole(fd, pos): + length = safe_lseek(fd, 0, os.SEEK_END) + next_data = safe_lseek(fd, pos, SEEK_DATA) + next_hole = safe_lseek(fd, pos, SEEK_HOLE) + + if pos == length: + return EOF, pos + elif pos == next_data: + # We are at data. + if next_hole == -1 or next_hole == length: + return EOF, length + else: + return HOLE, next_hole + elif pos == next_hole: + # We are at a hole. + if next_data == -1 or next_data == length: + return EOF, length + else: + return DATA, next_data + else: + assert False, \ + ("Do not understand: pos=%d next_data=%d next_hole=%d" % + (pos, next_data, next_hole)) + + +def find_data_and_holes(fd): + pos = safe_lseek(fd, 0, os.SEEK_CUR) + + kind, pos = current_data_or_pos(fd, pos) + while kind != EOF: + yield kind, pos + kind, pos = next_data_or_hole(fd, pos) + yield kind, pos + + +def make_xfer_instructions(fd): + prev_kind = None + prev_pos = None + for kind, pos in find_data_and_holes(fd): + if prev_kind == DATA: + yield (DATA, prev_pos, pos) + elif prev_kind == HOLE: + yield (HOLE, prev_pos, pos) + prev_kind = kind + prev_pos = pos + + +def copy_slice_from_file(to, fd, start, end): + safe_lseek(fd, start, os.SEEK_SET) + nbytes = end - start + max_at_a_time = 1024**2 + while nbytes > 0: + data = os.read(fd, min(nbytes, max_at_a_time)) + if not data: + break + to.write(data) + nbytes -= len(data) + + +for kind, start, end in make_xfer_instructions(fd): + if kind == HOLE: + sys.stdout.write('HOLE\n%d\n' % (end - start)) + elif kind == DATA: + sys.stdout.write('DATA\n%d\n' % (end - start)) + copy_slice_from_file(sys.stdout, fd, start, end) diff --git a/install-files/essential-files/etc/os-release b/install-files/essential-files/etc/os-release index b729c75f..c4c75b41 100644..120000 --- a/install-files/essential-files/etc/os-release +++ b/install-files/essential-files/etc/os-release @@ -1,5 +1 @@ -NAME="Baserock" -ID=baserock -HOME_URL="http://wiki.baserock.org" -SUPPORT_URL="http://wiki.baserock.org/mailinglist" -BUG_REPORT_URL="http://wiki.baserock.org/mailinglist" +../usr/lib/os-release
\ No newline at end of file diff --git a/install-files/essential-files/manifest b/install-files/essential-files/manifest index 2b77c237..93095d86 100644 --- a/install-files/essential-files/manifest +++ b/install-files/essential-files/manifest @@ -1,8 +1,11 @@ 0040755 0 0 /etc -overwrite 0100644 0 0 /etc/os-release +overwrite 0120000 0 0 /etc/os-release overwrite 0100644 0 0 /etc/profile overwrite 0100644 0 0 /etc/inputrc 0040755 0 0 /usr +0040755 0 0 /usr/bin +0100755 0 0 /usr/bin/brpaste 0040755 0 0 /usr/lib +0100644 0 0 /usr/lib/os-release 0040755 0 0 /usr/lib/tmpfiles.d 0100644 0 0 /usr/lib/tmpfiles.d/shutdownramfs.conf diff --git a/install-files/essential-files/usr/bin/brpaste b/install-files/essential-files/usr/bin/brpaste new file mode 100644 index 00000000..15f976b9 --- /dev/null +++ b/install-files/essential-files/usr/bin/brpaste @@ -0,0 +1,29 @@ +#!/usr/bin/python + +import urllib2 +import os +import json + +URL = 'http://paste.baserock.org/documents' + +def run(*args): + if args: + content = [open(x).read() for x in args] + extensions = [os.path.splitext(x)[1] for x in args] + else: + content = [sys.stdin.read()] + extensions = [None] + + for i, each in enumerate(content): + req = urllib2.Request(URL, each) + response = urllib2.urlopen(req) + the_page = response.read() + key = json.loads(the_page)['key'] + url = "http://paste.baserock.org/%s" % key + if extensions[i]: + url += extensions[i] + print url + +if __name__ == '__main__': + import sys + sys.exit(run(*sys.argv[1:])) diff --git a/install-files/essential-files/usr/lib/os-release b/install-files/essential-files/usr/lib/os-release new file mode 100644 index 00000000..b729c75f --- /dev/null +++ b/install-files/essential-files/usr/lib/os-release @@ -0,0 +1,5 @@ +NAME="Baserock" +ID=baserock +HOME_URL="http://wiki.baserock.org" +SUPPORT_URL="http://wiki.baserock.org/mailinglist" +BUG_REPORT_URL="http://wiki.baserock.org/mailinglist" diff --git a/install-files/openstack/etc/neutron/dnsmasq-neutron.conf b/install-files/openstack/etc/neutron/dnsmasq-neutron.conf new file mode 100644 index 00000000..d2659481 --- /dev/null +++ b/install-files/openstack/etc/neutron/dnsmasq-neutron.conf @@ -0,0 +1,2 @@ +# Provide a MTU (DHCP MTU option 26) +dhcp-option-force=26,1454 diff --git a/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh b/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh index 5a74dfcf..8c0b8da3 100755 --- a/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh +++ b/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh @@ -95,6 +95,28 @@ create_image_for_user(){ fi } +create_tempest_custom_flavor(){ + # Set the credential for admin + source "${admin_username}_env" + # In order to run tests in VMs we need a alternative flavor + # smaller than the small and bigger than the tiny flavor. + # So we create a flavor with the following features: + # name=m1.tempest_tests ID=6 Memory_MB=1024 Disk=1 Ephemeral=0 VCPUS=1 + echo "Creating custom small flavor for tempest tests and set it as alt_flavor in tempest.conf" + nova flavor-create m1.tempest_tests 6 1024 1 1 + sed -r -i "s/[#]?flavor_ref_alt =.*/flavor_ref_alt = 6/" tempest.conf +} + +prepare_scenario_tests(){ + local imgdir=/opt/openstack/images/ + mkdir -p "$imgdir" + wget -c http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz \ + -O "$imgdir"/cirros-0.3.1-x86_64-uec.tar.gz + cd "$imgdir" && tar xvf cirros-0.3.1-x86_64-uec.tar.gz +} + # Configure Openstack for running tempest tests. create_admin_user_env create_image_for_user "$admin_username" "$admin_test_image" +create_tempest_custom_flavor +prepare_scenario_tests diff --git a/install-files/openstack/etc/tempest/tempest.conf b/install-files/openstack/etc/tempest/tempest.conf index ad3d7fb2..f84eb1c0 100644 --- a/install-files/openstack/etc/tempest/tempest.conf +++ b/install-files/openstack/etc/tempest/tempest.conf @@ -389,7 +389,7 @@ live_migration = false # Does the test environment use block devices for live migration # (boolean value) -#block_migration_for_live_migration = false +block_migration_for_live_migration = false # Does the test environment block migration support cinder iSCSI # volumes. Note, libvirt doesn't support this, see @@ -648,7 +648,7 @@ build_interval = 1 api_v2 = true # Is the v1 image API enabled (boolean value) -#api_v1 = true +api_v1 = true [input-scenario] @@ -776,7 +776,7 @@ build_interval = 1 # List of dns servers which should be used for subnet creation (list # value) -#dns_servers = 8.8.8.8,8.8.4.4 +dns_servers = 8.8.8.8,8.8.4.4 # vnic_type to use when Launching instances with pre-configured ports. # Supported ports are: ['normal','direct','macvtap'] (string value) @@ -796,7 +796,7 @@ ipv6 = false # A list of enabled network extensions with a special entry all which # indicates every extension is enabled. Empty list indicates all # extensions are disabled (list value) -#api_extensions = all +api_extensions = router # Allow the execution of IPv6 subnet tests that use the extended IPv6 # attributes ipv6_ra_mode and ipv6_address_mode (boolean value) @@ -942,29 +942,29 @@ lock_path = /run/lock # # Directory containing image files (string value) -#img_dir = /opt/stack/new/devstack/files/images/cirros-0.3.1-x86_64-uec +img_dir = /opt/openstack/images/ # Image file name (string value) # Deprecated group/name - [DEFAULT]/qcow2_img_file -#img_file = cirros-0.3.1-x86_64-disk.img +img_file = cirros-0.3.1-x86_64-disk.img # Image disk format (string value) -#img_disk_format = qcow2 +img_disk_format = qcow2 # Image container format (string value) -#img_container_format = bare +img_container_format = bare # AMI image file name (string value) -#ami_img_file = cirros-0.3.1-x86_64-blank.img +ami_img_file = cirros-0.3.1-x86_64-blank.img # ARI image file name (string value) -#ari_img_file = cirros-0.3.1-x86_64-initrd +ari_img_file = cirros-0.3.1-x86_64-initrd # AKI image file name (string value) -#aki_img_file = cirros-0.3.1-x86_64-vmlinuz +aki_img_file = cirros-0.3.1-x86_64-vmlinuz # ssh username for the image file (string value) -#ssh_user = cirros +ssh_user = cirros # specifies how many resources to request at once. Used for large # operations testing. (integer value) diff --git a/install-files/openstack/manifest b/install-files/openstack/manifest index 8a5b47c1..3d9ea2dd 100644 --- a/install-files/openstack/manifest +++ b/install-files/openstack/manifest @@ -1,3 +1,5 @@ +0040755 0 0 /etc/neutron +0100644 0 0 /etc/neutron/dnsmasq-neutron.conf 0040755 0 0 /etc/horizon 0100644 0 0 /etc/horizon/apache-horizon.conf template 0100644 0 0 /etc/tempest/tempest.conf diff --git a/install-files/openstack/usr/share/openstack/ceilometer-db.yml b/install-files/openstack/usr/share/openstack/ceilometer-db.yml index 717c7d7d..46a929bc 100644 --- a/install-files/openstack/usr/share/openstack/ceilometer-db.yml +++ b/install-files/openstack/usr/share/openstack/ceilometer-db.yml @@ -22,7 +22,7 @@ name: ceilometer type: metering description: Openstack Metering Service - publicurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 + publicurl: http://{{ ansible_hostname }}:8777 internalurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 adminurl: http://{{ CONTROLLER_HOST_ADDRESS }}:8777 region: regionOne diff --git a/install-files/openstack/usr/share/openstack/cinder-db.yml b/install-files/openstack/usr/share/openstack/cinder-db.yml index 5f89da37..24e4980f 100644 --- a/install-files/openstack/usr/share/openstack/cinder-db.yml +++ b/install-files/openstack/usr/share/openstack/cinder-db.yml @@ -22,7 +22,7 @@ name: cinder type: volume description: Openstack Block Storage - publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s' + publicurl: 'http://{{ ansible_hostname }}:8776/v1/%(tenant_id)s' internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s' adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v1/%(tenant_id)s' region: regionOne @@ -33,7 +33,7 @@ name: cinderv2 type: volumev2 description: Openstack Block Storage - publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s' + publicurl: 'http://{{ ansible_hostname }}:8776/v2/%(tenant_id)s' internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s' adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8776/v2/%(tenant_id)s' region: regionOne diff --git a/install-files/openstack/usr/share/openstack/cinder/cinder.conf b/install-files/openstack/usr/share/openstack/cinder/cinder.conf index f690fbed..f3e4f11c 100644 --- a/install-files/openstack/usr/share/openstack/cinder/cinder.conf +++ b/install-files/openstack/usr/share/openstack/cinder/cinder.conf @@ -951,7 +951,7 @@ iscsi_ip_address={{ MANAGEMENT_INTERFACE_IP_ADDRESS }} # The port that the iSCSI daemon is listening on (integer # value) -#iscsi_port=3260 +iscsi_port=3260 # The maximum number of times to rescan targets to find volume # (integer value) @@ -973,11 +973,11 @@ volume_backend_name=LVM_iSCSI #enforce_multipath_for_image_xfer=false # Method used to wipe old volumes (string value) -#volume_clear=zero +volume_clear=zero # Size in MiB to wipe at start of old volumes. 0 => all # (integer value) -#volume_clear_size=0 +volume_clear_size=50 # The flag to pass to ionice to alter the i/o priority of the # process used to zero a volume after deletion, for example diff --git a/install-files/openstack/usr/share/openstack/glance.yml b/install-files/openstack/usr/share/openstack/glance.yml index 830f2bd3..4d642b6c 100644 --- a/install-files/openstack/usr/share/openstack/glance.yml +++ b/install-files/openstack/usr/share/openstack/glance.yml @@ -55,7 +55,7 @@ name: glance type: image description: Openstack Image Service - publicurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9292 + publicurl: http://{{ ansible_hostname }}:9292 internalurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9292 adminurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9292 region: regionOne diff --git a/install-files/openstack/usr/share/openstack/glance/glance-api.conf b/install-files/openstack/usr/share/openstack/glance/glance-api.conf index 9c2e6628..b6a4723d 100644 --- a/install-files/openstack/usr/share/openstack/glance/glance-api.conf +++ b/install-files/openstack/usr/share/openstack/glance/glance-api.conf @@ -12,7 +12,7 @@ #image_size_cap = 1099511627776 # Address to bind the API server -bind_host = {{ MANAGEMENT_INTERFACE_IP_ADDRESS }} +bind_host = 0.0.0.0 # Port the bind the API server to bind_port = 9292 diff --git a/install-files/openstack/usr/share/openstack/ironic.yml b/install-files/openstack/usr/share/openstack/ironic.yml index db0a8aa8..19906b04 100644 --- a/install-files/openstack/usr/share/openstack/ironic.yml +++ b/install-files/openstack/usr/share/openstack/ironic.yml @@ -49,7 +49,7 @@ name: ironic type: baremetal description: Openstack Ironic Service - publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:6385' + publicurl: 'http://{{ ansible_hostname }}:6385' internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:6385' adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:6385' region: 'regionOne' diff --git a/install-files/openstack/usr/share/openstack/keystone.yml b/install-files/openstack/usr/share/openstack/keystone.yml index 00bcac1a..2fae4e98 100644 --- a/install-files/openstack/usr/share/openstack/keystone.yml +++ b/install-files/openstack/usr/share/openstack/keystone.yml @@ -134,9 +134,9 @@ name: keystone type: identity description: Keystone Identity Service - publicurl: http://{{ CONTROLLER_HOST_ADDRESS }}:5000/v2.0 + publicurl: http://{{ ansible_hostname }}:5000/v2.0 internalurl: http://{{ CONTROLLER_HOST_ADDRESS }}:5000/v2.0 - adminurl: http://{{ CONTROLLER_HOST_ADDRESS }}:35357/v2.0 + adminurl: http://{{ ansible_hostname }}:35357/v2.0 region: regionOne token: "{{ KEYSTONE_TEMPORARY_ADMIN_TOKEN }}" endpoint: http://{{ CONTROLLER_HOST_ADDRESS }}:35357/v2.0 diff --git a/install-files/openstack/usr/share/openstack/neutron-db.yml b/install-files/openstack/usr/share/openstack/neutron-db.yml index 9cc77b5a..fee53315 100644 --- a/install-files/openstack/usr/share/openstack/neutron-db.yml +++ b/install-files/openstack/usr/share/openstack/neutron-db.yml @@ -21,7 +21,7 @@ name: neutron type: network description: Openstack Compute Networking - publicurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9696 + publicurl: http://{{ ansible_hostname }}:9696 internalurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9696 adminurl: http://{{ CONTROLLER_HOST_ADDRESS }}:9696 region: regionOne diff --git a/install-files/openstack/usr/share/openstack/neutron/dhcp_agent.ini b/install-files/openstack/usr/share/openstack/neutron/dhcp_agent.ini index e0963e57..1ab4c806 100644 --- a/install-files/openstack/usr/share/openstack/neutron/dhcp_agent.ini +++ b/install-files/openstack/usr/share/openstack/neutron/dhcp_agent.ini @@ -62,7 +62,7 @@ enable_isolated_metadata = True # dhcp_domain = openstacklocal # Override the default dnsmasq settings with this file -# dnsmasq_config_file = +dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf # Comma-separated list of DNS servers which will be used by dnsmasq # as forwarders. diff --git a/install-files/openstack/usr/share/openstack/nova-db.yml b/install-files/openstack/usr/share/openstack/nova-db.yml index 800d6c4b..0e933ba8 100644 --- a/install-files/openstack/usr/share/openstack/nova-db.yml +++ b/install-files/openstack/usr/share/openstack/nova-db.yml @@ -22,7 +22,7 @@ name: nova type: compute description: Openstack Compute Service - publicurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s' + publicurl: 'http://{{ ansible_hostname }}:8774/v2/%(tenant_id)s' internalurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s' adminurl: 'http://{{ CONTROLLER_HOST_ADDRESS }}:8774/v2/%(tenant_id)s' region: 'regionOne' diff --git a/install-files/openstack/usr/share/openstack/nova/nova.conf b/install-files/openstack/usr/share/openstack/nova/nova.conf index 9fc10493..f2db93fc 100644 --- a/install-files/openstack/usr/share/openstack/nova/nova.conf +++ b/install-files/openstack/usr/share/openstack/nova/nova.conf @@ -1602,7 +1602,7 @@ scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFi # Flag to decide whether to use # baremetal_scheduler_default_filters or not. (boolean value) -#scheduler_use_baremetal_filters=false +scheduler_use_baremetal_filters={{ SCHEDULER_USE_BAREMETAL_FILTERS }} # diff --git a/migrations/000-version-info.py b/migrations/000-version-info.py new file mode 100755 index 00000000..2bff51f4 --- /dev/null +++ b/migrations/000-version-info.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Migration to Baserock Definitions format version 0. + +The format of version 0 is not formally specified, except by the Morph +codebase. It marks the starting point of the work to formalise the Baserock +Definitions format. + +''' + + +import os +import sys + +import migrations + + +TO_VERSION = 0 + + +try: + if os.path.exists('./VERSION'): + # This will raise an exception if the VERSION file is invalid, which + # might be useful. + migrations.check_definitions_version(TO_VERSION) + + sys.stdout.write("Nothing to do.\n") + sys.exit(0) + else: + sys.stdout.write("No VERSION file found, creating one.\n") + migrations.set_definitions_version(TO_VERSION) + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/001-empty-build-depends.py b/migrations/001-empty-build-depends.py new file mode 100755 index 00000000..5d4296d6 --- /dev/null +++ b/migrations/001-empty-build-depends.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Migration to Baserock Definitions format version 1. + +In version 1, the 'build-depends' parameter was made optional. It was +previously mandatory to specify 'build-depends' for a chunk, even if it was an +empty list. + +''' + + +import sys +import warnings + +import migrations + + +TO_VERSION = 1 + + +def check_empty_build_depends(contents, filename): + assert contents['kind'] == 'stratum' + + valid = True + for chunk_ref in contents.get('chunks', []): + if 'build-depends' not in chunk_ref: + chunk_ref_name = chunk_ref.get('name', chunk_ref.get('morph')) + warnings.warn( + "%s:%s has no build-depends field, which " + "is invalid in definitions version 0." % + (contents['name'], chunk_ref_name)) + valid = False + + return valid + + +def remove_empty_build_depends(contents, filename): + assert contents['kind'] == 'stratum' + + changed = False + for chunk_ref in contents.get('chunks', []): + if 'build-depends' in chunk_ref: + if len(chunk_ref['build-depends']) == 0: + del chunk_ref['build-depends'] + changed = True + + return changed + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + success = migrations.process_definitions( + path='.', kinds=['stratum'], + validate_cb=check_empty_build_depends, + modify_cb=remove_empty_build_depends) + if success: + migrations.set_definitions_version(TO_VERSION) + sys.stdout.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stderr.write("Migration failed due to warnings.\n") + sys.exit(1) + else: + sys.stdout.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/002-missing-chunk-morphs.py b/migrations/002-missing-chunk-morphs.py new file mode 100755 index 00000000..2c93804e --- /dev/null +++ b/migrations/002-missing-chunk-morphs.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Migration to Baserock Definitions format version 2. + +In version 2, the processing of the 'morph:' field within stratum .morph files +became more strict. This migration checks whether definitions are valid +according to version 2 of the format. + +''' + + +import os +import sys +import warnings + +import migrations + + +TO_VERSION = 2 + + +def check_missing_chunk_morphs(contents, filename): + assert contents['kind'] == 'stratum' + + valid = True + + for chunk_ref in contents.get('chunks', []): + if 'morph' in chunk_ref: + chunk_path = os.path.join('.', chunk_ref['morph']) + if not os.path.exists(chunk_path): + # There's no way we can really fix this, so + # just warn and say the migration failed. + warnings.warn( + "%s points to non-existant file %s" % + (contents['name'], chunk_ref['morph'])) + valid = False + + return valid + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + safe_to_migrate = migrations.process_definitions( + kinds=['stratum'], validate_cb=check_missing_chunk_morphs) + + if not safe_to_migrate: + sys.stderr.write( + "Migration failed due to one or more warnings.\n") + sys.exit(1) + else: + migrations.set_definitions_version(TO_VERSION) + sys.stdout.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stdout.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/003-arch-armv5.py b/migrations/003-arch-armv5.py new file mode 100755 index 00000000..58eb79de --- /dev/null +++ b/migrations/003-arch-armv5.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Migration to Baserock Definitions format version 3. + +In version 3, there were two additions: + + - the 'armv5' architecture + - the install-essential-files.configure configuration extension + +This migration checks that neither of these are in use in the input (version 2) +definitions. Which isn't particularly useful. + +''' + + +import sys +import warnings + +import migrations + + +TO_VERSION = 3 + + +def check_arch(contents, filename): + assert contents['kind'] == 'system' + + valid = True + + if contents['arch'] == 'armv5': + warnings.warn( + "%s uses armv5 architecture that is not understood until version " + "3." % filename) + valid = False + + return valid + + +def check_configuration_extensions(contents, filename): + assert contents['kind'] == 'system' + + valid = True + + for extension in contents.get('configuration-extensions', []): + if extension == 'install-essential-files': + warnings.warn( + "%s uses install-essential-files.configure extension, which " + "was not present in morph.git until commit 423dc974a61f1c0 " + "(tag baserock-definitions-v3)." % filename) + valid = False + + return valid + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + safe_to_migrate = migrations.process_definitions( + kinds=['system'], validate_cb=check_arch) + safe_to_migrate = migrations.process_definitions( + kinds=['system'], validate_cb=check_configuration_extensions) + + if not safe_to_migrate: + sys.stderr.write( + "Migration failed due to one or more warnings.\n") + sys.exit(1) + else: + migrations.set_definitions_version(TO_VERSION) + sys.stdout.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stdout.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/004-install-files-overwrite-symlink.py b/migrations/004-install-files-overwrite-symlink.py new file mode 100755 index 00000000..6853dcb5 --- /dev/null +++ b/migrations/004-install-files-overwrite-symlink.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + +'''Migration to Baserock Definitions format version 4. + +This change to the format was made to work around a bug in a deployment +extension present in morph.git. + +Automated migration is not really possible for this change, and unless you +are experiencing the install-files.configure extension crashing, you can ignore +it completely. + +We have now moved all .configure and .write extensions into the definitions.git +repository. Changes like this no longer require a marking a new version of the +Baserock definitions format in order to prevent build tools crashing. + +Morph commit c373f5a403b0ec introduces version 4 of the definitions format. In +older versions of Morph the install-files.configure extension would crash if it +tried to overwrite a symlink. This bug is fixed in the version of Morph that +can build definitions version 4. + +If you need to overwrite a symlink at deploytime using install-files.configure, +please use VERSION to 4 or above in your definitions.git repo so older versions +of Morph gracefully refuse to deploy, instead of crashing. + +''' + + +import sys + +import migrations + + +TO_VERSION = 4 + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + migrations.set_definitions_version(TO_VERSION) + sys.stdout.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stdout.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/005-strip-commands.py b/migrations/005-strip-commands.py new file mode 100755 index 00000000..da3de940 --- /dev/null +++ b/migrations/005-strip-commands.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Migration to Baserock Definitions format version 5. + +Version 5 of the definitions format adds a 'strip-commands' field that can +be set in chunk definitions. + +Version 5 also allows deployment extensions to live in definitions.git instead +of morph.git. This greatly reduces the interface surface of the Baserock +definitions format specification, because we no longer have to mark a new +version of the definitions format each time an extension in morph.git is added, +removed, or changes its API in any way. + +In commit 6f4929946 of git://git.baserock.org/baserock/baserock/definitions.git +the deployment extensions were moved into an extensions/ subdirectory, and the +system and cluster .morph files that referred to them were all updated to +prepend 'extension/' to the filenames. This migration doesn't (re)do that +change. + +''' + + +import sys +import warnings + +import migrations + + +TO_VERSION = 5 + + +def check_strip_commands(contents, filename): + assert contents['kind'] == 'chunk' + + valid = True + + if 'strip-commands' in contents: + warnings.warn( + "%s has strip-commands, which are not valid until version 5" % + filename) + valid = False + + return valid + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + safe_to_migrate = migrations.process_definitions( + kinds=['chunk'], validate_cb=check_strip_commands) + + if not safe_to_migrate: + sys.stderr.write( + "Migration failed due to one or more warnings.\n") + sys.exit(1) + else: + migrations.set_definitions_version(TO_VERSION) + sys.stdout.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stdout.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/006-specify-build-system.py b/migrations/006-specify-build-system.py new file mode 100755 index 00000000..f033b790 --- /dev/null +++ b/migrations/006-specify-build-system.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +# THIS MIGRATION REQUIRES NETWORK ACCESS TO A BASEROCK GIT CACHE SERVER! If +# you do not have your own Trove, or don't know what a Trove is, it should +# work as-is, provided you have internet access that allows access to +# http://git.baserock.org:8080/. +# +# If you do have your own Trove, change the value of TROVE_HOST below to +# point to it. +# +# This migration uses the same autodetection mechanism that Morph and YBD use +# at build time, in order to fill in the 'build-system' field in strata where +# it is now needed. + + +'''Migration to Baserock Definitions format version 6. + +In definitions version 6, build system autodetection no longer happens. This +means that any chunk that wants to use one of the predefined build systems +(those built into Morph) must say so explicitly, using the 'build-system' +field. + +The build-system field for a chunk can now be specified within a stratum that +contains it. Previously you needed to add a .morph file for a chunk in order to +specify its build-system, but we want to avoid needing a .morph file for +components that follow standard patterns. + +Previously, if build-system wasn't given, Morph would scan the contents of the +chunk's Git repo and try to autodetect which build system was used. This could +be slow, could fail in confusing ways, and meant that to fully parse +definitions you needed access to some or all of the repos they referenced. + +The chosen build-system affects which predefined command sequences are set for +a chunk. It is valid to omit the field if a chunk has its own build commands +defined in a .morph file. When listing the chunks included in a stratum, either +'morph' or 'build-system' must be specified, but not both (to avoid the +possibility of conflicting values). + +''' + + +import requests +import yaml + +import logging +import os +import sys + +import migrations + + +TROVE_HOST = 'git.baserock.org' + +REPO_ALIASES = { + 'baserock:': 'git://%s/baserock/' % TROVE_HOST, + 'freedesktop:': 'git://anongit.freedesktop.org/', + 'github:': 'git://github.com/', + 'gnome:': 'git://git.gnome.org/', + 'upstream:': 'git://%s/delta/' % TROVE_HOST, +} + +GIT_CACHE_SERVER_URL = 'http://%s:8080/' % TROVE_HOST + + +TO_VERSION = 6 + + +# From ybd.git file repos.py at commit eb3bf397ba729387f0d4145a8df8d3c1f9eb707f + +def get_repo_url(repo): + for alias, url in REPO_ALIASES.items(): + repo = repo.replace(alias, url) + if repo.endswith('.git'): + repo = repo[:-4] + return repo + + +# Based on morph.git file buildsystem.py at commit a7748f9cdaaf4112c30d7c1. +# +# I have copied and pasted this code here, as it should not be needed anywhere +# once everyone has migrated to definitions version 6. + +class BuildSystem(object): + def used_by_project(self, file_list): + '''Does a project use this build system? + + ``exists`` is a function that returns a boolean telling if a + filename, relative to the project source directory, exists or not. + + ''' + raise NotImplementedError() # pragma: no cover + + +class ManualBuildSystem(BuildSystem): + + '''A manual build system where the morphology must specify all commands.''' + + name = 'manual' + + def used_by_project(self, file_list): + return False + + +class DummyBuildSystem(BuildSystem): + + '''A dummy build system, useful for debugging morphologies.''' + + name = 'dummy' + + def used_by_project(self, file_list): + return False + + +class AutotoolsBuildSystem(BuildSystem): + + '''The automake/autoconf/libtool holy trinity.''' + + name = 'autotools' + + def used_by_project(self, file_list): + indicators = [ + 'autogen', + 'autogen.sh', + 'configure', + 'configure.ac', + 'configure.in', + 'configure.in.in', + ] + + return any(x in file_list for x in indicators) + + +class PythonDistutilsBuildSystem(BuildSystem): + + '''The Python distutils build systems.''' + + name = 'python-distutils' + + def used_by_project(self, file_list): + indicators = [ + 'setup.py', + ] + + return any(x in file_list for x in indicators) + + +class CPANBuildSystem(BuildSystem): + + '''The Perl cpan build system.''' + + name = 'cpan' + + def used_by_project(self, file_list): + indicators = [ + 'Makefile.PL', + ] + + return any(x in file_list for x in indicators) + + +class CMakeBuildSystem(BuildSystem): + + '''The cmake build system.''' + + name = 'cmake' + + def used_by_project(self, file_list): + indicators = [ + 'CMakeLists.txt', + ] + + return any(x in file_list for x in indicators) + + +class QMakeBuildSystem(BuildSystem): + + '''The Qt build system.''' + + name = 'qmake' + + def used_by_project(self, file_list): + indicator = '.pro' + + for x in file_list: + if x.endswith(indicator): + return True + + return False + + +build_systems = [ + ManualBuildSystem(), + AutotoolsBuildSystem(), + PythonDistutilsBuildSystem(), + CPANBuildSystem(), + CMakeBuildSystem(), + QMakeBuildSystem(), + DummyBuildSystem(), +] + + +def detect_build_system(file_list): + '''Automatically detect the build system, if possible. + + If the build system cannot be detected automatically, return None. + For ``exists`` see the ``BuildSystem.exists`` method. + + ''' + for bs in build_systems: + if bs.used_by_project(file_list): + return bs + return None + + +## End of code based on morph.git file buildsystem.py. + +def get_toplevel_file_list_from_repo(url, ref): + '''Try to list the set of files in the root directory of the repo at 'url'. + + ''' + try: + response = requests.get( + GIT_CACHE_SERVER_URL + '1.0/trees', + params={'repo': url, 'ref': ref}, + headers={'Accept': 'application/json'}, + timeout=9) + logging.debug("Got response: %s" % response) + toplevel_tree = response.json()['tree'] + toplevel_filenames = toplevel_tree.keys() + except requests.exceptions.ConnectionError as e: + raise RuntimeError("Unable to connect to cache server %s: %s" % + (GIT_CACHE_SERVER_URL, e.message)) + return toplevel_filenames + + +def validate_chunk_refs(contents, filename): + assert contents['kind'] == 'stratum' + + valid = True + for chunk_ref in contents.get('chunks', []): + if chunk_ref.get('morph') is None: + # No chunk .morph file -- this stratum was relying on build-system + # autodetection here. + + if 'repo' not in chunk_ref: + warnings.warn("%s: Chunk %s doesn't specify a source repo." % + (filename, chunk_ref.get('name'))) + valid = False + + if 'ref' not in chunk_ref: + warnings.warn("%s: Chunk %s doesn't specify a source ref." % + (filename, chunk_ref.get('name'))) + valid = False + return valid + + +def move_dict_entry_last(dict_object, key, error_if_missing=False): + '''Move an entry in a ordered dict to the end.''' + + # This is a hack, I couldn't find a method on the 'CommentedMap' type dict + # that we receive from ruamel.yaml that would allow doing this neatly. + if key in dict_object: + value = dict_object[key] + del dict_object[key] + dict_object[key] = value + else: + if error_if_missing: + raise KeyError(key) + + +def ensure_buildsystem_defined_where_needed(contents, filename): + assert contents['kind'] == 'stratum' + + changed = False + for chunk_ref in contents.get('chunks', []): + if chunk_ref.get('morph') is None: + # No chunk .morph file -- this stratum was relying on build-system + # autodetection here. + + chunk_git_url = get_repo_url(chunk_ref['repo']) + chunk_git_ref = chunk_ref['ref'] + toplevel_file_list = get_toplevel_file_list_from_repo( + chunk_git_url, chunk_git_ref) + + logging.debug( + '%s: got file list %s', chunk_git_url, toplevel_file_list) + build_system = detect_build_system(toplevel_file_list) + + chunk_ref['build-system'] = build_system.name + move_dict_entry_last(chunk_ref, 'build-depends') + + changed = True + return changed + + +try: + if migrations.check_definitions_version(TO_VERSION - 1): + success = migrations.process_definitions( + kinds=['stratum'], + validate_cb=validate_chunk_refs, + modify_cb=ensure_buildsystem_defined_where_needed) + if not success: + sys.stderr.write( + "Migration failed due to one or more warnings.\n") + sys.exit(1) + else: + migrations.set_definitions_version(TO_VERSION) + sys.stderr.write("Migration completed successfully.\n") + sys.exit(0) + else: + sys.stderr.write("Nothing to do.\n") + sys.exit(0) +except RuntimeError as e: + sys.stderr.write("Error: %s\n" % e.message) + sys.exit(1) diff --git a/migrations/GUIDELINES b/migrations/GUIDELINES new file mode 100644 index 00000000..3694e2c9 --- /dev/null +++ b/migrations/GUIDELINES @@ -0,0 +1,35 @@ +Guidelines for writing migrations +--------------------------------- + +All changes to the definitions format must have a migration, but it is valid +for the migration to do nothing except update the version number (see +004-install-files-overwrite-symlink.py for an example of that). + +This small set of rules exists to ensure that the migrations are consistent and +easy to understand. If you are writing a migration and these rules don't make +any sense, we should probably change them. Please sign up to the +baserock-dev@baserock.org mailing list to suggest the change. + +- Write migrations in Python. They must be valid Python 3. For now, since + only Python 2 is available in Baserock 'build' and 'devel' reference systems + up to the 15.25 release of Baserock, they must also be valid Python 2. + +- Don't use any external libraries. + +- Follow the existing file naming pattern, and the existing code convention. + +- Keep the migration code as simple as possible. + +- Avoid crashing on malformed input data, where practical. For example, use + contents.get('field') instead of contents['field'] to avoid crashing when + 'field' is not present. The idea of this is to avoid a "cascade of errors" + problem when running the migrations on bad inputs. It is confusing when + migrations break on problems that are unrelated to the actual area where + they operate, even if they are theoretically "within their rights" to do so. + +- Migrate the definitions in line with current best practices. For example, + migrations/001-empty-build-depends.py doesn't need to remove empty + build-depends fields: they are still valid in version 1 of the format. But + best practice is now to remove them. Users who don't agree with this practice + can choose to not run that migration, which can be done with `chmod -x + migrations/xxx.py`. diff --git a/migrations/indent b/migrations/indent new file mode 100755 index 00000000..8d6f034f --- /dev/null +++ b/migrations/indent @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Automatically reformat a set of Baserock definition files. + +This tool expects to be able to use ruamel.yaml to load and write YAML. +It will totally ruin things if used with PyYAML. + +It makes sense to run this script on your definitions, and check through +and commit the result, before running any of the automated migrations. This +way, you can be sure that the migrations will only change things that they need +to in the .morph files. + +''' + + +import migrations + + +def force_rewrite(contents, filename): + return True + +migrations.process_definitions(path='.', modify_cb=force_rewrite) diff --git a/migrations/migrations.py b/migrations/migrations.py new file mode 100644 index 00000000..22ed1328 --- /dev/null +++ b/migrations/migrations.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Tools for migrating Baserock definitions from one format version to another. + +''' + + +# ruamel.yaml is a fork of PyYAML which allows rewriting YAML files without +# destroying all of the comments, ordering and formatting. The more +# widely-used PyYAML library will produce output totally different to the +# input file in most cases. +# +# See: <https://bitbucket.org/ruamel/yaml> +import ruamel.yaml as yaml + +import logging +import os +import warnings + + +# Uncomment this to cause all log messages to be written to stdout. By +# default they are hidden, but if you are debugging something this might help! +# +# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) + + +def pretty_warnings(message, category, filename, lineno, + file=None, line=None): + '''Format warning messages from warnings.warn().''' + return 'WARNING: %s\n' % (message) + +# Override the default warning formatter (which is ugly), and add a filter to +# ensure duplicate warnings only get displayed once. +warnings.simplefilter("once", append=True) +warnings.formatwarning = pretty_warnings + + + +def parse_yaml_with_roundtrip_info(text): + return yaml.load(text, yaml.RoundTripLoader) + +def write_yaml_with_roundtrip_info(contents, stream, **kwargs): + yaml.dump(contents, stream, Dumper=yaml.RoundTripDumper, **kwargs) + + + +class VersionFileError(RuntimeError): + '''Represents errors in the version marker file (./VERSION).''' + pass + + +class MigrationOutOfOrderError(RuntimeError): + '''Raised if a migration is run on too old a version of definitions. + + It's not an error to run a migration on a version that is already migrated. + + ''' + pass + + +def check_definitions_version(from_version, version_file='./VERSION', + to_version=None): + '''Check if migration between 'from_version' and 'to_version' is needed. + + Both 'from_version' and 'to_version' should be whole numbers. The + 'to_version' defaults to from_version + 1. + + This function reads the version marker file specified by 'version_file'. + Returns True if the version is between 'from_version' and 'to_version', + indicating that migration needs to be done. Returns False if the version is + already at or beyond 'to_version'. Raises MigrationOutOfOrderError if the + version is below 'from_version'. + + If 'version_file' is missing or invalid, it raises VersionFileError. The + version file is expected to follow the following format: + + version: 1 + + ''' + to_version = to_version or (from_version + 1) + need_to_migrate = False + + if os.path.exists(version_file): + logging.info("Found version information file: %s" % version_file) + + with open(version_file) as f: + version_text = f.read() + + if len(version_text) == 0: + raise VersionFileError( + "File %s exists but is empty." % version_file) + + try: + version_info = yaml.safe_load(version_text) + current_version = version_info['version'] + + if current_version >= to_version: + logging.info( + "Already at version %i." % current_version) + elif current_version < from_version: + raise MigrationOutOfOrderError( + "This tool expects to migrate from version %i to version " + "%i of the Baserock Definitions syntax. These definitions " + "claim to be version %i." % ( + from_version, to_version, current_version)) + else: + logging.info("Need to migrate from %i to %i.", + current_version, to_version) + need_to_migrate = True + except (KeyError, TypeError, ValueError) as e: + logging.exception(e) + raise VersionFileError( + "Invalid version info: '%s'" % version_text) + else: + raise VersionFileError( + "No file %s was found. Please run the migration scripts in order," + "starting from 000-version-info.py." % version_file) + + return need_to_migrate + + +def set_definitions_version(new_version, version_file='./VERSION'): + '''Update the version information stored in 'version_file'. + + The new version must be a whole number. If 'version_file' doesn't exist, + it will be created. + + ''' + version_info = {'version': new_version} + with open(version_file, 'w') as f: + # If 'default_flow_style' is True (the default) then the output here + # will look like "{version: 0}" instead of "version: 0". + yaml.safe_dump(version_info, f, default_flow_style=False) + + +def walk_definition_files(path='.', extensions=['.morph']): + '''Recursively yield all files under 'path' with the given extension(s). + + This is safe to run in the top level of a Git repository, as anything under + '.git' will be ignored. + + ''' + for dirname, dirnames, filenames in os.walk('.'): + filenames.sort() + dirnames.sort() + if '.git' in dirnames: + dirnames.remove('.git') + for filename in filenames: + for extension in extensions: + if filename.endswith(extension): + yield os.path.join(dirname, filename) + + +ALL_KINDS = ['cluster', 'system', 'stratum', 'chunk'] + + +def process_definitions(path='.', kinds=ALL_KINDS, validate_cb=None, + modify_cb=None): + '''Run callbacks for all Baserock definitions found in 'path'. + + If 'validate_cb' is set, it will be called for each definition and can + return True or False to indicate whether that definition is valid according + a new version of the format. The process_definitions() function will return + True if all definitions were valid according to validate_cb(), and False + otherwise. + + If 'modify_cb' is set, it will be called for each definition and can + modify the 'content' dict. It should return True if the dict was modified, + and in this case the definition file will be overwritten with the new + contents. The 'ruamel.yaml' library is used if it is available, which will + try to preserve comments, ordering and some formatting in the YAML + definition files. + + If 'validate_cb' is set and returns False for a definition, 'modify_cb' + will not be called. + + Both callbacks are passed two parameters: a dict containing the contents of + the definition file, and its filename. The filename is passed so you can + use it when reporting errors. + + The 'kinds' setting can be used to ignore some definitions according to the + 'kind' field. + + ''' + all_valid = True + + for filename in walk_definition_files(path=path): + with open(filename) as f: + text = f.read() + + if modify_cb is None: + contents = yaml.load(text) + else: + contents = parse_yaml_with_roundtrip_info(text) + + if 'kind' in contents: + if contents['kind'] in kinds: + valid = True + changed = False + + if validate_cb is not None: + valid = validate_cb(contents, filename) + all_valid &= valid + + if valid and modify_cb is not None: + changed = modify_cb(contents, filename) + + if changed: + with open(filename, 'w') as f: + write_yaml_with_roundtrip_info(contents, f, width=80) + else: + warnings.warn("%s is invalid: no 'kind' field set." % filename) + + return all_valid diff --git a/migrations/run-all b/migrations/run-all new file mode 100755 index 00000000..5a817ee5 --- /dev/null +++ b/migrations/run-all @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + + +'''Run a set of migration scripts. + +This script does exactly what `PYTHONPATH=. run-parts --exit-on-error` would +do. I avoided using 'run-parts' purely because the implementation in Fedora 22 +doesn't have an '--exit-on-error' option. The Busybox and Debian +implementations do have that option. + +Please fix run-parts in https://git.fedorahosted.org/cgit/crontabs.git/tree/ +so we can simplify this script :-) + +''' + + +import os +import subprocess +import sys + + +if len(sys.argv) == 2: + migration_dir = sys.argv[1] +elif len(sys.argv) == 1: + migration_dir = os.path.dirname(__file__) +else: + sys.stderr.write("Usage: %s [MIGRATION_DIR]\n" % sys.argv[0]) + sys.exit(1) + + +def is_executable(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + +env = os.environ +if 'PYTHONPATH' in env: + env['PYTHONPATH'] = env['PYTHONPATH'] + ':' + migration_dir +else: + env['PYTHONPATH'] = migration_dir + +try: + migrations_found = 0 + for fname in sorted(os.listdir(migration_dir)): + migration_fpath = os.path.join(migration_dir, fname) + if is_executable(migration_fpath): + if not os.path.samefile(migration_fpath, __file__) and \ + fname != 'indent': + migrations_found += 1 + sys.stdout.write(migration_fpath + ":\n") + subprocess.check_call( + migration_fpath, env=env) + + if migrations_found == 0: + sys.stderr.write("No migration files found in '%s'\n" % migration_dir) + sys.exit(1) + else: + sys.exit(0) + +except (subprocess.CalledProcessError, RuntimeError) as e: + sys.stderr.write(str(e) + '\n') + sys.exit(1) diff --git a/strata/apache-httpd-server.morph b/strata/apache-httpd-server.morph index 7a403535..5aae0c65 100644 --- a/strata/apache-httpd-server.morph +++ b/strata/apache-httpd-server.morph @@ -11,7 +11,7 @@ chunks: repo: upstream:apache/apr ref: 3c818c6d7351f0130282d212a69035642f5fecad unpetrify-ref: trunk -- name: httpd +- name: httpd-server morph: strata/apache-httpd-server/httpd-server.morph repo: upstream:apache/httpd ref: 6d8e0b2fd95268fcba96326ba9dce7bb8f712c19 @@ -35,5 +35,5 @@ chunks: unpetrify-ref: 4.4.5 build-depends: - apr - - httpd + - httpd-server - mod_wsgi-metrics diff --git a/strata/audio-bluetooth.morph b/strata/audio-bluetooth.morph index 00a614c9..ee1e537c 100644 --- a/strata/audio-bluetooth.morph +++ b/strata/audio-bluetooth.morph @@ -2,6 +2,7 @@ name: audio-bluetooth kind: stratum description: Components required for audio and bluetooth. build-depends: +- morph: strata/glib-common.morph - morph: strata/foundation.morph chunks: - name: libatomic_ops @@ -32,11 +33,17 @@ chunks: build-depends: - libical - alsa-lib +- name: dbus-glib + repo: upstream:dbus-glib + ref: 397e8297d433547c9bf4150ddd2b9e0b4c39628c + unpetrify-ref: dbus-glib_0.102 - name: bluez-tools morph: strata/audio-bluetooth/bluez-tools.morph repo: upstream:bluez-tools ref: 7350787e96a6ecf2cc5d4afddb3321ccad9fa461 unpetrify-ref: baserock/morph + build-depends: + - dbus-glib - name: obexd repo: upstream:obexd ref: 4225280022c206762c91beee47c62d05e1baeacc @@ -64,7 +71,7 @@ chunks: morph: strata/audio-bluetooth/ofono.morph repo: upstream:ofono ref: d05b718cc0b0d367227fbfbf52e60fc5462cc549 - unpetrify-ref: "1.15" + unpetrify-ref: '1.15' build-depends: - mobile-broadband-provider-info - bluez @@ -81,7 +88,7 @@ chunks: - name: pulseaudio morph: strata/audio-bluetooth/pulseaudio.morph repo: upstream:pulseaudio - ref: 53ad8aa7caa33caac52e35f71253e29d5a15f6e7 + ref: 53ad8aa7caa33caac52e35f71253e29d5a15f6e7 unpetrify-ref: v6.0 build-depends: - libsndfile diff --git a/strata/audio-bluetooth/pulseaudio.morph b/strata/audio-bluetooth/pulseaudio.morph index fa183fcb..be4cb557 100644 --- a/strata/audio-bluetooth/pulseaudio.morph +++ b/strata/audio-bluetooth/pulseaudio.morph @@ -2,9 +2,11 @@ name: pulseaudio kind: chunk description: PulseAudio System build-system: autotools +pre-configure-commands: +- NOCONFIGURE=1 ./bootstrap.sh configure-commands: -- ./autogen.sh -- ./configure --prefix="$PREFIX" --localstatedir=/var --sysconfdir=/etc --with-database=simple --with-systemduserunitdir=/lib/systemd/system +- ./configure --prefix="$PREFIX" --localstatedir=/var --sysconfdir=/etc --with-database=simple + --with-systemduserunitdir=/lib/systemd/system install-commands: - make DESTDIR="$DESTDIR" install - mkdir -p "$DESTDIR/etc/systemd/system/multi-user.target.wants" diff --git a/strata/bsp-armv5l-openbmc-aspeed.morph b/strata/bsp-armv5l-openbmc-aspeed.morph index 83bb74ef..d7e1f180 100644 --- a/strata/bsp-armv5l-openbmc-aspeed.morph +++ b/strata/bsp-armv5l-openbmc-aspeed.morph @@ -1,13 +1,12 @@ name: bsp-armv5l-openbmc-aspeed kind: stratum -description: -- | +description: | The set of platform specific components required for booting armvl5-openbmc-aspeed based systems build-depends: - morph: strata/core.morph chunks: -- name: linux-armv5l-openbmc-aspeed-wedge +- name: linux-armv5l-openbmc-aspeed morph: strata/bsp-armv5l-openbmc-aspeed/linux-armv5l-openbmc-aspeed.morph repo: upstream:linux-stable ref: 5cbce86c2115075b8054e4dba8cdf328aa6fa5b6 diff --git a/strata/bsp-armv8b64-generic.morph b/strata/bsp-armv8b64-generic.morph index a4d6645b..636e62b4 100644 --- a/strata/bsp-armv8b64-generic.morph +++ b/strata/bsp-armv8b64-generic.morph @@ -1,7 +1,6 @@ name: bsp-armv8b64-generic kind: stratum -description: -- | +description: | The set of platform specific components required for booting generic ARMv8 systems in big-endian mode, such as the 64-bit APM XGene ARM based m400 Moonshot cartridge. diff --git a/strata/bsp-armv8l64-generic.morph b/strata/bsp-armv8l64-generic.morph index a5edb9db..ca74dbe3 100644 --- a/strata/bsp-armv8l64-generic.morph +++ b/strata/bsp-armv8l64-generic.morph @@ -1,7 +1,6 @@ name: bsp-armv8l64-generic kind: stratum -description: -- | +description: | The set of platform specific components required for booting armv8l64-based systems, like the 64-bit APM XGene ARM based m400 Moonshot cartridge. diff --git a/strata/bsp-jetson/nouveau-drm.morph b/strata/bsp-jetson/nouveau-drm.morph index 33221a70..218091f4 100644 --- a/strata/bsp-jetson/nouveau-drm.morph +++ b/strata/bsp-jetson/nouveau-drm.morph @@ -1,12 +1,14 @@ name: nouveau-drm kind: chunk build-commands: - - sed -e 's/.*android\/sync.*/#ifdef CONFIG_SYNC\n&\n#endif/' -i drm/nouveau/nouveau_fence.c - - cd drm/nouveau && make ARCH=arm M=$(pwd) -C /usr/src/linux/ modules +- sed -e 's/.*android\/sync.*/#ifdef CONFIG_SYNC\n&\n#endif/' -i drm/nouveau/nouveau_fence.c +- cd drm/nouveau && make ARCH=arm M=$(pwd) -C /usr/src/linux/ modules install-commands: - - cd drm/nouveau && make ARCH=arm M="$(pwd)" -C /usr/src/linux/ INSTALL_MOD_PATH="$DESTDIR" modules_install +- cd drm/nouveau && 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 depmod -a "$version"; done) + 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 depmod -a "$version"; done) diff --git a/strata/bsp-x86_32-generic.morph b/strata/bsp-x86_32-generic.morph index 41003643..05d179b5 100644 --- a/strata/bsp-x86_32-generic.morph +++ b/strata/bsp-x86_32-generic.morph @@ -3,7 +3,9 @@ kind: stratum description: The set of platform specific components required for booting a 32-bit x86 based system. build-depends: -- morph: strata/core.morph +# nasm wants asciidoc and xmlto for generating its docs +# so include docutils here +- morph: strata/docutils.morph chunks: - name: linux-x86-32-generic morph: strata/bsp-x86_32-generic/linux-x86-32-generic.morph @@ -13,8 +15,8 @@ chunks: - name: nasm morph: strata/bsp-x86_32-generic/nasm.morph repo: upstream:nasm - ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 - unpetrify-ref: baserock/morph + ref: 8fa0fe16408afc76ce1ae4387e1a9d46893cfda6 + unpetrify-ref: nasm-2.11.08 - name: syslinux morph: strata/bsp-x86_32-generic/syslinux.morph repo: upstream:syslinux diff --git a/strata/bsp-x86_64-generic.morph b/strata/bsp-x86_64-generic.morph index 799af9d2..31d8374c 100644 --- a/strata/bsp-x86_64-generic.morph +++ b/strata/bsp-x86_64-generic.morph @@ -3,7 +3,9 @@ kind: stratum description: The set of platform specific components required for booting a 64-bit x86 based system. build-depends: -- morph: strata/core.morph +# nasm wants asciidoc and xmlto for generating its docs +# so include docutils here +- morph: strata/docutils.morph chunks: - name: linux-x86-64-generic morph: strata/bsp-x86_64-generic/linux-x86-64-generic.morph @@ -13,8 +15,8 @@ chunks: - name: nasm morph: strata/bsp-x86_64-generic/nasm.morph repo: upstream:nasm - ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 - unpetrify-ref: baserock/morph + ref: 8fa0fe16408afc76ce1ae4387e1a9d46893cfda6 + unpetrify-ref: nasm-2.11.08 - name: syslinux morph: strata/bsp-x86_64-generic/syslinux.morph repo: upstream:syslinux diff --git a/strata/bsp-x86_both-tools.morph b/strata/bsp-x86_both-tools.morph index f7212054..0d159ce6 100644 --- a/strata/bsp-x86_both-tools.morph +++ b/strata/bsp-x86_both-tools.morph @@ -3,17 +3,19 @@ kind: stratum description: The set of platform specific components required for configuring a bootable x86 based system. build-depends: -- morph: strata/core.morph +# nasm wants asciidoc and xmlto for generating its docs +# so include docutils here +- morph: strata/docutils.morph chunks: - name: nasm morph: strata/bsp-x86_both-tools/nasm.morph repo: upstream:nasm - ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 - unpetrify-ref: baserock/morph + ref: 8fa0fe16408afc76ce1ae4387e1a9d46893cfda6 + unpetrify-ref: nasm-2.11.08 - name: syslinux morph: strata/bsp-x86_both-tools/syslinux.morph repo: upstream:syslinux - ref: d715b39c0801ecea5e52f9029cea7c76320f93cf + ref: d715b39c0801ecea5e52f9029cea7c76320f93cf unpetrify-ref: baserock/morph build-depends: - nasm diff --git a/strata/build-essential.morph b/strata/build-essential.morph index 0a6f4e68..a774e420 100644 --- a/strata/build-essential.morph +++ b/strata/build-essential.morph @@ -147,7 +147,7 @@ chunks: morph: strata/build-essential/stage2-busybox.morph repo: upstream:busybox ref: 1ecfe811fe2f70380170ef7d820e8150054e88ca - unpetrify-ref: 1_23_1 + unpetrify-ref: '1_23_1' build-depends: - stage1-binutils - stage1-gcc @@ -305,7 +305,7 @@ chunks: morph: strata/build-essential/busybox.morph repo: upstream:busybox ref: 1ecfe811fe2f70380170ef7d820e8150054e88ca - unpetrify-ref: 1_23_1 + unpetrify-ref: '1_23_1' build-depends: - stage2-binutils - stage2-busybox diff --git a/strata/build-essential/busybox.morph b/strata/build-essential/busybox.morph index b5418bc0..1bbd97a6 100644 --- a/strata/build-essential/busybox.morph +++ b/strata/build-essential/busybox.morph @@ -3,14 +3,16 @@ kind: chunk configure-commands: # Busybox's default config has everything enabled. -- make defconfig +- make defconfig KCONFIG_NOTIMESTAMP=1 -- 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 +- 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' - +- '[ "$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 @@ -31,11 +33,16 @@ configure-commands: - 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_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 @@ -52,19 +59,20 @@ configure-commands: # 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 +- 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 +- make KCONFIG_NOTIMESTAMP=1 install-commands: - | if [ "$PREFIX" = /usr ]; then PREFIX=; fi && - make CONFIG_PREFIX="$DESTDIR$PREFIX" install && + make CONFIG_PREFIX="$DESTDIR$PREFIX" KCONFIG_NOTIMESTAMP=1 install && chmod 6755 "$DESTDIR$PREFIX"/bin/busybox - # Set up man environment variables - mkdir -p "$DESTDIR"/etc - | diff --git a/strata/build-essential/gcc.morph b/strata/build-essential/gcc.morph index a9d25ac1..f16b3c0e 100644 --- a/strata/build-essential/gcc.morph +++ b/strata/build-essential/gcc.morph @@ -15,8 +15,7 @@ products: # everything else gcc produces is required for compiling # this is the -devel artifact instead of -misc, since it goes in -devel # stratum artifacts by default - include: [ .* ] - + include: [.*] configure-commands: - mkdir o @@ -58,7 +57,7 @@ build-commands: 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" + ln -s gfortran "$DESTDIR/$PREFIX/bin/$fortran_alias" done diff --git a/strata/build-essential/glibc.morph b/strata/build-essential/glibc.morph index f820547d..54dbbd9c 100644 --- a/strata/build-essential/glibc.morph +++ b/strata/build-essential/glibc.morph @@ -17,7 +17,7 @@ products: include: - (usr/)?s?bin/.* - (usr/)?libexec/getconf/.* - - (usr/)?lib/libSegFault\.so(\.\d+)*$ + - (usr/)?lib(32|64)?/libSegFault\.so(\.\d+)*$ - artifact: glibc-libs include: # This is processed after bins, so bins can take libSegFault.so diff --git a/strata/build-essential/stage1-gcc.morph b/strata/build-essential/stage1-gcc.morph index f76b0cc6..6418ed6a 100644 --- a/strata/build-essential/stage1-gcc.morph +++ b/strata/build-essential/stage1-gcc.morph @@ -3,7 +3,10 @@ kind: chunk configure-commands: # Workaround from LFS due GCC not detecting stack protection correctly -- sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure +- | + sed -i -e '/k prot/a \ + gcc_cv_libc_provides_ssp=yes + ' gcc/configure - mkdir o diff --git a/strata/build-essential/stage2-busybox.morph b/strata/build-essential/stage2-busybox.morph index 98e4bf33..f271a40d 100644 --- a/strata/build-essential/stage2-busybox.morph +++ b/strata/build-essential/stage2-busybox.morph @@ -5,11 +5,11 @@ 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 +- make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- KCONFIG_NOTIMESTAMP=1 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' - +- '[ "$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 @@ -30,13 +30,19 @@ configure-commands: - 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_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_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 @@ -58,7 +64,7 @@ build-commands: export STAGE2_SYSROOT="$(dirname $(pwd))" export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" export LDFLAGS="--sysroot=$STAGE2_SYSROOT" - make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- + make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- KCONFIG_NOTIMESTAMP=1 install-commands: # We expect to be built with a non-standard prefix in stage 2 (i.e. not @@ -68,5 +74,7 @@ install-commands: export CPPFLAGS="--sysroot=$STAGE2_SYSROOT" export LDFLAGS="--sysroot=$STAGE2_SYSROOT" make CONFIG_PREFIX="$DESTDIR$PREFIX" \ - HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- install && + HOSTCC="/usr/bin/gcc" \ + CROSS_COMPILE=$TARGET_STAGE1- \ + KCONFIG_NOTIMESTAMP=1 install && chmod 6755 "$DESTDIR$PREFIX"/bin/busybox diff --git a/strata/ceph-service/boost.morph b/strata/ceph-service/boost.morph index cc954076..fa785e3c 100644 --- a/strata/ceph-service/boost.morph +++ b/strata/ceph-service/boost.morph @@ -3,6 +3,6 @@ kind: chunk configure-commands: - ./bootstrap.sh build-commands: -- ./b2 +- ./b2 install-commands: - ./b2 install --prefix="$DESTDIR$PREFIX" diff --git a/strata/ceph-service/ceph.morph b/strata/ceph-service/ceph.morph index a6b06759..56d30ead 100644 --- a/strata/ceph-service/ceph.morph +++ b/strata/ceph-service/ceph.morph @@ -3,7 +3,8 @@ kind: chunk build-system: autotools configure-commands: - NOCONFIGURE=1 ./autogen.sh -- ./configure --with-nss --prefix="$PREFIX" --sysconfdir=/etc --without-fuse --without-libatomic-ops --without-libxfs +- ./configure --with-nss --prefix="$PREFIX" --sysconfdir=/etc --without-fuse --without-libatomic-ops + --without-libxfs build-commands: - make install-commands: diff --git a/strata/ceph-service/leveldb.morph b/strata/ceph-service/leveldb.morph index bff2b87a..2b97c6e6 100644 --- a/strata/ceph-service/leveldb.morph +++ b/strata/ceph-service/leveldb.morph @@ -4,6 +4,6 @@ build-commands: - make install-commands: - mkdir -p "$DESTDIR$PREFIX"/lib -- mkdir -p "$DESTDIR$PREFIX"/include +- mkdir -p "$DESTDIR$PREFIX"/include - cp --preserve=links libleveldb.* "$DESTDIR$PREFIX"/lib - cp -r include/leveldb "$DESTDIR$PREFIX"/include diff --git a/strata/chef.morph b/strata/chef.morph index 69b495aa..b28298e0 100644 --- a/strata/chef.morph +++ b/strata/chef.morph @@ -71,8 +71,8 @@ chunks: unpetrify-ref: v1.2.5 build-depends: - hoe-master -- name: ipaddress-master - morph: strata/chef/ipaddress-master.morph +- name: ipaddress-0.8.0 + morph: strata/chef/ipaddress-0.8.0.morph repo: upstream:ruby-gems/ipaddress ref: dae93ad0e4fb9a5d547a15dae0c3f2417078c845 unpetrify-ref: master diff --git a/strata/chef/erubis-master.morph b/strata/chef/erubis-master.morph index f15e0968..05d1a9f9 100644 --- a/strata/chef/erubis-master.morph +++ b/strata/chef/erubis-master.morph @@ -1,4 +1,3 @@ ---- name: erubis-master kind: chunk build-system: manual @@ -10,7 +9,8 @@ configure-commands: # Manually do what it seems like the 'rook' build system would do, if it worked # Values taken from 'Rookbook.props'. - find -type f -exec sed -e 's/\$Release\$/2.7.0/g' -i \{} \; -- find -type f -exec sed -e 's/\$Copyright\$/copyright(c) 2006-2011 kuwata-lab.com all rights reserved./g' -i \{} \; +- find -type f -exec sed -e 's/\$Copyright\$/copyright(c) 2006-2011 kuwata-lab.com + all rights reserved./g' -i \{} \; build-commands: - gem build erubis.gemspec install-commands: diff --git a/strata/chef/hoe-master.morph b/strata/chef/hoe-master.morph index 9fe7ff8e..1a468789 100644 --- a/strata/chef/hoe-master.morph +++ b/strata/chef/hoe-master.morph @@ -1,4 +1,3 @@ ---- name: hoe-master kind: chunk build-system: manual diff --git a/strata/chef/ipaddress-master.morph b/strata/chef/ipaddress-0.8.0.morph index fdaa5de6..fdaa5de6 100644 --- a/strata/chef/ipaddress-master.morph +++ b/strata/chef/ipaddress-0.8.0.morph diff --git a/strata/chef/libyajl2-1.0.1.morph b/strata/chef/libyajl2-1.0.1.morph index d85d1567..7a21831d 100644 --- a/strata/chef/libyajl2-1.0.1.morph +++ b/strata/chef/libyajl2-1.0.1.morph @@ -9,5 +9,5 @@ build-commands: - USE_SYSTEM_LIBYAJL2=yes gem build libyajl2.gemspec install-commands: - mkdir -p "$DESTDIR/$(gem environment home)" -- USE_SYSTEM_LIBYAJL2=yes gem install --install-dir "$DESTDIR/$(gem environment home)" --bindir "$DESTDIR/$PREFIX/bin" - --ignore-dependencies --local ./libyajl2-1.0.1.gem +- USE_SYSTEM_LIBYAJL2=yes gem install --install-dir "$DESTDIR/$(gem environment home)" + --bindir "$DESTDIR/$PREFIX/bin" --ignore-dependencies --local ./libyajl2-1.0.1.gem diff --git a/strata/chef/plist-master.morph b/strata/chef/plist-master.morph index bef39f7d..7cf7cbb6 100644 --- a/strata/chef/plist-master.morph +++ b/strata/chef/plist-master.morph @@ -1,4 +1,3 @@ ---- name: plist-master kind: chunk build-system: manual diff --git a/strata/connman-common.morph b/strata/connman-common.morph index a22b7e90..fde00436 100644 --- a/strata/connman-common.morph +++ b/strata/connman-common.morph @@ -2,6 +2,7 @@ name: connman-common kind: stratum build-depends: - morph: strata/connectivity.morph +- morph: strata/glib-common.morph chunks: - name: connman morph: strata/connman-common/connman.morph diff --git a/strata/core.morph b/strata/core.morph index a6a9e06c..9e4fd4e1 100644 --- a/strata/core.morph +++ b/strata/core.morph @@ -32,8 +32,8 @@ chunks: - name: perl morph: strata/core/perl.morph repo: upstream:perl - ref: 78f9a3c880f11578fb9ff9c7d5f7e34b602d2ad1 - unpetrify-ref: baserock/morph + ref: 70f63a4c7dba89e8e48b44de7978faae4319e693 + unpetrify-ref: v5.22.0 build-depends: - gdbm - name: texinfo-tarball @@ -60,19 +60,44 @@ chunks: - autoconf-tarball - perl - texinfo-tarball +- name: help2man + repo: upstream:help2man + ref: 83bab7e2e8e24a380266a9a247c029c49b0de666 + unpetrify-ref: baserock/v1.46.5 + build-depends: + - autoconf-tarball + - automake +# Note: autoconf's version number must be set in autoconf's chunk morph, +# so if you update autoconf be sure to also update the version number +# in strata/core/autoconf.morph +- name: autoconf + morph: strata/core/autoconf.morph + repo: upstream:autoconf + ref: 218f9347c9c34919c2b8eef8d9a0513ac567a3c1 + unpetrify-ref: baserock/v2.69-texinfo-fix + build-depends: + - autoconf-tarball + - automake + - help2man + - texinfo-tarball - name: libtool-tarball morph: strata/core/libtool-tarball.morph repo: upstream:libtool-tarball ref: c026ca36e37d2643623a75d0d3e9e451023139f3 unpetrify-ref: libtool-2.4.6 +- name: file + repo: upstream:file + ref: f69c3fd9bcb108292e7887dd889e8b49f68c4a52 + unpetrify-ref: file-5.22 - name: libexpat morph: strata/core/libexpat.morph repo: upstream:libexpat ref: 7cfc09db3e258129ab05811f2f9e351746ddab9f unpetrify-ref: R_2_1_0 build-depends: - - autoconf-tarball + - autoconf - automake + - file - libtool-tarball - name: gettext-tarball morph: strata/core/gettext-tarball.morph @@ -93,6 +118,7 @@ chunks: unpetrify-ref: baserock/build-essential build-depends: - automake + - file - gettext-tarball - name: openssl-new morph: strata/core/openssl-new.morph @@ -113,14 +139,24 @@ chunks: unpetrify-ref: baserock/genivi/baseline build-depends: - automake +- name: libffi + morph: strata/core/libffi.morph + repo: upstream:libffi + ref: 77d4586cc47e8f4c02278afbc220145bba0d442b + unpetrify-ref: baserock/morph + build-depends: + - autoconf + - automake - name: cpython morph: strata/core/cpython.morph repo: upstream:cpython - ref: d0188e98ecf02e007d85fc34944f8be8f91b7e94 - unpetrify-ref: v2.7.9 + ref: 57af3f22d11600ca98c0c9073d0b3b57d43f7c4b + unpetrify-ref: v2.7.10 build-depends: - openssl-new - bzip2 + - libexpat + - libffi - sqlite3 - ncurses - readline @@ -130,30 +166,70 @@ chunks: unpetrify-ref: 0.22 build-depends: - cpython -- name: gtk-doc-stub - repo: upstream:gtk-doc-stub - ref: 58ec0d8593541ef7ae522ce42ebec6f98536c4e0 - unpetrify-ref: baserock/morph +# Note: bison's version number must be set in bison's chunk morph, +# so if you update bison be sure to also update the version number +# in strata/core/bison.morph +- name: bison + morph: strata/core/bison.morph + repo: upstream:bison + ref: 2ab6d1daaccf32fc4314e4b2fe44da977f11a308 + unpetrify-ref: baserock/v3.0.2 build-depends: - - bash + - autoconf + - automake + - flex + - gettext-tarball + - help2man + - mini-utils +# Note: patch's version number must be set in patch's chunk morph, +# so if you update patch be sure to also update the version number +# in strata/core/patch.morph +- name: patch + morph: strata/core/patch.morph + repo: upstream:patch + ref: 3bbb26c928a147cfcf0756f1cc0a1307e5cc663f + unpetrify-ref: baserock/v2.7.1 + build-depends: + - autoconf + - automake + - mini-utils + - bison - name: xz repo: upstream:xz ref: a0cd05ee71d330b79ead6eb9222e1b24e1559d3a unpetrify-ref: v5.2.0 build-depends: - - autoconf-tarball + - autoconf - automake + - file - gettext-tarball - libtool-tarball +# Note: libtool's version number must be set in libtool's chunk morph, +# so if you update libtool be sure to also update the version number +# in strata/core/libtool.morph +- name: libtool + morph: strata/core/libtool.morph + repo: upstream:libtool + ref: 5e11a17c39a2a976a09c33a568431a9f7ad00d48 + unpetrify-ref: baserock/v2.4.6 + build-depends: + - autoconf + - automake + - file + - help2man + - patch + - texinfo-tarball + - xz - name: libxml2 repo: upstream:libxml2 ref: ee8f1d4cda8dc1a6f2c515fe234f7bc89cdc9f80 unpetrify-ref: baserock/morph build-depends: - - autoconf-tarball + - autoconf - automake + - file - cpython - - libtool-tarball + - libtool - xz - name: ca-certificates morph: strata/core/ca-certificates.morph @@ -169,9 +245,10 @@ chunks: ref: 202aa9f7758636730299b86715d924f54468a908 unpetrify-ref: curl-7_38_0 build-depends: - - autoconf-tarball + - autoconf - automake - - libtool-tarball + - file + - libtool - openssl-new - ca-certificates - name: XML-Parser @@ -187,34 +264,12 @@ chunks: ref: 9874fca7122563e28d699a911404fc49d2a24f1c unpetrify-ref: v2.3.0 build-depends: - - autoconf-tarball + - autoconf - cpython - curl - gettext-tarball - libexpat - openssl-new -- name: help2man - repo: upstream:help2man - ref: 83bab7e2e8e24a380266a9a247c029c49b0de666 - unpetrify-ref: baserock/v1.46.5 - build-depends: - - autoconf-tarball - - automake -# Note: bison's version number must be set in bison's chunk morph, -# so if you update bison be sure to also update the version number -# in strata/core/bison.morph -- name: bison - morph: strata/core/bison.morph - repo: upstream:bison - ref: 2ab6d1daaccf32fc4314e4b2fe44da977f11a308 - unpetrify-ref: baserock/v3.0.2 - build-depends: - - autoconf-tarball - - automake - - flex - - gettext-tarball - - help2man - - mini-utils - name: gperf morph: strata/core/gperf.morph repo: upstream:gperf @@ -226,7 +281,7 @@ chunks: unpetrify-ref: baserock/morph build-depends: - XML-Parser - - autoconf-tarball + - autoconf - automake - perl - name: pkg-config @@ -235,29 +290,30 @@ chunks: ref: 74ceac54ef6f9247c00f08eecd8cca811a3c5934 unpetrify-ref: pkg-config-0.28 build-depends: - - autoconf-tarball + - autoconf - automake - - libtool-tarball + - libtool - name: attr morph: strata/core/attr.morph repo: upstream:attr ref: 4b005410f865895d4dcd56e2c135278a7a315877 unpetrify-ref: baserock/morph build-depends: - - autoconf-tarball + - file + - autoconf - automake - gettext-tarball - - libtool-tarball + - libtool - name: acl morph: strata/core/acl.morph repo: upstream:acl ref: f13e09bd54fd4a501c4952f002ed2752bdd9f93b unpetrify-ref: v2.2.52 build-depends: - - autoconf-tarball + - autoconf - automake - gettext-tarball - - libtool-tarball + - libtool - attr - name: linux-pam morph: strata/core/linux-pam.morph @@ -265,10 +321,10 @@ chunks: ref: b1521c97e73b10469f7b34c0571d51c647eca83c unpetrify-ref: Linux-PAM-1.1.8 build-depends: - - autoconf-tarball + - autoconf - automake - gettext-tarball - - libtool-tarball + - libtool - pkg-config - flex - attr @@ -279,10 +335,10 @@ chunks: ref: 4f7cca1bc9c2a274edb39d351b65747010d3ba7b unpetrify-ref: baserock/morph build-depends: - - autoconf-tarball + - autoconf - automake - gettext-tarball - - libtool-tarball + - libtool - pkg-config - attr - acl @@ -290,29 +346,31 @@ chunks: - name: shadow morph: strata/core/shadow.morph repo: upstream:shadow - ref: 4f5000a45963c2cc2a403ad23e459f20296b29c2 - unpetrify-ref: baserock/4.2 + ref: bfaa59229d61adb7fa0c570f0d94fd324c6e05aa + unpetrify-ref: upstream/4.2.1 build-depends: - - autoconf-tarball + - autoconf - automake - gettext-tarball - - libtool-tarball + - libtool - bison - attr - acl - linux-pam - libcap2 +# Note: util-linux's version number must be set in util-linux's chunk morph, +# so if you update util-linux be sure to also update the version number +# in strata/core/util-linux.morph - name: util-linux morph: strata/core/util-linux.morph repo: upstream:util-linux ref: 34760e62e0d5a25262a6aa801b2f1df61216363f unpetrify-ref: v2.26.1 build-depends: - - autoconf-tarball + - autoconf - automake - gettext-tarball - - git - - libtool-tarball + - libtool - pkg-config - linux-pam - shadow @@ -323,62 +381,16 @@ chunks: build-depends: - flex - texinfo-tarball -- name: patch - morph: strata/core/patch.morph - repo: upstream:patch - ref: 3bbb26c928a147cfcf0756f1cc0a1307e5cc663f - unpetrify-ref: baserock/v2.7.1 - build-depends: - - shadow - name: libxslt repo: upstream:libxslt ref: 73e08bf7c36a9145d38f51d37e66529b873c011a unpetrify-ref: master build-depends: - - autoconf-tarball - - libtool-tarball + - autoconf + - libtool - automake + - file - libxml2 -- name: gnome-common - repo: upstream:gnome-common - ref: 5d61b55e8bea32fe2b52e21682ee4b3719b290c5 - unpetrify-ref: 3.14.0 - build-depends: - - autoconf-tarball - - automake -- name: libffi - morph: strata/core/libffi.morph - repo: upstream:libffi - ref: 77d4586cc47e8f4c02278afbc220145bba0d442b - unpetrify-ref: baserock/morph - build-depends: - - autoconf-tarball - - automake -- name: glib - repo: upstream:glib - ref: 966ffb16f6bd54cb3d928a55d00d0eda73592094 - unpetrify-ref: 2.44.0 - build-depends: - - autoconf-tarball - - automake - - cpython - - gettext-tarball - - libffi - - pkg-config -- name: gobject-introspection - repo: upstream:gobject-introspection - ref: c0243e116c5e261c262dded9f4d7726a770c5a19 - unpetrify-ref: GOBJECT_INTROSPECTION_1_44_0 - build-depends: - - autoconf-tarball - - automake - - bash - - bison - - cpython - - flex - - glib - - libffi - - pkg-config - name: e2fsprogs morph: strata/core/e2fsprogs.morph repo: upstream:e2fsprogs @@ -387,3 +399,4 @@ chunks: build-depends: - pkg-config - util-linux + - file diff --git a/strata/core/attr.morph b/strata/core/attr.morph index 46d0b9c0..d0bf6976 100644 --- a/strata/core/attr.morph +++ b/strata/core/attr.morph @@ -1,8 +1,9 @@ name: attr kind: chunk build-system: autotools -configure-commands: +pre-configure-commands: - make configure +configure-commands: - | ./configure --prefix="$PREFIX" \ --exec-prefix="$PREFIX" \ diff --git a/strata/core/autoconf.morph b/strata/core/autoconf.morph new file mode 100644 index 00000000..63b95ba8 --- /dev/null +++ b/strata/core/autoconf.morph @@ -0,0 +1,5 @@ +name: autoconf +kind: chunk +build-system: autotools +pre-configure-commands: +- echo "2.69" > .tarball-version diff --git a/strata/core/ca-certificates.morph b/strata/core/ca-certificates.morph index b7bd9e5a..5bdb18ea 100644 --- a/strata/core/ca-certificates.morph +++ b/strata/core/ca-certificates.morph @@ -1,11 +1,12 @@ name: ca-certificates kind: chunk -build-system: autotools -configure-commands: [] -pre-install-commands: +build-system: manual +build-commands: +- make +install-commands: - mkdir -p "$DESTDIR"/usr/share/ca-certificates - mkdir -p "$DESTDIR"/usr/sbin -post-install-commands: +- make DESTDIR="$DESTDIR" install - mkdir "$DESTDIR"/etc - | cd "$DESTDIR"/usr/share/ca-certificates diff --git a/strata/core/cpython.morph b/strata/core/cpython.morph index 6c9e4b3d..d0c80220 100644 --- a/strata/core/cpython.morph +++ b/strata/core/cpython.morph @@ -2,6 +2,10 @@ name: cpython kind: chunk build-system: autotools configure-commands: -- ./configure --prefix="$PREFIX" --enable-shared +- | + ./configure --prefix="$PREFIX" \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi post-install-commands: - test -x "$DESTDIR"/"$PREFIX"/bin/python2 || ln -s python2.7 "$DESTDIR"/"$PREFIX"/bin/python2 diff --git a/strata/core/libtool.morph b/strata/core/libtool.morph new file mode 100644 index 00000000..d4465c31 --- /dev/null +++ b/strata/core/libtool.morph @@ -0,0 +1,6 @@ +name: libtool +kind: chunk +build-system: autotools +pre-configure-commands: +- echo "2.4.6" > .tarball-version +- ./bootstrap diff --git a/strata/core/patch.morph b/strata/core/patch.morph index b7f146ef..48c9c437 100644 --- a/strata/core/patch.morph +++ b/strata/core/patch.morph @@ -2,4 +2,5 @@ name: patch kind: chunk build-system: autotools pre-configure-commands: +- echo "2.7.1" > .tarball-version - ./bootstrap --skip-po diff --git a/strata/core/shadow.morph b/strata/core/shadow.morph index c8715a7d..cdb1ff75 100644 --- a/strata/core/shadow.morph +++ b/strata/core/shadow.morph @@ -1,10 +1,12 @@ name: shadow kind: chunk build-system: autotools +pre-configure-commands: +- autoreconf -vfi configure-commands: # Installing to /bin so that they overwrite busybox login. - | - ./autogen.sh --with-selinux=no \ + ./configure --with-selinux=no \ --sysconfdir=/etc \ --with-libpam=yes \ --prefix="$PREFIX" \ diff --git a/strata/core/util-linux.morph b/strata/core/util-linux.morph index eebba6f6..290283d1 100644 --- a/strata/core/util-linux.morph +++ b/strata/core/util-linux.morph @@ -1,8 +1,10 @@ name: util-linux kind: chunk build-system: autotools -configure-commands: +pre-configure-commands: +- echo "2.26.1" > .tarball-version - ./autogen.sh +configure-commands: # Installing to /bin so that they overwrite busybox login. - | ./configure --prefix="$PREFIX" \ diff --git a/strata/devtools.morph b/strata/devtools.morph index 5fb93c1d..6b55e2f2 100644 --- a/strata/devtools.morph +++ b/strata/devtools.morph @@ -36,3 +36,8 @@ chunks: repo: upstream:git-review ref: 79262a52301c146a6b60d09a828661a83a5f5ba7 unpetrify-ref: master +- name: wget + morph: strata/devtools/wget.morph + repo: upstream:wget + ref: 71d79f4f3043cf4ca3b2fb7f5328eae725c1293f + unpetrify-ref: baserock/v1.16.3 diff --git a/strata/devtools/wget.morph b/strata/devtools/wget.morph new file mode 100644 index 00000000..a3a7995a --- /dev/null +++ b/strata/devtools/wget.morph @@ -0,0 +1,10 @@ +name: wget +kind: chunk +build-system: autotools +pre-configure-commands: +# rsync is needed if we want the bootstrap script to download .po files, +# we can't download into our chroot so we remove this dependency +- sed -i '/^buildreq="/,/"/ { /^rsync.*/ d }' bootstrap.conf +- ./bootstrap --no-bootstrap-sync --skip-po +configure-commands: +- ./configure --prefix="$PREFIX" --with-ssl=openssl diff --git a/strata/docutils.morph b/strata/docutils.morph new file mode 100644 index 00000000..6c5ac67b --- /dev/null +++ b/strata/docutils.morph @@ -0,0 +1,50 @@ +name: docutils +kind: stratum +description: Stuff for generating documentation +build-depends: +- morph: strata/core.morph +chunks: +- name: xml-catalog + morph: strata/docutils/xml-catalog.morph + repo: baserock:baserock/xml-catalog + ref: 1d4a2abc875c4dda1b5eadc0a097a48a8d2ec82b + unpetrify-ref: master +- name: docbook-xml + morph: strata/docutils/docbook-xml.morph + repo: upstream:docbook-xml + ref: c8f0ce32a8075e9ab21e5cf734fb96195455264d + unpetrify-ref: docbook-xml-4.5 + build-depends: + # This is a little awkward, we don't really build-depend on xml-catalog, + # but if we don't include it as a build dependency + # then we won't have the existing xml catalog in our staging area + # which would cause this chunk to create a new catalog which would + # overwrite the catalog created by the 'xml-catalog' chunk. + # + # construction of the catalog cannot be done at system-integration time + # because we need the catalog *here* in order to build nasm complete with + # man pages. + - xml-catalog +- name: docbook-xsl + morph: strata/docutils/docbook-xsl.morph + repo: upstream:docbook-xsl + ref: 802da9dd5d4bc18f46a916eedc0c5c1980a15e59 + unpetrify-ref: docbook-xsl-1.78.1 + build-depends: + # Same issue as above, except this time we don't want to overwrite + # the catalog that now contains the XML DTDs. + - docbook-xml +- name: asciidoc + repo: upstream:asciidoc + ref: d3a6df0caa94edaf8180bd71bf2fc68390f56520 + unpetrify-ref: 8.6.9 + build-depends: + - docbook-xml + - docbook-xsl +- name: xmlto + repo: upstream:xmlto-tarball + ref: 6a590aba95cbcce0f184381fb19d16558e56832d + unpetrify-ref: xmlto-0.0.26 + build-depends: + - docbook-xml + - docbook-xsl diff --git a/strata/docutils/docbook-xml.morph b/strata/docutils/docbook-xml.morph new file mode 100644 index 00000000..f18acaba --- /dev/null +++ b/strata/docutils/docbook-xml.morph @@ -0,0 +1,104 @@ +name: docbook-xml +kind: chunk +build-system: manual +install-commands: +- install -v -d -m755 "$DESTDIR$PREFIX/share/xml/docbook/xml-dtd-4.5" +- install -v -d -m755 "$DESTDIR/etc/xml" +- | + cp -v -af docbook.cat *.dtd ent/ *.mod \ + "$DESTDIR$PREFIX/share/xml/docbook/xml-dtd-4.5" +post-install-commands: +- | + # Create (or update) and populate the "$DESTDIR/etc/xml/docbook" catalog file + if [ ! -e /etc/xml/docbook ]; then + xmlcatalog --noout --create "$DESTDIR/etc/xml/docbook" + else + # Copy the existing catalog so we can update it + cp /etc/xml/docbook "$DESTDIR/etc/xml/docbook" + fi + +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//DTD DocBook XML V4.5//EN" \ + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "public" \ + "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \ "file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "rewriteSystem" \ + "http://www.oasis-open.org/docbook/xml/4.5" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5" \ + "$DESTDIR/etc/xml/docbook" +- | + xmlcatalog --noout --add "rewriteURI" \ + "http://www.oasis-open.org/docbook/xml/4.5" \ + "file:///usr/share/xml/docbook/xml-dtd-4.5" \ + "$DESTDIR/etc/xml/docbook" + +- | + # Create (or update) and populate the "$DESTDIR/etc/xml/catalog" catalog file + if [ ! -e /etc/xml/catalog ]; then + echo 'Creating new xml catalog' + xmlcatalog --noout --create "$DESTDIR/etc/xml/catalog" + else + # Copy the existing catalog so we can update it + cp /etc/xml/catalog "$DESTDIR/etc/xml/catalog" + fi + +- | + xmlcatalog --noout --add "delegatePublic" \ + "-//OASIS//ENTITIES DocBook XML" \ + "file:///etc/xml/docbook" \ + "$DESTDIR/etc/xml/catalog" +- | + xmlcatalog --noout --add "delegatePublic" \ + "-//OASIS//DTD DocBook XML" \ + "file:///etc/xml/docbook" \ + "$DESTDIR/etc/xml/catalog" +- | + xmlcatalog --noout --add "delegateSystem" \ + "http://www.oasis-open.org/docbook/" \ + "file:///etc/xml/docbook" \ + "$DESTDIR/etc/xml/catalog" +- | + xmlcatalog --noout --add "delegateURI" \ + "http://www.oasis-open.org/docbook/" \ + "file:///etc/xml/docbook" \ + "$DESTDIR/etc/xml/catalog" diff --git a/strata/docutils/docbook-xsl.morph b/strata/docutils/docbook-xsl.morph new file mode 100644 index 00000000..b3bf396d --- /dev/null +++ b/strata/docutils/docbook-xsl.morph @@ -0,0 +1,50 @@ +name: docbook-xsl +kind: chunk +install-commands: +- install -v -m755 -d "$DESTDIR$PREFIX/share/xml/docbook/xsl-stylesheets-1.78.1" +- | + cp -v -R VERSION common eclipse epub extensions fo highlighting html \ + htmlhelp images javahelp lib manpages params profiling \ + roundtrip slides template tests tools webhelp website \ + xhtml xhtml-1_1 \ + "$DESTDIR$PREFIX/share/xml/docbook/xsl-stylesheets-1.78.1" + +- ln -s VERSION "$DESTDIR$PREFIX/share/xml/docbook/xsl-stylesheets-1.78.1/VERSION.xsl" + +- install -v -m644 -D README "$DESTDIR$PREFIX/share/doc/docbook-xsl-1.78.1/README.txt" +- | + install -v -m644 RELEASE-NOTES* NEWS* \ + "$DESTDIR$PREFIX/share/doc/docbook-xsl-1.78.1" +post-install-commands: +- if [ ! -d "$DESTDIR/etc/xml" ]; then install -v -m755 -d "$DESTDIR/etc/xml"; fi +- | + if [ ! -e /etc/xml/catalog ]; then + echo "Creating new xml catalog" + xmlcatalog --noout --create "$DESTDIR/etc/xml/catalog" + else + cp /etc/xml/catalog "$DESTDIR/etc/xml/catalog" + fi + +- | + xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/1.78.1" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.78.1" \ + "$DESTDIR/etc/xml/catalog" + +- | + xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/1.78.1" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.78.1" \ + "$DESTDIR/etc/xml/catalog" + +- | + xmlcatalog --noout --add "rewriteSystem" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.78.1" \ + "$DESTDIR/etc/xml/catalog" + +- | + xmlcatalog --noout --add "rewriteURI" \ + "http://docbook.sourceforge.net/release/xsl/current" \ + "/usr/share/xml/docbook/xsl-stylesheets-1.78.1" \ + "$DESTDIR/etc/xml/catalog" diff --git a/strata/virtualization/xml-catalog.morph b/strata/docutils/xml-catalog.morph index 34ba0306..34ba0306 100644 --- a/strata/virtualization/xml-catalog.morph +++ b/strata/docutils/xml-catalog.morph diff --git a/strata/enlightenment/bullet3.morph b/strata/enlightenment/bullet3.morph index 74cb097a..357e1f67 100644 --- a/strata/enlightenment/bullet3.morph +++ b/strata/enlightenment/bullet3.morph @@ -1,4 +1,4 @@ -name: bullet +name: bullet3 kind: chunk configure-commands: - cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON diff --git a/strata/foundation.morph b/strata/foundation.morph index 22cb2d29..20166cf7 100644 --- a/strata/foundation.morph +++ b/strata/foundation.morph @@ -100,12 +100,6 @@ chunks: repo: baserock:baserock/tbdiff ref: 235e95c3479f96b04d33edecc684f985bda50e53 unpetrify-ref: master -- name: dbus-glib - repo: upstream:dbus-glib - ref: 397e8297d433547c9bf4150ddd2b9e0b4c39628c - unpetrify-ref: dbus-glib_0.102 - build-depends: - - dbus - name: rsync morph: strata/foundation/rsync.morph repo: upstream:rsync diff --git a/strata/foundation/btrfs-progs.morph b/strata/foundation/btrfs-progs.morph index 4e724dc9..807a115f 100644 --- a/strata/foundation/btrfs-progs.morph +++ b/strata/foundation/btrfs-progs.morph @@ -5,5 +5,4 @@ pre-configure-commands: - ./autogen.sh configure-commands: # The change in the CFLAGS is needed to make the compilation succeed in armv5l -- export CFLAGS="-O2 $CFLAGS"; - ./configure --prefix="$PREFIX" --disable-documentation +- export CFLAGS="-O2 $CFLAGS"; ./configure --prefix="$PREFIX" --disable-documentation diff --git a/strata/foundation/time-zone-database.morph b/strata/foundation/time-zone-database.morph index c3c89bcf..701d781a 100644 --- a/strata/foundation/time-zone-database.morph +++ b/strata/foundation/time-zone-database.morph @@ -7,4 +7,5 @@ install-commands: # ETCDIR is actually where the 'tzselect', 'zdump' and 'zic' commands get # installed. Note that tzselect from this chunk will overlap with and override # the tzselect binary from GLIBC. -- make TOPDIR="$PREFIX" ETCDIR="$PREFIX/bin" TZDIR="$PREFIX/share/zoneinfo" DESTDIR="$DESTDIR" install +- make TOPDIR="$PREFIX" ETCDIR="$PREFIX/bin" TZDIR="$PREFIX/share/zoneinfo" DESTDIR="$DESTDIR" + install diff --git a/strata/genivi.morph b/strata/genivi.morph index 5294dc4e..f4d7d600 100644 --- a/strata/genivi.morph +++ b/strata/genivi.morph @@ -37,19 +37,19 @@ chunks: - name: genivi-common-api-runtime morph: strata/genivi/genivi-common-api-runtime.morph repo: upstream:genivi-common-api-runtime - ref: 188abb5e24d6a2a7fdd7e5d150439a162621292c - unpetrify-ref: 2.1.6 + ref: 56d1059459c24971bcbf45adef60f6dfd0b44667 + unpetrify-ref: 3.1.2p1 - name: genivi-common-api-dbus-runtime morph: strata/genivi/genivi-common-api-dbus-runtime.morph repo: upstream:genivi-common-api-dbus-runtime - ref: 3372155b32a2cf3b05e1a2a13f6f8413069de33f - unpetrify-ref: 2.1.6-p1 + ref: 49d0b428ca19852d49965f35328a314f22d88807 + unpetrify-ref: 3.1.2 build-depends: - genivi-common-api-runtime - name: audiomanager repo: upstream:audiomanager - ref: 00caae1e41e8891d9a1bafa76028e8119f06fd8a - unpetrify-ref: baserock/6.0 + ref: 8725157e248c6706de59a02996f869b6ccdccb13 + unpetrify-ref: "7.0" build-depends: - DLT-daemon - googletest @@ -102,8 +102,8 @@ chunks: - node-state-manager - name: node-health-monitor repo: upstream:genivi/node-health-monitor - ref: 2af264563ef1b60ba2636cbf5e8cd6a7ed07b0c0 - unpetrify-ref: baserock/1.3.3 + ref: 61f88bc9fc03c278664e05431ffb5933ff6007f1 + unpetrify-ref: baserock/1.3.5 build-depends: - node-state-manager - persistence-client-library diff --git a/strata/genivi/DLT-daemon.morph b/strata/genivi/DLT-daemon.morph index e22e31e3..d16c42ea 100644 --- a/strata/genivi/DLT-daemon.morph +++ b/strata/genivi/DLT-daemon.morph @@ -1,4 +1,4 @@ -name: DLT-deamon +name: DLT-daemon kind: chunk build-system: cmake configure-commands: diff --git a/strata/genivi/genivi-common-api-dbus-runtime.morph b/strata/genivi/genivi-common-api-dbus-runtime.morph index 8d6cb134..fa8742a0 100644 --- a/strata/genivi/genivi-common-api-dbus-runtime.morph +++ b/strata/genivi/genivi-common-api-dbus-runtime.morph @@ -1,5 +1,3 @@ name: genivi-common-api-dbus-runtime kind: chunk -build-system: autotools -pre-configure-commands: -- ln -s . build-aux +build-system: cmake diff --git a/strata/genivi/genivi-common-api-runtime.morph b/strata/genivi/genivi-common-api-runtime.morph index 7439331a..1c4a66c2 100644 --- a/strata/genivi/genivi-common-api-runtime.morph +++ b/strata/genivi/genivi-common-api-runtime.morph @@ -1,5 +1,3 @@ name: genivi-common-api-runtime kind: chunk -build-system: autotools -pre-configure-commands: -- ln -s . build-aux +build-system: cmake diff --git a/strata/glib-common.morph b/strata/glib-common.morph new file mode 100644 index 00000000..090bdf13 --- /dev/null +++ b/strata/glib-common.morph @@ -0,0 +1,24 @@ +name: glib-common +kind: stratum +description: GLib and dependencies +build-depends: +- morph: strata/core.morph +chunks: +- name: gtk-doc-stub + repo: upstream:gtk-doc-stub + ref: 58ec0d8593541ef7ae522ce42ebec6f98536c4e0 + unpetrify-ref: baserock/morph +- name: gnome-common + repo: upstream:gnome-common + ref: 5d61b55e8bea32fe2b52e21682ee4b3719b290c5 + unpetrify-ref: 3.14.0 +- name: glib + repo: upstream:glib + ref: 966ffb16f6bd54cb3d928a55d00d0eda73592094 + unpetrify-ref: 2.44.0 +- name: gobject-introspection + repo: upstream:gobject-introspection + ref: c0243e116c5e261c262dded9f4d7726a770c5a19 + unpetrify-ref: GOBJECT_INTROSPECTION_1_44_0 + build-depends: + - glib diff --git a/strata/graphics-common.morph b/strata/graphics-common.morph index c23ec829..5ba4d200 100644 --- a/strata/graphics-common.morph +++ b/strata/graphics-common.morph @@ -1,6 +1,7 @@ name: graphics-common kind: stratum build-depends: +- morph: strata/glib-common.morph - morph: strata/mesa-common.morph - morph: strata/x-common.morph chunks: diff --git a/strata/java/java-ant.morph b/strata/java/java-ant.morph index 172483ab..13c490d4 100644 --- a/strata/java/java-ant.morph +++ b/strata/java/java-ant.morph @@ -1,4 +1,4 @@ -name: ant +name: java-ant kind: chunk build-commands: - | diff --git a/strata/libdrm-common/drm.morph b/strata/libdrm-common/drm.morph index a614a831..4b0bdcc1 100644 --- a/strata/libdrm-common/drm.morph +++ b/strata/libdrm-common/drm.morph @@ -4,12 +4,14 @@ build-system: autotools pre-configure-commands: # Tegra requires a new coherent BO attribute, not currently upstream, so # patch it here - - sed -i '/NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)/a#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)' include/drm/nouveau_drm.h + - sed -i '/NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)/a#define NOUVEAU_GEM_DOMAIN_COHERENT (1 + << 4)' include/drm/nouveau_drm.h - | sed -i '/info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE;/a\ if (bo->flags & NOUVEAU_BO_COHERENT)\ info->domain |= NOUVEAU_GEM_DOMAIN_COHERENT;' nouveau/abi16.c - - sed -i '/NOUVEAU_BO_NOSNOOP 0x20000000/a#define NOUVEAU_BO_COHERENT 0x10000000' nouveau/nouveau.h + - sed -i '/NOUVEAU_BO_NOSNOOP 0x20000000/a#define NOUVEAU_BO_COHERENT 0x10000000' + nouveau/nouveau.h configure-commands: - - NOCONFIGURE=1 ./autogen.sh - - ./configure --prefix="$PREFIX" --enable-tegra-experimental-api --enable-freedreno-experimental-api +- NOCONFIGURE=1 ./autogen.sh +- ./configure --prefix="$PREFIX" --enable-tegra-experimental-api --enable-freedreno-experimental-api diff --git a/strata/libsoup-common.morph b/strata/libsoup-common.morph index ca81b6e0..759a842c 100644 --- a/strata/libsoup-common.morph +++ b/strata/libsoup-common.morph @@ -2,9 +2,10 @@ name: libsoup-common kind: stratum build-depends: - morph: strata/core.morph +- morph: strata/glib-common.morph chunks: - name: libsoup morph: strata/libsoup-common/libsoup.morph repo: upstream:libsoup - ref: ce764489e358bad6b49418f5c8bc7b25a4b1815e - unpetrify-ref: baserock/morph + ref: c29630a8fdb4e6997ec27da4af545bddefab35ad + unpetrify-ref: 2.48.0 diff --git a/strata/llvm-common/llvm.morph b/strata/llvm-common/llvm.morph index 9d280062..d47d1837 100644 --- a/strata/llvm-common/llvm.morph +++ b/strata/llvm-common/llvm.morph @@ -3,6 +3,7 @@ kind: chunk description: Low Level Virtual Machine build-system: autotools configure-commands: -- ./configure --prefix="$PREFIX" --sysconfdir=/etc --enable-shared --enable-targets=host --enable-optimized --disable-assertions +- ./configure --prefix="$PREFIX" --sysconfdir=/etc --enable-shared --enable-targets=host + --enable-optimized --disable-assertions build-commands: - make $MAKEFLAGS diff --git a/strata/lorry.morph b/strata/lorry.morph index b3a0c779..3f5722ee 100644 --- a/strata/lorry.morph +++ b/strata/lorry.morph @@ -12,6 +12,7 @@ description: | build-depends: - morph: strata/foundation.morph - morph: strata/python-cliapp.morph +- morph: strata/pcre-utils.morph # for swig chunks: - name: bzr-tarball repo: upstream:bzr-tarball @@ -56,7 +57,7 @@ chunks: unpetrify-ref: baserock/morph build-depends: - perl-dbi-tarball -- name: libserf-tarball +- name: libserf morph: strata/lorry/libserf.morph repo: upstream:libserf-tarball ref: 6f61a1acd01dc2ad1d2f5c1f7458702c77c69f9c @@ -64,11 +65,11 @@ chunks: build-depends: - libapr - libapr-util -- name: swig-tarball - morph: strata/lorry/swig-tarball.morph - repo: upstream:swig-tarball - ref: 1f6cb46b6a4b3ebf9352fa10198b0b286f84138b - unpetrify-ref: baserock/morph +- name: swig + morph: strata/lorry/swig.morph + repo: upstream:swig + ref: 4e23595704d6ddffe4e50ca41bbc90e4b8893f4d + unpetrify-ref: rel-3.0.6 - name: neon morph: strata/lorry/neon.morph repo: upstream:neon @@ -77,13 +78,13 @@ chunks: - name: subversion-tarball morph: strata/lorry/subversion-tarball.morph repo: upstream:subversion-tarball - ref: 2d02ea6f31311bf1b72f28c48d784b8d851ff2e0 - unpetrify-ref: baserock/morph + ref: bb0ef45f7c46b0ae221b26265ef98a768c33f820 + unpetrify-ref: subversion-1.8.13 build-depends: - - swig-tarball + - swig - libapr - libapr-util - - libserf-tarball + - libserf - neon - name: mercurial-tarball morph: strata/lorry/mercurial-tarball.morph @@ -105,7 +106,7 @@ chunks: - name: lorry morph: strata/lorry/lorry.morph repo: baserock:baserock/lorry - ref: 4fcff82742ce3325a860c060b597ff281872c594 + ref: a55f642cd3e2d7e330cf96ff9f9eb5d03ae39192 unpetrify-ref: master build-depends: - bzr-tarball diff --git a/strata/lorry/cvs-tarball.morph b/strata/lorry/cvs-tarball.morph index 5f34bc57..e03250e2 100644 --- a/strata/lorry/cvs-tarball.morph +++ b/strata/lorry/cvs-tarball.morph @@ -7,3 +7,4 @@ pre-configure-commands: configure-commands: - YACC='bison -y' ./configure --prefix "$PREFIX" --with-external-zlib --without-gssapi --without-krb4 --disable-dependency-tracking --disable-nls --disable-rpath + --enable-rootcommit diff --git a/strata/lorry/swig-tarball.morph b/strata/lorry/swig.morph index 7d16d85b..8a7d51b6 100644 --- a/strata/lorry/swig-tarball.morph +++ b/strata/lorry/swig.morph @@ -1,4 +1,4 @@ -name: swig-tarball +name: swig kind: chunk build-system: autotools pre-configure-commands: diff --git a/strata/lvm/lvm2.morph b/strata/lvm/lvm2.morph index 9b4a68bf..49b5f0fc 100644 --- a/strata/lvm/lvm2.morph +++ b/strata/lvm/lvm2.morph @@ -8,7 +8,7 @@ configure-commands: # '${exec_prefix}/sbin' in the generated .service files. # # udev rules *must* go in /lib, they'll be ignored if they go in /usr/lib. -- > +- | ./configure --prefix="$PREFIX" \ --sbindir="$PREFIX"/sbin \ --with-udev-prefix=/ \ diff --git a/strata/morph-utils.morph b/strata/morph-utils.morph index 58ca0db7..f5e3568a 100644 --- a/strata/morph-utils.morph +++ b/strata/morph-utils.morph @@ -36,9 +36,21 @@ chunks: unpetrify-ref: master - name: morph repo: baserock:baserock/morph - ref: 2579391b05758940652a8ac5207d0137720affd1 + ref: 60c378c55d5d0ef89184b49ae95e445f8de422e3 unpetrify-ref: master build-depends: - cmdtest - pyfilesystem - pylru + +# This chunk isn't required to use Morph, but is required to do automated +# migrations within the definitions.git repo. +# +# Currently we include a forked version that includes some support for +# preserving blank lines. This is quite useful when operating on .morph files. +# The patches have been submitted upstream here: +# https://bitbucket.org/ruamel/yaml/pull-request/3 +- name: ruamel.yaml + repo: upstream:python-packages/ruamel.yaml + ref: 840b3ccdb306c6aa6d874474e621ae5596595ae4 + unpetrify-ref: baserock/sam/blank-line-preservation-1 diff --git a/strata/multimedia-common.morph b/strata/multimedia-common.morph index 69f3ccad..2eaedabf 100644 --- a/strata/multimedia-common.morph +++ b/strata/multimedia-common.morph @@ -5,12 +5,29 @@ build-depends: - morph: strata/core.morph chunks: - name: ogg - repo: upstream:ogg - ref: 0deb6226917e32a71f15d5279d0bc76d8b97c13f + repo: upstream:ogg-git + ref: 9b2ba419aecb4a1c97114545d57174593dc13111 unpetrify-ref: master - name: libvorbis - repo: upstream:libvorbis - ref: 2ae58009cbc655a6031280f92fb1e7b324318ae8 - unpetrify-ref: libvorbis-1.3.3 + repo: upstream:libvorbis-git + ref: 7187e7a48f0c3ba32cc080f6bc3d921fe4ec6cc2 + unpetrify-ref: master + build-depends: + - ogg +- name: tremor + repo: upstream:tremor + ref: b56ffce0c0773ec5ca04c466bc00b1bbcaf65aef + unpetrify-ref: master + build-depends: + - ogg +- name: flac + repo: upstream:flac + ref: 6ced857c253d5da286bf31adfd74a627aaa43c77 + unpetrify-ref: master build-depends: - ogg +- name: libmad + morph: strata/multimedia-common/libmad.morph + repo: upstream:libmad-tarball + ref: f2b21c41aef22e81b605afe96e1e6ef1bea0cfdc + unpetrify-ref: baserock/0.15.1b-gstreamer-sdk-fork diff --git a/strata/multimedia-common/libmad.morph b/strata/multimedia-common/libmad.morph new file mode 100644 index 00000000..839adc15 --- /dev/null +++ b/strata/multimedia-common/libmad.morph @@ -0,0 +1,10 @@ +name: libmad +kind: chunk +build-system: autotools +configure-commands: +- | + OPTS= + case $MORPH_ARCH in + mips64*) ARCH_FLAGS="--enable-fpm=64bit" ;; + esac + ./configure --prefix="$PREFIX" $ARCH_FLAGS diff --git a/strata/networking-utils.morph b/strata/networking-utils.morph index e9ba3cde..880371cd 100644 --- a/strata/networking-utils.morph +++ b/strata/networking-utils.morph @@ -1,14 +1,19 @@ name: networking-utils kind: stratum description: | - Stratum which contains utils to works with networks: create, enable, filter... + Stratum which contains utils to works with networks: create, enable, filter... - This stratum requires kernel config flags which are not enabled in the default - Baserock kernel found in the BSP strata. See the Openstack BSP stratum to get - an idea of what is needed. + This stratum requires kernel config flags which are not enabled in the default + Baserock kernel found in the BSP strata. See the Openstack BSP stratum to get + an idea of what is needed. build-depends: - morph: strata/foundation.morph chunks: +- name: ebtables + morph: strata/networking-utils/ebtables.morph + repo: upstream:ebtables + ref: f4bdc80ae8c1a79b4ab5dcb8431ad85aea618d66 + unpetrify-ref: master - name: iproute2 morph: strata/networking-utils/iproute2.morph repo: upstream:iproute2 @@ -42,7 +47,7 @@ chunks: repo: upstream:libnet ref: 05df365769597e1d64d02af931d6127762ff2658 unpetrify-ref: libnet-1.2 -- name: arping +- name: iputils morph: strata/networking-utils/iputils.morph repo: upstream:iputils ref: d25e54e25107bc7c5d14737ed65f5f52b54f1472 @@ -50,3 +55,50 @@ chunks: build-depends: - libpcap - libnet +- name: libnfnetlink + morph: strata/networking-utils/libnfnetlink.morph + repo: upstream:libnfnetlink + ref: 1166116e34af868bc814aea338c246e49a7a8748 + unpetrify-ref: libnfnetlink-1.0.1 +- name: libnetfilter_conntrack + morph: strata/networking-utils/libnetfilter_conntrack.morph + repo: upstream:libnetfilter_conntrack + ref: 5ad6ecff6edffd925022372323e42264f61e850d + unpetrify-ref: libnetfilter_conntrack-1.0.4 + build-depends: + - libnfnetlink + - libmnl +- name: libnetfilter_cthelper + morph: strata/networking-utils/libnetfilter_cthelper.morph + repo: upstream:libnetfilter_cthelper + ref: b8df12f352db62d26e5116e960d24774d5c9f3b7 + unpetrify-ref: libnetfilter_cthelper-1.0.0 + build-depends: + - libmnl +- name: libnetfilter_cttimeout + morph: strata/networking-utils/libnetfilter_cttimeout.morph + repo: upstream:libnetfilter_cttimeout + ref: 329652bef21c831dae1a9a79084b999d40b4eb5b + unpetrify-ref: libnetfilter_cttimeout-1.0.0 + build-depends: + - libmnl +- name: libnetfilter_queue + morph: strata/networking-utils/libnetfilter_queue.morph + repo: upstream:libnetfilter_queue + ref: f5d092dd3145d427c7c2ed668e3ac899875c9612 + unpetrify-ref: libnetfilter_queue-1.0.2 + build-depends: + - libnfnetlink + - libmnl +- name: conntrack-tools + morph: strata/networking-utils/conntrack-tools.morph + repo: upstream:conntrack-tools + ref: fbe3181be4f2e33509b1c20b95fd55eb3e7075d7 + unpetrify-ref: conntrack-tools-1.4.2 + build-depends: + - libnfnetlink + - libmnl + - libnetfilter_conntrack + - libnetfilter_cttimeout + - libnetfilter_cthelper + - libnetfilter_queue diff --git a/strata/networking-utils/conntrack-tools.morph b/strata/networking-utils/conntrack-tools.morph new file mode 100644 index 00000000..e0ef7234 --- /dev/null +++ b/strata/networking-utils/conntrack-tools.morph @@ -0,0 +1,4 @@ +name: conntrack-tools +kind: chunk +build-system: autotools +max-jobs: 1 diff --git a/strata/virtualization/ebtables.morph b/strata/networking-utils/ebtables.morph index a4d9fc76..a4d9fc76 100644 --- a/strata/virtualization/ebtables.morph +++ b/strata/networking-utils/ebtables.morph diff --git a/strata/networking-utils/libnet.morph b/strata/networking-utils/libnet.morph index c4f2b213..ddb2cf3e 100644 --- a/strata/networking-utils/libnet.morph +++ b/strata/networking-utils/libnet.morph @@ -8,7 +8,8 @@ pre-configure-commands: - cd libnet && ./autogen.sh configure-commands: -- cd libnet && ./configure --prefix="$PREFIX" --disable-samples --enable-shared=yes --with-pic +- cd libnet && ./configure --prefix="$PREFIX" --disable-samples --enable-shared=yes + --with-pic build-commands: - cd libnet && make install-commands: diff --git a/strata/networking-utils/libnetfilter_conntrack.morph b/strata/networking-utils/libnetfilter_conntrack.morph new file mode 100644 index 00000000..ef6ebb48 --- /dev/null +++ b/strata/networking-utils/libnetfilter_conntrack.morph @@ -0,0 +1,3 @@ +name: libnetfilter_conntrack +kind: chunk +build-system: autotools diff --git a/strata/networking-utils/libnetfilter_cthelper.morph b/strata/networking-utils/libnetfilter_cthelper.morph new file mode 100644 index 00000000..7f410a4a --- /dev/null +++ b/strata/networking-utils/libnetfilter_cthelper.morph @@ -0,0 +1,3 @@ +name: libnetfilter_cthelper +kind: chunk +build-system: autotools diff --git a/strata/networking-utils/libnetfilter_cttimeout.morph b/strata/networking-utils/libnetfilter_cttimeout.morph new file mode 100644 index 00000000..b2281a5b --- /dev/null +++ b/strata/networking-utils/libnetfilter_cttimeout.morph @@ -0,0 +1,3 @@ +name: libnetfilter_cttimeout +kind: chunk +build-system: autotools diff --git a/strata/networking-utils/libnetfilter_queue.morph b/strata/networking-utils/libnetfilter_queue.morph new file mode 100644 index 00000000..d2b80d38 --- /dev/null +++ b/strata/networking-utils/libnetfilter_queue.morph @@ -0,0 +1,3 @@ +name: libnetfilter_queue +kind: chunk +build-system: autotools diff --git a/strata/networking-utils/libnfnetlink.morph b/strata/networking-utils/libnfnetlink.morph new file mode 100644 index 00000000..f4fe79ab --- /dev/null +++ b/strata/networking-utils/libnfnetlink.morph @@ -0,0 +1,3 @@ +name: libnfnetlink +kind: chunk +build-system: autotools diff --git a/strata/nfs/nfs-utils.morph b/strata/nfs/nfs-utils.morph index c412e1d0..8116a9f4 100644 --- a/strata/nfs/nfs-utils.morph +++ b/strata/nfs/nfs-utils.morph @@ -3,7 +3,8 @@ 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 +- ./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 diff --git a/strata/ntpd/ntpd.morph b/strata/ntpd/ntpd.morph index 49316c14..762762c7 100644 --- a/strata/ntpd/ntpd.morph +++ b/strata/ntpd/ntpd.morph @@ -2,7 +2,7 @@ name: ntpd kind: chunk build-system: autotools configure-commands: - - ./configure --prefix="$PREFIX" --enable-linuxcaps +- ./configure --prefix="$PREFIX" --enable-linuxcaps post-install-commands: - | cat > ntpd.service << EOF @@ -13,7 +13,7 @@ post-install-commands: [Service] Type=forking - ExecStart=/usr/bin/ntpd -u ntp:ntp + ExecStart=/usr/bin/ntpd -u ntp:ntp -Ng PrivateTmp=True Restart=on-failure @@ -40,8 +40,8 @@ post-install-commands: # matching hosts # # see ntp.conf(5) for more details - restrict -4 default kod notrap nomodify - restrict -6 default kod notrap nomodify + restrict -4 default limit kod notrap nomodify + restrict -6 default limit kod notrap nomodify EOF - install -D -m 644 ntp.conf "$DESTDIR"/etc/ntp.conf system-integration: diff --git a/strata/openstack-clients.morph b/strata/openstack-clients.morph index da177fce..2b458cc1 100644 --- a/strata/openstack-clients.morph +++ b/strata/openstack-clients.morph @@ -57,6 +57,16 @@ chunks: build-depends: - cmd2 - pyparsing +- name: tablib + morph: strata/openstack-clients/tablib.morph + repo: upstream:python-packages/tablib + ref: 1cc051f3e881289a8b51133c0c1ee73683b2d6fc + unpetrify-ref: v0.10.0 +- name: cliff-tablib + morph: strata/openstack-clients/cliff-tablib.morph + repo: upstream:python-packages/cliff-tablib + ref: a83bf47d7dfbb690dd53e189c532f0859898db04 + unpetrify-ref: 1.1 - name: python-neutronclient repo: upstream:openstack/python-neutronclient ref: aa1215a5ad063b299d32ef319eb63d5210249a9b @@ -101,3 +111,29 @@ chunks: repo: upstream:openstack/python-ironicclient ref: 4390a21663de3123fac306e9860624ba7deda0e6 unpetrify-ref: 0.4.1 +# Despite argparse being part of the Python 2.7's standard library, the +# pkg_resources module used by python-openstackclient doesn't look into +# the standard library, resulting in a 'DistributionNotFound: argparse' +# error. Hence, install argparse separately. +- name: argparse + morph: strata/openstack-clients/argparse.morph + repo: upstream:argparse + ref: ec94cd429c56487e89425f226284009f78a596c6 + unpetrify-ref: r130 +# The latest release of python-openstackclient is not being used as it +# requires newer versions of glance, neutron, keystone and nova. +- name: python-openstackclient + morph: strata/openstack-clients/python-openstackclient.morph + repo: upstream:openstack/python-openstackclient + ref: 28f65e665045c1c6d0697f856f06020c7c8e656a + unpetrify-ref: 1.2.0 +- name: os-client-config + morph: strata/openstack-clients/os-client-config.morph + repo: upstream:openstack/os-client-config + ref: a0df67704ace186b18fd1ecdc220a7e56409bc6f + unpetrify-ref: 1.3.0 +- name: appdirs + morph: strata/openstack-clients/appdirs.morph + repo: upstream:python-packages/appdirs + ref: 57f2bc44a8bca99bac6c57496c8b3fdea26f94d5 + unpetrify-ref: 1.4.0 diff --git a/strata/openstack-clients/appdirs.morph b/strata/openstack-clients/appdirs.morph new file mode 100644 index 00000000..53d0e476 --- /dev/null +++ b/strata/openstack-clients/appdirs.morph @@ -0,0 +1,3 @@ +name: appdirs +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-clients/argparse.morph b/strata/openstack-clients/argparse.morph new file mode 100644 index 00000000..499df5f5 --- /dev/null +++ b/strata/openstack-clients/argparse.morph @@ -0,0 +1,3 @@ +name: argparse +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-clients/cliff-tablib.morph b/strata/openstack-clients/cliff-tablib.morph new file mode 100644 index 00000000..4b48ba14 --- /dev/null +++ b/strata/openstack-clients/cliff-tablib.morph @@ -0,0 +1,3 @@ +name: cliff-tablib +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-clients/os-client-config.morph b/strata/openstack-clients/os-client-config.morph new file mode 100644 index 00000000..13c473d2 --- /dev/null +++ b/strata/openstack-clients/os-client-config.morph @@ -0,0 +1,3 @@ +name: os-client-config +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-clients/python-openstackclient.morph b/strata/openstack-clients/python-openstackclient.morph new file mode 100644 index 00000000..a4c9fae7 --- /dev/null +++ b/strata/openstack-clients/python-openstackclient.morph @@ -0,0 +1,3 @@ +name: python-openstackclient +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-clients/tablib.morph b/strata/openstack-clients/tablib.morph new file mode 100644 index 00000000..821ceb95 --- /dev/null +++ b/strata/openstack-clients/tablib.morph @@ -0,0 +1,3 @@ +name: tablib +kind: chunk +build-system: python-distutils diff --git a/strata/openstack-common.morph b/strata/openstack-common.morph index 86c80107..b66d0144 100644 --- a/strata/openstack-common.morph +++ b/strata/openstack-common.morph @@ -1,8 +1,8 @@ name: openstack-common kind: stratum description: | - Stratum with the python packages needed to compile openstack - clients and services. + Stratum with the python packages needed to compile openstack + clients and services. build-depends: - morph: strata/python-common.morph - morph: strata/foundation.morph @@ -25,9 +25,10 @@ chunks: morph: strata/openstack-common/babel.morph repo: upstream:babel # Babel requires core-23.1.zip to be present when compiles -# from source, the following branch and commit add this file -# to the repository. - ref: 603e77ae0e43b6ecdb3f3a8ea7988f7e7c83e867 +# from source, the following branch adds this file to the +# repository, and stops the date being added to the version +# number when running `python setup.py install`. + ref: 1891d93b10e6c11ab08099b95001b17e88315c2a unpetrify-ref: baserock/1.3-50-g246996b build-depends: - pytz diff --git a/strata/openstack-services.morph b/strata/openstack-services.morph index 6189527f..1feb1427 100644 --- a/strata/openstack-services.morph +++ b/strata/openstack-services.morph @@ -245,7 +245,7 @@ chunks: morph: strata/openstack-services/qpid-python.morph repo: upstream:python-packages/qpid-python ref: 587b0febaf1996db1e483137ed6addb45580ee9e - unpetrify-ref: 0.30 + unpetrify-ref: '0.30' - name: simplegeneric-tarball repo: upstream:python-packages/simplegeneric-tarball ref: 601fab9b154c557dfd848d531a8969f4697d1aa2 @@ -364,7 +364,6 @@ chunks: unpetrify-ref: 0.9.0 build-depends: - oslo-context - build-depends: - oslo-messaging - posix-ipc-tarball - name: keystonemiddleware @@ -659,7 +658,7 @@ chunks: morph: strata/openstack-services/tempest.morph repo: upstream:openstack/tempest ref: 26149b612d01ad605e4d0f41a2d67280c8088cda - unpetrify-ref: "4" + unpetrify-ref: '4' build-depends: - tempest-lib - name: tftp-hpa diff --git a/strata/openstack-services/open-iscsi.morph b/strata/openstack-services/open-iscsi.morph index 9d135ab2..6a0b73b3 100644 --- a/strata/openstack-services/open-iscsi.morph +++ b/strata/openstack-services/open-iscsi.morph @@ -6,7 +6,8 @@ install-commands: # Rewrite prefix and exec_prefix which are set to "/usr" and "/" respectively - make prefix="$PREFIX" exec_prefix="$PREFIX" DESTDIR="$DESTDIR" install # Install iscsistart app which is not listed by default in PROGRAMS -- make prefix="$PREFIX" exec_prefix="$PREFIX" DESTDIR="$DESTDIR" PROGRAMS="usr/iscsistart" install +- make prefix="$PREFIX" exec_prefix="$PREFIX" DESTDIR="$DESTDIR" PROGRAMS="usr/iscsistart" + install post-install-commands: # Configure iscsi daemon # Point the startup to the installed binary diff --git a/strata/python-pygobject.morph b/strata/python-pygobject.morph index 39f74f6d..53e9fd72 100644 --- a/strata/python-pygobject.morph +++ b/strata/python-pygobject.morph @@ -4,6 +4,7 @@ description: | Python GObject bindings build-depends: - morph: strata/core.morph +- morph: strata/glib-common.morph chunks: - name: pygobject morph: strata/python-pygobject/pygobject.morph diff --git a/strata/python-tools.morph b/strata/python-tools.morph index a84697af..e380530f 100644 --- a/strata/python-tools.morph +++ b/strata/python-tools.morph @@ -1,7 +1,7 @@ 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." +description: | + A stratum for useful python tools that we don't want to include in core. build-depends: - morph: strata/python-core.morph chunks: diff --git a/strata/python3-core.morph b/strata/python3-core.morph index 192e9201..f0da65fc 100644 --- a/strata/python3-core.morph +++ b/strata/python3-core.morph @@ -7,5 +7,5 @@ chunks: - name: python3 morph: strata/python3-core/python3.morph repo: upstream:cpython - ref: d1414cefaddc7b56caef75eea87226b1fce5ca7c - unpetrify-ref: v3.4.2 + ref: 3f1e8a3de39ff8a807720d57f49a91d7449435ad + unpetrify-ref: v3.4.3 diff --git a/strata/qt5-tools-qtwebkit.morph b/strata/qt5-tools-qtwebkit.morph index 53d5a682..bb86d6b5 100644 --- a/strata/qt5-tools-qtwebkit.morph +++ b/strata/qt5-tools-qtwebkit.morph @@ -10,7 +10,7 @@ chunks: morph: strata/qt5-tools/qtwebkit.morph repo: upstream:qt5/qtwebkit ref: 586bdc38324dfaeec65389bf7646c82cb35db017 - unpetrify-ref: "5.4.2" + unpetrify-ref: 5.4.2 - name: qtwebkit-examples morph: strata/qt5-tools/qtwebkit-examples.morph repo: upstream:qt5/qtwebkit-examples diff --git a/strata/samba.morph b/strata/samba.morph new file mode 100644 index 00000000..33dcd856 --- /dev/null +++ b/strata/samba.morph @@ -0,0 +1,12 @@ +name: samba +kind: stratum +description: Simple samba server +build-depends: +- morph: strata/core.morph +- morph: strata/foundation.morph +chunks: +- name: samba + morph: strata/samba/samba.morph + repo: upstream:samba + ref: 704592c14dfedbe98e95d43860d062dc6338bca3 + unpetrify-ref: master diff --git a/strata/samba/samba.morph b/strata/samba/samba.morph new file mode 100644 index 00000000..748ee886 --- /dev/null +++ b/strata/samba/samba.morph @@ -0,0 +1,127 @@ +name: samba +kind: chunk +configure-commands: +- | + # Here are really really ugly hacks: + # + # This fixes a problem with ./configure and recent compilers + # which implement c9x by default. + sed -i "s/#define bool int//" source3/lib/util_sec.c + # + # This fixes the problem with Baserock build environments running + # as root but sandboxed, and preventing certain privileged operations + # from taking effect. eg. seteuid() + # Instead, convince it that we're not running as root so that it + # doesn't run these tests. + sed -i "s/getuid() != 0/1/" source3/lib/util_sec.c + # + # + ./configure \ + --without-ldap \ + --disable-gnutls \ + --without-ad-dc \ + --without-acl-support \ + --without-ads \ + --prefix="$PREFIX" --sysconfdir=/etc --localstatedir=/var --enable-fhs +build-commands: +- make +install-commands: +- make install DESTDIR="$DESTDIR" +# systemd configuration +- mkdir -p "$DESTDIR/etc/tmpfiles.d" +- install -m 644 ./packaging/systemd/samba.conf.tmp "$DESTDIR/etc/tmpfiles.d/samba.conf" +- mkdir -p "$DESTDIR/lib/systemd/system/multi-user.target.wants" +- | + cat <<EOF >"$DESTDIR/lib/systemd/system/nmb.service" + [Unit] + Description=Samba NMB Daemon + After=syslog.target network-online.target + + [Service] + Type=forking + PIDFile=/var/run/samba/nmbd.pid + EnvironmentFile=-/etc/sysconfig/samba + ExecStart=$PREFIX/sbin/nmbd \$NMBDOPTIONS + ExecReload=$PREFIX/bin/kill -HUP \$MAINPID + + [Install] + WantedBy=multi-user.target + EOF +- | + cat <<EOF >"$DESTDIR/lib/systemd/system/smb.service" + [Unit] + Description=Samba SMB Daemon + After=syslog.target network-online.target nmb.service winbind.service + + [Service] + Type=forking + PIDFile=/var/run/samba/smbd.pid + EnvironmentFile=-/etc/sysconfig/samba + ExecStart=$PREFIX/sbin/smbd \$NMBDOPTIONS + ExecReload=$PREFIX/bin/kill -HUP \$MAINPID + + [Install] + WantedBy=multi-user.target + EOF +- | + cat <<EOF >"$DESTDIR/lib/systemd/system/winbind.service" + [Unit] + Description=Samba winbind Daemon + After=syslog.target network-online.target nmb.service + + [Service] + Type=forking + PIDFile=/var/run/samba/winbindd.pid + EnvironmentFile=-/etc/sysconfig/samba + ExecStart=$PREFIX/sbin/winbindd \$NMBDOPTIONS + ExecReload=$PREFIX/bin/kill -HUP \$MAINPID + + [Install] + WantedBy=multi-user.target + EOF +- | + for i in nmb smb winbind + do + ln -s ../$i.service "$DESTDIR/lib/systemd/system/multi-user.target.wants/$i.service" + done +- mkdir -p "$DESTDIR/var/log/samba" +# Install a sample configuration +- mkdir -p "$DESTDIR/etc/samba" +- | + cat <<EOF >"$DESTDIR/etc/samba/smb.conf" + [global] + workgroup = WORKGROUP + dns proxy = no + local master = yes + preferred master = yes + os level = 2 + log file = /var/log/samba/log.%m + max log size = 1000 + syslog = 0 + server role = standalone server + passdb backend = tdbsam + obey pam restrictions = yes + unix password sync = yes + pam password change = yes + map to guest = bad user + usershare allow guests = yes + [homes] + comment = Home Directories + browseable = no + read only = yes + create mask = 0700 + valid users = %S + ;[printers] + ;comment = All Printers + ;browseable = no + ;path = /var/spool/samba + ;printable = yes + ;guest ok = no + ;read only = yes + ;create mask = 0700 + ;[src] + ;comment = Source code + ;path = /src + ;read only = yes + ;guest ok = yes + EOF diff --git a/strata/swift.morph b/strata/swift.morph index 6045727a..6afcc832 100644 --- a/strata/swift.morph +++ b/strata/swift.morph @@ -16,6 +16,7 @@ chunks: ref: dd10d44e3eb9a1d2303c1f7d5126c099d56e97fc unpetrify-ref: v0.7.6 - name: liberasurecode + morph: strata/swift/liberasurecode.morph repo: upstream:liberasurecode ref: a380246762c16ea8eb7dbfccd50d296c3743b39e unpetrify-ref: v1.0.7 diff --git a/strata/swift/liberasurecode.morph b/strata/swift/liberasurecode.morph new file mode 100644 index 00000000..68839403 --- /dev/null +++ b/strata/swift/liberasurecode.morph @@ -0,0 +1,5 @@ +name: liberasurecode +kind: chunk +build-system: autotools +pre-configure-commands: +- autoreconf -ivf diff --git a/strata/test-tools/subunit.morph b/strata/test-tools/subunit.morph index b7b43a39..0d3819ed 100644 --- a/strata/test-tools/subunit.morph +++ b/strata/test-tools/subunit.morph @@ -1,3 +1,3 @@ -name: python-subunit +name: subunit kind: chunk build-system: autotools diff --git a/strata/tools.morph b/strata/tools.morph index 4128cad9..bfde546f 100644 --- a/strata/tools.morph +++ b/strata/tools.morph @@ -3,16 +3,13 @@ kind: stratum description: Various tools build-depends: - morph: strata/core.morph +- morph: strata/glib-common.morph chunks: - name: distcc morph: strata/tools/distcc.morph repo: upstream:distcc ref: c9691a9604fdf9d6711204999787d332b7141692 unpetrify-ref: baserock/morph -- name: file - repo: upstream:file - ref: f69c3fd9bcb108292e7887dd889e8b49f68c4a52 - unpetrify-ref: file-5.22 - name: gdb morph: strata/tools/gdb.morph repo: upstream:binutils-gdb @@ -71,8 +68,6 @@ chunks: repo: upstream:ipmitool ref: be7917f9f58c8a354bc0960ed57516af5d2bd29a unpetrify-ref: IPMITOOL_1_8_14 - build-depends: - - file - name: parted morph: strata/tools/parted.morph repo: upstream:parted diff --git a/strata/tools/gdb.morph b/strata/tools/gdb.morph index 808ff7d7..6f60da9e 100644 --- a/strata/tools/gdb.morph +++ b/strata/tools/gdb.morph @@ -2,4 +2,5 @@ name: gdb kind: chunk build-system: autotools configure-commands: -- ./configure --prefix="$PREFIX" --disable-werror --disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof +- ./configure --prefix="$PREFIX" --disable-werror --disable-gas --disable-binutils + --disable-ld --disable-gold --disable-gprof diff --git a/strata/tools/procps-ng.morph b/strata/tools/procps-ng.morph index 69df3d4a..e030b36c 100644 --- a/strata/tools/procps-ng.morph +++ b/strata/tools/procps-ng.morph @@ -9,11 +9,11 @@ description: | build-system: autotools configure-commands: - - NOCONFIGURE=1 ./autogen.sh +- NOCONFIGURE=1 ./autogen.sh # Setting exec-prefix to /usr causes a bunch of stuff to go in /usr/usr/bin # Setting prefix to / causes files to go in /include and /share # So don't do either of those things! - - ./configure --prefix="$PREFIX" --exec-prefix=/ +- ./configure --prefix="$PREFIX" --exec-prefix=/ post-install-commands: # We need to link the binaries into /bin so that they override the Busybox diff --git a/strata/unionfs-fuse-group.morph b/strata/unionfs-fuse-group.morph index 914b18e0..acb094ea 100644 --- a/strata/unionfs-fuse-group.morph +++ b/strata/unionfs-fuse-group.morph @@ -1,21 +1,20 @@ name: unionfs-fuse-group kind: stratum -description: +description: | User-space union file system. - This is used by Morph for systems which are unable to use 'overlayfs'. - It is slower than 'overlayfs', because it runs outside rather than - inside the kernel, but 'overlayfs' is only available in Linux 3.18 and - newer. + This is used by Morph for systems which are unable to use 'overlayfs'. It is slower + than 'overlayfs', because it runs outside rather than inside the kernel, but 'overlayfs' + is only available in Linux 3.18 and newer. build-depends: # Depends on foundation for 'fuse', and maybe other stuff. - morph: strata/foundation.morph chunks: - - name: unionfs.fuse - morph: strata/unionfs-fuse-group/unionfs-fuse.morph - repo: upstream:unionfs-fuse - ref: efac5b7aa91ec860f8f430a8d21060fe53a07002 - unpetrify-ref: v0.26 +- name: unionfs-fuse + morph: strata/unionfs-fuse-group/unionfs-fuse.morph + repo: upstream:unionfs-fuse + ref: efac5b7aa91ec860f8f430a8d21060fe53a07002 + unpetrify-ref: v0.26 diff --git a/strata/unionfs-fuse-group/unionfs-fuse.morph b/strata/unionfs-fuse-group/unionfs-fuse.morph index 9b8ac2c7..98e1ce1f 100644 --- a/strata/unionfs-fuse-group/unionfs-fuse.morph +++ b/strata/unionfs-fuse-group/unionfs-fuse.morph @@ -1,8 +1,7 @@ name: unionfs-fuse kind: chunk -description: - User-space union file system. +description: User-space union file system. build-system: manual diff --git a/strata/virtualization.morph b/strata/virtualization.morph index 548019aa..f63b3599 100644 --- a/strata/virtualization.morph +++ b/strata/virtualization.morph @@ -1,10 +1,10 @@ name: virtualization kind: stratum description: | - Virtualization for baserock - NOTE: this stratum requires kernel support, please see openstack bsp - kernel history to check which config are needed for openvswitch, libvirt, - or ebtables, for example. + Virtualization for baserock + NOTE: this stratum requires kernel support, please see openstack bsp + kernel history to check which config are needed for openvswitch or libvirt, + for example. build-depends: - morph: strata/libsoup-common.morph - morph: strata/python-core.morph @@ -12,17 +12,14 @@ build-depends: - morph: strata/connman-common.morph - morph: strata/lvm.morph - morph: strata/xorg-util-macros-common.morph +- morph: strata/networking-utils.morph +- morph: strata/docutils.morph chunks: - name: yajl morph: strata/virtualization/yajl.morph repo: upstream:yajl ref: 52fc681857228c65c1cb439782da485554875481 unpetrify-ref: baserock/morph -- name: xml-catalog - morph: strata/virtualization/xml-catalog.morph - repo: baserock:baserock/xml-catalog - ref: 1d4a2abc875c4dda1b5eadc0a097a48a8d2ec82b - unpetrify-ref: master - name: dnsmasq morph: strata/virtualization/dnsmasq.morph repo: upstream:dnsmasq @@ -42,11 +39,6 @@ chunks: repo: upstream:dmidecode ref: 47a0aa5d6696a83922ee70279b7253a4e55947d5 unpetrify-ref: master -- name: ebtables - morph: strata/virtualization/ebtables.morph - repo: upstream:ebtables - ref: f4bdc80ae8c1a79b4ab5dcb8431ad85aea618d66 - unpetrify-ref: master - name: libvirt morph: strata/virtualization/libvirt.morph repo: upstream:libvirt @@ -56,10 +48,8 @@ chunks: - libpciaccess - dnsmasq - qemu - - xml-catalog - yajl - dmidecode - - ebtables - name: pycurl repo: upstream:pycurl ref: 5ca370827d88817eeca3c56cbb37e4ddccc16c6e diff --git a/strata/wayland-generic.morph b/strata/wayland-generic.morph index c1dde012..37a57c5b 100644 --- a/strata/wayland-generic.morph +++ b/strata/wayland-generic.morph @@ -12,7 +12,7 @@ chunks: - name: wayland morph: strata/wayland-generic/wayland.morph repo: upstream:wayland - ref: 8e9d5a108476b3435a8286613b9a63b69afd92b7 - unpetrify-ref: 1.7.0 + ref: 60024af597b68974c451c89f960a7c11de11c33a + unpetrify-ref: 1.8.0 build-depends: - libxkbcommon diff --git a/strata/weston-common.morph b/strata/weston-common.morph index 2925d72c..fbc5d5f1 100644 --- a/strata/weston-common.morph +++ b/strata/weston-common.morph @@ -10,5 +10,5 @@ chunks: - name: weston morph: strata/weston-common/weston.morph repo: upstream:weston - ref: 322383ed469d69401b502618718a97a4e85c97d8 - unpetrify-ref: baserock/weston-1.7.0/tegra + ref: 97a6d48e725956a58afad4450c5981c42ba4aa9c + unpetrify-ref: baserock/weston-1.8.0/tegra diff --git a/strata/x-common.morph b/strata/x-common.morph index 28e04fcc..33d7b5b6 100644 --- a/strata/x-common.morph +++ b/strata/x-common.morph @@ -100,7 +100,7 @@ chunks: - name: xcb-proto repo: upstream:xcb-proto ref: 4b384d2a015c50d0e93dcacda4b8260a3fd37640 - unpetrify-ref: "1.11" + unpetrify-ref: '1.11' - name: xorg-lib-libxshmfence repo: upstream:xorg-lib-libxshmfence ref: 9c4f070e1304a3503cfab08f68573443025fc4c9 @@ -116,7 +116,7 @@ chunks: - name: xcb-libxcb repo: upstream:xcb-libxcb ref: d1e8ec96fca4862f37ec9f0e9407bb989c4c161a - unpetrify-ref: "1.11" + unpetrify-ref: '1.11' build-depends: - xcb-proto - xorg-lib-libXau diff --git a/strata/xstatic.morph b/strata/xstatic.morph index 0b400dff..deb9d1ec 100644 --- a/strata/xstatic.morph +++ b/strata/xstatic.morph @@ -1,13 +1,13 @@ name: xstatic kind: stratum description: | - Stratum with Xstatic and some xstatic libraries. + Stratum with Xstatic and some xstatic libraries. - XStatic is a packaging standard to package external static files as - a python package, so they are easily usable on all OSes. + XStatic is a packaging standard to package external static files as + a python package, so they are easily usable on all OSes. - This conflicts with the 'everything from Git' policy of Baserock, - but it is required right now for the Openstack system to work. + This conflicts with the 'everything from Git' policy of Baserock, + but it is required right now for the Openstack system to work. build-depends: - morph: strata/foundation.morph - morph: strata/python-core.morph diff --git a/strata/zookeeper-server.morph b/strata/zookeeper-server.morph index 97acd2ca..483a3fde 100644 --- a/strata/zookeeper-server.morph +++ b/strata/zookeeper-server.morph @@ -1,6 +1,7 @@ name: zookeeper-server kind: stratum -description: This Stratum installs a zookeeper server and small program to populate it with default data. +description: This Stratum installs a zookeeper server and small program to populate + it with default data. build-depends: - morph: strata/zookeeper.morph chunks: diff --git a/strata/zookeeper/zookeeper-client.morph b/strata/zookeeper/zookeeper-client.morph index 591c1840..7bc99f08 100644 --- a/strata/zookeeper/zookeeper-client.morph +++ b/strata/zookeeper/zookeeper-client.morph @@ -1,17 +1,17 @@ name: zookeeper-client kind: chunk build-commands: - - mkdir -p "$DESTDIR$PREFIX"/zookeeper-client - - cp -r * "$DESTDIR$PREFIX"/zookeeper-client - - make -C "$DESTDIR$PREFIX"/zookeeper-client/ZKTest/Release/ +- mkdir -p "$DESTDIR$PREFIX"/zookeeper-client +- cp -r * "$DESTDIR$PREFIX"/zookeeper-client +- make -C "$DESTDIR$PREFIX"/zookeeper-client/ZKTest/Release/ post-install-commands: - - | - install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-client.service - [unit] - Description=Zookeeper client init - [Service] - ExecStart=/usr/zookeeper-client/ZKTest/Release/ZKTest nodeTypeOne 10.24.1.198 - RemainAfterExit=yes - [Install] - WantedBy=multi-user.target - EOF +- | + install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-client.service + [unit] + Description=Zookeeper client init + [Service] + ExecStart=/usr/zookeeper-client/ZKTest/Release/ZKTest nodeTypeOne 10.24.1.198 + RemainAfterExit=yes + [Install] + WantedBy=multi-user.target + EOF diff --git a/strata/zookeeper/zookeeper-server.morph b/strata/zookeeper/zookeeper-server.morph index 082c063c..502bbda3 100644 --- a/strata/zookeeper/zookeeper-server.morph +++ b/strata/zookeeper/zookeeper-server.morph @@ -1,30 +1,30 @@ name: zookeeper-server kind: chunk build-commands: - - mkdir -p "$DESTDIR$PREFIX"/zookeeper_server - - cp -r * "$DESTDIR$PREFIX"/zookeeper_server - - make -C "$DESTDIR$PREFIX"/zookeeper_server/zkServerFileSetup/Release/ +- mkdir -p "$DESTDIR$PREFIX"/zookeeper_server +- cp -r * "$DESTDIR$PREFIX"/zookeeper_server +- make -C "$DESTDIR$PREFIX"/zookeeper_server/zkServerFileSetup/Release/ post-install-commands: - - | - install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-server.service - [unit] - Description=Zookeeper server - [Service] - ExecStart=/usr/zookeeper/bin/zkServer.sh start - RemainAfterExit=yes - [Install] - WantedBy=multi-user.target - EOF - - | - install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-init.service - [unit] - Description=Zookeeper server init - [Service] - ExecStart=/usr/zookeeper_server/zkServerFileSetup/Release/zkServerFileSetup - RemainAfterExit=no - [Install] - WantedBy=multi-user.target - EOF - - mkdir "$DESTDIR"/etc/systemd/system/multi-user.target.wants - - ln -s "$DESTDIR"/etc/systemd/system/zookeeper-server.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-server.service - - ln -s "$DESTDIR"/etc/systemd/system/zookeeper-init.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-init.service +- | + install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-server.service + [unit] + Description=Zookeeper server + [Service] + ExecStart=/usr/zookeeper/bin/zkServer.sh start + RemainAfterExit=yes + [Install] + WantedBy=multi-user.target + EOF +- | + install -D -m 644 /proc/self/fd/0 << 'EOF' "$DESTDIR"/etc/systemd/system/zookeeper-init.service + [unit] + Description=Zookeeper server init + [Service] + ExecStart=/usr/zookeeper_server/zkServerFileSetup/Release/zkServerFileSetup + RemainAfterExit=no + [Install] + WantedBy=multi-user.target + EOF +- mkdir "$DESTDIR"/etc/systemd/system/multi-user.target.wants +- ln -s "$DESTDIR"/etc/systemd/system/zookeeper-server.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-server.service +- ln -s "$DESTDIR"/etc/systemd/system/zookeeper-init.service "$DESTDIR"/etc/systemd/system/multi-user.target.wants/zookeeper-init.service diff --git a/strata/zookeeper/zookeeper.morph b/strata/zookeeper/zookeeper.morph index dbe6ccbb..db446a1b 100644 --- a/strata/zookeeper/zookeeper.morph +++ b/strata/zookeeper/zookeeper.morph @@ -1,14 +1,14 @@ name: zookeeper kind: chunk configure-commands: - - mkdir -p "$DESTDIR$PREFIX"/lib/zookeeper +- mkdir -p "$DESTDIR$PREFIX"/lib/zookeeper build-commands: - - ant -p compile_jute - - mkdir -p "$DESTDIR$PREFIX"/zookeeper - - cp -r * "$DESTDIR$PREFIX"/zookeeper - - cd "$DESTDIR$PREFIX"/zookeeper/src/c && autoreconf -i - - cd "$DESTDIR$PREFIX"/zookeeper/src/c && ./configure --prefix="$PREFIX" --libdir="$PREFIX"/lib/ - - make -C "$DESTDIR$PREFIX"/zookeeper/src/c - - cd "$DESTDIR$PREFIX"/zookeeper/src/c && make install - - mv "$DESTDIR$PREFIX"/zookeeper/conf/zoo_sample.cfg "$DESTDIR$PREFIX"/zookeeper/conf/zoo.cfg - - make -C "$DESTDIR$PREFIX"/zookeeper/src/c zktest-mt +- ant -p compile_jute +- mkdir -p "$DESTDIR$PREFIX"/zookeeper +- cp -r * "$DESTDIR$PREFIX"/zookeeper +- cd "$DESTDIR$PREFIX"/zookeeper/src/c && autoreconf -i +- cd "$DESTDIR$PREFIX"/zookeeper/src/c && ./configure --prefix="$PREFIX" --libdir="$PREFIX"/lib/ +- make -C "$DESTDIR$PREFIX"/zookeeper/src/c +- cd "$DESTDIR$PREFIX"/zookeeper/src/c && make install +- mv "$DESTDIR$PREFIX"/zookeeper/conf/zoo_sample.cfg "$DESTDIR$PREFIX"/zookeeper/conf/zoo.cfg +- make -C "$DESTDIR$PREFIX"/zookeeper/src/c zktest-mt diff --git a/systems/build-system-armv5l-openbmc-aspeed.morph b/systems/build-system-armv5l-openbmc-aspeed.morph index 7230bbc0..922d49f1 100644 --- a/systems/build-system-armv5l-openbmc-aspeed.morph +++ b/systems/build-system-armv5l-openbmc-aspeed.morph @@ -1,7 +1,6 @@ name: build-system-armv5l-openbmc-aspeed kind: system -description: -- | +description: | The system that should be used for building other Baserock systems for little endian ARMv5 computers. arch: armv5l @@ -14,6 +13,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-armv5l-openbmc-aspeed morph: strata/bsp-armv5l-openbmc-aspeed.morph - name: tools @@ -30,6 +31,8 @@ strata: morph: strata/devtools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: mtd-utilities diff --git a/systems/build-system-armv7lhf-highbank.morph b/systems/build-system-armv7lhf-highbank.morph index 42156d78..fa96ca02 100644 --- a/systems/build-system-armv7lhf-highbank.morph +++ b/systems/build-system-armv7lhf-highbank.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-armv7-highbank morph: strata/bsp-armv7-highbank.morph - name: tools @@ -39,6 +42,8 @@ strata: morph: strata/devtools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: unionfs-fuse-group diff --git a/systems/build-system-armv7lhf-jetson.morph b/systems/build-system-armv7lhf-jetson.morph index 3bdcf9f0..2e180a6e 100644 --- a/systems/build-system-armv7lhf-jetson.morph +++ b/systems/build-system-armv7lhf-jetson.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-jetson morph: strata/bsp-jetson.morph - name: tools @@ -39,6 +42,8 @@ strata: morph: strata/devtools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-armv8b64.morph b/systems/build-system-armv8b64.morph index aa16f545..27757027 100644 --- a/systems/build-system-armv8b64.morph +++ b/systems/build-system-armv8b64.morph @@ -1,7 +1,6 @@ name: build-system-armv8b64 kind: system -description: -- | +description: | The system that should be used for building all other Baserock systems for 64-bit ARMv8 computers running in big-endian mode. arch: armv8b64 @@ -16,6 +15,8 @@ strata: morph: strata/bsp-armv8b64-generic.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: tools morph: strata/tools.morph - name: python-cliapp @@ -26,6 +27,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/build-system-armv8l64.morph b/systems/build-system-armv8l64.morph index e7ddf034..2f9560c4 100644 --- a/systems/build-system-armv8l64.morph +++ b/systems/build-system-armv8l64.morph @@ -1,7 +1,6 @@ name: build-system-armv8l64 kind: system -description: -- | +description: | The system that should be used for building all other Baserock systems for little endian 64-bit ARMv8 computers. arch: armv8l64 @@ -14,6 +13,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-armv8l64-generic morph: strata/bsp-armv8l64-generic.morph - name: tools @@ -42,6 +43,8 @@ strata: morph: strata/devtools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-ppc64.morph b/systems/build-system-ppc64.morph index 642df309..5c2851bf 100644 --- a/systems/build-system-ppc64.morph +++ b/systems/build-system-ppc64.morph @@ -1,6 +1,7 @@ name: build-system-ppc64 kind: system -description: The system that should be used for building all other Baserock systems for 64-bit POWER computers. +description: The system that should be used for building all other Baserock systems + for 64-bit POWER computers. arch: ppc64 strata: - name: build-essential @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-ppc64-generic morph: strata/bsp-ppc64-generic.morph - name: tools @@ -39,6 +42,8 @@ strata: morph: strata/devtools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-x86_32-chroot.morph b/systems/build-system-x86_32-chroot.morph index 646ae6a8..bfd77b8e 100644 --- a/systems/build-system-x86_32-chroot.morph +++ b/systems/build-system-x86_32-chroot.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: tools morph: strata/tools.morph - name: python-cliapp @@ -39,6 +42,8 @@ strata: morph: strata/bsp-x86_both-tools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-x86_32.morph b/systems/build-system-x86_32.morph index c14b54f2..fe35055f 100644 --- a/systems/build-system-x86_32.morph +++ b/systems/build-system-x86_32.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-x86_32-generic morph: strata/bsp-x86_32-generic.morph - name: tools @@ -37,10 +40,10 @@ strata: morph: strata/openstack-clients.morph - name: devtools morph: strata/devtools.morph -- name: bsp-x86_both-tools - morph: strata/bsp-x86_both-tools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-x86_64-chroot.morph b/systems/build-system-x86_64-chroot.morph index 82493d1e..3bbdd914 100644 --- a/systems/build-system-x86_64-chroot.morph +++ b/systems/build-system-x86_64-chroot.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: tools morph: strata/tools.morph - name: python-cliapp @@ -39,6 +42,8 @@ strata: morph: strata/bsp-x86_both-tools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/build-system-x86_64.morph b/systems/build-system-x86_64.morph index 4b688555..b5e39f73 100644 --- a/systems/build-system-x86_64.morph +++ b/systems/build-system-x86_64.morph @@ -1,6 +1,7 @@ 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. +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 @@ -11,6 +12,8 @@ strata: morph: strata/foundation.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: bsp-x86_64-generic morph: strata/bsp-x86_64-generic.morph - name: tools @@ -37,10 +40,10 @@ strata: morph: strata/openstack-clients.morph - name: devtools morph: strata/devtools.morph -- name: bsp-x86_both-tools - morph: strata/bsp-x86_both-tools.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph configuration-extensions: diff --git a/systems/ceph-service-x86_64-generic.morph b/systems/ceph-service-x86_64-generic.morph index daaa6957..9a36b850 100644 --- a/systems/ceph-service-x86_64-generic.morph +++ b/systems/ceph-service-x86_64-generic.morph @@ -30,6 +30,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils @@ -50,6 +52,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-common morph: strata/python-common.morph - name: chef diff --git a/systems/cross-bootstrap-system-armv5l-generic.morph b/systems/cross-bootstrap-system-armv5l-generic.morph index 08cc11f6..e479d150 100644 --- a/systems/cross-bootstrap-system-armv5l-generic.morph +++ b/systems/cross-bootstrap-system-armv5l-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cross-bootstrap-system-armv7lhf-generic.morph b/systems/cross-bootstrap-system-armv7lhf-generic.morph index e52a0375..280b1e0e 100644 --- a/systems/cross-bootstrap-system-armv7lhf-generic.morph +++ b/systems/cross-bootstrap-system-armv7lhf-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cross-bootstrap-system-armv8b64-generic.morph b/systems/cross-bootstrap-system-armv8b64-generic.morph index adfbd412..53e9f46b 100644 --- a/systems/cross-bootstrap-system-armv8b64-generic.morph +++ b/systems/cross-bootstrap-system-armv8b64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cross-bootstrap-system-armv8l64-generic.morph b/systems/cross-bootstrap-system-armv8l64-generic.morph index 5cc2f83b..1214362f 100644 --- a/systems/cross-bootstrap-system-armv8l64-generic.morph +++ b/systems/cross-bootstrap-system-armv8l64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cross-bootstrap-system-ppc64-generic.morph b/systems/cross-bootstrap-system-ppc64-generic.morph index 35b3f626..297f862b 100644 --- a/systems/cross-bootstrap-system-ppc64-generic.morph +++ b/systems/cross-bootstrap-system-ppc64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cross-bootstrap-system-x86_64-generic.morph b/systems/cross-bootstrap-system-x86_64-generic.morph index 471bd40d..ef8912ad 100644 --- a/systems/cross-bootstrap-system-x86_64-generic.morph +++ b/systems/cross-bootstrap-system-x86_64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/python-pygobject.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/cxmanage-system-x86_64-generic.morph b/systems/cxmanage-system-x86_64-generic.morph index ed7e8d63..85f74e4c 100644 --- a/systems/cxmanage-system-x86_64-generic.morph +++ b/systems/cxmanage-system-x86_64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/bsp-x86_64-generic.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph - name: cxmanage morph: strata/cxmanage.morph configuration-extensions: diff --git a/systems/devel-system-armv7-chroot.morph b/systems/devel-system-armv7-chroot.morph index d7a06fe9..6fe76927 100644 --- a/systems/devel-system-armv7-chroot.morph +++ b/systems/devel-system-armv7-chroot.morph @@ -37,6 +37,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -49,6 +51,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7-highbank.morph b/systems/devel-system-armv7-highbank.morph index 854edd76..9305bd55 100644 --- a/systems/devel-system-armv7-highbank.morph +++ b/systems/devel-system-armv7-highbank.morph @@ -38,6 +38,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -50,6 +52,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: unionfs-fuse-group diff --git a/systems/devel-system-armv7-versatile.morph b/systems/devel-system-armv7-versatile.morph index 34c9a239..fc1ee9c5 100644 --- a/systems/devel-system-armv7-versatile.morph +++ b/systems/devel-system-armv7-versatile.morph @@ -38,6 +38,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -50,6 +52,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7-wandboard.morph b/systems/devel-system-armv7-wandboard.morph index 300981f9..4d6eabff 100644 --- a/systems/devel-system-armv7-wandboard.morph +++ b/systems/devel-system-armv7-wandboard.morph @@ -38,6 +38,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -50,6 +52,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7b-chroot.morph b/systems/devel-system-armv7b-chroot.morph index 4eed73e4..01187420 100644 --- a/systems/devel-system-armv7b-chroot.morph +++ b/systems/devel-system-armv7b-chroot.morph @@ -29,6 +29,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -41,6 +43,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7b-highbank.morph b/systems/devel-system-armv7b-highbank.morph index ba5de00b..acd68b5f 100644 --- a/systems/devel-system-armv7b-highbank.morph +++ b/systems/devel-system-armv7b-highbank.morph @@ -34,6 +34,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -46,6 +48,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: unionfs-fuse-group diff --git a/systems/devel-system-armv7lhf-chroot.morph b/systems/devel-system-armv7lhf-chroot.morph index d0917fcb..180779d9 100644 --- a/systems/devel-system-armv7lhf-chroot.morph +++ b/systems/devel-system-armv7lhf-chroot.morph @@ -37,6 +37,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -49,6 +51,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7lhf-highbank.morph b/systems/devel-system-armv7lhf-highbank.morph index 189c2913..8660e698 100644 --- a/systems/devel-system-armv7lhf-highbank.morph +++ b/systems/devel-system-armv7lhf-highbank.morph @@ -41,6 +41,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -53,6 +55,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: unionfs-fuse-group diff --git a/systems/devel-system-armv7lhf-jetson.morph b/systems/devel-system-armv7lhf-jetson.morph index 1c39b3ea..bac4f2ab 100644 --- a/systems/devel-system-armv7lhf-jetson.morph +++ b/systems/devel-system-armv7lhf-jetson.morph @@ -41,6 +41,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -53,6 +55,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv7lhf-wandboard.morph b/systems/devel-system-armv7lhf-wandboard.morph index 4432f947..c11bbbb6 100644 --- a/systems/devel-system-armv7lhf-wandboard.morph +++ b/systems/devel-system-armv7lhf-wandboard.morph @@ -41,6 +41,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -53,6 +55,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv8b64.morph b/systems/devel-system-armv8b64.morph index 44ff2d53..001de4b5 100644 --- a/systems/devel-system-armv8b64.morph +++ b/systems/devel-system-armv8b64.morph @@ -42,6 +42,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -52,6 +54,8 @@ strata: morph: strata/ansible.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-armv8l64.morph b/systems/devel-system-armv8l64.morph index cad71c4e..cde9fe18 100644 --- a/systems/devel-system-armv8l64.morph +++ b/systems/devel-system-armv8l64.morph @@ -40,6 +40,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -52,6 +54,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-ppc64-chroot.morph b/systems/devel-system-ppc64-chroot.morph index fe437767..59b03bdd 100644 --- a/systems/devel-system-ppc64-chroot.morph +++ b/systems/devel-system-ppc64-chroot.morph @@ -35,6 +35,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -47,6 +49,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-ppc64-generic.morph b/systems/devel-system-ppc64-generic.morph index 26776429..0a077609 100644 --- a/systems/devel-system-ppc64-generic.morph +++ b/systems/devel-system-ppc64-generic.morph @@ -38,6 +38,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -50,6 +52,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-x86_32-chroot.morph b/systems/devel-system-x86_32-chroot.morph index bc3872a7..b071abfc 100644 --- a/systems/devel-system-x86_32-chroot.morph +++ b/systems/devel-system-x86_32-chroot.morph @@ -37,6 +37,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -49,6 +51,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-x86_32-generic.morph b/systems/devel-system-x86_32-generic.morph index 952bff79..9f792f30 100644 --- a/systems/devel-system-x86_32-generic.morph +++ b/systems/devel-system-x86_32-generic.morph @@ -42,6 +42,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -54,6 +56,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-x86_64-chroot.morph b/systems/devel-system-x86_64-chroot.morph index 394201e0..5be9910c 100644 --- a/systems/devel-system-x86_64-chroot.morph +++ b/systems/devel-system-x86_64-chroot.morph @@ -39,6 +39,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -51,6 +53,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-x86_64-generic.morph b/systems/devel-system-x86_64-generic.morph index fe56a5de..ae0c97e8 100644 --- a/systems/devel-system-x86_64-generic.morph +++ b/systems/devel-system-x86_64-generic.morph @@ -42,6 +42,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -54,6 +56,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/devel-system-x86_64-vagrant.morph b/systems/devel-system-x86_64-vagrant.morph index b8d4d2e7..4a91f84b 100644 --- a/systems/devel-system-x86_64-vagrant.morph +++ b/systems/devel-system-x86_64-vagrant.morph @@ -40,6 +40,8 @@ strata: morph: strata/baserock-import.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -52,6 +54,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/genivi-baseline-system-armv7lhf-jetson.morph b/systems/genivi-baseline-system-armv7lhf-jetson.morph index 71247d39..535696f6 100644 --- a/systems/genivi-baseline-system-armv7lhf-jetson.morph +++ b/systems/genivi-baseline-system-armv7lhf-jetson.morph @@ -17,6 +17,8 @@ strata: morph: strata/connman-common.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph +- name: glib-common + morph: strata/glib-common.morph - name: libdrm-common morph: strata/libdrm-common.morph - name: multimedia-common diff --git a/systems/genivi-baseline-system-armv7lhf-versatile.morph b/systems/genivi-baseline-system-armv7lhf-versatile.morph index 429ca2d8..c1425115 100644 --- a/systems/genivi-baseline-system-armv7lhf-versatile.morph +++ b/systems/genivi-baseline-system-armv7lhf-versatile.morph @@ -17,6 +17,8 @@ strata: morph: strata/connman-common.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph +- name: glib-common + morph: strata/glib-common.morph - name: libdrm-common morph: strata/libdrm-common.morph - name: multimedia-common diff --git a/systems/genivi-baseline-system-x86_64-generic.morph b/systems/genivi-baseline-system-x86_64-generic.morph index 6048e078..da0a1b3a 100644 --- a/systems/genivi-baseline-system-x86_64-generic.morph +++ b/systems/genivi-baseline-system-x86_64-generic.morph @@ -17,6 +17,8 @@ strata: morph: strata/connman-common.morph - name: audio-bluetooth morph: strata/audio-bluetooth.morph +- name: glib-common + morph: strata/glib-common.morph - name: libdrm-common morph: strata/libdrm-common.morph - name: multimedia-common diff --git a/systems/installer-system-armv8b64.morph b/systems/installer-system-armv8b64.morph index f1a83d6d..860a6231 100644 --- a/systems/installer-system-armv8b64.morph +++ b/systems/installer-system-armv8b64.morph @@ -1,6 +1,7 @@ name: installer-system-armv8b64 kind: system -description: The system that should be used as an Installer to install other Baserock systems. +description: The system that should be used as an Installer to install other Baserock + systems. arch: armv8b64 strata: - name: build-essential @@ -9,6 +10,8 @@ strata: morph: strata/core.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: foundation morph: strata/foundation.morph - name: bsp-armv8b64-generic @@ -21,6 +24,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/installer-system-x86_64.morph b/systems/installer-system-x86_64.morph index e9c4cd94..1e854f33 100644 --- a/systems/installer-system-x86_64.morph +++ b/systems/installer-system-x86_64.morph @@ -1,6 +1,7 @@ name: installer-system-x86_64 kind: system -description: The system that should be used as an Installer to install other Baserock systems. +description: The system that should be used as an Installer to install other Baserock + systems. arch: x86_64 strata: - name: build-essential @@ -9,6 +10,8 @@ strata: morph: strata/core.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: foundation morph: strata/foundation.morph - name: bsp-x86_64-generic @@ -21,6 +24,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/java-build-system-x86_64-generic.morph b/systems/java-build-system-x86_64-generic.morph index a4ed7643..f0830980 100644 --- a/systems/java-build-system-x86_64-generic.morph +++ b/systems/java-build-system-x86_64-generic.morph @@ -45,6 +45,8 @@ strata: morph: strata/nfs.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-tools morph: strata/python-tools.morph - name: python-common @@ -57,6 +59,8 @@ strata: morph: strata/swift.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: coreutils-common diff --git a/systems/openstack-system-x86_64.morph b/systems/openstack-system-x86_64.morph index 2f700e68..8c191be6 100644 --- a/systems/openstack-system-x86_64.morph +++ b/systems/openstack-system-x86_64.morph @@ -9,6 +9,8 @@ strata: morph: strata/core.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-pygobject morph: strata/python-pygobject.morph - name: python-common @@ -59,6 +61,8 @@ strata: morph: strata/ntpd.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: test-tools morph: strata/test-tools.morph - name: swift @@ -80,6 +84,7 @@ configuration-extensions: - extensions/openstack-network - extensions/openstack-neutron - extensions/openstack-ceilometer +- extensions/openstack-time - extensions/fstab - extensions/openstack-ironic - extensions/install-essential-files diff --git a/systems/qt4-devel-system-x86_64-generic.morph b/systems/qt4-devel-system-x86_64-generic.morph index c7bad950..0285fa70 100644 --- a/systems/qt4-devel-system-x86_64-generic.morph +++ b/systems/qt4-devel-system-x86_64-generic.morph @@ -20,6 +20,8 @@ strata: morph: strata/bsp-x86_64-generic.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph - name: x-common morph: strata/x-common.morph - name: x-generic diff --git a/systems/qt5-devel-system-x86_64-generic.morph b/systems/qt5-devel-system-x86_64-generic.morph index a1f38e9e..c342ceb9 100644 --- a/systems/qt5-devel-system-x86_64-generic.morph +++ b/systems/qt5-devel-system-x86_64-generic.morph @@ -20,6 +20,8 @@ strata: morph: strata/bsp-x86_64-generic.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph - name: x-common morph: strata/x-common.morph - name: x-generic diff --git a/systems/swift-system-x86_64.morph b/systems/swift-system-x86_64.morph index c959b6f7..139c0028 100644 --- a/systems/swift-system-x86_64.morph +++ b/systems/swift-system-x86_64.morph @@ -17,6 +17,8 @@ strata: morph: strata/ntpd.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: python-common morph: strata/python-common.morph - name: ansible diff --git a/systems/trove-system-x86_64.morph b/systems/trove-system-x86_64.morph index efc66b5c..3ffb8995 100644 --- a/systems/trove-system-x86_64.morph +++ b/systems/trove-system-x86_64.morph @@ -13,6 +13,8 @@ strata: morph: strata/core.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: tools morph: strata/tools.morph - name: python-cliapp @@ -23,6 +25,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils diff --git a/systems/web-system-x86_64-generic.morph b/systems/web-system-x86_64-generic.morph index 3f477833..4101f615 100644 --- a/systems/web-system-x86_64-generic.morph +++ b/systems/web-system-x86_64-generic.morph @@ -13,6 +13,8 @@ strata: morph: strata/core.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph - name: nfs morph: strata/nfs.morph - name: databases diff --git a/systems/weston-system-armv7lhf-jetson.morph b/systems/weston-system-armv7lhf-jetson.morph index 78ddc8b4..652c4690 100644 --- a/systems/weston-system-armv7lhf-jetson.morph +++ b/systems/weston-system-armv7lhf-jetson.morph @@ -1,6 +1,7 @@ name: weston-system-armv7lhf-jetson kind: system -description: A weston system for ARMv7 little-endian hard-float NVIDIA Jetson TK1 computers. +description: A weston system for ARMv7 little-endian hard-float NVIDIA Jetson TK1 + computers. arch: armv7lhf strata: - name: build-essential @@ -41,6 +42,8 @@ strata: morph: strata/x-generic.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph configuration-extensions: - extensions/set-hostname - extensions/add-config-files diff --git a/systems/weston-system-x86_64-generic.morph b/systems/weston-system-x86_64-generic.morph index d927dd58..0adfa767 100644 --- a/systems/weston-system-x86_64-generic.morph +++ b/systems/weston-system-x86_64-generic.morph @@ -41,6 +41,8 @@ strata: morph: strata/x-generic.morph - name: tools morph: strata/tools.morph +- name: glib-common + morph: strata/glib-common.morph configuration-extensions: - extensions/set-hostname - extensions/add-config-files diff --git a/systems/xfce-system.morph b/systems/xfce-system.morph index f87b0982..6a1e0b2b 100644 --- a/systems/xfce-system.morph +++ b/systems/xfce-system.morph @@ -9,6 +9,8 @@ strata: morph: strata/core.morph - name: python-core morph: strata/python-core.morph +- name: python3-core + morph: strata/python3-core.morph - name: foundation morph: strata/foundation.morph - name: bsp-x86_64-generic @@ -41,6 +43,8 @@ strata: morph: strata/python-wsgi.morph - name: libsoup-common morph: strata/libsoup-common.morph +- name: glib-common + morph: strata/glib-common.morph - name: ostree-core morph: strata/ostree-core.morph - name: morph-utils |