desultory / ugrd

A minimalistic initramfs generator, designed for FDE
GNU General Public License v2.0
31 stars 11 forks source link

No subvolume validation #2

Closed desultory closed 5 months ago

desultory commented 9 months ago

If root_subvol is used, there is no guarantee a valid one will be selected.

bwbuhse commented 9 months ago

I can give this a shot if you haven't worked on it yet (unless there's some specific reason they're not validated right now that's not just you haven't gotten around to it)

desultory commented 9 months ago

/proc/mounts could potentially be filtered for lines with "subvol=name" or something, as long as hostonly mode is not active.

I think this method may start to break down if you're selecting a subvol other than the one you're using. I think the "hostonly" checks are nice to have, and having to totally disable them to select a new subvolume doesn't make sense.

I think there will be cases where users may want to create a new ro subvolume and then boot to that. If you wanted to check for that, you'd have to make sure the root btrfs volume is mounted somewhere, then scan for subvolumes under that. I do this within the initramfs for the selector, but I want to try to not touch the host system if possible.


Maybe the "hostonly" checks could be categorized into groups? That way it can be partially disabled? I honestly used that variable name for "dracut compatibility" and because otherwise, that arg would do nothing. Maybe --hostonly could just be aliases for "--check-image" or something.

desultory commented 5 months ago

root subvol validation was added a while back