Container packing works.

Able to build container0.axf, container1.axf ... files as required.
This commit is contained in:
Bahadir Balban
2009-09-14 13:48:10 +03:00
parent 90b2815836
commit 48351450a6
2 changed files with 15 additions and 15 deletions

View File

@@ -28,8 +28,6 @@ def source_to_builddir(srcdir, id):
return join(BUILDDIR, cont_builddir)
class LinuxBuilder:
LINUX_KERNEL_BUILDDIR = None
LINUX_KERNELDIR = None
def __init__(self, pathdict, container):
self.LINUX_KERNELDIR = pathdict["LINUX_KERNELDIR"]
@@ -38,6 +36,8 @@ class LinuxBuilder:
self.LINUX_KERNEL_BUILDDIR = \
source_to_builddir(LINUX_KERNELDIR, container.id)
self.kernel_image = None
def build_linux(self):
print '\nBuilding the linux kernel...'
os.chdir(self.LINUX_KERNELDIR)
@@ -47,6 +47,12 @@ class LinuxBuilder:
os.system("make ARCH=arm " + \
"CROSS_COMPILE=arm-none-linux-gnueabi- O=" + \
self.LINUX_KERNEL_BUILDDIR)
# Get the kernel image path
self.kernel_image = \
join(self.LINUX_KERNEL_BUILDDIR, \
'arch/arm/boot/compressed/vmlinux')
print 'Done...'
def clean(self):

View File

@@ -26,35 +26,29 @@ def source_to_builddir(srcdir, id):
return join(BUILDDIR, cont_builddir)
class RootfsBuilder:
LINUX_ROOTFS_BUILDDIR = None
LINUX_ROOTFSDIR = None
rootfs_lds_in = None
rootfs_lds_out = None
rootfs_elf_out = None
def __init__(self, pathdict, container):
self.LINUX_ROOTFSDIR = pathdict["LINUX_ROOTFSDIR"]
# Determine build directory
self.LINUX_ROOTFS_BUILDDIR = \
source_to_builddir(self.LINUX_ROOTFSDIR, container.id)
self.rootfs_lds_in = join(self.LINUX_ROOTFSDIR, "rootfs.lds.in")
self.rootfs_lds_out = join(self.LINUX_ROOTFS_BUILDDIR, "rootfs.lds")
self.rootfs_elf_out = join(self.LINUX_ROOTFS_BUILDDIR, "rootfs.elf")
def build_rootfs(self):
print 'Building the root filesystem...'
# IO files from this build
rootfs_lds_in = join(self.LINUX_ROOTFSDIR, "rootfs.lds.in")
rootfs_lds_out = join(self.LINUX_ROOTFS_BUILDDIR, "rootfs.lds")
rootfs_elf_out = join(self.LINUX_ROOTFS_BUILDDIR, "rootfs.elf")
os.chdir(LINUX_ROOTFSDIR)
if not os.path.exists(self.LINUX_ROOTFS_BUILDDIR):
os.makedirs(self.LINUX_ROOTFS_BUILDDIR)
os.system("arm-none-linux-gnueabi-cpp -P " + \
"%s > %s" % (rootfs_lds_in, rootfs_lds_out))
"%s > %s" % (self.rootfs_lds_in, self.rootfs_lds_out))
os.system("arm-none-linux-gnueabi-gcc " + \
"-nostdlib -o %s -T%s rootfs.S" % (rootfs_elf_out, rootfs_lds_out))
"-nostdlib -o %s -T%s rootfs.S" % (self.rootfs_elf_out, \
self.rootfs_lds_out))
print "Done..."
return rootfs_lds_out
def clean(self):
print 'Cleaning the built root filesystem...'