diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 653bb7d149..7ca69e527c 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -34,8 +34,6 @@ jobs: - { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' } - { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' } steps: - - name: Check out the repo - uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry diff --git a/test/container/Dockerfile-Arch b/test/container/Dockerfile-Arch index f05ce8f1de..3831a87533 100644 --- a/test/container/Dockerfile-Arch +++ b/test/container/Dockerfile-Arch @@ -2,16 +2,15 @@ FROM docker.io/archlinux MAINTAINER https://github.com/dracutdevs/dracut -# Install needed packages for the dracut CI container -RUN pacman --noconfirm -Syu \ - linux dash strace dhclient asciidoc cpio pigz squashfs-tools \ - qemu btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \ - dhcp networkmanager multipath-tools vi tcpdump open-iscsi connman \ - git shfmt shellcheck astyle which base-devel glibc parted ntfs-3g && yes | pacman -Scc +# install aur helper to allow easy install of aur packages +RUN pacman --noconfirm -Syu base-devel git +RUN useradd -m build && echo "build ALL=(ALL) NOPASSWD: /usr/bin/pacman" > "/etc/sudoers.d/allow_pacman" +RUN su build -c 'cd && git clone https://aur.archlinux.org/paru-bin.git && cd paru-bin && makepkg -s --noconfirm' && pacman -U --noconfirm ~build/paru-bin/*.pkg.tar.* + +COPY tools/* /tmp/ +WORKDIR /tmp -RUN useradd -m build -RUN su build -c 'cd && git clone https://aur.archlinux.org/perl-config-general.git && cd perl-config-general && makepkg -s --noconfirm' -RUN pacman -U --noconfirm ~build/perl-config-general/*.pkg.tar.* -RUN su build -c 'cd && git clone https://aur.archlinux.org/tgt.git && cd tgt && makepkg -s --noconfirm' -RUN pacman -U --noconfirm ~build/tgt/*.pkg.tar.* -RUN rm -fr ~build +# Install needed packages for the dracut CI container +# Assume that initramfs virtual package is installed so that the default mkinitcpio package does not get installed +RUN su build -c 'paru --needed --noconfirm -Syu --assume-installed initramfs `/tmp/test-packages.sh` ' \ + && yes | paru -Sccd diff --git a/test/container/Dockerfile-Debian b/test/container/Dockerfile-Debian index 9ba3a1fca1..d0b3cc610d 100644 --- a/test/container/Dockerfile-Debian +++ b/test/container/Dockerfile-Debian @@ -2,66 +2,12 @@ FROM docker.io/debian:latest MAINTAINER https://github.com/dracutdevs/dracut +COPY tools/* /tmp/ +WORKDIR /tmp + # Install needed packages for the dracut CI container # Install dracut as a linux-initramfs-tool provider so that the default initramfs-tool package does not get installed # Uninstall initramfs-tools-core as a workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994492 RUN apt-get update -y -qq && apt-get upgrade -y -qq && apt-get install -y -qq --no-install-recommends dracut && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \ - asciidoc \ - astyle \ - btrfs-progs \ - busybox-static \ - bzip2 \ - ca-certificates \ - console-setup \ - cpio \ - cryptsetup \ - curl \ - dash \ - debhelper \ - debhelper-compat \ - dmraid \ - docbook \ - docbook-xml \ - docbook-xsl \ - fdisk \ - g++ \ - gawk \ - git \ - iputils-arping \ - iputils-ping \ - isc-dhcp-client \ - isc-dhcp-server \ - kmod \ - less \ - libdmraid-dev \ - libkmod-dev \ - linux-image-generic \ - lvm2 \ - make \ - mdadm \ - multipath-tools \ - nbd-client \ - nbd-server \ - network-manager \ - nfs-kernel-server \ - ntfs-3g \ - open-iscsi \ - ovmf \ - parted \ - pigz \ - pkg-config \ - procps \ - qemu-system-x86 \ - quilt \ - shellcheck \ - squashfs-tools \ - strace \ - sudo \ - systemd-boot-efi \ - tcpdump \ - tgt \ - thin-provisioning-tools \ - vim \ - wget \ + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 $(/tmp/test-packages.sh) \ && apt-get clean && dpkg -P --force-depends dracut dracut-core initramfs-tools-core diff --git a/test/container/Dockerfile-Fedora-latest b/test/container/Dockerfile-Fedora-latest index 2ce397513e..e8b2bec5cf 100644 --- a/test/container/Dockerfile-Fedora-latest +++ b/test/container/Dockerfile-Fedora-latest @@ -2,70 +2,9 @@ FROM registry.fedoraproject.org/fedora:latest MAINTAINER https://github.com/dracutdevs/dracut +COPY tools/* /tmp/ +WORKDIR /tmp + # Install needed packages for the dracut CI container -RUN dnf -y install --setopt=install_weak_deps=False \ - asciidoc \ - bash-completion \ - biosdevname \ - bluez \ - btrfs-progs \ - busybox \ - bzip2 \ - cifs-utils \ - cryptsetup \ - dash \ - dbus-daemon \ - device-mapper-multipath \ - dhcp-client \ - dhcp-server \ - dmraid \ - e2fsprogs \ - f2fs-tools \ - fcoe-utils \ - fuse3 \ - gcc \ - git \ - iproute \ - iputils \ - iscsi-initiator-utils \ - kbd \ - kernel \ - kmod-devel \ - libkcapi-hmaccalc \ - libselinux-utils \ - lvm2 \ - lzop \ - make \ - mdadm \ - memstrack \ - mksh \ - nbd \ - ndctl \ - NetworkManager \ - nfs-utils \ - ntfs-3g \ - ntfsprogs \ - nvme-cli \ - parted \ - pcsc-lite \ - pigz \ - qemu-system-x86-core \ - rng-tools \ - rpm-build \ - sbsigntools \ - scsi-target-utils \ - ShellCheck \ - shfmt \ - squashfs-tools \ - strace \ - sudo \ - systemd-boot-unsigned \ - systemd-networkd \ - systemd-resolved \ - tar \ - tcpdump \ - tpm2-tools \ - wget \ - which \ - xz \ +RUN dnf -y install --setopt=install_weak_deps=False $(/tmp/test-packages.sh) \ && dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest index 3e7cefc229..876196336d 100644 --- a/test/container/Dockerfile-OpenSuse-latest +++ b/test/container/Dockerfile-OpenSuse-latest @@ -2,12 +2,9 @@ FROM registry.opensuse.org/opensuse/tumbleweed-dnf:latest MAINTAINER https://github.com/dracutdevs/dracut +COPY tools/* /tmp/ +WORKDIR /tmp + # Install needed packages for the dracut CI container -RUN dnf -y install --setopt=install_weak_deps=False \ - dash asciidoc mdadm lvm2 dmraid cryptsetup nfs-utils nbd dhcp-server \ - strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \ - sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \ - tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \ - iscsiuio open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \ - multipath-tools util-linux-systemd systemd-boot \ +RUN dnf -y install --setopt=install_weak_deps=False $(/tmp/test-packages.sh) \ && dnf -y remove dracut && dnf -y update && dnf clean all diff --git a/tools/test-packages.sh b/tools/test-packages.sh new file mode 100755 index 0000000000..25aaa57cec --- /dev/null +++ b/tools/test-packages.sh @@ -0,0 +1,174 @@ +#!/bin/sh + +if [ -f /etc/os-release ]; then + # shellcheck disable=SC1091 + . /etc/os-release +fi + +# common packages +cat << EOF + asciidoc + astyle + bash-completion + bluez + busybox + bzip2 + cifs-utils + cryptsetup + dash + dmraid + f2fs-tools + fuse3 + gawk + gcc + git + jq + kbd + lvm2 + lzop + make + mdadm + ndctl + ntfs-3g + nvme-cli + parted + pigz + rng-tools + shfmt + strace + sudo + tar + tcpdump + vim + wget + which +EOF + +# common packages (but not openSUSE) +if [ -x /usr/bin/yum ] || [ -x /usr/bin/dpkg ] || [ -x /usr/bin/pacman ]; then + cat << EOF + btrfs-progs + squashfs-tools + tpm2-tools +EOF +fi + +# packages for rpm based distros +if [ -x /usr/bin/rpm ]; then + cat << EOF + dhcp-client + dhcp-server + e2fsprogs + iproute + iputils + kernel + nbd + NetworkManager + nfs-utils + ntfsprogs + rpm-build + ShellCheck + xz +EOF +fi + +if [ -x /usr/bin/yum ] || [ -x /usr/bin/pacman ]; then + cat << EOF + biosdevname + memstrack + nfs-utils + sbsigntools +EOF +fi + +if [ -x /usr/bin/yum ]; then + cat << EOF + dbus-daemon + device-mapper-multipath + fcoe-utils + iscsi-initiator-utils + kmod-devel + libkcapi-hmaccalc + libselinux-utils + mksh + pcsc-lite + qemu-system-x86-core + scsi-target-utils + systemd-boot-unsigned + systemd-networkd + systemd-resolved +EOF +fi + +if [ "$ID" = "opensuse-tumbleweed" ]; then + cat << EOF + btrfsprogs + dbus-broker + iscsiuio + libkmod-devel + multipath-tools + open-iscsi + procps + qemu-kvm + squashfs + systemd-boot + tgt + /usr/bin/qemu-system-$(uname -m) + util-linux-systemd +EOF +fi + +if [ -x /usr/bin/pacman ]; then + cat << EOF + connman + cpio + dhclient + dhcp + linux + multipath-tools + networkmanager + open-iscsi + pcsclite + qemu + shellcheck + tgt +EOF +fi + +# packages for deb based distro's +if [ -x /usr/bin/dpkg ]; then + cat << EOF + ca-certificates + console-setup + cpio + curl + debhelper + debhelper-compat + docbook + docbook-xml + docbook-xsl + fdisk + iputils-arping + iputils-ping + isc-dhcp-client + isc-dhcp-server + iscsiuio + libdmraid-dev + libkmod-dev + linux-image-generic + multipath-tools + nbd-client + nbd-server + network-manager + nfs-kernel-server + open-iscsi + ovmf + pkg-config + procps + qemu-system-x86 + shellcheck + systemd-boot-efi + tgt + thin-provisioning-tools +EOF +fi