From e68ef1bcccea4d1aa3c5ce84b68f91a440d9a380 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 1 Dec 2023 19:59:11 -0700 Subject: [PATCH] Split out fwupd on Red Hat systems Signed-off-by: Tommy --- Fedora-Workstation-38.sh | 20 ++++++++++-------- RHEL-Server-9.sh | 21 ++++++++++--------- .../fwupd-refresh.service.d/override.conf | 2 ++ 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 etc/systemd/system/fwupd-refresh.service.d/override.conf diff --git a/Fedora-Workstation-38.sh b/Fedora-Workstation-38.sh index 9ce638e..c3f929b 100644 --- a/Fedora-Workstation-38.sh +++ b/Fedora-Workstation-38.sh @@ -98,15 +98,6 @@ echo -e '[zram0]\nzram-fraction = 1\nmax-zram-size = 8192\ncompression-algorithm sudo curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dnf/dnf.conf -o /etc/dnf/dnf.conf sudo sed -i 's/^metalink=.*/&\&protocol=https/g' /etc/yum.repos.d/* -# Update packages and firmware -sudo dnf upgrade -y -echo 'UriSchemes=file;https' | sudo tee -a /etc/fwupd/fwupd.conf -sudo systemctl restart fwupd -sudo fwupdmgr get-devices -sudo fwupdmgr refresh --force -sudo fwupdmgr get-updates -y -sudo fwupdmgr update -y - # Remove unneeded packages sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem \ #Network + hardware tools @@ -175,4 +166,15 @@ if [ "$virt_type" = "" ]; then sudo dracut -f fi +#Setup fwupd +if [ "$virt_type" = "" ]; then + sudo dnf install fwupd -y + echo 'UriSchemes=file;https' | sudo tee -a /etc/fwupd/fwupd.conf + sudo systemctl restart fwupd + mkdir -p /etc/systemd/system/fwupd-refresh.service.d + sudo curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/system/fwupd-refresh.service.d/override.conf -o /etc/systemd/system/fwupd-refresh.service.d/override.conf + sudo systemctl daemon-reload + sudo systemctl enable --now fwupd-refresh.timer +fi + ## The script is done. You can also remove gnome-terminal since gnome-console will replace it. diff --git a/RHEL-Server-9.sh b/RHEL-Server-9.sh index ebd729a..d3784eb 100644 --- a/RHEL-Server-9.sh +++ b/RHEL-Server-9.sh @@ -147,16 +147,6 @@ sudo sed -i 's/test_scan: true/test_scan: false/' /etc/insights-client/malware-d sudo sed -i 's/apply_updates = no/apply_updates = yes\nreboot = when-needed/g' /etc/dnf/automatic.conf sudo systemctl enable --now dnf-automatic.timer -#Setup fwupd -sudo dnf install fwupd -y -echo 'UriSchemes=file;https' | sudo tee -a /etc/fwupd/fwupd.conf -sudo systemctl restart fwupd -mkdir -p /etc/systemd/system/fwupd-refresh.service.d -echo '[Service] -ExecStart=/usr/bin/fwupdmgr update' | tee /etc/systemd/system/fwupd-refresh.service.d/override.conf -sudo systemctl daemon-reload -sudo systemctl enable --now fwupd-refresh.timer - # Enable fstrim.timer sudo systemctl enable --now fstrim.timer @@ -192,4 +182,15 @@ if [ "$virt_type" = "" ]; then sudo dnf config-manager --save --setopt=divested.includepkgs=divested-release,real-ucode,microcode_ctl,amd-ucode-firmware sudo dnf install real-ucode sudo dracut -f +fi + +#Setup fwupd +if [ "$virt_type" = "" ]; then + sudo dnf install fwupd -y + echo 'UriSchemes=file;https' | sudo tee -a /etc/fwupd/fwupd.conf + sudo systemctl restart fwupd + mkdir -p /etc/systemd/system/fwupd-refresh.service.d + sudo curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/system/fwupd-refresh.service.d/override.conf -o /etc/systemd/system/fwupd-refresh.service.d/override.conf + sudo systemctl daemon-reload + sudo systemctl enable --now fwupd-refresh.timer fi \ No newline at end of file diff --git a/etc/systemd/system/fwupd-refresh.service.d/override.conf b/etc/systemd/system/fwupd-refresh.service.d/override.conf new file mode 100644 index 0000000..e2f4943 --- /dev/null +++ b/etc/systemd/system/fwupd-refresh.service.d/override.conf @@ -0,0 +1,2 @@ +[Service] +ExecStart=/usr/bin/fwupdmgr update \ No newline at end of file