Skip to content

Commit

Permalink
Drop support for package_errors.log + EXIT_ON_MISSING_PACKAGES
Browse files Browse the repository at this point in the history
This was unreliable already within FAI, esp. when aborting and rerunning
a build.

Now with the switch from FAI to our minifai, we no longer support
EXIT_ON_MISSING_PACKAGES. Minifai operates per class and aborts on any
package installation that fails. There's no point in generating
package_errors.log and TEST-MissingPackages.xml (meant for inclusion in
e.g. Jenkins jobs), so drop config/scripts/GRMLBASE/01-packages overall,
and related code from grml-live and setting in etc/grml/grml-live.conf.
  • Loading branch information
mika committed Jan 30, 2025
1 parent 8c08217 commit 9c6d089
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 139 deletions.
55 changes: 0 additions & 55 deletions config/scripts/GRMLBASE/01-packages

This file was deleted.

5 changes: 0 additions & 5 deletions etc/grml/grml-live.conf
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@
# the mksquashfs option -ef:
# SQUASHFS_EXCLUDES_FILE="${GRML_FAI_CONFIG}/grml/squashfs-excludes"

# Do you want to exit grml-live if some packages were requested for installation
# on fresh installs but are missing on the generated ISO finally?
# By default the package list is sent to stdout but grml-live doesn't interrupt.
# EXIT_ON_MISSING_PACKAGES=1

# Do you want to use a special string for identifying the ISO?
# By default the grml-name and version string are used as a base for generating
# /conf/bootid.txt on the ISO. If you want to use a different value feel free to
Expand Down
79 changes: 0 additions & 79 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -755,85 +755,6 @@ else
fi # BUILD_DIRTY?
# }}}

# package validator {{{
CHECKLOG="$LOG_OUTPUT"/fai/
if [ -r "$CHECKLOG/dpkg.selections" ] ; then
package_count=$(wc -l "$CHECKLOG/dpkg.selections" | awk '{print $1}')
else
package_count="unknown"
fi

mkdir -p "$REPORTS"
REPORT_MISSING_PACKAGES="${REPORTS}/TEST-MissingPackages.xml"

# check for missing packages
if ! [ -s "$CHECKLOG/package_errors.log" ] ; then
einfo "No missing packages found, generating empty junit report."

cat > "${REPORT_MISSING_PACKAGES}" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="grml-live-missing-packages" tests="${package_count}" time="1" failures="0" errors="0" skipped="0" assertions="0">
<testcase name="test_missing_packages" time="0" assertions="0">
</testcase>
<system-out>
</system-out>
<system-err>
</system-err>
</testsuite>
EOF
eend 0
else
einfo "Missing packages found, generating junit report."

if [ -r "$CHECKLOG/package_errors.log" ] ; then
package_errors=$(wc -l "$CHECKLOG/package_errors.log" | awk '{print $1}')
else
package_errors="unknown"
fi

mkdir -p "$REPORTS"
REPORT_MISSING_PACKAGES="${REPORTS}/TEST-MissingPackages.xml"

cat > "${REPORT_MISSING_PACKAGES}" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="grml-live-missing-packages" tests="${package_count}" time="1" failures="${package_errors}" errors="${package_errors}" skipped="0" assertions="0">
EOF

# shellcheck disable=SC2013 # We expect each line to be a single word.
for package in $(awk '{print $1}' "${CHECKLOG}/package_errors.log" | sed 's;/;\\/;') ; do
failure_reason="$(awk "/$package/ {print \$2}" "${CHECKLOG}/package_errors.log")"
cat >> "${REPORT_MISSING_PACKAGES}" << EOF
<testcase name="test_missing_packages_${package}" time="0" assertions="0">
<failure type="${failure_reason}" message="Package ${package} is missing">
Package $package is missing in chroot (${failure_reason})
</failure>
</testcase>
EOF
done

cat >> "${REPORT_MISSING_PACKAGES}" << EOF
<system-out>
</system-out>
<system-err>
</system-err>
</testsuite>
EOF
eend 0

if [ -n "$EXIT_ON_MISSING_PACKAGES" ] && [ -z "$BUILD_DIRTY" ] ; then
eerror "The following packages were requested for installation but could not be processed:"
cat "$CHECKLOG/package_errors.log"
eerror "... exiting as requested via \$EXIT_ON_MISSING_PACKAGES."
eend 1
bailout 13
else
ewarn "The following packages were requested for installation but could not be processed:"
cat "$CHECKLOG/package_errors.log"
eend 0
fi
fi
# }}}

# grub boot {{{
grub_setup() {
EFI_IMG="/boot/efi.img"
Expand Down

0 comments on commit 9c6d089

Please sign in to comment.