Files
arca/internal/udisks/mount.go
Kyle Isom c835358829 Initial implementation of arca, a LUKS volume manager.
Go CLI using cobra with mount, unmount, status, and init subcommands.
Unlocks via udisks2 D-Bus (passphrase/keyfile) or cryptsetup (FIDO2/TPM2)
with ordered method fallback. Includes NixOS-specific LD_LIBRARY_PATH
injection for systemd cryptsetup token plugins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 07:42:38 -07:00

24 lines
629 B
Go

package udisks
import (
"fmt"
)
// Mount mounts a filesystem and returns the mount point chosen by udisks2.
func (c *Client) Mount(dev *BlockDevice) (string, error) {
obj := c.conn.Object(busName, dev.ObjectPath)
var mountpoint string
err := obj.Call(ifaceFilesystem+".Mount", 0, noOptions()).Store(&mountpoint)
if err != nil {
return "", fmt.Errorf("mounting %s: %w", dev.DevicePath, err)
}
return mountpoint, nil
}
// Unmount unmounts a filesystem.
func (c *Client) Unmount(dev *BlockDevice) error {
obj := c.conn.Object(busName, dev.ObjectPath)
return obj.Call(ifaceFilesystem+".Unmount", 0, noOptions()).Err
}