version: '2'
pipelines:
  - mpp-import-pipelines:
      path: fedora-vars.ipp.yaml
  - mpp-import-pipeline:
      path: fedora-build-v2.ipp.yaml
      id: build
    runner:
      mpp-format-string: org.osbuild.fedora{release}
  - name: tree
    build: name:build
    stages:
      - type: org.osbuild.rpm
        inputs:
          packages:
            type: org.osbuild.files
            origin: org.osbuild.source
            mpp-depsolve:
              architecture: $arch
              module-platform-id: $module_platform_id
              repos:
                mpp-eval: repos
              packages:
                - dnf
                - rpm-ostree
                - ostree
                - pigz
                - kernel
                - kernel-modules
                - kernel-modules-extra
                - glibc-all-langpacks
                - grub2-tools-efi
                - efibootmgr
                - shim-x64
                - grub2-efi-x64-cdboot
                - shim-ia32
                - grub2-efi-ia32-cdboot
                - biosdevname
                - memtest86+
                - syslinux
                - grub2-tools
                - grub2-tools-minimal
                - grub2-tools-extra
                - dracut
                - anaconda-dracut
                - dracut-network
                - dracut-config-generic
                - initscripts
                - cryptsetup
                - rpcbind
                - kbd
                - kbd-misc
                - tar
                - xz
                - curl
                - bzip2
                - systemd-sysv
                - systemd-units
                - rsyslog
                - fcoe-utils
                - net-tools
                - nfs-utils
        options:
          gpgkeys:
            mpp-eval: gpgkeys
          exclude:
            docs: true
          disable_dracut: true
      - type: org.osbuild.dracut
        options:
          kernel:
            - mpp-format-string: '{rpms[''tree''][''kernel''].evra}'
          add_modules:
            - convertfs
            - dmsquash-live
            - livenet
            - pollcdrom
            - qemu
            - qemu-net
      - type: org.osbuild.locale
        options:
          language: en_US.UTF-8
      - type: org.osbuild.users
        options:
          users:
            root:
              password: ''
  - name: image
    build: name:build
    stages:
      - type: org.osbuild.squashfs
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:tree
        options:
          filename: rootfs.img
          compression:
            method: lz4
  - name: initrd
    build: name:build
    stages:
      - type: org.osbuild.gunzip
        inputs:
          file:
            type: org.osbuild.files
            origin: org.osbuild.pipeline
            references:
              name:tree:
                file:
                  mpp-format-string: /boot/initramfs-{rpms['tree']['kernel'].evra}.img
        options:
          path: initramfs.img
      - type: org.osbuild.cpio.out
        options:
          filename: initramfs.img
          append: true
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:image
  - name: uki
    build: name:build
    stages:
      - type: org.osbuild.uki
        options:
          filename: linux.efi
          kernel:
            opts:
              - root=live:/rootfs.img
        inputs:
          kernel:
            type: org.osbuild.files
            origin: org.osbuild.pipeline
            references:
              name:tree:
                file:
                  mpp-format-string: /boot/vmlinuz-{rpms['tree']['kernel'].evra}
          initrd:
            type: org.osbuild.files
            origin: org.osbuild.pipeline
            references:
              name:initrd:
                file:
                  mpp-format-string: /initramfs.img
          osrel:
            type: org.osbuild.files
            origin: org.osbuild.pipeline
            references:
              name:tree:
                file:
                  mpp-format-string: /etc/os-release
