Documentation ¶
Index ¶
- Constants
- Variables
- func AddRootDirCallback(c func(string))
- func CompleteShPath(base string) string
- func DataHomeGlobs(opts *SnapDirOptions) []string
- func FeaturesDirUnder(rootdir string) string
- func IsCompleteShSymlink(compPath string) bool
- func SetRootDir(rootdir string)
- func SetSnapHomeDirs(homedirs string) []string
- func SnapBlobDirUnder(rootdir string) string
- func SnapBootAssetsDirUnder(rootdir string) string
- func SnapDeviceDirUnder(rootdir string) string
- func SnapFDEDirUnder(rootdir string) string
- func SnapFDEDirUnderSave(savedir string) string
- func SnapHomeDirs() []string
- func SnapKernelDriversTreesDirUnder(rootdir string) string
- func SnapModeenvFileUnder(rootdir string) string
- func SnapRepairConfigFileUnder(rootdir string) string
- func SnapRuntimeServicesDirUnder(rootdir string) string
- func SnapSaveDirUnder(rootdir string) string
- func SnapSeedDirUnder(rootdir string) string
- func SnapServicesDirUnder(rootdir string) string
- func SnapStateFileUnder(rootdir string) string
- func SnapStateLockFileUnder(rootdir string) string
- func SnapSystemParamsUnder(rootdir string) string
- func SnapSystemdConfDirUnder(rootdir string) string
- func SnapSystemdDirUnder(rootdir string) string
- func SnapdStateDir(rootdir string) string
- func StripRootDir(dir string) string
- func SupportsClassicConfinement() bool
- type SnapDirOptions
Constants ¶
const ( // These are directories which are static inside the core snap and // can never be prefixed as they will be always absolute once we // are in the snap confinement environment. CoreLibExecDir = "/usr/lib/snapd" CoreSnapMountDir = "/snap" // UserHomeSnapDir is the directory with snap data inside user's home UserHomeSnapDir = "snap" // HiddenSnapDataHomeDir is an experimental hidden directory for snap data HiddenSnapDataHomeDir = ".snap/data" // ExposedSnapHomeDir is the directory where snaps should place user-facing // data after ~/snap has been migrated to ~/.snap ExposedSnapHomeDir = "Snap" // LocalInstallBlobTempPrefix is used by local install code: // * in daemon to spool the snap file to <SnapBlobDir>/<LocalInstallBlobTempPrefix>* // * in snapstate to auto-cleans them up using the same prefix LocalInstallBlobTempPrefix = ".local-install-" )
Variables ¶
var ( GlobalRootDir string = "/" RunDir string SnapMountDir string DistroLibExecDir string SnapBlobDir string SnapDataDir string SnapDownloadCacheDir string SnapAppArmorDir string SnapSeccompBase string SnapSeccompDir string SnapMountPolicyDir string SnapCgroupPolicyDir string SnapUdevRulesDir string SnapKModModulesDir string SnapKModModprobeDir string LocaleDir string SnapdSocket string SnapSocket string SnapRunDir string SnapRunNsDir string SnapRunLockDir string SnapBootstrapRunDir string SnapVoidDir string SnapdMaintenanceFile string SnapdStoreSSLCertsDir string SnapSeedDir string SnapDeviceDir string SnapAssertsDBDir string SnapCookieDir string SnapTrustedAccountKey string SnapAssertsSpoolDir string SnapSeqDir string SnapStateFile string SnapStateLockFile string SnapSystemKeyFile string SnapRepairConfigFile string SnapRepairDir string SnapRepairStateFile string SnapRepairRunDir string SnapRepairAssertsDir string SnapRunRepairDir string SnapRollbackDir string SnapCacheDir string SnapNamesFile string SnapSectionsFile string SnapCommandsDB string SnapAuxStoreInfoDir string SnapBinariesDir string SnapServicesDir string SnapRuntimeServicesDir string SnapUserServicesDir string SnapSystemdConfDir string SnapDesktopFilesDir string SnapDesktopIconsDir string SnapPolkitPolicyDir string SnapSystemdDir string SnapSystemdRunDir string SnapDBusSessionPolicyDir string SnapDBusSystemPolicyDir string SnapDBusSessionServicesDir string SnapDBusSystemServicesDir string SnapModeenvFile string SnapBootAssetsDir string SnapFDEDir string SnapSaveDir string SnapDeviceSaveDir string SnapDataSaveDir string CloudMetaDataFile string CloudInstanceDataFile string ClassicDir string XdgRuntimeDirBase string XdgRuntimeDirGlob string CompletionHelperInCore string BashCompletionScript string LegacyCompletersDir string CompletersDir string SystemFontsDir string SystemLocalFontsDir string SystemFontconfigCacheDirs []string SnapshotsDir string SysfsDir string FeaturesDir string )
the various file paths
Functions ¶
func AddRootDirCallback ¶
func AddRootDirCallback(c func(string))
AddRootDirCallback registers a callback for whenever the global root directory (set by SetRootDir) is changed to enable updates to variables in other packages that depend on its location.
func CompleteShPath ¶
func DataHomeGlobs ¶
func DataHomeGlobs(opts *SnapDirOptions) []string
DataHomeGlobs returns a slice of globbing expressions for the snap directories in use.
func FeaturesDirUnder ¶
FeaturesDirUnder returns the path to the features dir under rootdir.
func IsCompleteShSymlink ¶
func SetRootDir ¶
func SetRootDir(rootdir string)
SetRootDir allows settings a new global root directory, this is useful for e.g. chroot operations
func SetSnapHomeDirs ¶
SetSnapHomeDirs sets SnapHomeDirs to the user defined values and appends /home if needed. homedirs must be a comma separated list of paths to home directories. If homedirs is empty, SnapHomeDirs will be a slice of length 1 containing "/home". Also generates the data directory globbing expressions for each user. Expected to be run by configstate.Init, returns a slice of home directories.
func SnapBlobDirUnder ¶
SnapBlobDirUnder returns the path to the snap blob dir under rootdir.
func SnapBootAssetsDirUnder ¶
SnapBootAssetsDirUnder returns the path to boot assets directory under a rootdir.
func SnapDeviceDirUnder ¶
SnapDeviceDirUnder returns the path to device directory under rootdir.
func SnapFDEDirUnder ¶
SnapFDEDirUnder returns the path to full disk encryption state directory under rootdir.
func SnapFDEDirUnderSave ¶
SnapFDEDirUnderSave returns the path to full disk encryption state directory inside the given save tree dir.
func SnapHomeDirs ¶
func SnapHomeDirs() []string
SnapHomeDirs returns a slice of the currently configured home directories.
func SnapKernelDriversTreesDirUnder ¶
SnapKernelTreesDirUnder returns the path to the snap kernel drivers trees dir under rootdir.
func SnapModeenvFileUnder ¶
SnapModeenvFileUnder returns the path to the modeenv file under rootdir.
func SnapRepairConfigFileUnder ¶
SnapSaveDirUnder returns the path to device save directory under rootdir.
func SnapSaveDirUnder ¶
SnapSaveDirUnder returns the path to device save directory under rootdir.
func SnapSeedDirUnder ¶
SnapSeedDirUnder returns the path to the snap seed dir under rootdir.
func SnapServicesDirUnder ¶
SnapServicesDirUnder returns the path to the systemd services conf dir under rootdir.
func SnapStateFileUnder ¶
SnapStateFileUnder returns the path to snapd state file under rootdir.
func SnapStateLockFileUnder ¶
SnapStateLockFileUnder returns the path to snapd state lock file under rootdir.
func SnapSystemParamsUnder ¶
SnapSystemParamsUnder returns the path to the system-params file under rootdir.
func SnapSystemdConfDirUnder ¶
SnapSystemdConfDirUnder returns the path to the systemd conf dir under rootdir.
func SnapSystemdDirUnder ¶
SnapSystemdDirUnder returns the path to the systemd conf dir under rootdir.
func SnapdStateDir ¶
SnapdStateDir returns the path to /var/lib/snapd dir under rootdir.
func StripRootDir ¶
StripRootDir strips the custom global root directory from the specified argument.
func SupportsClassicConfinement ¶
func SupportsClassicConfinement() bool
SupportsClassicConfinement returns true if the current directory layout supports classic confinement.
Types ¶
type SnapDirOptions ¶
type SnapDirOptions struct { // HiddenSnapDataDir determines if the snaps' data is in ~/.snap/data instead // of ~/snap HiddenSnapDataDir bool // MigratedToExposedHome determines if the snap's directory in ~/Snap has been // initialized with the contents of the snap's previous home (i.e., the // revisioned data directory). MigratedToExposedHome bool }