~ubuntu-branches/ubuntu/trusty/vboot-utils/trusty

« back to all changes in this revision

Viewing changes to utility/mount-helpers.h

  • Committer: Package Import Robot
  • Author(s): Antonio Terceiro
  • Date: 2012-12-16 11:03:40 UTC
  • Revision ID: package-import@ubuntu.com-20121216110340-f7wcseecbc9jed5l
Tags: upstream-0~20121212
ImportĀ upstreamĀ versionĀ 0~20121212

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 
2
 * Use of this source code is governed by a BSD-style license that can be
 
3
 * found in the LICENSE file.
 
4
 *
 
5
 * Header file for mount helpers.
 
6
 */
 
7
#ifndef _MOUNT_HELPERS_H_
 
8
#define _MOUNT_HELPERS_H_
 
9
 
 
10
/* General utility functions. */
 
11
uint64_t blk_size(const char *device);
 
12
int remove_tree(const char *tree);
 
13
int runcmd(const gchar *argv[], gchar **output);
 
14
int same_vfs(const char *mnt_a, const char *mnt_b);
 
15
char *stringify_hex(uint8_t *binary, size_t length);
 
16
uint8_t *hexify_string(char *string, uint8_t *binary, size_t length);
 
17
void shred(const char *keyfile);
 
18
 
 
19
/* Loopback device attach/detach helpers. */
 
20
gchar *loop_attach(int fd, const char *name);
 
21
int loop_detach(const gchar *loopback);
 
22
int loop_detach_name(const char *name);
 
23
 
 
24
/* Encrypted device mapper setup/teardown. */
 
25
int dm_setup(uint64_t bytes, const gchar *encryption_key, const char *name,
 
26
                const gchar *device, const char *path, int discard);
 
27
int dm_teardown(const gchar *device);
 
28
char *dm_get_key(const gchar *device);
 
29
 
 
30
/* Sparse file creation. */
 
31
int sparse_create(const char *path, uint64_t bytes);
 
32
 
 
33
/* Filesystem creation. */
 
34
int filesystem_build(const char *device, uint64_t block_bytes,
 
35
                        uint64_t blocks_min, uint64_t blocks_max);
 
36
int filesystem_resize(const char *device, uint64_t blocks, uint64_t blocks_max);
 
37
 
 
38
/* Encrypted keyfile handling. */
 
39
char *keyfile_read(const char *keyfile, uint8_t *system_key);
 
40
int keyfile_write(const char *keyfile, uint8_t *system_key, char *plain);
 
41
 
 
42
#endif /* _MOUNT_HELPERS_H_ */