Skip to content

Commit 742d6fe

Browse files
committed
linux: fix ignore hunt for config if config-kdevops is defined
Commit f70bf0c ("linux: fix heuristic with missing configuration") added support for looking for the latest linux-next config if your ref does not have an associated kernel configuration. This failed to capture the special-casing of config-kdevops special file, which let's you stick to that configuration for your builds. Fix this. Fixes: f70bf0c ("linux: fix heuristic with missing configuration") Reported-by: Chuck Lever <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent ad0bb9f commit 742d6fe

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

playbooks/roles/bootlinux/tasks/main.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,40 +246,53 @@
246246
register: kernel_config
247247
delegate_to: localhost
248248

249-
- name: Find all linux-next configs
249+
- name: Find all linux-next configs if a your custom config-kdevops and ref config was not found
250250
find:
251251
paths: "{{ role_path }}/templates"
252252
patterns: "config-next*"
253253
file_type: file
254254
recurse: no
255255
register: found_configs
256256
delegate_to: localhost
257-
when: not kernel_config.stat.exists
257+
when:
258+
- not config_kdevops.stat.exists
259+
- not kernel_config.stat.exists
258260

259261
- name: Extract the date from the filenames
260262
set_fact:
261263
configs_with_dates: "{{ configs_with_dates | default([]) + [{'file': item.path, 'date': (item.path | regex_search('config-next-(\\d{8})')).split('-')[-1]}] }}"
262264
loop: "{{ found_configs.files }}"
263-
when: item.path is search('config-next-(\\d{8})')
265+
when:
266+
- not config_kdevops.stat.exists
267+
- not kernel_config.stat.exists
268+
- item.path is search('config-next-(\\d{8})')
264269
no_log: true
265270
delegate_to: localhost
266271

267272
- name: Sort configs based on date extracted from filename
268273
set_fact:
269274
sorted_configs: "{{ configs_with_dates | selectattr('date', 'defined') | sort(attribute='date', reverse=True) | map(attribute='file') | list }}"
270-
when: configs_with_dates | length > 0
275+
when:
276+
- not config_kdevops.stat.exists
277+
- not kernel_config.stat.exists
278+
- configs_with_dates | length > 0
271279
delegate_to: localhost
272280

273281
- name: Set latest linux-next config if configs are found
274282
set_fact:
275283
latest_linux_next_config: "{{ sorted_configs[0] }}"
276-
when: sorted_configs | length > 0
284+
when:
285+
- not config_kdevops.stat.exists and not kernel_config.stat.exists
286+
- sorted_configs | length > 0
277287
delegate_to: localhost
278288

279289
- name: Use the specific kernel config or fallback to the latest linux-next
280290
set_fact:
281291
linux_config: "{{ target_linux_config | default('') if kernel_config.stat.exists else (latest_linux_next_config | default('') | basename) }}"
282-
when: latest_linux_next_config is defined
292+
when:
293+
- not config_kdevops.stat.exists
294+
- not kernel_config.stat.exists
295+
- latest_linux_next_config is defined
283296
delegate_to: localhost
284297

285298
- name: Verify config used

0 commit comments

Comments
 (0)