Skip to content
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

Mount a custom home partition #353

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

muhdsalm
Copy link

@muhdsalm muhdsalm commented Aug 18, 2024

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

  • Implement mounting custom home partitions
  • Implement decrypting encrypted home partitions
    Up till this point, to add a custom home partition you have to mess around with abroot.json and filesystem labels yourself.
  • Implement adding a custom home partition in the Vanilla Installer
  • Implement encrypting the home partition in the installer
  • Implement adding an encrypted home partition in the installer. This could also extend to adding an encrypted var partition as well

@muhdsalm
Copy link
Author

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
Copy link
Author

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 mirkobrombin requested review from taukakao and removed request for taukakao August 20, 2024 19:22
@mirkobrombin
Copy link
Member

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

Copy link
Member

@taukakao taukakao left a comment

Choose a reason for hiding this comment

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

I'm really sorry, I see that work went into this, I just think it's way too overkill for what we're trying to do here.

In my opinion, we should just make /home a symlink to /var/home.
It's how Silverblue does it and would allow mounting something in /home (would mount to /var/home)

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

@mirkobrombin
Copy link
Member

That's also fair

@muhdsalm
Copy link
Author

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
Copy link
Member

@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
Copy link
Author

@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
Copy link
Member

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

@muhdsalm
Copy link
Author

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
Copy link
Author

muhdsalm commented Aug 27, 2024

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
Copy link
Member

@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

Copy link
Member

@taukakao taukakao left a comment

Choose a reason for hiding this comment

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

Seems to me like there's no checking if the symlink exists already.
If I'm wrong and you tested this across an update and multiple reboots then you can resolve this.

@muhdsalm
Copy link
Author

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
Copy link
Author

Perhaps encryption should be handled in a different PR

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