OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [rootfs/] [SConscript] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
# -*- mode: python; coding: utf-8; -*-
2
 
3
#  Codezero -- a microkernel for embedded systems.
4
#
5
#  Copyright © 2009  B Labs Ltd
6
 
7
import os.path
8
import sys, subprocess, shutil
9
from os.path import *
10
 
11
Import('config', 'environment', 'previmage')
12
 
13
e = environment.Clone()
14
 
15
sys.path.append('../../../')
16
 
17
from config.projpaths import *
18
from config.configuration import *
19
from tools.pyelf.lmanext import *
20
 
21
rootfs_lds_in = \
22
'''
23
/*
24
 * Linker script that embeds an empty root filesystem.
25
 * This is to be replaced by a real rootfs image later.
26
 */
27
SECTIONS
28
{
29
        . = %s;
30
        .bss : { *(.bss) }
31
}
32
'''
33
 
34
def generate_rootfs_lds(target, source, env):
35
    with open(source[1].path, 'r') as lds_in:
36
        with open(target[0].path, 'w+') as lds_out:
37
            linker_script = lds_in.read()
38
            lds_out.write(linker_script % next_available_lma(source[0].path))
39
 
40
rootfs_lds = e.Command('rootfs.lds', [previmage, 'rootfs.lds.in'], generate_rootfs_lds)
41
 
42
e.Append(LINKFLAGS = '-T' + rootfs_lds[0].path)
43
rootfs_img = e.Program('rootfs.elf', 'rootfs.c')
44
Depends(rootfs_img, rootfs_lds)
45
 
46
Return('rootfs_img')

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.