RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Macros | Typedefs | Functions
mkrootfs.c File Reference
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <rtems/mkrootfs.h>
#include <rtems/libio.h>
Include dependency graph for mkrootfs.c:

Data Structures

struct  rtems_rootfs_dir_table
 

Macros

#define MKFILE_MODE   (S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IROTH)
 
#define MKDIR_MODE   (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
 

Typedefs

typedef struct rtems_rootfs_dir_table rtems_rootfs_dir_table
 

Functions

int rtems_rootfs_file_append (const char *file, mode_t omode, const int line_cnt, const char **lines)
 Appends the lines to the a file. More...
 
int rtems_rootfs_append_host_rec (in_addr_t cip, const char *cname, const char *dname)
 Helper for bulding an /etc/hosts file. More...
 
int rtems_create_root_fs (void)
 Create a few common directories, plus a: /etc/passwd, /etc/group, /etc/host.conf, and /etc/hosts file. More...
 

Function Documentation

◆ rtems_create_root_fs()

int rtems_create_root_fs ( void  )

Create a few common directories, plus a: /etc/passwd, /etc/group, /etc/host.conf, and /etc/hosts file.

Returns
0 on success, -1 on error

◆ rtems_rootfs_append_host_rec()

int rtems_rootfs_append_host_rec ( in_addr_t  cip,
const char *  cname,
const char *  dname 
)

Helper for bulding an /etc/hosts file.

Parameters
cip
cname
dname
Returns
0 on success, -1 on error

◆ rtems_rootfs_file_append()

int rtems_rootfs_file_append ( const char *  file,
mode_t  omode,
const int  line_cnt,
const char **  lines 
)

Appends the lines to the a file.

Create the file and builds the path if it does not exist.

Parameters
file
omode
line_cnt
lines
Returns
0 on success, -1 on error