Top | ![]() |
![]() |
![]() |
![]() |
gboolean fu_common_spawn_sync (const gchar * const *argv
,FuOutputHandler handler_cb
,gpointer handler_user_data
,GCancellable *cancellable
,GError **error
);
Runs a subprocess and waits for it to exit. Any output on standard out or
standard error will be forwarded to handler_cb
as whole lines.
argv |
The argument list to run |
|
handler_cb |
A FuOutputHandler or |
[scope call] |
handler_user_data |
the user data to pass to |
|
cancellable |
a GCancellable, or |
|
error |
gboolean fu_common_rmtree (const gchar *directory
,GError **error
);
Recursively removes a directory.
gboolean fu_common_mkdir_parent (const gchar *filename
,GError **error
);
Creates any required directories, including any parent directories.
gboolean fu_common_set_contents_bytes (const gchar *filename
,GBytes *bytes
,GError **error
);
Writes a blob of data to a filename, creating the parent directories as required.
GBytes * fu_common_get_contents_bytes (const gchar *filename
,GError **error
);
Reads a blob of data from a file.
GBytes * fu_common_get_contents_fd (gint fd
,gsize count
,GError **error
);
Reads a blob from a specific file descriptor.
Note: this will close the fd when done
gboolean fu_common_extract_archive (GBytes *blob
,const gchar *dir
,GError **error
);
Extracts an achive to a directory.
GBytes * fu_common_firmware_builder (GBytes *bytes
,const gchar *script_fn
,const gchar *output_fn
,GError **error
);
Builds a firmware file using tools from the host session in a bubblewrap jail. Several things happen during build:
The bytes
data is untarred to a temporary location
A bubblewrap container is set up
The startup.sh script is run inside the container
The firmware.bin is extracted from the container
The temporary location is deleted