Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
comm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
drivers
comm
Commits
18cd771c
Commit
18cd771c
authored
6 years ago
by
Alejandro Lopez Gestoso
Browse files
Options
Downloads
Patches
Plain Diff
Added maintainer scripts to add ftdio udev rule and user to the group dialout
parent
d38bac5b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
scripts/debian/postinst
+42
-0
42 additions, 0 deletions
scripts/debian/postinst
scripts/debian/prerm
+31
-0
31 additions, 0 deletions
scripts/debian/prerm
with
74 additions
and
1 deletion
CMakeLists.txt
+
1
−
1
View file @
18cd771c
...
...
@@ -90,7 +90,7 @@ IF (UNIX)
SET
(
CPACK_DEBIAN_PACKAGE_MAINTAINER
"labrobotica - labrobotica@iri.upc.edu"
)
# Uncomment to add the necessary mantainer scripts
#
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/
package_scripts/preinst;${CMAKE_SOURCE_DIR}/package_scripts/postinst;${CMAKE_SOURCE_DIR}/package_scripts/prerm;${CMAKE_SOURCE_DIR}/package_scripts/post
rm")
SET
(
CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"
${
CMAKE_SOURCE_DIR
}
/
scripts/debian/postinst;
${
CMAKE_SOURCE_DIR
}
/scripts/debian/pre
rm"
)
# Uncomment to add dependencies comma separated
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
...
...
This diff is collapsed.
Click to expand it.
scripts/debian/postinst
0 → 100644
+
42
−
0
View file @
18cd771c
#!/bin/bash
set
-e
case
"
$1
"
in
configure
)
echo
" Addind user to dialout group..."
sudo
usermod
-a
-G
dialout
$SUDO_USER
echo
" Done."
echo
" Adding ftdi udev rule..."
FILE
=
"/etc/udev/rules.d/99-ftdi.rules"
LINE0
=
"#The following line allow the users on dialout to access SUBSYSTEM:VENDOR:PRODUCT=usb|usb_device:0403:6001 devices"
LINE1
=
"SUBSYSTEM==
\"
usb|usb_device
\"
, ATTRS{idVendor}==
\"
0403
\"
, ATTRS{idProduct}==
\"
6001
\"
, GROUP=
\"
dialout
\"
"
sudo touch
$FILE
grep
-qF
--
"
$LINE0
"
"
$FILE
"
||
echo
"
$LINE0
"
|
sudo tee
-a
"
$FILE
"
>
/dev/null
grep
-qF
--
"
$LINE1
"
"
$FILE
"
||
echo
"
$LINE1
"
|
sudo tee
-a
"
$FILE
"
>
/dev/null
sudo
udevadm control
--reload-rules
sudo
service udev restart
echo
" Done. Need to unplug-plug devices for changes to take effect"
;;
abort-upgrade
)
;;
abort-remove
)
;;
abort-deconfigure
)
;;
esac
# usermod -a -G dialout $SUDO_USER
# echo "SUBSYSTEM==\"usb|usb_device\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6001\", GROUP=\"dialout\"" > /etc/udev/rules.d/99-ftdi.rules
# udevadm control --reload-rules
# service udev restart
exit
0
This diff is collapsed.
Click to expand it.
scripts/debian/prerm
0 → 100644
+
31
−
0
View file @
18cd771c
#!/bin/bash
set
-e
case
"
$1
"
in
remove
)
# echo " Removing ftdi udev rule..."
# FILE="/etc/udev/rules.d/99-ftdi.rules"
# sudo sed -i -E "/SUBSYSTEM.*usb.usb_device.*idVendor.*0403.*idProduct.*6001.*GROUP.*dialout\"/d" $FILE
# sudo sed -i -E "/#The following line allow the users on dialout to access SUBSYSTEM:VENDOR:PRODUCT=usb|usb_device:0403:6001 devices/d" $FILE
# sudo udevadm control --reload-rules
# sudo service udev restart
# echo " Done. Need to unplug-plug devices for changes to take effect"
echo
"---=== WARNING: The user continues on the dialout group. Remove it if necessary. ===---"
echo
"---=== WARNING: The ftdi udev rule wasn't removed from 99-ftdi.rules. Remove it if necessary. ===---"
;;
upgrade
)
;;
deconfigure
)
;;
failed-upgrade
)
;;
esac
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment