mirror of
https://github.com/drasko/codezero.git
synced 2026-07-18 05:05:24 +02:00
Container packing works.
Able to build container0.axf, container1.axf ... files as required.
This commit is contained in:
@@ -28,8 +28,6 @@ def source_to_builddir(srcdir, id):
|
|||||||
return join(BUILDDIR, cont_builddir)
|
return join(BUILDDIR, cont_builddir)
|
||||||
|
|
||||||
class LinuxBuilder:
|
class LinuxBuilder:
|
||||||
LINUX_KERNEL_BUILDDIR = None
|
|
||||||
LINUX_KERNELDIR = None
|
|
||||||
|
|
||||||
def __init__(self, pathdict, container):
|
def __init__(self, pathdict, container):
|
||||||
self.LINUX_KERNELDIR = pathdict["LINUX_KERNELDIR"]
|
self.LINUX_KERNELDIR = pathdict["LINUX_KERNELDIR"]
|
||||||
@@ -38,6 +36,8 @@ class LinuxBuilder:
|
|||||||
self.LINUX_KERNEL_BUILDDIR = \
|
self.LINUX_KERNEL_BUILDDIR = \
|
||||||
source_to_builddir(LINUX_KERNELDIR, container.id)
|
source_to_builddir(LINUX_KERNELDIR, container.id)
|
||||||
|
|
||||||
|
self.kernel_image = None
|
||||||
|
|
||||||
def build_linux(self):
|
def build_linux(self):
|
||||||
print '\nBuilding the linux kernel...'
|
print '\nBuilding the linux kernel...'
|
||||||
os.chdir(self.LINUX_KERNELDIR)
|
os.chdir(self.LINUX_KERNELDIR)
|
||||||
@@ -47,6 +47,12 @@ class LinuxBuilder:
|
|||||||
os.system("make ARCH=arm " + \
|
os.system("make ARCH=arm " + \
|
||||||
"CROSS_COMPILE=arm-none-linux-gnueabi- O=" + \
|
"CROSS_COMPILE=arm-none-linux-gnueabi- O=" + \
|
||||||
self.LINUX_KERNEL_BUILDDIR)
|
self.LINUX_KERNEL_BUILDDIR)
|
||||||
|
|
||||||
|
# Get the kernel image path
|
||||||
|
self.kernel_image = \
|
||||||
|
join(self.LINUX_KERNEL_BUILDDIR, \
|
||||||
|
'arch/arm/boot/compressed/vmlinux')
|
||||||
|
|
||||||
print 'Done...'
|
print 'Done...'
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
|||||||
@@ -26,35 +26,29 @@ def source_to_builddir(srcdir, id):
|
|||||||
return join(BUILDDIR, cont_builddir)
|
return join(BUILDDIR, cont_builddir)
|
||||||
|
|
||||||
class RootfsBuilder:
|
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):
|
def __init__(self, pathdict, container):
|
||||||
self.LINUX_ROOTFSDIR = pathdict["LINUX_ROOTFSDIR"]
|
self.LINUX_ROOTFSDIR = pathdict["LINUX_ROOTFSDIR"]
|
||||||
|
|
||||||
# Determine build directory
|
|
||||||
self.LINUX_ROOTFS_BUILDDIR = \
|
self.LINUX_ROOTFS_BUILDDIR = \
|
||||||
source_to_builddir(self.LINUX_ROOTFSDIR, container.id)
|
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):
|
def build_rootfs(self):
|
||||||
print 'Building the root filesystem...'
|
print 'Building the root filesystem...'
|
||||||
# IO files from this build
|
# 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)
|
os.chdir(LINUX_ROOTFSDIR)
|
||||||
if not os.path.exists(self.LINUX_ROOTFS_BUILDDIR):
|
if not os.path.exists(self.LINUX_ROOTFS_BUILDDIR):
|
||||||
os.makedirs(self.LINUX_ROOTFS_BUILDDIR)
|
os.makedirs(self.LINUX_ROOTFS_BUILDDIR)
|
||||||
os.system("arm-none-linux-gnueabi-cpp -P " + \
|
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 " + \
|
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..."
|
print "Done..."
|
||||||
return rootfs_lds_out
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
print 'Cleaning the built root filesystem...'
|
print 'Cleaning the built root filesystem...'
|
||||||
|
|||||||
Reference in New Issue
Block a user