Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fsck in cli.sh #785

Merged
merged 2 commits into from
May 15, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove duplicate conditional statements.
  • Loading branch information
Jerry authored and Jerry committed May 14, 2017
commit cb75a10f65d4e966287ceafda3bc3371c61a6567
31 changes: 14 additions & 17 deletions cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -555,23 +555,20 @@ container_mounted()
}

fs_check(){
if [ "${METHOD}" = "chroot" ]; then
is_mounted "${CHROOT_DIR}" && return 0
case "$TARGET_TYPE" in
file)
local loop_device
loop_device="$(losetup -f 2>&1 |grep -o -E '/dev/.*loop[0-9]+')"
[ -z "$loop_device" ] && return 0
losetup "${loop_device}" "${TARGET_PATH}"
e2fsck -p "${loop_device}"
losetup -d "${loop_device}"
;;
partition)
e2fsck -p "${TARGET_PATH}"
esac
else
return 0
fi
is_mounted "${CHROOT_DIR}" && return 0
case "$TARGET_TYPE" in
file)
local loop_device
loop_device="$(losetup -f 2>&1 |grep -o -E '/dev/.*loop[0-9]+')"
[ -z "$loop_device" ] && return 0
losetup "${loop_device}" "${TARGET_PATH}"
e2fsck -p "${loop_device}"
losetup -d "${loop_device}"
;;
partition)
e2fsck -p "${TARGET_PATH}"
esac
return 0
}

mount_part()
Expand Down