Skip to content

Commit

Permalink
Adds patches to ATLAS to fix issues with grep 3.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAssassin23 committed Aug 12, 2023
1 parent a334a05 commit 826f71a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions patch-atlas-src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- name: Checking to see if patches need to be applied.
ansible.builtin.stat:
path: "{{ hpl_root }}/tmp/ATLAS_PATCHING_COMPLETE"
register: no_patches_needed

# Fixes fgrep warning being added to output and causing
# the ATLAS configuration to fail to identify aspects of
# the given node
- name: Patching ATLAS source code (Part 1).
ansible.builtin.replace:
path: "{{ hpl_root }}tmp/ATLAS/CONFIG/include/atlas_sys.h"
regexp: '2>&1'
replace: '2>/dev/null'
when: no_patches_needed.stat.exists == false

# Fixes 'free(): invalid pointer' error during
# ATLAS configuration
- name: Patching ATLAS source code (Part 2).
ansible.builtin.lineinfile:
path: "{{ hpl_root }}tmp/ATLAS/CONFIG/src/probe_comp.c"
insertbefore: 'free\(cmnd\)'
line: ' printf("\n");'
firstmatch: true
when: no_patches_needed.stat.exists == false

# Fixes 'corrupted size vs. prev_size' error during
# ATLAS configuration
- name: Patching ATLAS source code (Part 3).
ansible.builtin.lineinfile:
path: "{{ hpl_root }}tmp/ATLAS/CONFIG/include/atlas_sys.h"
insertbefore: 'if \(fgets\(sout, len, fpin\)\)'
line: ' printf("\n");'
firstmatch: true
when: no_patches_needed.stat.exists == false

- name: Create 'ATLAS_PATCHING_COMPLETE' file.
ansible.builtin.file:
path: "{{ hpl_root }}/tmp/ATLAS_PATCHING_COMPLETE"
state: touch
mode: 0644

0 comments on commit 826f71a

Please sign in to comment.