Changeset b0afac0 in rtems_waf


Ignore:
Timestamp:
Jun 15, 2016, 1:14:16 AM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
1aef190
Parents:
93e5545
Message:

Add root_filesystem support to create a root file system.

To use add to your wscript file:

rtems.root_filesystem(bld, 'rootfs',

etc/rc.conf?,
'rootfs.tar', 'rootfs-tar.o')

to create a rootfs-tar.o which you add to your executable's list of
sources.

In your main or Init function add:

#include <rtems/untar.h>
extern int _binary_rootfs_tar_start;
extern int _binary_rootfs_tar_size;
static void expand_rootfs_tarfile(void)
{

rtems_status_code sc;
rtems_printer printer;
rtems_print_printer_printf(&printer);
sc = Untar_FromMemory_Print((void *)(&_binary_rootfs_tar_start),

(size_t)&_binary_rootfs_tar_size,
&printer);

if (sc != RTEMS_SUCCESSFUL)

fprintf(stderr, "error: untar failed: %s\n", rtems_status_text(sc));

}

Note, some arch's may not need the '_' at the start of the tar symbols.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtems.py

    r93e5545 rb0afac0  
    222222        conf.env.LINKFLAGS = cflags['cflags'] + ldflags['ldflags']
    223223        conf.env.LIB       = flags['LIB']
     224        conf.env.LIBPATH   = ldflags['libpath']
    224225
    225226        conf.env.RTRACE_WRAPPER_ST = '-W %s'
     
    514515    return None
    515516
     517def root_filesystem(bld, name, files, tar, obj):
     518    bld(name = name + '_tar',
     519        target = tar,
     520        source = files,
     521        rule = 'SDIR=$PWD && cd ../.. && tar --format=ustar -cf $SDIR/${TGT} $(echo "${SRC}" | sed -e "s/\.\.\/\.\.\///\")')
     522    bld.objects(name = name,
     523                target = obj,
     524                source = tar,
     525                rule = '${OBJCOPY} -I binary -B ${RTEMS_ARCH} ${OBJCOPY_FLAGS} ${SRC} ${TGT}')
     526
    516527def clone_tasks(bld):
    517528    if bld.cmd == 'build':
     
    714725        [ { 'key': 'warnings', 'path': False, 'flags': { '-W': 1 }, 'cflags': False, 'lflags': False },
    715726          { 'key': 'includes', 'path': True,  'flags': { '-I': 1, '-isystem': 2, '-sysroot': 2 } },
     727          { 'key': 'libpath',  'path': True,  'flags': { '-L': 1 } },
    716728          { 'key': 'machines', 'path': True,  'flags': { '-O': 1, '-m': 1, '-f': 1 } },
    717729          { 'key': 'specs',    'path': True,  'flags': { '-q': 1, '-B': 2, '--specs': 2 } } ]
Note: See TracChangeset for help on using the changeset viewer.