Skip to content

Commit

Permalink
pull firmware list from comp
Browse files Browse the repository at this point in the history
Also link to FQ entry.
see coreos/fedora-coreos-docs#629
  • Loading branch information
jbtrystram committed Apr 22, 2024
1 parent 5144dc0 commit 49febaf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Unit]
Description=Check if cgroupsv1 Is Still Being Used
ConditionControlGroupController=v1
Before=systemd-user-sessions.service
[Service]
Type=oneshot
ExecStart=/usr/libexec/coreos-check-cgroups-version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ConditionKernelCommandLine=ignition.firstboot
Before=systemd-user-sessions.service

[Service]
Before=systemd-user-sessions.service
Type=oneshot
ProtectHome=read-only
ExecStart=/usr/libexec/coreos-check-ssh-keys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# This service is used for printing a message if
# some wireless firmwares are missing
[Unit]
Description=Check if all the wireless firmwares are installed
Description=Check For Wireless Firmware Packages
Before=systemd-user-sessions.service
[Service]
Type=oneshot
ExecStart=/usr/libexec/coreos-check-wireless-firmwares
Expand Down
53 changes: 35 additions & 18 deletions overlay.d/15fcos/usr/libexec/coreos-check-wireless-firmwares
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,37 @@
# and provide remediation steps
# See https://github.com/coreos/fedora-coreos-tracker/issues/1575

layered_packages="$(rpm-ostree status --json -b | jq -r '.deployments[0].packages[]')"

if echo "$layered_packages" | grep -q "NetworkManager-wifi"; then
if echo "$layered_packages" | grep -q "atheros-firmware" && \
echo "$layered_packages" | grep -q "brcmfmac-firmware" && \
echo "$layered_packages" | grep -q "mt7xxx-firmware" && \
echo "$layered_packages" | grep -q "realtek-firmware"
then
return 0
fi
set -euo pipefail

# List of wifi-firmwares
# SOURCE: https://pagure.io/fedora-comps/blob/main/f/comps-f41.xml.in#_2700
firmwares=(
atheros-firmware
b43-fwcutter
b43-openfwwf
brcmfmac-firmware
iwlegacy-firmware
iwlwifi-dvm-firmware
iwlwifi-mvm-firmware
libertas-firmware
mt7xxx-firmware
nxpwireless-firmware
realtek-firmware
tiwilink-firmware
atmel-firmware
bcm283x-firmware
zd1211-firmware
)
regex=$(IFS='|'; echo "${firmwares[*]}")

layered_packages="$(rpm-ostree status --json -b | jq -r '.deployments[0]."requested-packages"[]')"

if grep -q "NetworkManager-wifi" <<< "$layered_packages"; then
if grep -qP $regex <<< "$layered_packages"; then
exit 0
fi
else
return 0
exit 0
fi

# Change the output color to yellow
Expand All @@ -29,14 +48,12 @@ motd_path=/run/motd.d/30_wireless_firmwares_warning.motd
cat << EOF > "${motd_path}"
${warn}
##########################################################################
WARNING: The NetworkManager-wifi is installed on this system.
However, some wifi-firmwares are not installed.
WARNING: The NetworkManager-wifi is a requested layered package on this
system, but no Wi-Fi drivers are requested. The Wi-Fi drivers will no
longer be included by default in the future.
To layer the missing firmwares use the following :
sudo rpm-ostree install atheros-firmware brcmfmac-firmware \
mt7xxx-firmware realtek-firmware
Then reboot the system.
More context and remediation steps are available in the following FAQ entry:
https://docs.fedoraproject.org/en-US/fedora-coreos/wifi/
To disable this warning, use:
sudo systemctl disable coreos-check-wireless-firmwares.service
Expand Down

0 comments on commit 49febaf

Please sign in to comment.