Skip to content

Commit

Permalink
fix: Ensure we are not processing LUKS or LVM devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeglius committed Feb 23, 2025
1 parent 20a8a17 commit c3fb6bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions media-automount-generator
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ for dev in $(lsblk -n --shell --output PATH --filter 'TYPE == "part"'); do
continue
fi

# Ensure we are not dealing with LUKS or LVM devices
if [[ $dev == /dev/mapper/* ]]; then
log "$dev: device might be LUKS or LVM. Skipping..."
continue
fi

# Check if is removable, and if so, skip it
parent_dev=$(lsblk -n --inverse --output=NAME --filter='TYPE == "disk"' "$dev" | tail -1)
if [[ $(</sys/block/"$parent_dev"/removable) -eq 1 ]]; then
Expand Down

0 comments on commit c3fb6bb

Please sign in to comment.