summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dracut-initramfs-builder/tasks/dnbd3-fixes.yml17
-rw-r--r--dracut-initramfs-builder/tasks/main.yml11
2 files changed, 20 insertions, 8 deletions
diff --git a/dracut-initramfs-builder/tasks/dnbd3-fixes.yml b/dracut-initramfs-builder/tasks/dnbd3-fixes.yml
new file mode 100644
index 0000000..e9bd6dd
--- /dev/null
+++ b/dracut-initramfs-builder/tasks/dnbd3-fixes.yml
@@ -0,0 +1,17 @@
+---
+- name: Hack fix dnbd3 blk.c for Ubuntu newer kernels
+ replace:
+ dest: "{{ gittarget }}/builder/modules.d/dnbd3-rootfs/scripts/build.sh"
+ regexp: 'make -j4 dnbd3 dnbd3-client'
+ replace: 'sed -i "s/backing_dev_info.ra_pages/backing_dev_info->ra_pages/g" blk.c && make -j4 dnbd3 dnbd3-client'
+ backup: yes
+ when:
+ - ansible_distribution == "Ubuntu"
+- name: Hack fix dnbd3 blk.h for CentOS kernels with backports
+ replace:
+ dest: "{{ gittarget }}/builder/modules.d/dnbd3-rootfs/scripts/build.sh"
+ regexp: 'make -j4 dnbd3 dnbd3-client'
+ replace: 'sed -i "s/KERNEL_VERSION.*/KERNEL_VERSION\(3, 10, 0\)/g" blk.h && make -j4 dnbd3 dnbd3-client'
+ backup: yes
+ when:
+ - ansible_distribution == "CentOS"
diff --git a/dracut-initramfs-builder/tasks/main.yml b/dracut-initramfs-builder/tasks/main.yml
index 6c8042a..b50e57d 100644
--- a/dracut-initramfs-builder/tasks/main.yml
+++ b/dracut-initramfs-builder/tasks/main.yml
@@ -10,14 +10,9 @@
repo: "{{ gitsource }}"
dest: "{{ gittarget }}"
depth: 1
-- name: Hack fix dnbd3 blk.h for CentOS (one day this should get fixed in dnbd3 :))
- replace:
- dest: "{{ gittarget }}/builder/modules.d/dnbd3-rootfs/scripts/build.sh"
- regexp: 'make -j4 dnbd3 dnbd3-client'
- replace: 'sed -i "s/KERNEL_VERSION.*/KERNEL_VERSION\(3, 10, 0\)/g" blk.h && make -j4 dnbd3 dnbd3-client'
- backup: yes
- when:
- - ansible_distribution == "CentOS"
+
+- include: tasks/dnbd3-fixes.yml
+
- name: Build initramfs with dracut
shell: "{{ gittarget }}/builder/build-initramfs.sh -s -d -p {{ gittarget }}/initramfs"
args: