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

Remove dependency on systemd-escape #1240

Open
achilleas-k opened this issue Feb 20, 2025 · 1 comment
Open

Remove dependency on systemd-escape #1240

achilleas-k opened this issue Feb 20, 2025 · 1 comment

Comments

@achilleas-k
Copy link
Member

// MountUnitNameFor returns the escaped name of the mount unit for a given
// mountpoint by calling:
//
// systemd-escape --path --suffix=mount "mountpoint"
func MountUnitNameFor(mountpoint string) (string, error) {
cmd := exec.Command("systemd-escape", "--path", "--suffix=mount", mountpoint)
stdout, err := cmd.Output()
if err != nil {
return "", fmt.Errorf("systemd-escape call failed: %s", ExecError(err))
}
return strings.TrimSpace(string(stdout)), nil
}

We shouldn't depend on systemd-escape to generate manifests. We already have osbuild.pathEscape() which does most of it in plain Go code, but I think it's not 100%. It should be possible to make it a full port.

@achilleas-k
Copy link
Member Author

@achilleas-k achilleas-k marked this as a duplicate of #1271 Feb 27, 2025
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

No branches or pull requests

1 participant