Skip to content

Commit

Permalink
xpadneo, dkms: Remove DKMS work-around and let DKMS handle the source
Browse files Browse the repository at this point in the history
See-also: atar-axis#323
Signed-off-by: Kai Krakow <kai@kaishome.de>
  • Loading branch information
kakra committed Dec 19, 2024
1 parent 788f004 commit e6837ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
23 changes: 8 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@ if [[ ! -d /sys/devices/virtual/misc/uhid ]]; then

fi

if [[ -z "${INSTALLED[*]}" ]]; then
echo "* creating dkms.conf"
sed 's/"@DO_NOT_CHANGE@"/"'"${VERSION}"'"/g' <hid-xpadneo/dkms.conf.in >hid-xpadneo/dkms.conf

echo "* creating dkms.conf"
sed 's/"@DO_NOT_CHANGE@"/"'"${VERSION}"'"/g' <hid-xpadneo/dkms.conf.in >hid-xpadneo/dkms.conf
echo "* registering module"
dkms add "${V[@]}" "hid-xpadneo" || maybe_already_installed

# TODO: Works around https://github.com/dell/dkms/issues/177 for DKMS 3
echo "* adding hid-xpadneo-${VERSION} folder to /usr/src"
mkdir -p "/usr/src/hid-xpadneo-${VERSION}"
cp --recursive "${V[@]}" hid-xpadneo/. "/usr/src/hid-xpadneo-${VERSION}/."
echo "* building module"
dkms build "${V[@]}" "hid-xpadneo/${VERSION}" || cat_dkms_make_log

echo "* installing module (using DKMS)"
dkms install "${V[*]}" "${FORCE}" "hid-xpadneo/${VERSION}" || cat_dkms_make_log

else

echo "already installed!"

fi
echo "* installing module"
dkms install "${V[@]}" "${FORCE}" "hid-xpadneo/${VERSION}"
6 changes: 6 additions & 0 deletions lib/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@ cat_dkms_make_log() {
exit ${last_error}
}

maybe_already_installed() {
local last_error=$?
>&2 echo "HINT: Try uninstalling xpadneo first"
exit $last_error
}

# shellcheck disable=SC2034
mapfile -t INSTALLED < <(get_dkms_versions_installed)

0 comments on commit e6837ce

Please sign in to comment.