Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opensuse support #530

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

alexispurslane
Copy link

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
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.

systemd-devel \
zlib-devel \
python3 \
git-lfs
Copy link
Member

Choose a reason for hiding this comment

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

sort deps

Comment on lines 17 to 19
if [[ "$ID" =~ "opensuse" ]] || [[ "$ID_LIKE" =~ "opensuse" ]]; then
sudo zypper up rustup
else
Copy link
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
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
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
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
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.

None yet

2 participants