| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.OSTree.Objects.Sysroot
Contents
- Exported types
- Methods
- cleanup
- deployTree
- deploymentSetKargs
- deploymentSetMutable
- deploymentUnlock
- ensureInitialized
- getBootedDeployment
- getBootversion
- getDeploymentDirectory
- getDeploymentDirpath
- getDeploymentOriginPath
- getDeployments
- getFd
- getMergeDeployment
- getPath
- getRepo
- getSubbootversion
- initOsname
- load
- loadIfChanged
- lock
- lockAsync
- lockFinish
- new
- newDefault
- originNewFromRefspec
- prepareCleanup
- queryDeploymentsFor
- repo
- simpleWriteDeployment
- tryLock
- unload
- unlock
- writeDeployments
- writeDeploymentsWithOptions
- writeOriginFile
- Properties
Description
- newtype Sysroot = Sysroot (ManagedPtr Sysroot)
- class GObject o => IsSysroot o
- toSysroot :: (MonadIO m, IsSysroot o) => o -> m Sysroot
- noSysroot :: Maybe Sysroot
- sysrootCleanup :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> m ()
- sysrootDeployTree :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) => a -> Maybe Text -> Text -> Maybe KeyFile -> Maybe b -> Maybe [Text] -> Maybe c -> m Deployment
- sysrootDeploymentSetKargs :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) => a -> b -> [Text] -> Maybe c -> m ()
- sysrootDeploymentSetMutable :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) => a -> b -> Bool -> Maybe c -> m ()
- sysrootDeploymentUnlock :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) => a -> b -> DeploymentUnlockedState -> Maybe c -> m ()
- sysrootEnsureInitialized :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> m ()
- sysrootGetBootedDeployment :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Deployment
- sysrootGetBootversion :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Int32
- sysrootGetDeploymentDirectory :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b) => a -> b -> m File
- sysrootGetDeploymentDirpath :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b) => a -> b -> m Text
- sysrootGetDeploymentOriginPath :: (HasCallStack, MonadIO m, IsFile a) => a -> m File
- sysrootGetDeployments :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m [Deployment]
- sysrootGetFd :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Int32
- sysrootGetMergeDeployment :: (HasCallStack, MonadIO m, IsSysroot a) => a -> Maybe Text -> m Deployment
- sysrootGetPath :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m File
- sysrootGetRepo :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> m Repo
- sysrootGetSubbootversion :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Int32
- sysrootInitOsname :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Text -> Maybe b -> m ()
- sysrootLoad :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> m ()
- sysrootLoadIfChanged :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Bool -> Maybe b -> m ()
- sysrootLock :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m ()
- sysrootLockAsync :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- sysrootLockFinish :: (HasCallStack, MonadIO m, IsSysroot a, IsAsyncResult b) => a -> b -> m ()
- sysrootNew :: (HasCallStack, MonadIO m, IsFile a) => Maybe a -> m Sysroot
- sysrootNewDefault :: (HasCallStack, MonadIO m) => m Sysroot
- sysrootOriginNewFromRefspec :: (HasCallStack, MonadIO m, IsSysroot a) => a -> Text -> m KeyFile
- sysrootPrepareCleanup :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> Maybe b -> m ()
- sysrootQueryDeploymentsFor :: (HasCallStack, MonadIO m, IsSysroot a) => a -> Maybe Text -> m (Deployment, Deployment)
- sysrootRepo :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Repo
- sysrootSimpleWriteDeployment :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsDeployment c, IsCancellable d) => a -> Maybe Text -> b -> Maybe c -> [SysrootSimpleWriteDeploymentFlags] -> Maybe d -> m ()
- sysrootTryLock :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Bool
- sysrootUnload :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m ()
- sysrootUnlock :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m ()
- sysrootWriteDeployments :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> [Deployment] -> Maybe b -> m ()
- sysrootWriteDeploymentsWithOptions :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) => a -> [Deployment] -> SysrootWriteDeploymentsOpts -> Maybe b -> m ()
- sysrootWriteOriginFile :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) => a -> b -> Maybe KeyFile -> Maybe c -> m ()
- constructSysrootPath :: (IsSysroot o, IsFile a) => a -> IO (GValueConstruct o)
- getSysrootPath :: (MonadIO m, IsSysroot o) => o -> m File
Exported types
Constructors
| Sysroot (ManagedPtr Sysroot) |
Methods
cleanup
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Delete any state that resulted from a partially completed transaction, such as incomplete deployments.
deployTree
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) | |
| => a |
|
| -> Maybe Text |
|
| -> Text |
|
| -> Maybe KeyFile |
|
| -> Maybe b |
|
| -> Maybe [Text] |
|
| -> Maybe c |
|
| -> m Deployment | (Can throw |
Check out deployment tree with revision revision, performing a 3
way merge with providedMergeDeployment for configuration.
deploymentSetKargs
sysrootDeploymentSetKargs Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> [Text] |
|
| -> Maybe c |
|
| -> m () | (Can throw |
Entirely replace the kernel arguments of deployment with the
values in newKargs.
deploymentSetMutable
sysrootDeploymentSetMutable Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> Bool |
|
| -> Maybe c |
|
| -> m () | (Can throw |
By default, deployment directories are not mutable. This function will allow making them temporarily mutable, for example to allow layering additional non-OSTree content.
deploymentUnlock
sysrootDeploymentUnlock Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> DeploymentUnlockedState |
|
| -> Maybe c |
|
| -> m () | (Can throw |
Configure the target deployment deployment such that it
is writable. There are multiple modes, essentially differing
in whether or not any changes persist across reboot.
The OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX state is persistent
across reboots.
ensureInitialized
sysrootEnsureInitialized Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Ensure that self is set up as a valid rootfs, by creating
/ostree/repo, among other things.
getBootedDeployment
sysrootGetBootedDeployment Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m Deployment | Returns: The currently booted deployment, or |
No description available in the introspection data.
getBootversion
sysrootGetBootversion :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Int32 Source #
No description available in the introspection data.
getDeploymentDirectory
sysrootGetDeploymentDirectory Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b) | |
| => a |
|
| -> b |
|
| -> m File | Returns: Path to deployment root directory |
No description available in the introspection data.
getDeploymentDirpath
sysrootGetDeploymentDirpath Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b) | |
| => a |
|
| -> b |
|
| -> m Text | Returns: Path to deployment root directory, relative to sysroot |
Note this function only returns a *relative* path - if you want
to access, it, you must either use fd-relative api such as openat(),
or concatenate it with the full sysrootGetPath.
getDeploymentOriginPath
sysrootGetDeploymentOriginPath Source #
Arguments
| :: (HasCallStack, MonadIO m, IsFile a) | |
| => a |
|
| -> m File | Returns: Path to deployment origin file |
No description available in the introspection data.
getDeployments
sysrootGetDeployments Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m [Deployment] | Returns: Ordered list of deployments |
No description available in the introspection data.
getFd
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m Int32 | Returns: A file descriptor valid for the lifetime of |
Access a file descriptor that refers to the root directory of this
sysroot. sysrootLoad must have been invoked prior to
calling this function.
getMergeDeployment
sysrootGetMergeDeployment Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> Maybe Text |
|
| -> m Deployment | Returns: Configuration merge deployment |
Find the deployment to use as a configuration merge source; this is the first one in the current deployment list which matches osname.
getPath
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a | |
| -> m File | Returns: Path to rootfs |
No description available in the introspection data.
getRepo
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m Repo | (Can throw |
Retrieve the OSTree repository in sysroot self.
getSubbootversion
sysrootGetSubbootversion :: (HasCallStack, MonadIO m, IsSysroot a) => a -> m Int32 Source #
No description available in the introspection data.
initOsname
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Text |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Initialize the directory structure for an "osname", which is a
group of operating system deployments, with a shared /var. One
is required for generating a deployment.
load
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Load deployment list, bootversion, and subbootversion from the
rootfs self.
loadIfChanged
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a | |
| -> Bool | |
| -> Maybe b | |
| -> m () | (Can throw |
No description available in the introspection data.
lock
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m () | (Can throw |
Acquire an exclusive multi-process write lock for self. This call
blocks until the lock has been acquired. The lock is not
reentrant.
Release the lock with sysrootUnlock. The lock will also
be released if self is deallocated.
lockAsync
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
An asynchronous version of sysrootLock.
lockFinish
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m () | (Can throw |
Call when sysrootLockAsync is ready.
new
Arguments
| :: (HasCallStack, MonadIO m, IsFile a) | |
| => Maybe a |
|
| -> m Sysroot | Returns: An accessor object for an system root located at |
No description available in the introspection data.
newDefault
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Sysroot | Returns: An accessor for the current visible root / filesystem |
No description available in the introspection data.
originNewFromRefspec
sysrootOriginNewFromRefspec Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> Text |
|
| -> m KeyFile | Returns: A new config file which sets |
No description available in the introspection data.
prepareCleanup
sysrootPrepareCleanup Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Like sysrootCleanup in that it cleans up incomplete deployments
and old boot versions, but does NOT prune the repository.
queryDeploymentsFor
sysrootQueryDeploymentsFor Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> Maybe Text |
|
| -> m (Deployment, Deployment) |
Find the pending and rollback deployments for osname. Pass Nothing for osname
to use the booted deployment's osname. By default, pending deployment is the
first deployment in the order that matches osname, and rollback will be the
next one after the booted deployment, or the deployment after the pending if
we're not looking at the booted deployment.
Since: 2017.7
repo
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m Repo | Returns: The OSTree repository in sysroot |
This function is a variant of sysrootGetRepo that cannot fail, and
returns a cached repository. Can only be called after sysrootLoad
has been invoked successfully.
simpleWriteDeployment
sysrootSimpleWriteDeployment Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsDeployment c, IsCancellable d) | |
| => a |
|
| -> Maybe Text |
|
| -> b |
|
| -> Maybe c |
|
| -> [SysrootSimpleWriteDeploymentFlags] |
|
| -> Maybe d |
|
| -> m () | (Can throw |
Prepend newDeployment to the list of deployments, commit, and
cleanup. By default, all other deployments for the given osname
except the merge deployment and the booted deployment will be
garbage collected.
If SysrootSimpleWriteDeploymentFlagsRetain is
specified, then all current deployments will be kept.
If SysrootSimpleWriteDeploymentFlagsNotDefault is
specified, then instead of prepending, the new deployment will be
added right after the booted or merge deployment, instead of first.
If SysrootSimpleWriteDeploymentFlagsNoClean is
specified, then no cleanup will be performed after adding the
deployment. Make sure to call sysrootCleanup sometime
later, instead.
tryLock
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m Bool | (Can throw |
Try to acquire an exclusive multi-process write lock for self. If
another process holds the lock, this function will return
immediately, setting outAcquired to False, and returning True
(and no error).
Release the lock with sysrootUnlock. The lock will also
be released if self is deallocated.
unload
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m () |
Release any resources such as file descriptors referring to the root directory of this sysroot. Normally, those resources are cleared by finalization, but in garbage collected languages that may not be predictable.
This undoes the effect of ostree_sysroot_load().
unlock
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a) | |
| => a |
|
| -> m () |
Clear the lock previously acquired with sysrootLock. It
is safe to call this function if the lock has not been previously
acquired.
writeDeployments
sysrootWriteDeployments Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> [Deployment] |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Older version of sysrootWriteDeploymentsWithOptions. This
version will perform post-deployment cleanup by default.
writeDeploymentsWithOptions
sysrootWriteDeploymentsWithOptions Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) | |
| => a |
|
| -> [Deployment] |
|
| -> SysrootWriteDeploymentsOpts |
|
| -> Maybe b |
|
| -> m () | (Can throw |
Assuming newDeployments have already been deployed in place on disk via
sysrootDeployTree, atomically update bootloader configuration. By
default, no post-transaction cleanup will be performed. You should invoke
sysrootCleanup at some point after the transaction, or specify
do_postclean in opts. Skipping the post-transaction cleanup is useful
if for example you want to control pruning of the repository.
writeOriginFile
sysrootWriteOriginFile Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSysroot a, IsDeployment b, IsCancellable c) | |
| => a |
|
| -> b |
|
| -> Maybe KeyFile |
|
| -> Maybe c |
|
| -> m () | (Can throw |
Immediately replace the origin file of the referenced deployment
with the contents of newOrigin. If newOrigin is Nothing,
this function will write the current origin of deployment.
Properties
path
constructSysrootPath :: (IsSysroot o, IsFile a) => a -> IO (GValueConstruct o) Source #