---
- block:
  - name: Install linux-base from apt
    apt:
      name:
        - "linux-base"
      force: yes
      install_recommends: no
      cache_valid_time: "{{ apt_cache_valid_time }}"

  - name: Install kernel libc
    http_deb:
      name: "linux-libc-dev"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_libc_url }}"
      checksum: "sha256:{{ linux_libc_SHA256 }}"

  - name: Install generic kernel headers
    http_deb:
      name: "linux-headers-{{ build_kernel_version_base }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_headers_generic_url }}"
      checksum: "sha256:{{ linux_headers_generic_SHA256 }}"

  - name: Install Zoox kernel headers
    http_deb:
      name: "linux-headers-{{ build_kernel_version }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_headers_zoox_url }}"
      checksum: "sha256:{{ linux_headers_zoox_SHA256 }}"

  - name: Install kernel modules
    http_deb:
      name: "linux-modules-{{ build_kernel_version }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_modules_url }}"
      checksum: "sha256:{{ linux_modules_SHA256 }}"

  - name: Install kernel image
    http_deb:
      name: "linux-image-{{ build_kernel_version }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_image_url }}"
      checksum: "sha256:{{ linux_image_SHA256 }}"

  - name: Install kernel debug symbols
    http_deb:
      name: "linux-image-{{ build_kernel_version }}-dbgsym"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_dbgsym_url }}"
      checksum: "sha256:{{ linux_dbgsym_SHA256 }}"

  - name: Install common kernel tools
    http_deb:
      name: "linux-tools-common"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_tools_common_url }}"
      checksum: "sha256:{{ linux_tools_common_SHA256 }}"

  - name: Install generic kernel tools
    http_deb:
      name: "linux-tools-{{ build_kernel_version_base }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_tools_generic_url }}"
      checksum: "sha256:{{ linux_tools_generic_SHA256 }}"

  - name: Install Zoox kernel tools
    http_deb:
      name: "linux-tools-{{ build_kernel_version }}"
      version: "{{ build_kernel_version_base }}"
      url: "{{ linux_tools_zoox_url }}"
      checksum: "sha256:{{ linux_tools_zoox_SHA256 }}"

  become: yes
