summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_load_tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_load_tar.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_load_tar.c57
1 files changed, 7 insertions, 50 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c
index e51194fa8c..723699bdcc 100644
--- a/cpukit/libfs/src/imfs/imfs_load_tar.c
+++ b/cpukit/libfs/src/imfs/imfs_load_tar.c
@@ -1,3 +1,10 @@
+/**
+ * @file
+ *
+ * @brief RTEMS Load Tarfs
+ * @ingroup IMFS
+ */
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -11,14 +18,6 @@
#include "config.h"
#endif
-/*
- * This file implements the "mount" procedure for tar-based IMFS
- * extensions. The TAR is not actually mounted under the IMFS.
- * Directories from the TAR file are created as usual in the IMFS.
- * File entries are created as IMFS_LINEAR_FILE nodes with their nods
- * pointing to addresses in the TAR image.
- */
-
#include "imfs.h"
#include <sys/stat.h>
@@ -27,52 +26,10 @@
#include <rtems/untar.h>
-/*
- * TAR file format:
- *
- * Offset Length Contents
- * 0 100 bytes File name ('\0' terminated, 99 maxmum length)
- * 100 8 bytes File mode (in octal ascii)
- * 108 8 bytes User ID (in octal ascii)
- * 116 8 bytes Group ID (in octal ascii)
- * 124 12 bytes File size (s) (in octal ascii)
- * 136 12 bytes Modify time (in octal ascii)
- * 148 8 bytes Header checksum (in octal ascii)
- * 156 1 bytes Link flag
- * 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
- * 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
- * 257 8 bytes Magic GNU tar ("ustar \0")
- * 265 32 bytes User name ('\0' terminated, 31 maxmum length)
- * 297 32 bytes Group name ('\0' terminated, 31 maxmum length)
- * 329 8 bytes Major device ID (in octal ascii)
- * 337 8 bytes Minor device ID (in octal ascii)
- * 345 167 bytes Padding
- * 512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511),
- * round up to 512 bytes
- *
- * Checksum:
- * int i, sum;
- * char* header = tar_header_pointer;
- * sum = 0;
- * for(i = 0; i < 512; i++)
- * sum += 0xFF & header[i];
- */
-
#define MAX_NAME_FIELD_SIZE 99
#define MIN(a,b) ((a)>(b)?(b):(a))
-/*
- * rtems_tarfs_load
- *
- * Here we create the mountpoint directory and load the tarfs at
- * that node. Once the IMFS has been mounted, we work through the
- * tar image and perform as follows:
- * - For directories, simply call mkdir(). The IMFS creates nodes as
- * needed.
- * - For files, we make our own calls to IMFS eval_for_make and
- * create_node.
- */
int rtems_tarfs_load(
const char *mountpoint,
uint8_t *tar_image,