Moved linux/rootfs build scripts to scripts directory.

This commit is contained in:
Bahadir Balban
2009-09-13 12:23:45 +03:00
parent f7acdc116d
commit 772440baa0
4 changed files with 90 additions and 8 deletions

View File

@@ -18,3 +18,8 @@ CONFIG_H = join("include/l4/config.h")
CONFIG_SHELVE_DIR = join(BUILDDIR, "configdata")
CONFIG_SHELVE_FILENAME = "configuration"
CONFIG_SHELVE = join(CONFIG_SHELVE_DIR, CONFIG_SHELVE_FILENAME)
LINUXDIR = join(PROJROOT, 'conts/linux')
LINUX_KERNELDIR = join(LINUXDIR, 'linux-2.6.28.10')
LINUX_ROOTFSDIR = join(LINUXDIR, 'rootfs')

View File

@@ -19,14 +19,6 @@ def cml2_header_to_symbols(cml2_header, symbols):
symbols.get_platform(name, value)
symbols.get_ncontainers(name, value)
symbols.get_container_parameters(name, value)
for cont in symbols.containers:
print "Container", cont.id
print "vma start:", cont.vma_start
print "vma end:", cont.vma_end
print "lma start:", cont.lma_start
print "lma end:", cont.lma_end
print "type:", cont.type
print "\n"
def cml2_update_config_h(config_h_path, config):
with open(config_h_path, "a") as config_h:

41
scripts/linux/build_linux.py Executable file
View File

@@ -0,0 +1,41 @@
#! /usr/bin/env python2.6
# -*- mode: python; coding: utf-8; -*-
#
# Codezero -- a microkernel for embedded systems.
#
# Copyright © 2009 B Labs Ltd
#
import os, sys, shelve
from os.path import join
PROJRELROOT = '../../'
SCRIPTROOT = os.path.abspath(os.path.dirname("."))
sys.path.append(os.path.abspath(PROJRELROOT))
from config.projpaths import *
from config.configuration import *
LINUX_KERNEL_BUILDDIR = join(BUILDDIR, os.path.relpath(LINUX_KERNELDIR, PROJROOT))
def main():
config_symbols = configuration_retrieve()
os.chdir(LINUX_KERNELDIR)
if not os.path.exists(LINUX_KERNEL_BUILDDIR):
os.makedirs(LINUX_KERNEL_BUILDDIR)
os.system("make defconfig ARCH=arm O=" + LINUX_KERNEL_BUILDDIR)
os.system("make ARCH=arm " + \
"CROSS_COMPILE=arm-none-linux-gnueabi- O=" + \
LINUX_KERNEL_BUILDDIR)
def clean():
if os.path.exists(LINUX_KERNEL_BUILDDIR):
shutil.rmtree(LINUX_KERNEL_BUILDDIR)
if __name__ == "__main__":
if len(sys.argv) == 1:
main()
elif "clean" == sys.argv[1]:
clean()
else:
print " Usage: %s [clean]" % (sys.argv[0])

44
scripts/linux/build_rootfs.py Executable file
View File

@@ -0,0 +1,44 @@
#! /usr/bin/env python2.6
# -*- mode: python; coding: utf-8; -*-
#
# Codezero -- a microkernel for embedded systems.
#
# Copyright © 2009 B Labs Ltd
import os, sys, shelve, shutil
from os.path import join
PROJRELROOT = "../.."
SCRIPTROOT = os.path.abspath(os.path.dirname("."))
sys.path.append(os.path.abspath(PROJRELROOT))
from config.projpaths import *
from config.configuration import *
LINUX_ROOTFS_BUILDDIR = join(BUILDDIR, os.path.relpath(LINUX_ROOTFSDIR, PROJROOT))
rootfs_lds_in = join(LINUX_ROOTFSDIR, "rootfs.lds.in")
rootfs_lds_out = join(LINUX_ROOTFS_BUILDDIR, "rootfs.lds")
rootfs_elf_out = join(LINUX_ROOTFS_BUILDDIR, "rootfs.elf")
def main():
os.chdir(LINUX_ROOTFSDIR)
config_symbols = configuration_retrieve()
if not os.path.exists(LINUX_ROOTFS_BUILDDIR):
os.makedirs(LINUX_ROOTFS_BUILDDIR)
os.system("arm-none-linux-gnueabi-cpp -P " + \
"%s > %s" % (rootfs_lds_in, rootfs_lds_out))
os.system("arm-none-linux-gnueabi-gcc " + \
"-nostdlib -o %s -T%s rootfs.S" % (rootfs_elf_out, rootfs_lds_out))
def clean():
if os.path.exists(LINUX_ROOTFS_BUILDDIR):
shutil.rmtree(LINUX_ROOTFS_BUILDDIR)
if __name__ == "__main__":
if len(sys.argv) == 1:
main()
elif "clean" == sys.argv[1]:
clean()
else:
print " Usage: %s [clean]" % (sys.argv[0])