From 32d7402125db0c46c43b05322e588a692f96827a Mon Sep 17 00:00:00 2001 From: SimonLi Date: Sat, 3 Apr 2021 08:55:13 +0800 Subject: [PATCH] IssueNo: #I3EPRJ Description: build device with no need to hb set Sig: build Feature or Bugfix: Feature Binary Source: No --- .gitignore | 5 ++++- hb/build/build_process.py | 2 ++ hb/common/device.py | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ecc00b7..021e786 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ __pycache__/ *.py[cod] -.vscode \ No newline at end of file +.vscode +*.swp +cscope.* +tags diff --git a/hb/build/build_process.py b/hb/build/build_process.py index 53fbb49..3d5af06 100755 --- a/hb/build/build_process.py +++ b/hb/build/build_process.py @@ -186,6 +186,8 @@ class Build(): if self._target is None and Device.is_in_device(): # Compile device board device_path, kernel, board = Device.device_menuconfig() + # xxx: build device, no need to set root manually, so set it speculatively. + self.config.root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))) self.config.out_path = os.path.join(self.config.root_path, 'out', board) diff --git a/hb/common/device.py b/hb/common/device.py index 3f17a64..e8d4fed 100755 --- a/hb/common/device.py +++ b/hb/common/device.py @@ -26,8 +26,7 @@ class Device(): @staticmethod def is_in_device(): cwd_pardir = os.path.dirname(os.path.dirname(os.getcwd())) - config = Config() - return os.path.join(config.root_path, 'device') == cwd_pardir + return os.path.basename(cwd_pardir) == 'device' @staticmethod def is_kernel(kernel_path): -- GitLab