Building of linux and rootfs as containers nicely getting in shape

Created a Linux builder that takes a container object as its parameter.
Build of linux kernel will be coordinated by input from this container parameter
This commit is contained in:
Bahadir Balban
2009-09-13 14:35:04 +03:00
parent 772440baa0
commit 2d2677945f
2 changed files with 44 additions and 28 deletions

View File

@@ -21,24 +21,28 @@ 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))
class BuildRootfs:
@staticmethod
def build_rootfs():
print 'Building the root filesystem...'
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)
@staticmethod
def clean():
if os.path.exists(LINUX_ROOTFS_BUILDDIR):
shutil.rmtree(LINUX_ROOTFS_BUILDDIR)
if __name__ == "__main__":
if len(sys.argv) == 1:
main()
BuildRootfs.build_rootfs()
elif "clean" == sys.argv[1]:
clean()
BuildRootfs.clean()
else:
print " Usage: %s [clean]" % (sys.argv[0])