From 53814b26bc69f2eb5b86643d0aaf4b6d0c5f7037 Mon Sep 17 00:00:00 2001 From: nan mu Date: Thu, 12 Sep 2024 14:38:22 +0800 Subject: [PATCH 1/2] Fix #119 Signed-off-by: nan mu --- install.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.bash b/install.bash index 7a3e595..21602b1 100755 --- a/install.bash +++ b/install.bash @@ -38,7 +38,12 @@ elif ! dpkg -s 'gcc' 'meson' 'libc6-dev' &> /dev/null; then fi UBUNTU_VERSION="$(grep -o '^VERSION_ID=.*$' /etc/os-release | cut -d'=' -f2 | tr -d '"')" -if [[ $OS == "ubuntu" ]] && [[ $(bc -l <<< "$UBUNTU_VERSION >= 21.10") -eq 1 ]]; then +if [[ $OS == "ubuntu" ]] && [[ $(bc -l <<< "$UBUNTU_VERSION >= 23.10") -eq 1 ]]; then + echo "Installing zram module package for Ubuntu (linux-modules)" + if ! dpkg -s linux-modules-$(uname -a | awk '{print $3}') &> /dev/null; then + apt-get install --yes dpkg -s linux-modules-$(uname -a | awk '{print $3}') || exit 1 + fi +elif [[ $OS == "ubuntu" ]] && [[ $(bc -l <<< "$UBUNTU_VERSION >= 21.10") -eq 1 ]]; then echo "Installing zram module package for Ubuntu (linux-modules-extra-raspi)" if ! dpkg -s 'linux-modules-extra-raspi' &> /dev/null; then apt-get install --yes linux-modules-extra-raspi || exit 1 From bd65fc7e0864620a8cdd532b30aa9e8a4015f3fd Mon Sep 17 00:00:00 2001 From: nan mu Date: Thu, 12 Sep 2024 14:48:14 +0800 Subject: [PATCH 2/2] Fix ShellCheck hint Signed-off-by: nan mu --- install.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.bash b/install.bash index 21602b1..4bd00aa 100755 --- a/install.bash +++ b/install.bash @@ -40,8 +40,8 @@ fi UBUNTU_VERSION="$(grep -o '^VERSION_ID=.*$' /etc/os-release | cut -d'=' -f2 | tr -d '"')" if [[ $OS == "ubuntu" ]] && [[ $(bc -l <<< "$UBUNTU_VERSION >= 23.10") -eq 1 ]]; then echo "Installing zram module package for Ubuntu (linux-modules)" - if ! dpkg -s linux-modules-$(uname -a | awk '{print $3}') &> /dev/null; then - apt-get install --yes dpkg -s linux-modules-$(uname -a | awk '{print $3}') || exit 1 + if ! dpkg -s "linux-modules-$(uname -a | awk '{print $3}')" &> /dev/null; then + apt-get install --yes "linux-modules-$(uname -a | awk '{print $3}')" || exit 1 fi elif [[ $OS == "ubuntu" ]] && [[ $(bc -l <<< "$UBUNTU_VERSION >= 21.10") -eq 1 ]]; then echo "Installing zram module package for Ubuntu (linux-modules-extra-raspi)"