Skip to content

OXT-1654: Handle NVMe symlinks in /dev.#112

Merged
jean-edouard merged 2 commits intoOpenXT:masterfrom
eric-ch:oxt-1654
Jul 25, 2019
Merged

OXT-1654: Handle NVMe symlinks in /dev.#112
jean-edouard merged 2 commits intoOpenXT:masterfrom
eric-ch:oxt-1654

Conversation

@eric-ch
Copy link
Copy Markdown
Contributor

@eric-ch eric-ch commented Jul 23, 2019

udev may create a symlink alias to the block device in /dev for some NVMe drives. get_devnode_{disk,partition} assumes (per comment) they are passed the block device
path, but some utility tools (e.g, lvm-utils) can return the symlink alias instead that end up being passed as argument.
Add a sanitizing function to avoid that.

part2 already has snippets doing just that when trying to remove any existing LVM setup cleaning. So use the new function instead.

Eric Chanudet added 2 commits July 23, 2019 16:15
udev may create a symlink alias to the block device in /dev for some
NVMe drives.

get_devnode_{disk,partition} assumes they are passed the block device
path, but some utility tools (e.g, lvm-utils) can return the symlink
alias instead.

Add a sanitizing function to handle that.

Signed-off-by: Eric Chanudet <chanudete@ainfosec.com>

OXT-1654
sanitize_devnode will follow the symlink alias and print the block
device full path on stdout.
Use the interface instead of local snippets.

Signed-off-by: Eric Chanudet <chanudete@ainfosec.com>

OXT-1654
@jean-edouard
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

@jean-edouard jean-edouard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging soon.

@jean-edouard jean-edouard merged commit 0cff8a9 into OpenXT:master Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants