Skip to content

Commit

Permalink
Fixed code logic in resize_filesystem method
Browse files Browse the repository at this point in the history
resize_filesystem runs fs-check on the filesytem prior to
resize. This check however should not be done if the filesystem
got deployed on a ramdisk. For that purpose the _is_ramdisk_device
method exists. The logic in the method as well as the call
were wrong. This in the end lead to a correct logic but is
completely confusing. This commit fixes and simplifies the
_is_ramdisk_device method and corrects the caller logic
  • Loading branch information
schaefi committed Jul 24, 2020
1 parent d230999 commit 69df7af
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dracut/modules.d/99kiwi-lib/kiwi-filesystem-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function resize_filesystem {
return
;;
esac
if _is_ramdisk_device "${device}"; then
if ! _is_ramdisk_device "${device}"; then
check_filesystem "${device}"
fi
info "Resizing ${fstype} filesystem on ${device}..."
Expand Down Expand Up @@ -104,9 +104,5 @@ function probe_filesystem {
# Methods considered private
#--------------------------------------
function _is_ramdisk_device {
local device=$1
if echo "${device}" | grep -qi "/dev/ram";then
return 1
fi
return 0
echo "$1" | grep -qi "/dev/ram"
}

0 comments on commit 69df7af

Please sign in to comment.