forcing rpm-check if files added to the commit
[apex.git] / build / overcloud-opendaylight-sfc.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -e
11
12 ################################################
13 #####    Adding SFC+OpenDaylight overcloud #####
14 ################################################
15
16 #copy opendaylight overcloud full to isolate odl-sfc
17 cp -f images/overcloud-full-opendaylight.qcow2 images/overcloud-full-opendaylight-sfc_build.qcow2
18
19 # work around for XFS grow bug
20 # http://xfs.org/index.php/XFS_FAQ#Q:_Why_do_I_receive_No_space_left_on_device_after_xfs_growfs.3F
21 cat > /tmp/xfs-grow-remount-fix.service << EOF
22 [Unit]
23 Description=XFS Grow Bug Remount
24 After=network.target
25 Before=getty@tty1.service
26
27 [Service]
28 Type=oneshot
29 ExecStart=/bin/bash -c "echo 'XFS Grow Bug Remount Sleeping 180s' && sleep 180 && echo 'XFS Grow Bug Remounting Now' && mount -o remount,inode64 /"
30 RemainAfterExit=no
31
32 [Install]
33 WantedBy=multi-user.target
34 EOF
35
36
37 # kernel is patched with patch from this post
38 # http://xfs.org/index.php/XFS_FAQ#Q:_Why_do_I_receive_No_space_left_on_device_after_xfs_growfs.3F
39 LIBGUESTFS_BACKEND=direct virt-customize \
40     --upload "/tmp/xfs-grow-remount-fix.service:/etc/systemd/system/xfs-grow-remount-fix.service" \
41     --run-command "chmod 664 /etc/systemd/system/xfs-grow-remount-fix.service" \
42     --run-command "systemctl enable xfs-grow-remount-fix.service" \
43     --install 'https://radez.fedorapeople.org/kernel-ml-3.13.7-1.el7.centos.x86_64.rpm' \
44     --run-command 'grub2-set-default "\$(grep -P \"submenu|^menuentry\" /boot/grub2/grub.cfg | cut -d \"\\x27\" | head -n 1)"' \
45     --install 'https://radez.fedorapeople.org/openvswitch-kmod-2.3.90-1.el7.centos.x86_64.rpm' \
46     --run-command 'yum downgrade -y https://radez.fedorapeople.org/openvswitch-2.3.90-1.x86_64.rpm' \
47     --run-command 'rm -f /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/net/openvswitch/openvswitch.ko' \
48     --run-command 'ln -s /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/extra/openvswitch/openvswitch.ko /lib/modules/3.13.7-1.el7.centos.x86_64/kernel/net/openvswitch/openvswitch.ko' \
49     -a images/overcloud-full-opendaylight-sfc_build.qcow2
50 mv images/overcloud-full-opendaylight-sfc_build.qcow2 images/overcloud-full-opendaylight-sfc.qcow2