Skip to content

Add opensuse support#530

Open
alexispurslane wants to merge 2 commits intosystem76:masterfrom
alexispurslane:master
Open

Add opensuse support#530
alexispurslane wants to merge 2 commits intosystem76:masterfrom
alexispurslane:master

Conversation

@alexispurslane
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Author

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.

Comment thread scripts/install-deps.sh Outdated
systemd-devel \
zlib-devel \
python3 \
git-lfs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort deps

Comment thread scripts/install-rust.sh Outdated
Comment on lines +17 to +19
if [[ "$ID" =~ "opensuse" ]] || [[ "$ID_LIKE" =~ "opensuse" ]]; then
sudo zypper up rustup
else
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is expected that rustup is installed from https://rustup.rs/, not by a distro package.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should it do if rustup has been installed via a distro package?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case can actually just be removed. It was initially done to ensure users had a version of rustup new enough to support TOML-based toolchain files. I've done it in #531 to preserve the context.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood!

@crawfxrd
Copy link
Copy Markdown
Member

crawfxrd commented Mar 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants