Fix root volume size comparison

Fixes QubesOS/qubes-issues#4553
This commit is contained in:
AJ Jordan 2018-11-30 23:51:59 -05:00
parent 98a6b60a49
commit 8000e76d43
No known key found for this signature in database
GPG Key ID: A4FDB7BE12F63EC3

View File

@ -16,7 +16,7 @@ sysfs_xvda="/sys/class/block/xvda"
# if root filesystem use already (almost) the whole dis # if root filesystem use already (almost) the whole dis
non_rootfs_data=$(( 250 * 1024 * 2 )) non_rootfs_data=$(( 250 * 1024 * 2 ))
rootfs_size=$(df --block-size=512 --output=size / | tail -n 1) rootfs_size=$(df --block-size=512 --output=size / | tail -n 1)
if [ $(cat $sysfs_xvda/size) -lt \ if [ $(cat $sysfs_xvda/size) -gt \
$(( non_rootfs_data + rootfs_size )) ]; then $(( non_rootfs_data + rootfs_size )) ]; then
echo "root filesystem already at $rootfs_size blocks" >&2 echo "root filesystem already at $rootfs_size blocks" >&2
exit 0 exit 0