![]() |
![]() |
![]() |
Schroot Reference Manual | ![]() |
---|
SbuildChrootSbuildChroot — chroot object |
SbuildChroot; SbuildChrootClass; void (*SbuildChrootPrintDetailsFunc) (SbuildChroot *chroot, FILE *file); const gchar* (*SbuildChrootGetChrootTypeFunc) (const SbuildChroot *chroot); SbuildChrootSessionFlags (*SbuildChrootGetSessionFlagsFunc) (const SbuildChroot *chroot); void (*SbuildChrootPrintConfigFunc) (SbuildChroot *chroot, FILE *file); enum SbuildChrootSessionFlags; enum SbuildChrootSetupType; SbuildChroot* sbuild_chroot_new (void); SbuildChroot* sbuild_chroot_new_from_keyfile (GKeyFile *keyfile, const char *group, gboolean active); gboolean sbuild_chroot_set_properties_from_keyfile (SbuildChroot *chroot, GKeyFile *keyfile); const char* sbuild_chroot_get_name (const SbuildChroot *restrict chroot); void sbuild_chroot_set_name (SbuildChroot *chroot, const char *name); const char* sbuild_chroot_get_description (const SbuildChroot *restrict chroot); void sbuild_chroot_set_description (SbuildChroot *chroot, const char *description); guint sbuild_chroot_get_priority (const SbuildChroot *restrict chroot); void sbuild_chroot_set_priority (SbuildChroot *chroot, guint priority); char** sbuild_chroot_get_groups (const SbuildChroot *restrict chroot); void sbuild_chroot_set_groups (SbuildChroot *chroot, char **groups); char** sbuild_chroot_get_root_groups (const SbuildChroot *restrict chroot); void sbuild_chroot_set_root_groups (SbuildChroot *chroot, char **groups); char** sbuild_chroot_get_aliases (const SbuildChroot *restrict chroot); void sbuild_chroot_set_aliases (SbuildChroot *chroot, char **aliases); gboolean sbuild_chroot_get_run_setup_scripts (const SbuildChroot *restrict chroot); void sbuild_chroot_set_run_setup_scripts (SbuildChroot *chroot, gboolean run_setup_scripts); gboolean sbuild_chroot_get_run_session_scripts (const SbuildChroot *restrict chroot); void sbuild_chroot_set_run_session_scripts (SbuildChroot *chroot, gboolean run_session_scripts); guint sbuild_chroot_get_max_users (const SbuildChroot *restrict chroot); void sbuild_chroot_set_max_users (SbuildChroot *chroot, guint max_users); guint sbuild_chroot_get_current_users (const SbuildChroot *restrict chroot); void sbuild_chroot_set_current_users (SbuildChroot *chroot, guint current_users); const char* sbuild_chroot_get_mount_location (const SbuildChroot *restrict chroot); void sbuild_chroot_set_mount_location (SbuildChroot *chroot, const char *location); const char* sbuild_chroot_get_mount_device (const SbuildChroot *restrict chroot); void sbuild_chroot_set_mount_device (SbuildChroot *chroot, const char *device); void sbuild_chroot_print_details (SbuildChroot *chroot, FILE *file); void sbuild_chroot_print_config (SbuildChroot *chroot, FILE *file); const gchar* sbuild_chroot_get_chroot_type (const SbuildChroot *chroot); SbuildChrootSessionFlags sbuild_chroot_get_session_flags (const SbuildChroot *chroot);
"active" gboolean : Read "aliases" GStrv : Read / Write / Construct "current-users" guint : Read / Write "description" gchararray : Read / Write / Construct "groups" GStrv : Read / Write / Construct "max-users" guint : Read / Write / Construct "mount-device" gchararray : Read / Write "mount-location" gchararray : Read / Write "name" gchararray : Read / Write / Construct "priority" guint : Read / Write / Construct "root-groups" GStrv : Read / Write / Construct "run-session-scripts" gboolean : Read / Write / Construct "run-setup-scripts" gboolean : Read / Write / Construct
This object contains all of the metadata associated with a single chroot. This is the in-core representation of a chroot definition in the configuration file, and may be initialised directly from an open GKeyFile.
This object is a container of information only. The only things it can do are satisfying requests for information and printing its details.
typedef struct { GObjectClass parent; SbuildChrootPrintDetailsFunc print_details; SbuildChrootPrintConfigFunc print_config; SbuildChrootSetupEnvFunc setup_env; SbuildChrootGetChrootTypeFunc get_chroot_type; SbuildChrootSetupLockFunc setup_lock; SbuildChrootGetSessionFlagsFunc get_session_flags; } SbuildChrootClass;
SbuildChroot class.
GObjectClass parent ; |
the parent class |
SbuildChrootPrintDetailsFunc print_details ; |
vfunc to print additional chroot details |
SbuildChrootPrintConfigFunc print_config ; |
vfunc to print the config file group for this chroot |
SbuildChrootSetupEnvFunc setup_env ; |
|
SbuildChrootGetChrootTypeFunc get_chroot_type ; |
vfunc to get the user visible chroot type name |
SbuildChrootSetupLockFunc setup_lock ; |
|
SbuildChrootGetSessionFlagsFunc get_session_flags ; |
vfunc to get the session flags for this chroot type |
void (*SbuildChrootPrintDetailsFunc) (SbuildChroot *chroot, FILE *file);
Print detailed information about chroot
to file
. The information
is printed in plain text with one line per property. This should
print additional detail in derived SbuildChroot classes.
chroot : |
an SbuildChroot |
file : |
the file to output to. |
const gchar* (*SbuildChrootGetChrootTypeFunc) (const SbuildChroot *chroot);
This function is used to get the name of the chroot type subclassed from this type. This is a user-friendly form of the registered type name of the class, for use in messages and configuration files.
chroot : |
an SbuildChroot |
Returns : | the type name |
SbuildChrootSessionFlags (*SbuildChrootGetSessionFlagsFunc) (const SbuildChroot *chroot);
This function is used to get the session flags of the chroot. These determine how the SbuildSession controlling the chroot will operate.
chroot : |
an SbuildChroot |
Returns : | the SbuildChrootSessionFlags |
void (*SbuildChrootPrintConfigFunc) (SbuildChroot *chroot, FILE *file);
Print the configuration group for a chroot in the format required by schroot.conf.
chroot : |
an SbuildChroot. |
file : |
the file to output to. |
typedef enum { SBUILD_CHROOT_SESSION_AUTOCREATE = 1 << 0, SBUILD_CHROOT_SESSION_PERSISTENT = 1 << 1, SBUILD_CHROOT_SESSION_MULTIUSER = 1 << 2 } SbuildChrootSessionFlags;
The session options for a given chroot type
SBUILD_CHROOT_SESSION_AUTOCREATE |
Create a session automatically, otherwise the session must be requested explicitly. |
SBUILD_CHROOT_SESSION_PERSISTENT |
The session persists once schroot terminates, otherwise is ephemeral and automatically removed. |
SBUILD_CHROOT_SESSION_MULTIUSER |
The chroot may have multiple users, otherwise only a single user is permitted. The current-users and max-users properties are only valid if this is set. |
typedef enum { SBUILD_CHROOT_SETUP_START, SBUILD_CHROOT_SETUP_STOP, SBUILD_CHROOT_RUN_START, SBUILD_CHROOT_RUN_STOP } SbuildChrootSetupType;
The type of chroot setup operation
SBUILD_CHROOT_SETUP_START |
Set up a new chroot, preparing it for use |
SBUILD_CHROOT_SETUP_STOP |
Clean up an existing chroot, possibly deleting it |
SBUILD_CHROOT_RUN_START |
Start running a command in an existing chroot |
SBUILD_CHROOT_RUN_STOP |
Stop running a command in an existing chroot |
SbuildChroot* sbuild_chroot_new (void);
Creates a new SbuildChroot.
Returns : | the newly created SbuildChroot. |
SbuildChroot* sbuild_chroot_new_from_keyfile (GKeyFile *keyfile, const char *group, gboolean active);
Creates a new SbuildChroot.
keyfile : |
the GKeyFile containing the chroot configuration |
group : |
the group in keyfile to use
|
active : |
TRUE if the chroot is an active session, otherwise FALSE |
Returns : | the newly created SbuildChroot. |
gboolean sbuild_chroot_set_properties_from_keyfile (SbuildChroot *chroot, GKeyFile *keyfile);
Sets the properties of an existing SbuildChroot from a GKeyFile.
chroot : |
an SbuildChroot. |
keyfile : |
the GKeyFile containing the chroot configuration |
Returns : | TRUE on success, FALSE on failure. |
const char* sbuild_chroot_get_name (const SbuildChroot *restrict chroot);
Get the name of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_name (SbuildChroot *chroot, const char *name);
Set the name of a chroot.
chroot : |
an SbuildChroot. |
name : |
the name to set. |
const char* sbuild_chroot_get_description (const SbuildChroot *restrict chroot);
Get the description of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_description (SbuildChroot *chroot, const char *description);
Set the description of a chroot.
chroot : |
an SbuildChroot. |
description : |
the description to set. |
guint sbuild_chroot_get_priority (const SbuildChroot *restrict chroot);
Get the priority of the chroot. This is a number indicating whether than a ditribution is older than another.
chroot : |
an SbuildChroot |
Returns : | the priority. |
void sbuild_chroot_set_priority (SbuildChroot *chroot, guint priority);
Set the priority of a chroot. This is a number indicating whether a distribution is older than another. For example, "oldstable" and "oldstable-security" might be 0, while "stable" and "stable-security" 1, "testing" 2 and "unstable" 3. The values are not important, but the difference between them is.
chroot : |
an SbuildChroot. |
priority : |
the priority to set. |
char** sbuild_chroot_get_groups (const SbuildChroot *restrict chroot);
Get the groups of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_groups (SbuildChroot *chroot, char **groups);
Set the groups of a chroot.
chroot : |
an SbuildChroot. |
groups : |
the groups to set. |
char** sbuild_chroot_get_root_groups (const SbuildChroot *restrict chroot);
Get the root groups of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_root_groups (SbuildChroot *chroot, char **groups);
Set the groups of a chroot.
chroot : |
an SbuildChroot. |
groups : |
the groups to set. |
char** sbuild_chroot_get_aliases (const SbuildChroot *restrict chroot);
Get the aliases of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_aliases (SbuildChroot *chroot, char **aliases);
Set the aliases of a chroot.
chroot : |
an SbuildChroot. |
aliases : |
the aliases to set. |
gboolean sbuild_chroot_get_run_setup_scripts (const SbuildChroot *restrict chroot);
Check if chroot setup scripts will be run.
chroot : |
an SbuildChroot |
Returns : | TRUE if setup scripts will be run, otherwise FALSE. |
void sbuild_chroot_set_run_setup_scripts (SbuildChroot *chroot, gboolean run_setup_scripts);
Set whether chroot setup scripts should be run or not.
chroot : |
an SbuildChroot. |
run_setup_scripts : |
TRUE to run setup scripts, otherwise FALSE. |
gboolean sbuild_chroot_get_run_session_scripts (const SbuildChroot *restrict chroot);
Check if chroot session scripts will be run.
chroot : |
an SbuildChroot |
Returns : | TRUE if session scripts will be run, otherwise FALSE. |
void sbuild_chroot_set_run_session_scripts (SbuildChroot *chroot, gboolean run_session_scripts);
Set whether chroot session scripts should be run or not.
chroot : |
an SbuildChroot. |
run_session_scripts : |
TRUE to run session scripts, otherwise FALSE. |
guint sbuild_chroot_get_max_users (const SbuildChroot *restrict chroot);
Get the maximum number of users of the chroot.
chroot : |
an SbuildChroot |
Returns : | the max number of users. |
void sbuild_chroot_set_max_users (SbuildChroot *chroot, guint max_users);
Set the maximum number of users of a chroot.
chroot : |
an SbuildChroot. |
max_users : |
the max_users to set. |
guint sbuild_chroot_get_current_users (const SbuildChroot *restrict chroot);
Get the current number of users of the chroot.
chroot : |
an SbuildChroot |
Returns : | the current number of users. |
void sbuild_chroot_set_current_users (SbuildChroot *chroot, guint current_users);
Set the current number of users of a chroot.
chroot : |
an SbuildChroot. |
current_users : |
the current_users to set. |
const char* sbuild_chroot_get_mount_location (const SbuildChroot *restrict chroot);
Get the mount location of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_mount_location (SbuildChroot *chroot, const char *location);
Set the mount location of a chroot.
chroot : |
an SbuildChroot. |
location : |
the mount location to set. |
const char* sbuild_chroot_get_mount_device (const SbuildChroot *restrict chroot);
Get the mount device of the chroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_chroot_set_mount_device (SbuildChroot *chroot, const char *device);
Set the mount device of a chroot.
chroot : |
an SbuildChroot. |
device : |
the mount device to set. |
void sbuild_chroot_print_details (SbuildChroot *chroot, FILE *file);
Print detailed information about chroot
to file
. The information
is printed in plain text with one line per property.
chroot : |
an SbuildChroot. |
file : |
the file to output to. |
void sbuild_chroot_print_config (SbuildChroot *chroot, FILE *file);
Print the configuration group for a chroot in the format required by schroot.conf.
chroot : |
an SbuildChroot. |
file : |
the file to output to. |
const gchar* sbuild_chroot_get_chroot_type (const SbuildChroot *chroot);
Get the type of the chroot. This returns a user-readable string which is equivalant to the type name of the subclassed SbuildChroot.
chroot : |
an SbuildChroot |
Returns : | a string. This string points to internally allocated storage in the chroot and must not be freed, modified or stored. |
SbuildChrootSessionFlags sbuild_chroot_get_session_flags (const SbuildChroot *chroot);
Get the session flags of the chroot. These determine how the SbuildSession controlling the chroot will operate.
chroot : |
an SbuildChroot |
Returns : | the SbuildChrootSessionFlags. |
active
" property"active" gboolean : Read
Is the chroot currently in use?.
Default value: FALSE
current-users
" property"current-users" guint : Read / Write
The number of users currently using this chroot.
Default value: 1
description
" property"description" gchararray : Read / Write / Construct
The description of the chroot.
Default value: ""
groups
" property"groups" GStrv : Read / Write / Construct
The groups allowed to use this chroot.
max-users
" property"max-users" guint : Read / Write / Construct
The maximum number of users able to use this chroot.
Allowed values: >= 1
Default value: 1
mount-device
" property"mount-device" gchararray : Read / Write
The block device for of the chroot.
Default value: ""
mount-location
" property"mount-location" gchararray : Read / Write
The mounted location (path) of the chroot.
Default value: ""
name
" property"name" gchararray : Read / Write / Construct
The name of the chroot.
Default value: ""
priority
" property"priority" guint : Read / Write / Construct
The priority of the chroot distribution, the lower the older the distribution.
Default value: 0
root-groups
" property"root-groups" GStrv : Read / Write / Construct
The groups allowed to use this chroot as root.
run-session-scripts
" property"run-session-scripts" gboolean : Read / Write / Construct
Run chroot session scripts?.
Default value: FALSE
<< GObject-derived classes | SbuildChrootPlain >> |