forked from rapido-linux/rapido
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cephfs_fuse_autorun.sh
executable file
·51 lines (43 loc) · 1.43 KB
/
cephfs_fuse_autorun.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#
# Copyright (C) SUSE LINUX GmbH 2016, all rights reserved.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) version 3.
#
# This library 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 Lesser General Public
# License for more details.
if [ ! -f /vm_autorun.env ]; then
echo "Error: autorun scripts must be run from within an initramfs VM"
exit 1
fi
. /vm_autorun.env
set -x
# enable debugfs
cat /proc/mounts | grep debugfs &> /dev/null
if [ $? -ne 0 ]; then
mount -t debugfs debugfs /sys/kernel/debug/
fi
cat /proc/mounts | grep configfs &> /dev/null
if [ $? -ne 0 ]; then
mount -t configfs configfs /sys/kernel/config/
fi
for i in $DYN_DEBUG_MODULES; do
echo "module $i +pf" > /sys/kernel/debug/dynamic_debug/control || _fatal
done
for i in $DYN_DEBUG_FILES; do
echo "file $i +pf" > /sys/kernel/debug/dynamic_debug/control || _fatal
done
modprobe fuse
sed -i "s#keyring = .*#keyring = /etc/ceph/keyring#g; \
s#admin socket = .*##g; \
s#run dir = .*#run dir = /var/run/#g; \
s#log file = .*#log file = /var/log/\$name.\$pid.log#g" \
/etc/ceph/ceph.conf
mkdir -p /mnt/cephfs
ceph-fuse /mnt/cephfs
set +x