-
Notifications
You must be signed in to change notification settings - Fork 24
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
✨ device: linux lvm support #4971
Conversation
Test Results3 163 tests 3 162 ✅ 1m 26s ⏱️ Results for commit cc236c0. ♻️ This comment has been updated with latest results. |
effab67
to
78ab83c
Compare
@slntopp can you add some words about how to best test this new functionality? |
Difference is that before if root partition was |
func mapLVM2Partitions(part BlockDevice) (partitions []*PartitionInfo) { | ||
for _, p := range part.Children { | ||
devFsName := "/dev/mapper/" + p.Name | ||
partitions = append(partitions, &PartitionInfo{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we make a blockdevice -> partitioninfo func? i think we use this in more places than here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a method to BlockDevice
What has changed
After mount targets (partitions) are discovered, we'd attempt to either find
fstab
file or detectostree
partition.fstab
If
fstab
configuration is discovered, provider will parse it and mount all discovered partitions using "opts" configured in the file. This ensures all required features and flags are used, for instance if partition hasbtrfs
orxfs
sub-volumes.Additionally, device manager would add same partition twice or more if it's mounted multiple times with different opts.
Additionally, device manager will attempt to mount these partitions as
/tmp/cnspec-scanxxxx
+<fstab mountpoint>
By the time we get to attempt detect asset, partitions are already mounted and the scan dir has the structure closest to that in the original VM.
ostree
ostree
filesystem together with edge case distros like Fedora CoreOS have a very different file structure as well as missing lot of usual service files (likehostname
,machine-id
, etc)First of all, device manager attempts to
untangle
the pointers and locate the actual and latest root filesystem.Additionally this PR introduces
bind
option to the volume mounter, which doesn't mount partition again with--bind
as one may think, though but adjusts the fs-connection used for asset detection and can be used anywhere else, where the files search relies on standard linux tree structure. For malware detection and similar operationsBind
can be ignored to get the full overview of the system.moby/mount instead of sys/unix
Since
fstab
options include both flags and "data" we need a reliable way to split those, so mount doesn't crash out withinvalid argument
error. moby mount provides that, so we simply don't have to reinvent a bicycle here.inject platform ids fallback
As mentioned, some distros don't have usual means of ID-ing the OS like hostname, machine-id or ssh-host-keys. We can however inject custom platform-ids in this cases. With this PR we don't error out from asset detection if no platform ids were found and there are injected ones.