Files
scylladb/dist/common/scripts/scylla_kernel_check
Takuya ASADA 7f2df8f86e dist/common/scripts: introduce scylla_lib.sh
To reduce duplicated code and simplified scripts introduce scylla_lib.sh
for shellscripts which provides functions to classify distributions,
and load all sysconfig files.

This also fixes script bugs to misdetect Debian and RHEL.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1480667672-9453-2-git-send-email-syuu@scylladb.com>
2016-12-06 12:06:30 +02:00

36 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -e
#
# Copyright (C) 2016 ScyllaDB
. /usr/lib/scylla/scylla_lib.sh
if [ ! -f /sbin/mkfs.xfs ]; then
if is_debian_variant; then
apt-get install -y xfsprogs
else
yum install -y xfsprogs
fi
fi
mkdir -p /var/tmp/mnt
dd if=/dev/zero of=/var/tmp/kernel-check.img bs=1M count=128 > /dev/null 2>&1
mkfs.xfs /var/tmp/kernel-check.img > /dev/null
mount /var/tmp/kernel-check.img /var/tmp/mnt -o loop
iotune --fs-check --evaluation-directory /var/tmp/mnt > /dev/null 2>&1 &&:
RET=$?
umount /var/tmp/mnt
rm -rf /var/tmp/mnt
rm /var/tmp/kernel-check.img
if [ $RET -eq 0 ]; then
echo "This is a supported kernel version."
else
echo "This is an unsupported kernel version."
if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "14.04" ]; then
echo "Please upgrade to a newer kernel version by executing 'apt-get install linux-image-generic-lts-vivid && reboot'."
else
echo "Please upgrade to a newer kernel version."
fi
echo " see http://www.scylladb.com/kb/kb-fs-not-qualified-aio/ for details"
fi
exit $RET