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

Disable zchunk and deltarpm before first template boot #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions dnf/bootstrap-dnf-centos-stream.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ repo_gpgcheck=1
plugins=1
installonly_limit=3
color=never
deltarpm=False
zchunk=False

reposdir=/var/empty

Expand Down
2 changes: 2 additions & 0 deletions dnf/bootstrap-dnf-fedora.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ gpgcheck=1
plugins=1
installonly_limit=3
color=never
deltarpm=False
zchunk=False

reposdir=/var/empty

Expand Down
6 changes: 3 additions & 3 deletions scripts/prepare-chroot-base
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ else
fi

DNF=dnf
DNF_OPTS+=(--releasever "$DIST_VER" --installroot="${INSTALL_DIR}" "--downloaddir=$DOWNLOAD_DIR" --downloadonly)
# Delta RPMs and zchunk are unnecessary attack surface
DNF_SEC_OPTS=(--setopt=deltarpm=False --setopt=deltarpm_percentage=0 --setopt=zchunk=0)
DNF_OPTS+=(--releasever "$DIST_VER" --installroot="${INSTALL_DIR}" "--downloaddir=$DOWNLOAD_DIR" --downloadonly "${DNF_SEC_OPTS[@]}")

# Ensure INSTALL_DIR exists
mkdir -p "$INSTALL_DIR"
Expand All @@ -61,8 +63,6 @@ if ! [ -f "${INSTALL_DIR}/tmp/.prepared_base" ]; then
echo "INFO: Initializing RPM database..."
# We want signature checks.
RPM_OPTS=('--define=_pkgverify_level all' '--define=_pkgverify_flags 0x0')
# Delta RPMs and zchunk are unnecessary attack surface
DNF_OPTS+=(--setopt=deltarpm=False --setopt=deltarpm_percentage=0 --setopt=zchunk=0)
if [ "$(getenforce || :)" = Enforcing ]; then
dbpath=$(rpm --eval '%{_dbpath}')
mkdir -p "${INSTALL_DIR}${dbpath}"
Expand Down
6 changes: 5 additions & 1 deletion template_rpm/distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ if [ -z "${DIST_VER}" ]; then
error "Please provide DIST_VER in environment."
fi

DNF_OPTS=(-y --releasever "${DIST_VER}")
DNF_OPTS=(-y
"--releasever=${DIST_VER}"
--setopt=deltarpm=False
--setopt=zchunk=False
--setopt=gpgcheck=1)

if [ -n "${REPO_PROXY}" ]; then
DNF_OPTS+=("--setopt=proxy=${REPO_PROXY}")
Expand Down