system76 / firmware-open

System76 Open Firmware
Other
944 stars 84 forks source link

Add opensuse support #530

Open alexispurslane opened 4 months ago

alexispurslane commented 4 months ago

Adds opensuse support in the build scripts. I should've just done the build in a distrobox, but I forgot, and ended up just adding support, so I figured I might as well share :)

Here's the necessary patch to ec for its script, too (github won't allow me to attach the patch file):

From ff99cdae2795fa7c655ceb230eabbd79dcecfedf Mon Sep 17 00:00:00 2001
From: Alexis Purslane <alexispurslane@pm.me>
Date: Tue, 5 Mar 2024 08:15:05 -0500
Subject: [PATCH] Add opensuse support

---
 scripts/deps.sh | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/scripts/deps.sh b/scripts/deps.sh
index 43cba75..914f95d 100755
--- a/scripts/deps.sh
+++ b/scripts/deps.sh
@@ -31,6 +31,20 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
         sdcc \
         shellcheck \
         xxd
+elif [[ "${ID}" =~ "opensuse" ]] || [[ "${ID_LIKE}" =~ "opensuse" ]]; then
+    sudo zypper in \
+        -y \
+        cross-avr-gcc13 \
+        avr-libc \
+        avrdude \
+        clang-tools \
+        curl \
+        gcc \
+        make \
+        sdcc \
+        ShellCheck \
+        systemd-devel \
+        vim
 elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
     sudo dnf install \
         --assumeyes \
@@ -75,7 +89,11 @@ make git-config
 RUSTUP_NEW_INSTALL=0
 if which rustup &> /dev/null; then
     msg "Updating rustup"
-    rustup self update
+    if [[ "$ID" =~ "opensuse" ]] || [[ "$ID_LIKE" =~ "opensuse" ]]; then
+      sudo zypper up rustup
+    else
+      rustup self update
+    fi
 else
     RUSTUP_NEW_INSTALL=1
     msg "Installing Rust"
-- 
2.44.0
alexispurslane commented 4 months ago

You also need to install libopenssl-devel for the final build script to run, but I'm not sure which script to put that in.

crawfxrd commented 4 months ago

You also need to install libopenssl-devel for the final build script to run, but I'm not sure which script to put that in.

That should go in the firmware-open install-deps.sh as it's needed by edk2.