mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
feat: Check filesystem during installation
feat: Check filesystem during installation
This commit is contained in:
commit
c1de32eff6
@ -31,11 +31,22 @@ rm -f "$STORAGE"/"$BASE".agent
|
||||
rm -f "$STORAGE"/"$BASE".boot.img
|
||||
rm -f "$STORAGE"/"$BASE".system.img
|
||||
|
||||
TMP="/tmp/dsm"
|
||||
RDC="$STORAGE/dsm.rd"
|
||||
FS=$(stat -f -c %T "$STORAGE")
|
||||
|
||||
if [[ "$FS" == "ext"* ]]; then
|
||||
TMP="$STORAGE/tmp"
|
||||
else
|
||||
TMP="/tmp/dsm"
|
||||
fi
|
||||
|
||||
RDC="$STORAGE/dsm.rd"
|
||||
rm -rf "$TMP" && mkdir -p "$TMP"
|
||||
|
||||
# Check free diskspace
|
||||
MIN_SPACE=5842450944
|
||||
SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
||||
(( MIN_SPACE > SPACE )) && error "Not enough free space for installation." && exit 95
|
||||
|
||||
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||
|
||||
if [ ! -f "${RDC}" ]; then
|
||||
@ -253,7 +264,7 @@ echo "$BASE" > "$STORAGE"/dsm.ver
|
||||
|
||||
# Check free diskspace
|
||||
SPACE=$(df --output=avail -B 1 "$STORAGE" | tail -n 1)
|
||||
(( 6442450944 > SPACE )) && error "Not enough free space in destination folder." && exit 94
|
||||
(( MIN_SPACE > SPACE )) && error "Not enough free space in storage folder." && exit 94
|
||||
|
||||
mv -f "$PAT" "$STORAGE"/"$BASE".pat
|
||||
mv -f "$BOOT" "$STORAGE"/"$BASE".boot.img
|
||||
|
Loading…
x
Reference in New Issue
Block a user