From 4a36b8753adfe14a3af926485f9cf0eacddad01e Mon Sep 17 00:00:00 2001 From: Alexis Purslane Date: Tue, 5 Mar 2024 08:10:10 -0500 Subject: [PATCH 1/2] Add opensuse support --- scripts/coreboot-sdk.sh | 14 ++++++++++++++ scripts/install-deps.sh | 18 ++++++++++++++++++ scripts/install-rust.sh | 8 +++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/scripts/coreboot-sdk.sh b/scripts/coreboot-sdk.sh index 4dbed5ee..06c86e1e 100755 --- a/scripts/coreboot-sdk.sh +++ b/scripts/coreboot-sdk.sh @@ -39,6 +39,20 @@ elif [ "$ID" = "fedora" ] || [[ "$ID_LIKE" =~ "fedora" ]]; then tar \ xz \ zlib-devel +elif [[ "$ID" =~ "opensuse" ]] || [[ "ID_LIKE" =~ "opensuse" ]]; then + sudo zypper in -y \ + bzip2 \ + ca-certificates \ + flex \ + gcc \ + gcc-c++ \ + gcc-ada \ + make \ + mozilla-nss-devel \ + patch \ + tar \ + xz \ + zlib-devel elif [ "$ID" = "ubuntu" ] || [[ "$ID_LIKE" =~ "debian" ]]; then sudo apt-get --quiet update sudo apt-get --quiet install --no-install-recommends --assume-yes \ diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index e1b3f081..c7996374 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -53,6 +53,24 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then python3 \ systemd-devel \ zlib-devel +elif [[ "${ID}" =~ "opensuse" ]] || [[ "${ID_LIKE}" =~ "opensuse" ]]; then + sudo zypper in -t pattern devel_C_C++ + sudo zypper in \ + -y \ + ccache \ + cmake \ + curl \ + dosfstools \ + flashrom \ + libuuid-devel \ + mtools \ + ncurses-devel \ + parted \ + patch \ + systemd-devel \ + zlib-devel \ + python3 \ + git-lfs elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then sudo pacman -S \ --noconfirm \ diff --git a/scripts/install-rust.sh b/scripts/install-rust.sh index 69e49fee..6e91beec 100755 --- a/scripts/install-rust.sh +++ b/scripts/install-rust.sh @@ -8,11 +8,17 @@ set -Ee +. /etc/os-release + RUSTUP_NEW_INSTALL=0 # NOTE: rustup is used to allow multiple toolchain installations. if command -v rustup >/dev/null 2>&1; then - rustup self update + if [[ "$ID" =~ "opensuse" ]] || [[ "$ID_LIKE" =~ "opensuse" ]]; then + sudo zypper up rustup + else + rustup self update + fi else RUSTUP_NEW_INSTALL=1 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ From 4cfc576fc4e9853bece4ff528e27abf3e9011ba5 Mon Sep 17 00:00:00 2001 From: Alexis Purslane Date: Tue, 5 Mar 2024 11:40:25 -0500 Subject: [PATCH 2/2] fix some missing things, update according to review --- scripts/install-deps.sh | 9 ++++++--- scripts/install-rust.sh | 8 +------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index c7996374..7860fbe5 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -62,15 +62,18 @@ elif [[ "${ID}" =~ "opensuse" ]] || [[ "${ID_LIKE}" =~ "opensuse" ]]; then curl \ dosfstools \ flashrom \ + git-lfs \ + libopenssl-devel \ libuuid-devel \ mtools \ ncurses-devel \ parted \ patch \ - systemd-devel \ - zlib-devel \ python3 \ - git-lfs + systemd-devel \ + zlib-devel + # There is no python-unversioned package for openSUSE, so we have to do this + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then sudo pacman -S \ --noconfirm \ diff --git a/scripts/install-rust.sh b/scripts/install-rust.sh index 6e91beec..f1934052 100755 --- a/scripts/install-rust.sh +++ b/scripts/install-rust.sh @@ -8,17 +8,11 @@ set -Ee -. /etc/os-release - RUSTUP_NEW_INSTALL=0 # NOTE: rustup is used to allow multiple toolchain installations. if command -v rustup >/dev/null 2>&1; then - if [[ "$ID" =~ "opensuse" ]] || [[ "$ID_LIKE" =~ "opensuse" ]]; then - sudo zypper up rustup - else - rustup self update - fi + rustup self update else RUSTUP_NEW_INSTALL=1 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \