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

Add options for security, all or no patches during build #51

Open
wants to merge 3 commits 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
14 changes: 13 additions & 1 deletion scripts/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ RELEASE=$(source /etc/os-release; echo $ID)
# manager.
PKGMGR="${PKGMGR:-}"
PKGMGR_OPTS="${PKGMGR_OPTS:-}"
PKGMGR_UPDATE="${PKGMGR_UPDATE:-}"

# Install dnf because we need it for security patches only when defined
if [[ $PKGMGR_UPDATE == 'security' && -f "/usr/bin/microdnf" ]]; then
/usr/bin/microdnf install dnf -y $PKGMGR_OPTS
fi
if [ -z $PKGMGR ]; then
# Expect dnf to be installed, however if we find microdnf default to it.
PKGMGR=/usr/bin/dnf
Expand All @@ -49,7 +54,14 @@ mkdir -p /tmp/src

cd /tmp/src

$PKGMGR update -y $PKGMGR_OPTS
# run all, security or none for package update
if [ $PKGMGR_UPDATE == 'all' ]; then
$PKGMGR update -y $PKGMGR_OPTS
elif [ $PKGMGR_UPDATE == 'security' ]; then
$PKGMGR update -y $PKGMGR_OPTS --security
elif [ $PKGMGR_UPDATE == 'none' ]; then
echo "Skipping dnf update(s) as defined: ${PKGMGR_UPDATE}"
fi

function install_bindep {
# Protect from the bindep builder image use of the assemble script
Expand Down
19 changes: 16 additions & 3 deletions scripts/install-from-bindep
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ set -ex
# manager.
PKGMGR="${PKGMGR:-}"
PKGMGR_OPTS="${PKGMGR_OPTS:-}"
PKGMGR_UPDATE="${PKGMGR_UPDATE:-}"

# Install dnf because we need it for security patches only when defined
if [[ $PKGMGR_UPDATE == 'security' && -f "/usr/bin/microdnf" ]]; then
/usr/bin/microdnf install dnf -y $PKGMGR_OPTS
fi
if [ -z $PKGMGR ]; then
# Expect dnf to be installed, however if we find microdnf default to it.
PKGMGR=/usr/bin/dnf
if [ -f "/usr/bin/microdnf" ]; then
if [[ $PKGMGR_UPDATE == 'security' && -f "/usr/bin/dnf" ]]; then
PKGMGR=/usr/bin/dnf
elif [[ $PKGMGR_UPDATE != 'security' && -f "/usr/bin/microdnf" ]]; then
PKGMGR=/usr/bin/microdnf
if [ -z "${PKGMGR_OPTS}" ]; then
# NOTE(pabelanger): skip install docs and weak dependencies to
Expand All @@ -34,7 +40,14 @@ if [ -z $PKGMGR ]; then
fi
fi

$PKGMGR update -y $PKGMGR_OPTS
# run all, security or none for package update
if [ $PKGMGR_UPDATE == 'all' ]; then
$PKGMGR update -y $PKGMGR_OPTS
elif [ $PKGMGR_UPDATE == 'security' ]; then
$PKGMGR update -y $PKGMGR_OPTS --security
elif [ $PKGMGR_UPDATE == 'none' ]; then
echo "Skipping dnf update(s) as defined: ${PKGMGR_UPDATE}"
fi

if [ -f /output/bindep/run.txt ] ; then
PACKAGES=$(cat /output/bindep/run.txt)
Expand Down