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

systemd-stage-1: Remove systemd-gpt-auto-generator #277703

Closed

Conversation

ElvishJerricco
Copy link
Contributor

This doesn't actually work in systemd stage 1 at all right now. It cannot mount / or /usr. It still works as expected in stage 2.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This doesn't actually work in systemd stage 1 at all right now. It
cannot mount / or /usr. It still works as expected in stage 2.
@NickCao
Copy link
Member

NickCao commented Dec 30, 2023

This doesn't actually work in systemd stage 1 at all right now.

What exactly goes wrong?

@arianvp
Copy link
Member

arianvp commented Dec 30, 2023

Yeh a little bit more context in the commit / PR would be appreciated. I'm kind of confused why we want to disable or enable this

@ElvishJerricco
Copy link
Contributor Author

ElvishJerricco commented Dec 30, 2023

@NickCao In stage 1, the only thing it does is create mount units for /sysroot via the /dev/gpt-auto-root device link generated by udev. The problem is that we put /sysroot into the SYSTEMD_SYSROOT_FSTAB file, and fstab-generator makes units for it too. So the two conflict and stage 1 breaks.

To fix this, we would need to put root= on the cmdline, which isn't as trivial as it sounds. The fstab-generator will ignore the root FS when its on cmdline like that, but not if its in fstab. On the other hand, gpt-auto doesn't even know about the fstab file so it can't check there to ignore, so it can only use cmdline.

@YHNdnzj
Copy link

YHNdnzj commented Dec 31, 2023

The fstab-generator will ignore the root FS when its on cmdline like that, but not if its in fstab. On the other hand, gpt-auto doesn't even know about the fstab file so it can't check there to ignore, so it can only use cmdline.

How? root=fstab works perfectly for the use case you mentioned.

@ElvishJerricco
Copy link
Contributor Author

ElvishJerricco commented Jan 1, 2024

@YHNdnzj Ah, that's a good point. Regardless, we would always be using root=fstab, and then systemd-gpt-auto-generator would still be literally never doing anything. So regardless of that, systemd-gpt-auto-generator is never doing anything and we might as well remove it until we actually support it.

@philiptaron
Copy link
Contributor

I like #282022 substantially more than this one, for what it's worth. 🔢

Does this PR also belong on the "Systemd in Stage 1" board?

@ElvishJerricco
Copy link
Contributor Author

Closed in favor of #282022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants