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 <[email protected]>
  • Loading branch information
kakra committed Dec 18, 2024
1 parent 227c101 commit d537c76
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
25 changes: 9 additions & 16 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,16 @@ if [[ ! -d /sys/devices/virtual/misc/uhid ]]; then

fi

if [[ -z "${INSTALLED[*]}" ]]; then
set -e

set -e
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 @@ -48,5 +48,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)
1 change: 1 addition & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ echo "found ${#INSTALLED[@]} registered instance(s) on your system"

set -e

# NOTE: overrides VERSION from lib/installer.sh but we don't need it
for VERSION in "${INSTALLED[@]}"; do
echo "* ${VERSION}"

Expand Down

0 comments on commit d537c76

Please sign in to comment.