8000 buildroot/rebuild.py: Add '--savedefconfig' · ClangBuiltLinux/boot-utils@8f4b222 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f4b222

Browse files
committed
buildroot/rebuild.py: Add '--savedefconfig'
It is helpful to run savedefconfig when upgrading Buildroot to make sure that options do not get silently disabled or changed but up until this point, savedefconfig has only been run when editing a configuration file, which is annoying when building all images. Add a flag to allow running savedefconfig without editing so that it can be done non-interactively. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 6c4b94c commit 8f4b222

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

buildroot/rebuild.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def buildroot_make(make_arg=None, **kwargs):
3838
subprocess.run(make_cmd, **kwargs, check=True, cwd=SRC_FOLDER)
3939

4040

41-
def build_image(architecture, edit_config):
41+
def build_image(architecture, edit_config, savedefconfig):
4242
buildroot_make('clean')
4343

4444
config = Path(ROOT_FOLDER, f"{architecture}.config")
@@ -50,6 +50,7 @@ def build_image(architecture, edit_config):
5050
buildroot_make('defconfig', env={**os.environ, 'BR2_DEFCONFIG': config})
5151
if edit_config:
5252
buildroot_make('menuconfig')
53+
if edit_config or savedefconfig:
5354
buildroot_make('savedefconfig')
5455

5556
buildroot_make()
@@ -141,6 +142,10 @@ def parse_arguments():
141142
'--release',
142143
action='store_true',
143144
help=f"Create a release on GitHub (tag: {RELEASE_TAG})")
145+
parser.add_argument('-s',
146+
'--savedefconfig',
147+
action='store_true',
148+
help='Run savedefconfig after configuration stage')
144149

145150
return parser.parse_args()
146151

@@ -156,7 +161,7 @@ def parse_arguments():
156161

157162
download_and_extract_buildroot()
158163
for arch in architectures:
159-
build_image(arch, args.edit_config)
164+
build_image(arch, args.edit_config, args.savedefconfig)
160165

161166
if args.release:
162167
release_images()

0 commit comments

Comments
 (0)
0