Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preinstallimages in containers #1031

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions init_buildsystem
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,19 @@ preinstall_image() {
check_exit
echo "unpacking preinstall image${2:+ $2}"
preinstall_setup

TAR_EXCLUDES="--exclude .build --exclude .init_b_cache"

if [ -f "/run/.containerenv" ]; then
# we're running in a podman container and we probably don't have sufficient capabilities to create special files
TAR_EXCLUDES="$TAR_EXCLUDES --exclude dev/* --exclude proc/* --exclude run/* --exclude sys/*"
fi

if test -x /usr/bin/bsdtar ; then
TAR="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P --chroot --numeric-owner -x"
TAR="/usr/bin/bsdtar $TAR_EXCLUDES -P --chroot --numeric-owner -x"
else
unsafe_preinstall_check
TAR="tar --exclude .build --exclude .init_b_cache -x"
TAR="tar $TAR_EXCLUDES -x"
fi
if ! $TAR -f "$BUILD_INIT_CACHE/rpms/$1" ; then
echo "ERROR: unpack failed."
Expand Down
Loading