From f8d9514e79b653cd6c6b2041e16d7f7a8dc30140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 4 Dec 2018 00:00:01 +0000 Subject: [PATCH] add --custom-config-file-gem5 option to build gem5 kernels more easily --- README.adoc | 4 ++-- build-linux | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index bf4827b..ddd4694 100644 --- a/README.adoc +++ b/README.adoc @@ -3495,7 +3495,7 @@ git -C "$(./getvar linux_source_dir)" fetch https://gem5.googlesource.com/arm/li git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15 ./build-linux \ --arch arm \ - --custom-config-file "$(./getvar linux_source_dir)/arch/arm/configs/gem5_defconfig" \ + --custom-config-file-gem5 \ --linux-build-id gem5-v4.15 \ ; git -C "$(./getvar linux_source_dir)" checkout - @@ -3571,7 +3571,7 @@ git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15 ./build-linux \ --arch aarch64 \ --config-fragment linux_config/display \ - --custom-config-file "$(./getvar linux_source_dir)/arch/arm64/configs/gem5_defconfig" \ + --custom-config-file-gem5 \ --linux-build-id gem5-v4.15 \ ; git -C "$(./getvar linux_source_dir)" checkout - diff --git a/build-linux b/build-linux index eed3514..aecceed 100755 --- a/build-linux +++ b/build-linux @@ -28,6 +28,13 @@ Pass multiple times to use multiple fragment files. Ignore all default kernel configurations and use this file instead. Still uses options explicitly passed with `--config` and `--config-fragment` on top of it. +''' + ) + parser.add_argument( + '--custom-config-file-gem5', default=False, action='store_true', + help='''\ +Use the gem5 Linux kernel fork config as the custom config file. +Ignore --custom-config-file. ''' ) parser.add_argument( @@ -77,10 +84,14 @@ Configure the kernel, but don't build it. 'CC={}'.format(cc), common.Newline, 'O={}'.format(build_dir), common.Newline, ] + verbose - if args.custom_config_file is not None: - if not os.path.exists(args.custom_config_file): + if args.custom_config_file_gem5: + custom_config_file = os.path.join(common.linux_source_dir, 'arch', common.linux_arch, 'configs', 'gem5_defconfig') + else: + custom_config_file = args.custom_config_file + if custom_config_file is not None: + if not os.path.exists(custom_config_file): raise Exception('config fragment file does not exist: {}'.format(args.custom_config_file)) - base_config_file = args.custom_config_file + base_config_file = custom_config_file config_fragments = [] else: base_config_file = os.path.join(common.linux_config_dir, 'buildroot-{}'.format(args.arch))