1 | /** |
---|
2 | * @file rtems/mkrootfs.h |
---|
3 | * |
---|
4 | * RTEMS Root FS creation support. |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | Copyright Cybertec Pty Ltd, 2000 |
---|
9 | All rights reserved Cybertec Pty Ltd, 2000 |
---|
10 | |
---|
11 | COPYRIGHT (c) 1989-1998. |
---|
12 | On-Line Applications Research Corporation (OAR). |
---|
13 | |
---|
14 | The license and distribution terms for this file may be |
---|
15 | found in the file LICENSE in this distribution or at |
---|
16 | |
---|
17 | http://www.rtems.com/license/LICENSE. |
---|
18 | |
---|
19 | This software with is provided ``as is'' and with NO WARRANTY. |
---|
20 | |
---|
21 | $Id$ |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _RTEMS_MKROOTFS_H |
---|
25 | #define _RTEMS_MKROOTFS_H |
---|
26 | |
---|
27 | #include <rtems.h> |
---|
28 | |
---|
29 | #ifdef __cplusplus |
---|
30 | extern "C" { |
---|
31 | #endif |
---|
32 | |
---|
33 | /* |
---|
34 | * Builds the complete path, like "mkdir -p". |
---|
35 | */ |
---|
36 | |
---|
37 | int |
---|
38 | rtems_rootfs_mkdir (const char *path, mode_t omode); |
---|
39 | |
---|
40 | /** |
---|
41 | * Appends the lines to the a file. Create the file |
---|
42 | * and builds the path if it does not exist. |
---|
43 | * |
---|
44 | * @param file |
---|
45 | * @param omode |
---|
46 | * @param line_cnt |
---|
47 | * @param lines |
---|
48 | * |
---|
49 | * @return 0 on success, -1 on error |
---|
50 | */ |
---|
51 | |
---|
52 | int |
---|
53 | rtems_rootfs_file_append (const char *file, |
---|
54 | mode_t omode, |
---|
55 | const int line_cnt, |
---|
56 | const char **lines); |
---|
57 | |
---|
58 | /** |
---|
59 | * @brief Helper for bulding an /etc/hosts file. |
---|
60 | * |
---|
61 | * @param cip |
---|
62 | * @param cname |
---|
63 | * @param dname |
---|
64 | * |
---|
65 | * @return 0 on success, -1 on error |
---|
66 | */ |
---|
67 | |
---|
68 | int |
---|
69 | rtems_rootfs_append_host_rec (in_addr_t cip, |
---|
70 | const char *cname, |
---|
71 | const char *dname); |
---|
72 | |
---|
73 | /** |
---|
74 | * Create a few common directories, plus a: |
---|
75 | * /etc/passwd, /etc/group, /etc/host.conf, and |
---|
76 | * /etc/hosts file. |
---|
77 | * |
---|
78 | * @return 0 on success, -1 on error |
---|
79 | */ |
---|
80 | |
---|
81 | int |
---|
82 | rtems_create_root_fs ( void ); |
---|
83 | |
---|
84 | #ifdef __cplusplus |
---|
85 | } |
---|
86 | #endif |
---|
87 | |
---|
88 | #endif |
---|