Skip to content

Commit

Permalink
/etc/init.d/S00datapart: show fsck log only on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Oct 25, 2020
1 parent 5c3c533 commit 2bd433b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions board/common/overlay/etc/init.d/S00datapart
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ case "$1" in

msg_done "${disk_dev}"

if [ -b ${data_dev} ]
then
if grep -q 'fsck.mode=force' /proc/cmdline
then
/sbin/e2fsck -fy ${data_dev}
if [[ -b ${data_dev} ]]; then
msg_begin "Checking data filesystem"
if grep -q 'fsck.mode=force' /proc/cmdline; then
/sbin/e2fsck -fy ${data_dev} &> /tmp/fsck.log
elif ! grep -q 'fsck.mode=skip' /proc/cmdline; then
/sbin/e2fsck -y ${data_dev} &> /tmp/fsck.log
fi
if [[ $? == 0 ]]; then
msg_done
else
/sbin/e2fsck -y ${data_dev}
msg_fail
cat /tmp/fsck.log
fi
exit 0
fi
Expand Down

0 comments on commit 2bd433b

Please sign in to comment.