mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
bak
This commit is contained in:
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
import common
|
||||
|
||||
class BaremetalComponent(common.Component):
|
||||
class BaremetalComponent(common.BuildComponent):
|
||||
def do_build(self, args):
|
||||
common.assert_crosstool_ng_supports_arch(args.arch)
|
||||
build_dir = self.get_build_dir(args)
|
||||
@@ -171,4 +171,4 @@ Build the baremetal examples with crosstool-NG.
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
BaremetalComponent().build()
|
||||
BaremetalComponent().main()
|
||||
|
||||
@@ -10,7 +10,7 @@ import re
|
||||
|
||||
import common
|
||||
|
||||
class BuildrootComponent(common.Component):
|
||||
class BuildrootComponent(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--build-linux', default=self._defaults['build_linux'], action='store_true',
|
||||
@@ -185,4 +185,4 @@ Run Linux on an emulator
|
||||
return os.path.relpath(abspath, common.buildroot_src_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
BuildrootComponent().build()
|
||||
BuildrootComponent().main()
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
import common
|
||||
|
||||
class CrosstoolNgComponent(common.Component):
|
||||
class CrosstoolNgComponent(common.BuildComponent):
|
||||
def do_build(self, args):
|
||||
common.assert_crosstool_ng_supports_arch(args.arch)
|
||||
build_dir = self.get_build_dir(args)
|
||||
@@ -74,4 +74,4 @@ Build crosstool-NG with Newlib for bare metal compilation'
|
||||
return common.crosstool_ng_build_dir
|
||||
|
||||
if __name__ == '__main__':
|
||||
CrosstoolNgComponent().build()
|
||||
CrosstoolNgComponent().main()
|
||||
|
||||
@@ -7,7 +7,7 @@ import tarfile
|
||||
import common
|
||||
|
||||
|
||||
class DockerComponent(common.Component):
|
||||
class DockerComponent(common.BuildComponent):
|
||||
def get_argparse_args(self):
|
||||
return {
|
||||
'description': '''\
|
||||
@@ -76,4 +76,4 @@ See also:https://github.com/cirosantilli/linux-kernel-module-cheat#ubuntu-guest-
|
||||
def get_default_args(self):
|
||||
return {'docker': True}
|
||||
|
||||
DockerComponent().build()
|
||||
DockerComponent().main()
|
||||
|
||||
@@ -6,7 +6,7 @@ import subprocess
|
||||
|
||||
import common
|
||||
|
||||
class Gem5Component(common.Component):
|
||||
class Gem5Component(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'extra_scons_args',
|
||||
@@ -110,4 +110,4 @@ class Gem5Component(common.Component):
|
||||
return common.gem5_build_dir
|
||||
|
||||
if __name__ == '__main__':
|
||||
Gem5Component().build()
|
||||
Gem5Component().main()
|
||||
|
||||
@@ -5,7 +5,7 @@ import shutil
|
||||
|
||||
import common
|
||||
|
||||
class LinuxComponent(common.Component):
|
||||
class LinuxComponent(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--config', default=[], action='append',
|
||||
@@ -146,4 +146,4 @@ Build the Linux kernel.
|
||||
return common.linux_build_dir
|
||||
|
||||
if __name__ == '__main__':
|
||||
LinuxComponent().build()
|
||||
LinuxComponent().main()
|
||||
|
||||
4
build-m5
4
build-m5
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
import common
|
||||
|
||||
class M5Component(common.Component):
|
||||
class M5Component(common.BuildComponent):
|
||||
def get_make_cmd(self, args):
|
||||
allowed_toolchains = ['buildroot']
|
||||
cc = common.get_toolchain_tool('gcc', allowed_toolchains=allowed_toolchains)
|
||||
@@ -41,4 +41,4 @@ class M5Component(common.Component):
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
M5Component().build()
|
||||
M5Component().main()
|
||||
|
||||
@@ -7,7 +7,7 @@ import shutil
|
||||
|
||||
import common
|
||||
|
||||
class ModulesComponent(common.Component):
|
||||
class ModulesComponent(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--make-args',
|
||||
@@ -125,4 +125,4 @@ See also: https://github.com/cirosantilli/linux-kernel-module-cheat#host
|
||||
return os.path.join(common.kernel_modules_build_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
ModulesComponent().build()
|
||||
ModulesComponent().main()
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
import common
|
||||
|
||||
class QemuComponent(common.Component):
|
||||
class QemuComponent(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--userland',
|
||||
@@ -60,4 +60,4 @@ class QemuComponent(common.Component):
|
||||
return common.qemu_build_dir
|
||||
|
||||
if __name__ == '__main__':
|
||||
QemuComponent().build()
|
||||
QemuComponent().main()
|
||||
|
||||
@@ -8,7 +8,7 @@ import subprocess
|
||||
|
||||
import common
|
||||
|
||||
class UserlandComponent(common.Component):
|
||||
class UserlandComponent(common.BuildComponent):
|
||||
def add_parser_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--has-package',
|
||||
@@ -88,4 +88,4 @@ has the OpenBLAS libraries and headers installed.
|
||||
return common.userland_build_dir
|
||||
|
||||
if __name__ == '__main__':
|
||||
UserlandComponent().build()
|
||||
UserlandComponent().main()
|
||||
|
||||
@@ -84,11 +84,11 @@ if os.path.exists(config_file):
|
||||
config = imp.load_source('config', config_file)
|
||||
configs = {x:getattr(config, x) for x in dir(config) if not x.startswith('__')}
|
||||
|
||||
class Component:
|
||||
class BuildComponent:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def build(self):
|
||||
def main(self):
|
||||
'''
|
||||
Parse CLI, and to the build based on it.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import shutil
|
||||
|
||||
import common
|
||||
|
||||
class CopyOverlayComponent(common.Component):
|
||||
class CopyOverlayComponent(common.BuildComponent):
|
||||
def do_build(self, args):
|
||||
distutils.dir_util.copy_tree(
|
||||
common.rootfs_overlay_dir,
|
||||
@@ -26,4 +26,4 @@ over just adding that to BR2_ROOTFS_OVERLAY:
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
CopyOverlayComponent().build()
|
||||
CopyOverlayComponent().main()
|
||||
|
||||
Reference in New Issue
Block a user