tools/zram_setup.sh: don't assume CEPH_SRC is set
authorDavid Disseldorp <ddiss@suse.de>
Wed, 22 Mar 2017 09:34:25 +0000 (10:34 +0100)
committerDavid Disseldorp <ddiss@suse.de>
Wed, 22 Mar 2017 09:44:11 +0000 (10:44 +0100)
CEPH_SRC was until now used to determine an appropriate owner for the
initrd directory zram mountpoint, as well as for the vstart dirs.
Instead, use the RAPIDO_DIR owner for the initrd zram mountpoint.

Signed-off-by: David Disseldorp <ddiss@suse.de>
tools/zram_setup.sh

index ac949ddf9fb0a24a7f46d52e35068fa7cb712c72..5eb4361594951e600663906faa6b33a4c6fd5dd5 100755 (executable)
@@ -43,9 +43,6 @@ function _zram_setup() {
        echo "mounted $zram_name for $zram_mnt_owner at $zram_mnt"
 }
 
-# get ownership of the ceph src dir so it can be applied to the mounted fses
-owner=`stat --format="%U:%G" $CEPH_SRC` || _fail
-
 num_zram_devs=1
 [ -n "$ZRAM_VSTART_OUT_SIZE" ] && ((num_zram_devs++))
 [ -n "$ZRAM_VSTART_DATA_SIZE" ] && ((num_zram_devs++))
@@ -53,17 +50,21 @@ num_zram_devs=1
 modprobe zram num_devices="${num_zram_devs}" || _fail
 zram_i=0
 
+# use rapido dir ownership for initramfs subdir mount point
+owner=`stat --format="%U:%G" $RAPIDO_DIR` || _fail
 _zram_setup "zram${zram_i}" $ZRAM_INITRD_SIZE $ZRAM_INITRD_MNT $owner
 ((zram_i++))
 
 # if running with a vstart.sh cluster, use zram for logs and data
 if [ -n "$ZRAM_VSTART_OUT_SIZE" ]; then
+       owner=`stat --format="%U:%G" $CEPH_SRC` || _fail
        _zram_setup "zram${zram_i}" $ZRAM_VSTART_OUT_SIZE \
                    $ZRAM_VSTART_OUT_MNT $owner
        ((zram_i++))
 fi
 
 if [ -n "$ZRAM_VSTART_DATA_SIZE" ]; then
+       owner=`stat --format="%U:%G" $CEPH_SRC` || _fail
        _zram_setup "zram${zram_i}" $ZRAM_VSTART_DATA_SIZE \
                    $ZRAM_VSTART_DATA_MNT $owner
        ((zram_i++))