Vanilla-OS / ABRoot

ABRoot is a utility that provides full immutability and atomicity to a Linux system, by transacting between two root filesystems. Updates are performed using OCI images, to ensure that the system is always in a consistent state.
http://abroot.vanillaos.org/
GNU General Public License v3.0
309 stars 24 forks source link

Mount a custom home partition #353

Open muhdsalm opened 1 month ago

muhdsalm commented 1 month ago

This is kinda part one in the process to support custom home partitions. This a sort of roadmap of the process:

muhdsalm commented 1 month ago

I really have no idea if the decryption thing works or not because I don't have any encrypted on my system. If someone does, please do let me know if it works.

muhdsalm commented 1 month ago

Update: works on my machine (also I finally don't have to mount my home partition by hand anymore 😁)

You can test it by using the muhdsalm/test image

mirkobrombin commented 1 month ago

Added a reviewer by mistake. Anyway the changes looks good for now!

mirkobrombin commented 1 month ago

That's also fair

muhdsalm commented 1 month ago

Maybe it's just me, but the fact that /var/home is bind mounted to /home means that a lot of configuration doesn't break if I were to install a different distro and it's expecting /var/home (which doesn't exist anymore). And keeping configuration between different systems is one of the reasons to use a custom home partition.

taukakao commented 1 month ago

@muhdsalm Could you elaborate? I don't understand what you mean.

If you were to switch from a different OS with a separate home partition to an ABRoot based OS you could just put the mount to /home in your fstab and systemd would automatically mount it in /var/home Currently it's not possible since systemd doesn't overwrite the mount in /home but if it's a symlink it should work.

muhdsalm commented 1 month ago

@muhdsalm Could you elaborate? I don't understand what you mean.

If you were to switch from a different OS with a separate home partition to an ABRoot based OS you could just put the mount to /home in your fstab and systemd would automatically mount it in /var/home Currently it's not possible since systemd doesn't overwrite the mount in /home but if it's a symlink it should work.

Some application configs break when switching from a system with $HOME set as /var/home to system with $HOME set to /home because they expect /var/home to still be there on the new system.

taukakao commented 1 month ago

With a symlink, we would still use /home for $HOME Using a bind mount or a symlink should behave almost identically.

muhdsalm commented 1 month ago

With a symlink, we would still use /home for $HOME Using a bind mount or a symlink should behave almost identically.

Oh ok, cool

muhdsalm commented 1 month ago

Also, /home doesn't need to exist before systemd so I strongly disagree with putting all the logic here.

Would the decryption be a reason to put the logic here?

taukakao commented 1 month ago

@muhdsalm No, decryption should be handled like in other distros through fstab and crypttab in my opinion.

The only reason why we need /var this early is because it contains part of /etc

muhdsalm commented 4 weeks ago

The issue with this push is that the /home cannot exist otherwise it will not create the symlink (which is expected behavior), so while testing you have to remove /home manually.

muhdsalm commented 3 weeks ago

Perhaps encryption should be handled in a different PR