Define the constants for hard coded values used in _repair_scratch_fs()
to check fsck exit code.
Suggested-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
# overlay mount point parent must be the base fs root
export OVL_MNT="ovl-mnt"
# overlay mount point parent must be the base fs root
export OVL_MNT="ovl-mnt"
+# From e2fsprogs/e2fsck/e2fsck.h:
+# Exit code used by fsck-type programs
+export FSCK_OK=0
+export FSCK_NONDESTRUCT=1
+export FSCK_REBOOT=2
+export FSCK_UNCORRECTED=4
+export FSCK_ERROR=8
+export FSCK_USAGE=16
+export FSCK_CANCELED=32
+export FSCK_LIBRARY=128
+
export PWD=`pwd`
#export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really.
export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
export PWD=`pwd`
#export DEBUG=${DEBUG:=...} # arbitrary CFLAGS really.
export MALLOCLIB=${MALLOCLIB:=/usr/lib/libefence.a}
fsck -t $FSTYP -y $SCRATCH_DEV 2>&1
local res=$?
case $res in
fsck -t $FSTYP -y $SCRATCH_DEV 2>&1
local res=$?
case $res in
+ $FSCK_OK|$FSCK_NONDESTRUCT|$FSCK_REBOOT)