From 268b89a4de5fd18b3882c774c95d071be87125f6 Mon Sep 17 00:00:00 2001 From: Adam Rozman Date: Fri, 3 Jan 2025 13:05:09 +0200 Subject: [PATCH] remove dracut from the IPA rootfs this commit: - removes the dracut packages from the rootfs The size of the IPA image is slowly but steadily growing, and in order to minimize the size of the image some packages could be removed. Although dracut is used at some point in the DIB build process there is no point leaving it in the root file system after the IPA build process is finished. IPA user space does not rely on dracut, systemd can handle everything on it's own. Signed-off-by: Adam Rozman --- jenkins/scripts/dynamic_worker_workflow/build_ipa.sh | 2 +- .../ipa-cleanup-dracut/cleanup.d/99-ipa-cleanup-dracut | 5 ++--- .../ipa-cleanup-dracut/finalise.d/99-delete-dracut | 8 ++++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100755 jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/finalise.d/99-delete-dracut diff --git a/jenkins/scripts/dynamic_worker_workflow/build_ipa.sh b/jenkins/scripts/dynamic_worker_workflow/build_ipa.sh index 62123a9e..ae9e57f8 100755 --- a/jenkins/scripts/dynamic_worker_workflow/build_ipa.sh +++ b/jenkins/scripts/dynamic_worker_workflow/build_ipa.sh @@ -66,7 +66,7 @@ METADATA_PATH="/tmp/metadata.txt" sudo rm -rf "${IPA_BUILD_WORKSPACE}" # Update apt packages -sudo apt-get update -y +sudo apt-get update -y # Install required packages sudo apt-get install --yes python3-pip python3-virtualenv qemu-utils diff --git a/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/cleanup.d/99-ipa-cleanup-dracut b/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/cleanup.d/99-ipa-cleanup-dracut index 8e65885c..ad770089 100755 --- a/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/cleanup.d/99-ipa-cleanup-dracut +++ b/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/cleanup.d/99-ipa-cleanup-dracut @@ -1,9 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash -if [ "${DIB_DEBUG_TRACE:-1}" -gt 0 ]; then +if [[ "${DIB_DEBUG_TRACE:-1}" -gt 0 ]]; then set -x fi set -eu -set -o pipefail sudo rm -rf "$TARGET_ROOT/var/tmp/dracut"* diff --git a/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/finalise.d/99-delete-dracut b/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/finalise.d/99-delete-dracut new file mode 100755 index 00000000..c8fe381d --- /dev/null +++ b/jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/ipa-cleanup-dracut/finalise.d/99-delete-dracut @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ "${DIB_DEBUG_TRACE:-1}" -gt 0 ]]; then + set -x +fi +set -eu + +sudo dnf remove -y dracut