Compare commits

..

3 commits

Author SHA1 Message Date
Fedora Release Engineering
f4104cf281 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-16 03:32:40 +00:00
Thomas Deutschmann
ebb52e0d0a kmodgenca: fallback to US when locale country code is missing rhbz#2416536
Fall back to "US" when `locale country_ab2` returns empty (as seen with
LANG=C), preventing an empty countryName in the generated OpenSSL
config.

Fixes: rhbz#2416536
2026-01-08 10:39:42 +01:00
Mark K
ec65894b43 fix cleanup_cachedir function 2026-01-08 09:02:17 +01:00
2 changed files with 8 additions and 2 deletions

2
akmods
View file

@ -172,7 +172,7 @@ cleanup_cachedir ()
local excluded
excluded=$(find /boot -name 'vmlinuz-*' '!' -name '*rescue*' 2>/dev/null | sed 's/.*vmlinuz-//')
local -a file_list
mapfile -t file_list < <(find /var/cache/akmods -mindepth 3 2>/dev/null | grep -Fv -f <(echo "${excluded}"))
mapfile -t file_list < <(find /var/cache/akmods -mindepth 2 -type f -not -name .last.log 2>/dev/null | grep -Fv -f <(echo "${excluded}"))
for one_file in "${file_list[@]}"; do
if grep -q ".*\.rpm$" <<< "${one_file}" ; then
if ! rpm -q "$(basename "${one_file%.rpm}")" >/dev/null ; then

View file

@ -433,6 +433,12 @@ function create_cacert_config() {
# Set '-batch' argument.
AUTOMATIC_BUILD_OPTION="-batch"
local cert_country_code=$(locale country_ab2)
if [[ -z ${cert_country_code} ]]; then
echo -e "${BOLD_YELLOW_TEXT}WARNING:${CLEAR_TEXT} COULD NOT DETECT COUNTRY CODE FROM LOCALE; USING FALLBACK VALUE: US" >&2
cert_country_code=US
fi
# Utilise default values if 'AUTOMATIC_BUILD' is equal to '1'.
# - Set OpenSSL field values.
# - Comment default and min/max values.
@ -441,7 +447,7 @@ function create_cacert_config() {
-e "s#\(emailAddress *= \).*#\1akmods@${cert_hostname}#" \
-e "s#\(localityName *= \).*#\1None#" \
-e "s#\(stateOrProvinceName *= \).*#\1None#" \
-e "s#\(countryName *= \).*#\1$(locale country_ab2)#" \
-e "s#\(countryName *= \).*#\1${cert_country_code}#" \
-e "s#\(commonName *= \).*#\1${KEYNAME}#" \
-e "s/^[^#]*_default *= /#&/" \
-e "s/^[^#]*_min/#&/" \