Skip to content

Commit f8d9514

Browse files
committed
add --custom-config-file-gem5 option to build gem5 kernels more easily
1 parent f03e6ea commit f8d9514

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,7 @@ git -C "$(./getvar linux_source_dir)" fetch https://gem5.googlesource.com/arm/li
34953495
git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
34963496
./build-linux \
34973497
--arch arm \
3498-
--custom-config-file "$(./getvar linux_source_dir)/arch/arm/configs/gem5_defconfig" \
3498+
--custom-config-file-gem5 \
34993499
--linux-build-id gem5-v4.15 \
35003500
;
35013501
git -C "$(./getvar linux_source_dir)" checkout -
@@ -3571,7 +3571,7 @@ git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
35713571
./build-linux \
35723572
--arch aarch64 \
35733573
--config-fragment linux_config/display \
3574-
--custom-config-file "$(./getvar linux_source_dir)/arch/arm64/configs/gem5_defconfig" \
3574+
--custom-config-file-gem5 \
35753575
--linux-build-id gem5-v4.15 \
35763576
;
35773577
git -C "$(./getvar linux_source_dir)" checkout -

build-linux

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ Pass multiple times to use multiple fragment files.
2828
Ignore all default kernel configurations and use this file instead.
2929
Still uses options explicitly passed with `--config` and
3030
`--config-fragment` on top of it.
31+
'''
32+
)
33+
parser.add_argument(
34+
'--custom-config-file-gem5', default=False, action='store_true',
35+
help='''\
36+
Use the gem5 Linux kernel fork config as the custom config file.
37+
Ignore --custom-config-file.
3138
'''
3239
)
3340
parser.add_argument(
@@ -77,10 +84,14 @@ Configure the kernel, but don't build it.
7784
'CC={}'.format(cc), common.Newline,
7885
'O={}'.format(build_dir), common.Newline,
7986
] + verbose
80-
if args.custom_config_file is not None:
81-
if not os.path.exists(args.custom_config_file):
87+
if args.custom_config_file_gem5:
88+
custom_config_file = os.path.join(common.linux_source_dir, 'arch', common.linux_arch, 'configs', 'gem5_defconfig')
89+
else:
90+
custom_config_file = args.custom_config_file
91+
if custom_config_file is not None:
92+
if not os.path.exists(custom_config_file):
8293
raise Exception('config fragment file does not exist: {}'.format(args.custom_config_file))
83-
base_config_file = args.custom_config_file
94+
base_config_file = custom_config_file
8495
config_fragments = []
8596
else:
8697
base_config_file = os.path.join(common.linux_config_dir, 'buildroot-{}'.format(args.arch))

0 commit comments

Comments
 (0)