-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some wifi-firmwares will be split into sub-packages in fedora 40 We will keep them in until fedora 41, but display a warning message in the console if NetworkManager-wifi is layered without the most popular the wifi firmwares. See coreos/fedora-coreos-tracker#1575
1 parent
0566985
commit 5144dc0
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
overlay.d/15fcos/usr/lib/systemd/system/coreos-check-wireless-firmwares.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This service is used for printing a message if | ||
# some wireless firmwares are missing | ||
[Unit] | ||
Description=Check if all the wireless firmwares are installed | ||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/libexec/coreos-check-wireless-firmwares | ||
RemainAfterExit=yes | ||
[Install] | ||
WantedBy=multi-user.target |
45 changes: 45 additions & 0 deletions
45
overlay.d/15fcos/usr/libexec/coreos-check-wireless-firmwares
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/bash | ||
# This script checks if | ||
# and will prints a message to the serial console | ||
# to warn the user about missing wifi firmware messages | ||
# 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 | ||
else | ||
return 0 | ||
fi | ||
|
||
# Change the output color to yellow | ||
warn=$(echo -e '\033[0;33m') | ||
# No color | ||
nc=$(echo -e '\033[0m') | ||
|
||
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. | ||
To layer the missing firmwares use the following : | ||
sudo rpm-ostree install atheros-firmware brcmfmac-firmware \ | ||
mt7xxx-firmware realtek-firmware | ||
Then reboot the system. | ||
To disable this warning, use: | ||
sudo systemctl disable coreos-check-wireless-firmwares.service | ||
########################################################################## | ||
${nc} | ||
EOF |