Merge pull request #5 from dmulder/master
[ddiss/rapido.git] / runtime.vars
1 #
2 # Copyright (C) SUSE LINUX GmbH 2016, all rights reserved.
3 #
4 # This library is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU Lesser General Public License as published
6 # by the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) version 3.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
12 # License for more details.
13
14 # process user defined configuration
15 . ${RAPIDO_DIR}/rapido.conf
16
17 # initramfs output path
18 DRACUT_OUT="${RAPIDO_DIR}/initrds/myinitrd"
19
20 # initramfs xattr name, with optional qemu parameters
21 QEMU_ARGS_XATTR="user.rapido.qemu_args"
22
23 # initramfs ramdisk details
24 ZRAM_INITRD_SIZE="1G"
25 ZRAM_INITRD_MNT="$RAPIDO_DIR/initrds"
26
27 if [ -n "$CEPH_SRC" ]; then
28         # ramdisk for vstart.sh logs and data
29         ZRAM_VSTART_OUT_SIZE="1G"
30         ZRAM_VSTART_DATA_SIZE="1G"
31
32         if [ -f "${CEPH_SRC}/../build/CMakeCache.txt" ]; then
33                 # cmake build, compiled binaries and configs are in build subdir
34                 CEPH_BIN="${CEPH_SRC}/../build/bin/ceph"
35                 CEPH_RBD_BIN="${CEPH_SRC}/../build/bin/rbd"
36                 CEPH_MOUNT_BIN="${CEPH_SRC}/../build/bin/mount.ceph"
37                 CEPH_RADOS_BIN="${CEPH_SRC}/rados"
38                 CEPH_FUSE_BIN="${CEPH_SRC}/../build/bin/ceph-fuse"
39                 CEPH_RADOS_LIB="${CEPH_SRC}/../lib/librados.so"
40                 CEPH_RBD_LIB="${CEPH_SRC}/../lib/librbd.so"
41                 CEPH_CONF="${CEPH_SRC}/../build/ceph.conf"
42                 CEPH_KEYRING="${CEPH_SRC}/../build/keyring"
43
44                 # with cmake, vstart.sh is triggered from the build dir
45                 ZRAM_VSTART_OUT_MNT="${CEPH_SRC}/../build/out"
46                 ZRAM_VSTART_DATA_MNT="${CEPH_SRC}/../build/dev"
47         else
48                 # autotools build
49                 CEPH_BIN="${CEPH_SRC}/ceph"
50                 CEPH_RBD_BIN="${CEPH_SRC}/rbd"
51                 CEPH_MOUNT_BIN="${CEPH_SRC}/mount.ceph"
52                 CEPH_RADOS_BIN="${CEPH_SRC}/rados"
53                 CEPH_FUSE_BIN="${CEPH_SRC}/ceph-fuse"
54                 CEPH_RADOS_LIB="${CEPH_SRC}/.libs/librados.so"
55                 CEPH_RBD_LIB="${CEPH_SRC}/.libs/librbd.so"
56                 CEPH_CONF="${CEPH_SRC}/ceph.conf"
57                 CEPH_KEYRING="${CEPH_SRC}/keyring"
58
59                 # vstart.sh is triggered from the src dir
60                 ZRAM_VSTART_OUT_MNT="${CEPH_SRC}/out"
61                 ZRAM_VSTART_DATA_MNT="${CEPH_SRC}/dev"
62         fi
63         RBD_NAMER_BIN="${CEPH_SRC}/ceph-rbdnamer"
64         RBD_UDEV_RULES="${CEPH_SRC}/../udev/50-rbd.rules"
65         CEPH_UDEV_RULES="${CEPH_SRC}/../udev/95-ceph-osd.rules"
66         CEPH_DISK_SYSTEMD_SVC="${CEPH_SRC}/../systemd/ceph-disk@.service"
67         CEPH_OSD_SYSTEMD_SVC="${CEPH_SRC}/../systemd/ceph-osd@.service"
68 else
69         # use installed Ceph binaries and configs
70         RBD_NAMER_BIN="/usr/bin/ceph-rbdnamer"
71         RBD_UDEV_RULES="/usr/lib/udev/rules.d/50-rbd.rules"
72         CEPH_UDEV_RULES="/usr/lib/udev/rules.d/95-ceph-osd.rules"
73         CEPH_DISK_SYSTEMD_SVC="/usr/lib/systemd/system/ceph-disk@.service"
74         CEPH_OSD_SYSTEMD_SVC="/usr/lib/systemd/system/ceph-osd@.service"
75         CEPH_BIN="/usr/bin/ceph"
76         CEPH_RBD_BIN="/usr/bin/rbd"
77         CEPH_MOUNT_BIN="/usr/sbin/mount.ceph"
78         CEPH_RADOS_BIN="/usr/bin/rados"
79         CEPH_FUSE_BIN="/usr/bin/ceph-fuse"
80         CEPH_RADOS_LIB="/usr/lib64/librados.so"
81         CEPH_RBD_LIB="/usr/lib64/librbd.so"
82         CEPH_CONF="/etc/ceph/ceph.conf"
83         CEPH_KEYRING="/etc/ceph/ceph.client.${CEPH_USER}.keyring"
84 fi
85
86 function _fail() {
87         echo "error: $*"
88         exit 1
89 }