meta-starlingx/meta-stx-virt/recipes-extended/ceph/files/ceph-preshutdown.sh
Jackie Huang 46d78550bd ceph: add version 13.2.2 and align with stx 3.0
ceph-disk is used by stx puppet manifest but it's replaced by
ceph-volume in ceph 14.1+, and there might be other incompatible
issues, so add version 13.2.2 to align with stx 3.0, the version
14.1 is kept so it may be used by future stx release.

This includes the following changes:
- Add recipe and patches for version 13.2.2
- Set preferred version to 13.2.2
- Rename ceph_%.bbappend to ceph_14.1.0.bbappend
- Update the conf file and scripts from stx 2.0 to stx 3.0
- Remove the useless files in stx-integ

fix #483
fix #497

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Babak Sarashki <Babak.SarAshki@windriver.com>
2020-06-17 08:55:01 -07:00

31 lines
680 B
Bash

#!/bin/bash
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
script=$(basename $0)
# Set nullglob so wildcards will return empty string if no match
shopt -s nullglob
for dev in /dev/rbd[0-9]*; do
for mnt in $(mount | awk -v dev=$dev '($1 == dev) {print $3}'); do
logger -t ${script} "Unmounting $mnt"
/usr/bin/umount $mnt
done
logger -t ${script} "Unmounted $dev"
done
for dev in /dev/rbd[0-9]*; do
/usr/bin/rbd unmap -o force $dev
logger -t ${script} "Unmapped $dev"
done
lsmod | grep -q '^rbd\>' && /usr/sbin/modprobe -r rbd
lsmod | grep -q '^libceph\>' && /usr/sbin/modprobe -r libceph
exit 0