Skip to content

Commit

Permalink
Merge pull request #1522 from madhu-pillai/crypt_fs
Browse files Browse the repository at this point in the history
OCPBUGS-33124: coreos-cryptfs: drop growpart call
  • Loading branch information
openshift-merge-bot[bot] authored Jun 20, 2024
2 parents dee91ea + 12d62d4 commit 2826e18
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions overlay.d/05rhcos/usr/libexec/coreos-cryptfs
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,10 @@ try_open() {
# this avoids the cryptsetup performance penalty.
msg "${dev} is not encrypted. Device will be mounted as device-mapper linear target."

# We inline a growpart here since it's simpler than trying to reconfigure dm-linear
local major minor devpath partition parent_path parent_device
major=$((0x$(stat -c '%t' "${dev}")))
minor=$((0x$(stat -c '%T' "${dev}")))
devpath=$(realpath "/sys/dev/block/${major}:${minor}")
partition=$(cat "$devpath/partition")
parent_path=$(dirname "$devpath")
parent_device=/dev/$(basename "${parent_path}")

# TODO: make this idempotent, and don't error out if
# we can't resize.
growpart "${parent_device}" "${partition}" || true
# Note: we used to growpart here, but don't anymore. That should only
# have been done on firstboot, not every boot. Since we don't support
# this LUKS setup anymore on new installs, we dropped it. That also
# fixes some growpart-related issues (see OCPBUGS-33124).

local dev_size=$(($(blockdev --getsize "${dev}") - "${LUKS_HEADER_OFFSET_SECTORS}"))
echo "0 ${dev_size} linear ${dev} ${LUKS_HEADER_OFFSET_SECTORS}" \
Expand Down

0 comments on commit 2826e18

Please sign in to comment.