Optimize OS/release/version detection for faster execution #70

Merged
benpro merged 86 commits from fast-debian-check into master 2019-04-05 11:01:57 +02:00
Showing only changes of commit ae0b3ae2f1 - Show all commits

View file

@ -797,8 +797,9 @@ if is_debian; then
continue
fi
reservedBlockCount=$(dumpe2fs -h "$part" 2>/dev/null | grep -e "Reserved block count:" | grep -Eo "[0-9]+")
percentage=$(python -c "print(int(round(float(${reservedBlockCount})/${blockCount}*100)))")
if [ "$percentage" -lt 5 ]; then
# Use bc to have a rounded percentage
percentage=$(echo "scale=0; ${reservedBlockCount} * 100 / ${blockCount}" | bc)
if [ "$percentage" -lt "5" ]; then
failed "IS_TUNE2FS_M5" "Partition ${part} has less than 5% reserved blocks!"
fi
done