blob: 9de884923010a94d2f1a3def29c514906c2af7f2 [file] [log] [blame]
developer782bc7f2024-08-23 15:39:22 +08001#!/bin/sh
2
3# Copyright (C) 2024 MediaTek Inc. All rights reserved.
4# Author: Weijie Gao <weijie.gao@mediatek.com>
5# Top rules
6
7# Declare substages of every stage
developera589aa62024-09-26 16:45:04 +08008sub_stage_prepare="update_ab_info mk_ab_tmp pre_prepare apply_autobuild_script_patch modify_feeds_conf update_feeds \
developer782bc7f2024-08-23 15:39:22 +08009 mtk_feed_prepare install_feeds autobuild_prepare post_prepare"
developer9ab216e2024-09-04 09:26:31 +080010sub_stage_build="update_ab_info pre_build do_build post_build"
developer782bc7f2024-08-23 15:39:22 +080011sub_stage_release="pre_release do_release post_release"
12sub_stage_sdk_release="pre_sdk_release do_sdk_release post_sdk_release"
13sub_stage_menuconfig="do_menuconfig_update"
14
15# Declare hooks of every substage
16hooks_pre_prepare=
17hooks_mtk_feed_prepare="remove_files_by_mtk_feed_list copy_mtk_feed_files apply_mtk_feed_base_patches \
18 apply_mtk_feed_feed_patches"
19hooks_autobuild_prepare="remove_files_by_global_list copy_global_files apply_global_patches \
20 remove_files_by_platform_list copy_platform_files apply_platform_patches \
21 remove_files_by_wifi_list copy_wifi_files apply_wifi_patches \
22 remove_files_by_sku_list copy_sku_files apply_sku_patches \
23 remove_files_by_variant_list copy_variant_files apply_variant_patches \
24 prepare_wifi_driver prepare_openwrt_config platform_change_openwrt_config \
25 wifi_change_openwrt_config sku_change_openwrt_config variant_change_openwrt_config \
26 enable_openwrt_collect_debug_symbols make_defconfig update_target_info \
27 platform_change_kernel_config wifi_change_kernel_config sku_change_kernel_config \
28 variant_change_kernel_config enable_kernel_proc_config_gz"
29hooks_post_prepare="prepare_stamp"
30
31hooks_pre_build=
32hooks_do_build="download_openwrt_packages build_openwrt"
33hooks_post_build=
34
35hooks_pre_release="update_target_info mk_ab_bin_release"
36hooks_do_release="collect_openwrt_images collect_openwrt_configs collect_kernel_debug_symbols \
37 collect_userspace_debug_symbols collect_feeds_buildinfo"
38hooks_post_release=
39
40hooks_pre_sdk_release=
41hooks_do_sdk_release="release_openwrt_sdk"
42hooks_post_sdk_release=
43
44# Global information
45build_time=
46internal_build=
47mtk_feed_path=
48kernel_ver=
49target_name=
50subtarget_name=
51
52openwrt_bin_dir=
53openwrt_config_file=
54kernel_config_file=
55
56# Generic function for modifying openwrt config, to be compliant with menuconfig
57# $1: Config name
58openwrt_config_disable() {
59 if test -z "${do_menuconfig}"; then
60 if kconfig_enabled "${openwrt_config_file}" "${1}"; then
61 kconfig_disable "${openwrt_config_file}" "${1}"
62 fi
63 fi
64}
65
66# $1: Config name
67# $2: Value to be set for config (y if not specified)
68openwrt_config_enable() {
69 if test -z "${do_menuconfig}"; then
70 if ! kconfig_enabled "${openwrt_config_file}" "${1}"; then
71 kconfig_enable "${openwrt_config_file}" "${1}" "${2}"
72 fi
73 fi
74}
75
76# $1: Config name
77openwrt_config_enabled() {
78 kconfig_enabled "${openwrt_config_file}" "${1}"
79}
80
81# Generic function for modifying target's kernel config
82# $1: Config name
83kernel_config_disable() {
84 if kconfig_enabled "${kernel_config_file}" "${1}"; then
85 kconfig_disable "${kernel_config_file}" "${1}"
86 fi
87}
88
89# $1: Config name
90# $2: Value to be set for config (y if not specified)
91kernel_config_enable() {
92 if ! kconfig_enabled "${kernel_config_file}" "${1}"; then
93 kconfig_enable "${kernel_config_file}" "${1}" "${2}"
94 fi
95}
96
97# $1: Config name
98kernel_config_enabled() {
99 kconfig_enabled "${kernel_config_file}" "${1}"
100}
101
developer9ab216e2024-09-04 09:26:31 +0800102# Whether this is for internal build
103update_ab_info() {
104 if test -z "${internal_build}"; then
105 if test -d "${openwrt_root}/../mtk-openwrt-feeds"; then
106 log_dbg "Internal repo build mode"
107 internal_build=1
108 fi
109 fi
110}
111
developer782bc7f2024-08-23 15:39:22 +0800112# Create the ${ab_tmp} directory
113mk_ab_tmp() {
114 exec_log "mkdir -p \"${ab_tmp}\""
115}
116
developera589aa62024-09-26 16:45:04 +0800117# Modify scripts for specific features:
118# 1. allow specify feed subdirectory for scanning
119# 2. allow config merging and diff
120apply_autobuild_script_patch() {
121 copy_files "${ab_root}/scripts/${openwrt_branch}/files"
122 apply_patches "${ab_root}/scripts/${openwrt_branch}/patches"
developer782bc7f2024-08-23 15:39:22 +0800123}
124
125modify_feeds_conf() {
126 local rev_file_list=
127 local feed_rev=
128 local feed_url="https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds"
129
130 # Backup original feeds
131 exec_log "cp -f \"${openwrt_root}/feeds.conf.default\" \"${ab_tmp}/\""
132
133 # Modify feeds
134 openwrt_feeds_replace_url packages https://gerrit.mediatek.inc/openwrt/feeds/packages
135 openwrt_feeds_replace_url luci https://gerrit.mediatek.inc/openwrt/feeds/luci
136 openwrt_feeds_replace_url routing https://gerrit.mediatek.inc/openwrt/feeds/routing
137 openwrt_feeds_disable telephony
138 openwrt_feeds_change_src_git_type packages 0
139 openwrt_feeds_change_src_git_type luci 0
140 openwrt_feeds_change_src_git_type routing 0
141
142 # Add mtk-openwrt-feeds
143 [ -n "${ab_variant_dir}" ] && list_append rev_file_list "${ab_variant_dir}/feed_revision"
144 [ -n "${ab_sku_dir}" ] && list_append rev_file_list "${ab_sku_dir}/feed_revision"
145 [ -n "${ab_wifi_dir}" ] && list_append rev_file_list "${ab_wifi_dir}/feed_revision"
146 [ -n "${ab_platform_dir}" ] && list_append rev_file_list "${ab_platform_dir}/feed_revision"
147 list_append rev_file_list "${ab_root}/feed_revision"
148
149 for rev_file in ${rev_file_list}; do
150 if test -f "${rev_file}"; then
151 feed_rev=$(cat "${rev_file}")
152 break;
153 fi
154 done
155
156 [ -n "${feed_rev}" ] && feed_rev="^${feed_rev}"
157
developer9ab216e2024-09-04 09:26:31 +0800158 if test -n "${internal_build}"; then
developer782bc7f2024-08-23 15:39:22 +0800159 feed_url="${openwrt_root}/../mtk-openwrt-feeds"
developer782bc7f2024-08-23 15:39:22 +0800160 fi
161
162 if test -n "${internal_build}" -a -z "${feed_rev}"; then
163 openwrt_feeds_add mtk_openwrt_feed src-link "${feed_url}" --subdir=feed
164 else
165 openwrt_feeds_add mtk_openwrt_feed src-git "${feed_url}${feed_rev}" --subdir=feed
166 fi
167}
168
169update_feeds() {
developerfe20bee2024-09-11 10:05:11 +0800170 exec_log "${openwrt_root}/scripts/feeds update -a -r -s"
developer782bc7f2024-08-23 15:39:22 +0800171
172 mtk_feed_path=${openwrt_root}/feeds/mtk_openwrt_feed
173}
174
175remove_files_by_mtk_feed_list() {
176 remove_files_from_list "${mtk_feed_path}/common/remove_list.txt"
177 remove_files_from_list "${mtk_feed_path}/${openwrt_branch}/remove_list.txt"
178}
179
180copy_mtk_feed_files() {
181 copy_files "${mtk_feed_path}/common/files"
182 copy_files "${mtk_feed_path}/tools" tools
183 copy_files "${mtk_feed_path}/${openwrt_branch}/files"
184}
185
186apply_mtk_feed_base_patches() {
187 apply_patches "${mtk_feed_path}/${openwrt_branch}/patches-base"
188}
189
190apply_mtk_feed_feed_patches() {
191 apply_patches "${mtk_feed_path}/${openwrt_branch}/patches-feeds"
192}
193
194install_feeds() {
195 exec_log "${openwrt_root}/scripts/feeds install -a"
196}
197
198remove_files_by_global_list() {
199 remove_files_from_list "${ab_global}/common/remove_list.txt"
200 remove_files_from_list "${ab_global}/${openwrt_branch}/remove_list.txt"
201}
202
203copy_global_files() {
204 copy_files "${ab_global}/common/files"
205 copy_files "${ab_global}/${openwrt_branch}/files"
206}
207
208apply_global_patches() {
209 apply_patches "${ab_global}/${openwrt_branch}/patches-base" || return 1
210 apply_patches "${ab_global}/${openwrt_branch}/patches-feeds" || return 1
211 apply_patches "${ab_global}/${openwrt_branch}/patches" || return 1
212}
213
214remove_files_by_platform_list() {
215 remove_files_from_list "${ab_platform_dir}/remove_list.txt"
216 remove_files_from_list "${ab_platform_dir}/${openwrt_branch}/remove_list.txt"
217}
218
219copy_platform_files() {
220 copy_files "${ab_platform_dir}/files"
221 copy_files "${ab_platform_dir}/${openwrt_branch}/files"
222}
223
224apply_platform_patches() {
225 apply_patches "${ab_platform_dir}/${openwrt_branch}/patches-base" || return 1
226 apply_patches "${ab_platform_dir}/${openwrt_branch}/patches-feeds" || return 1
227 apply_patches "${ab_platform_dir}/${openwrt_branch}/patches" || return 1
228}
229
230remove_files_by_wifi_list() {
231 if test -n "${ab_wifi_dir}"; then
232 remove_files_from_list "${ab_wifi_dir}/remove_list.txt"
233 remove_files_from_list "${ab_wifi_dir}/${openwrt_branch}/remove_list.txt"
234 fi
235}
236
237copy_wifi_files() {
238 if test -n "${ab_wifi_dir}"; then
239 copy_files "${ab_wifi_dir}/files"
240 copy_files "${ab_wifi_dir}/${openwrt_branch}/files"
241 fi
242}
243
244apply_wifi_patches() {
245 if test -n "${ab_wifi_dir}"; then
246 apply_patches "${ab_wifi_dir}/${openwrt_branch}/patches-base" || return 1
247 apply_patches "${ab_wifi_dir}/${openwrt_branch}/patches-feeds" || return 1
248 apply_patches "${ab_wifi_dir}/${openwrt_branch}/patches" || return 1
249 fi
250}
251
252remove_files_by_sku_list() {
253 if test -n "${ab_sku_dir}"; then
254 remove_files_from_list "${ab_sku_dir}/remove_list.txt"
255 remove_files_from_list "${ab_sku_dir}/${openwrt_branch}/remove_list.txt"
256 fi
257}
258
259copy_sku_files() {
260 if test -n "${ab_sku_dir}"; then
261 copy_files "${ab_sku_dir}/files"
262 copy_files "${ab_sku_dir}/${openwrt_branch}/files"
263 fi
264}
265
266apply_sku_patches() {
267 if test -n "${ab_sku_dir}"; then
268 apply_patches "${ab_sku_dir}/${openwrt_branch}/patches-base" || return 1
269 apply_patches "${ab_sku_dir}/${openwrt_branch}/patches-feeds" || return 1
270 apply_patches "${ab_sku_dir}/${openwrt_branch}/patches" || return 1
271 fi
272}
273
274remove_files_by_variant_list() {
275 if test -n "${ab_variant_dir}"; then
276 remove_files_from_list "${ab_sku_dir}/remove_list.txt"
277 remove_files_from_list "${ab_sku_dir}/${openwrt_branch}/remove_list.txt"
278 fi
279}
280
281copy_variant_files() {
282 if test -n "${ab_variant_dir}"; then
283 copy_files "${ab_variant_dir}/files"
284 copy_files "${ab_variant_dir}/${openwrt_branch}/files"
285 fi
286}
287
288apply_variant_patches() {
289 if test -n "${ab_variant_dir}"; then
290 apply_patches "${ab_variant_dir}/${openwrt_branch}/patches-base" || return 1
291 apply_patches "${ab_variant_dir}/${openwrt_branch}/patches-feeds" || return 1
292 apply_patches "${ab_variant_dir}/${openwrt_branch}/patches" || return 1
293 fi
294}
295
296# prepare_wifi_driver() { } Implemented by wifi inclusion
297
298prepare_openwrt_config() {
developera589aa62024-09-26 16:45:04 +0800299 local kconfig_files=
300
developerb854e822024-09-29 09:29:54 +0800301 exec_log "make -C \"${openwrt_root}\" prepare-tmpinfo scripts/config/aconf"
developer782bc7f2024-08-23 15:39:22 +0800302
303 openwrt_config_file="${openwrt_root}/.config"
304
developera589aa62024-09-26 16:45:04 +0800305 kconfig_files="\"${ab_platform_dir}/${openwrt_branch}/defconfig\""
306
developer782bc7f2024-08-23 15:39:22 +0800307 if test ${ab_branch_level} -ge 2; then
developer782bc7f2024-08-23 15:39:22 +0800308 kconfig_files="${kconfig_files} \"${ab_wifi_dir}/${openwrt_branch}/defconfig\""
developer782bc7f2024-08-23 15:39:22 +0800309 fi
310
311 if test ${ab_branch_level} -ge 3; then
developer782bc7f2024-08-23 15:39:22 +0800312 kconfig_files="${kconfig_files} \"${ab_sku_dir}/${openwrt_branch}/defconfig\""
developer782bc7f2024-08-23 15:39:22 +0800313 fi
314
315 if test ${ab_branch_level} -ge 4; then
developer782bc7f2024-08-23 15:39:22 +0800316 kconfig_files="${kconfig_files} \"${ab_variant_dir}/${openwrt_branch}/defconfig\""
developer782bc7f2024-08-23 15:39:22 +0800317 fi
318
developera589aa62024-09-26 16:45:04 +0800319 exec_log "rm -f \"${openwrt_config_file}.old\""
320 exec_log "STAGING_DIR_HOST=\"${openwrt_root}/staging_dir/host\" \"${openwrt_root}/scripts/config/aconf\" -m -o \"${openwrt_config_file}\" -k \"${openwrt_root}/Config.in\" ${kconfig_files}"
developer782bc7f2024-08-23 15:39:22 +0800321
developera589aa62024-09-26 16:45:04 +0800322 # for debug purpose
323 exec_log "cp -f \"${openwrt_config_file}\" \"${ab_tmp}/${ab_branch}.config\""
324 exec_log "STAGING_DIR_HOST=\"${openwrt_root}/staging_dir/host\" \"${openwrt_root}/scripts/config/aconf\" -m -M -o \"${ab_tmp}/${ab_branch}_defconfig\" -k \"${openwrt_root}/Config.in\" ${kconfig_files}"
developer782bc7f2024-08-23 15:39:22 +0800325}
326
327# {platform,wifi,sku,variant}_change_openwrt_config() { } Implemented by platform sub levels
328
329enable_openwrt_collect_debug_symbols() {
330 openwrt_config_enable CONFIG_COLLECT_KERNEL_DEBUG
331 openwrt_config_enable CONFIG_DEBUG
332 openwrt_config_disable CONFIG_KERNEL_DEBUG_INFO_REDUCED
333}
334
335make_defconfig() {
336 if test -f "${ab_tmp}/.config.prev" -a -f "${openwrt_root}/.config"; then
337 if ! cmp -s "${ab_tmp}/.config.prev" "${openwrt_root}/.config"; then
338 exec_log "make -C \"${openwrt_root}\" defconfig"
339 fi
340 fi
341}
342
343__target_info_updated=
344
345update_target_info() {
346 [ -n "${__target_info_updated}" ] && return 0
347
348 target_name=$(openwrt_get_target_name)
349 subtarget_name=$(openwrt_get_subtarget_name)
350
351 if test -z "${target_name}"; then
352 log_err "Failed to get OpenWrt's target name"
353 return 1
354 fi
355
356 log_info "Target name: ${target_name}"
357 [ -n "${subtarget_name}" ] && log_info "Subtarget name: ${subtarget_name}"
358
359 openwrt_bin_dir=$(openwrt_get_bin_dir)
360
361 if test -z "${openwrt_bin_dir}"; then
362 log_err "Failed to get OpenWrt's bin directory"
363 return 1
364 fi
365
366 log_dbg "Target bin dir: ${openwrt_bin_dir}"
367
368 kernel_ver=$(openwrt_get_target_kernel_version ${target_name})
369
370 if test -z "${kernel_ver}"; then
371 log_err "Failed to get OpenWrt's target kernel version"
372 return 1
373 else
374 log_info "Target kernel version: ${kernel_ver}"
375 fi
376
377 if test -n ${subtarget_name}; then
378 if test -f "${openwrt_root}/target/linux/${target_name}/${subtarget_name}/config-${kernel_ver}"; then
379 kernel_config_file="${openwrt_root}/target/linux/${target_name}/${subtarget_name}/config-${kernel_ver}"
380 fi
381 fi
382
383 if test -z ${kernel_config_file}; then
384 if test -f "${openwrt_root}/target/linux/${target_name}/config-${kernel_ver}"; then
385 kernel_config_file="${openwrt_root}/target/linux/${target_name}/config-${kernel_ver}"
386 fi
387 fi
388
389 if test -z ${kernel_config_file}; then
390 log_err "Unable to find target's kernel config file"
391 return 1
392 fi
393
394 log_dbg "Target kernel config file: ${kernel_config_file}"
395
396 __target_info_updated=1
397}
398
399# {platform,wifi,sku,variant}_change_kernel_config() { } Implemented by platform sub levels
400
401enable_kernel_proc_config_gz() {
402 kernel_config_enable CONFIG_IKCONFIG
403 kernel_config_enable CONFIG_IKCONFIG_PROC
404}
405
406prepare_stamp() {
407 if test -n "${do_menuconfig}"; then
408 touch "${ab_tmp}/.stamp.menuconfig"
409 else
410 rm -f "${ab_tmp}/.stamp.menuconfig"
411 fi
412
413 echo -n "${ab_branch}" > "${ab_tmp}/branch_name"
414 echo -n "${ab_cmdline}" > "${ab_tmp}/cmdline"
415}
416
417download_openwrt_packages() {
418 if test x"${internal_build}" = x"1"; then
developer9ab216e2024-09-04 09:26:31 +0800419 if test -d "${openwrt_root}/../dl"; then
420 if ! test -d "${openwrt_root}/dl" -o -L "${openwrt_root}/dl"; then
421 exec_log "ln -sf ../dl \"${openwrt_root}/dl\""
422 fi
developer782bc7f2024-08-23 15:39:22 +0800423 fi
424 fi
425
426 exec_log "make -C \"${openwrt_root}\" V=1 -j\$((\$(nproc) + 1)) download"
427}
428
429build_openwrt() {
430 local ret=
431 local verbose=1
432
433 if test x"${debug_set}" = x"yes"; then
434 verbose=s
435 fi
436
437 build_time=$(date +%Y%m%d%H%M%S)
438
439 exec_log "make -C \"${openwrt_root}\" V=${verbose} -j\$((\$(nproc) + 1))"
440
441 ret=$?
442
443 if test ${ret} != 0; then
444 log_warn "Build failed with error code ${ret}."
445 log_warn "Restart single-threaded building for debugging purpose."
446
447 exec_log "make -C \"${openwrt_root}\" V=s -j1"
448
449 ret=$?
450
451 if test ${ret} != 0; then
452 log_err "Debug build failed with error code ${ret}."
453 return 1
454 fi
455 fi
456
457 log_info "OpenWrt built successfully"
458}
459
460# Create the ${ab_bin_release} directory
461mk_ab_bin_release() {
462 exec_log "mkdir -p \"${ab_bin_release}\""
463}
464
465collect_openwrt_images() {
466 local file_count=0
467 local files=
468
469 if [ -z "${build_time}" ]; then
470 build_time=$(date +%Y%m%d%H%M%S)
471 fi
472
473 files=$(find "${openwrt_bin_dir}" -maxdepth 1 -name '*.bin' -o -name "*.img" -o -name '*.itb' -o -name '*.gz')
474
475 for file in ${files}; do
476 local file_no_ext=${file%.*}
477 local file_name=${file_no_ext##*/}
478 local file_ext=${file##*.}
479
480 exec_log "cp -rf \"${file}\" \"${ab_bin_release}/${file_name}-${build_time}.${file_ext}\""
481 ((file_count++))
482 done
483
484 log_info "Total ${file_count} image files copied."
485}
486
487collect_openwrt_configs() {
488 local linux_dir=$(openwrt_get_target_kernel_linux_build_dir ${target_name})
489
490 exec_log "cp -f \"${openwrt_root}/.config\" \"${ab_bin_release}/openwrt.config\""
491
492 if test -z "${linux_dir}"; then
493 log_warn "Failed to get OpenWrt's linux kernel build directory"
494 else
495 local kernel_config_data="${linux_dir}/kernel/config_data"
496
497 if [ -f "${kernel_config_data}" ]; then
498 exec_log "cp -f \"${kernel_config_data}\" \"${ab_bin_release}/kernel.config\""
499 fi
500 fi
501}
502
503collect_kernel_debug_symbols() {
504 if [ -f "${openwrt_bin_dir}/kernel-debug.tar.zst" ]; then
505 exec_log "cp -f \"${openwrt_bin_dir}/kernel-debug.tar.zst\" \"${ab_bin_release}/\""
506 fi
507}
508
509collect_userspace_debug_symbols() {
510 local staging_dir_root=$(openwrt_get_staging_dir_root)
511
512 log_dbg "Staging dir root: ${staging_dir_root}"
513
514 if test -d "${staging_dir_root}"; then
515 staging_dir_root_prefix=$(dirname "${staging_dir_root}")
516 staging_dir_root_name=$(basename "${staging_dir_root}")
517
developere10d8622024-09-05 09:17:25 +0800518 if test -x "${openwrt_root}/staging_dir/host/bin/zstd"; then
519 exec_log "tar -c -C \"${staging_dir_root_prefix}\" \"${staging_dir_root_name}\" | \"${openwrt_root}/staging_dir/host/bin/zstd\" -T0 -f -o \"${ab_bin_release}/rootfs-debug.tar.zst\""
520 else
521 exec_log "tar -jcf \"${ab_bin_release}/rootfs-debug.tar.bz2\" -C \"${staging_dir_root_prefix}\" \"${staging_dir_root_name}\""
522 fi
developer782bc7f2024-08-23 15:39:22 +0800523 fi
524}
525
526collect_feeds_buildinfo() {
527 if [ -f "${openwrt_bin_dir}/feeds.buildinfo" ]; then
528 exec_log "cp -f \"${openwrt_bin_dir}/feeds.buildinfo\" \"${ab_bin_release}/\""
529 fi
530}
531
532do_menuconfig_update() {
developer782bc7f2024-08-23 15:39:22 +0800533 local kconfig_files=
534 local final_file=
535
developera589aa62024-09-26 16:45:04 +0800536 openwrt_config_file="${openwrt_root}/.config"
537
developer782bc7f2024-08-23 15:39:22 +0800538 if test ${ab_branch_level} -eq 1; then
developer561475a2024-09-27 11:07:06 +0800539 final_file="${ab_platform_dir}/${openwrt_branch}/defconfig"
developer782bc7f2024-08-23 15:39:22 +0800540 fi
541
developer782bc7f2024-08-23 15:39:22 +0800542 if test ${ab_branch_level} -ge 2; then
543 kconfig_files="\"${ab_platform_dir}/${openwrt_branch}/defconfig\""
544 final_file="${ab_wifi_dir}/${openwrt_branch}/defconfig"
developer782bc7f2024-08-23 15:39:22 +0800545 fi
546
547 if test ${ab_branch_level} -ge 3; then
developer782bc7f2024-08-23 15:39:22 +0800548 kconfig_files="${kconfig_files} \"${final_file}\""
549 final_file="${ab_sku_dir}/${openwrt_branch}/defconfig"
developer782bc7f2024-08-23 15:39:22 +0800550 fi
551
552 if test ${ab_branch_level} -ge 4; then
developer782bc7f2024-08-23 15:39:22 +0800553 kconfig_files="${kconfig_files} \"${final_file}\""
554 final_file="${ab_variant_dir}/${openwrt_branch}/defconfig"
developer782bc7f2024-08-23 15:39:22 +0800555 fi
556
developer561475a2024-09-27 11:07:06 +0800557 if test x"${sync_config_set}" == x"yes"; then
558 exec_log "rm -f \"${openwrt_config_file}.old\""
559 exec_log "STAGING_DIR_HOST=\"${openwrt_root}/staging_dir/host\" \"${openwrt_root}/scripts/config/aconf\" -m -o \"${openwrt_config_file}\" -k \"${openwrt_root}/Config.in\" ${kconfig_files} \"${final_file}\""
560 fi
561
562 exec_log "make -C \"${openwrt_root}\" menuconfig scripts/config/aconf"
563
564 if test ${ab_branch_level} -eq 1; then
565 exec_log "STAGING_DIR_HOST=\"${openwrt_root}/staging_dir/host\" \"${openwrt_root}/scripts/config/aconf\" -m -M -o \"${ab_platform_dir}/${openwrt_branch}/defconfig\" -k \"${openwrt_root}/Config.in\" \"${openwrt_config_file}\""
566 return
567 fi
568
developera589aa62024-09-26 16:45:04 +0800569 exec_log "STAGING_DIR_HOST=\"${openwrt_root}/staging_dir/host\" \"${openwrt_root}/scripts/config/aconf\" -d -o \"${final_file}\" -k \"${openwrt_root}/Config.in\" -n \"${openwrt_config_file}\" ${kconfig_files}"
developer782bc7f2024-08-23 15:39:22 +0800570}