tools/br_setup: obtain dnsmasq pid from pidfile
[ddiss/rapido.git] / cut_tcmu_rbd_loop.sh
1 #!/bin/bash
2 #
3 # Copyright (C) SUSE LINUX GmbH 2016, all rights reserved.
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published
7 # by the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) version 3.
9 #
10 # This library is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
13 # License for more details.
14
15 RAPIDO_DIR="$(realpath -e ${0%/*})"
16 . "${RAPIDO_DIR}/runtime.vars"
17
18 _rt_require_dracut_args
19
20 [ -n "$TCMU_RUNNER_SRC" ] || _fail "TCMU_RUNNER_SRC needs to be configured"
21 tcmu_so_inc=""
22 for i in `find ${TCMU_RUNNER_SRC} -type f|grep "\.so"`; do
23         tcmu_so_inc="${tcmu_so_inc} --include $i /lib64/`basename $i`"
24 done
25
26 dracut  --install "tail blockdev ps rmdir resize dd vim grep find df sha256sum \
27                    strace mkfs.xfs mkfs.btrfs sync dirname uuidgen sleep \
28                    /lib64/libkeyutils.so.1 \
29                    /usr/lib64/libnl-genl-3.so /usr/lib64/libgio-2.0.so \
30                    /usr/lib64/libcryptopp-5.6.2.so.0 \
31                    /usr/lib64/libboost_thread.so.1.54.0 \
32                    /usr/lib64/libboost_system.so.1.54.0 \
33                    /usr/lib64/libboost_random.so.1.54.0 \
34                    /usr/lib64/libboost_iostreams.so.1.54.0 \
35                    /usr/lib64/libhandle.so.1 /lib64/libssl.so.1.0.0" \
36         --include "${RAPIDO_DIR}/tcmu_rbd_autorun.sh" "/.profile" \
37         --include "${RAPIDO_DIR}/rapido.conf" "/rapido.conf" \
38         --include "${RAPIDO_DIR}/vm_autorun.env" "/vm_autorun.env" \
39         --include "$CEPH_RADOS_LIB" "/lib64/librados.so" \
40         --include "$CEPH_RBD_LIB" "/lib64/librbd.so" \
41         --include "$CEPH_CONF" "/etc/ceph/ceph.conf" \
42         --include "$CEPH_KEYRING" "/etc/ceph/keyring" \
43         --include "${TCMU_RUNNER_SRC}/tcmu-runner" "/bin/tcmu-runner" \
44         $tcmu_so_inc \
45         --add-drivers "target_core_mod target_core_user tcm_loop" \
46         --modules "bash base network ifcfg" \
47         $DRACUT_EXTRA_ARGS \
48         $DRACUT_OUT