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

fix: fix error in udev-fix.sh #228

Merged
merged 1 commit into from
May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions patches/udev-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ set -eo pipefail
### Variables
DEBIAN_FRONTEND="noninteractive"
TITLE="\e[31mMainsailOS Patcher\e[0m - udev rule fix"
UDEV_PKG_VERSION="$(dpkg-query -s udev | grep "Version" | sed 's/Version\: //')"
UDEV_FIX_RAW_RULE_FILE="https://raw.githubusercontent.com/systemd/systemd/main/rules.d/60-serial.rules"
UDEV_FIX_TMP_FILE="/tmp/60-serial.rules"
UDEV_FIX_OUTPUT_FILE="/etc/udev/rules.d/60-serial.rules"
Expand Down Expand Up @@ -74,14 +73,17 @@ print_footer(){
# Patch Funcs

patch_udev(){
if [[ -n "${UDEV_PKG_VERSION}" ]] && [[ "${UDEV_PKG_VERSION}" =~ "deb11u2" ]]; then
echo_red "'udev' version: ${UDEV_PKG_VERSION}, is affected by bug ..."
local udev_pkg_version
udev_pkg_version="$(dpkg-query -s udev | grep "Version" | sed 's/Version\: //')"

if [[ -n "${udev_pkg_version}" ]] && [[ "${udev_pkg_version}" =~ "deb11u2" ]]; then
echo_red "'udev' version: ${udev_pkg_version}, is affected by bug ..."
echo_green "Install patched udev rule from systemd git repository ..."
curl -sSL "${UDEV_FIX_RAW_RULE_FILE}" > "${UDEV_FIX_TMP_FILE}"
sudo cp "${UDEV_FIX_TMP_FILE}" "${UDEV_FIX_OUTPUT_FILE}"
rm -f "${UDEV_FIX_TMP_FILE}"
else
echo_green "'udev' version: ${UDEV_PKG_VERSION}, is NOT affected by bug ... [SKIPPED]"
echo_green "'udev' version: ${udev_pkg_version}, is NOT affected by bug ... [SKIPPED]"
fi
}

Expand Down