diff --git a/README-fork.md b/README-fork.md new file mode 100644 index 0000000..89ab967 --- /dev/null +++ b/README-fork.md @@ -0,0 +1,20 @@ +Android-Udev-Rules +================== + +Develop with your Android devices on Linux. + +************************************************* +This is a fork of the original repo hosted at http://github.com/apotheos/Android-Udev-Rules. It extends the use of the original script, which is aimed at Ubuntu, to Fedora and, perhaps, other `systemd`-based Linux distributions. + +The shell-script within the repo is intended to be run as *root #:* so that the *udev rules* file can be copied to the *udev system config* directory--i.e. **/etc/udev/rules.d/** + +The customizations I've made to the script are intended as a workaround for systems with **SystemD** installed. I've commented out the line for *chkconfig*, as an attempt to restart `udev` was not properly handled on Fedora20 PCs. + +Aside from that, and perhaps more importantly, I've also included a line to the *shell-script* to add a new group **plugdev** to the system, since the *udev-rules* file refers to it as the assigned user group. + +Please Note: +------------------ +The user will still need to be added to the *plugdev* group manually as so: +`gpasswd -a username plugdev` + +I'll look into adding this functionality to the script itself, though I'm not sure whether or not it'd be wise to do so. Feel free to share any thoughts/comments on the matter. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0c527e9 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +Android-Udev-Rules +================== + +Develop with your Android devices on Linux. + +************************************************* +The `install.sh` script is written to facilitate the installation of the necessary `udev` rules in order to interface with android devices over the USB port. It is intended to be run as `root #` so that the *51-android.rules* file can be copied to the system's configuration directory--e.g. `/etc/udev/rules.d/` + +In addition to the original script there's the `installOnFedora.sh` as a workaround for systems with **SystemD** installed. I've commented out the line for *chkconfig*, as an attempt to restart `udev` was not properly handled on Fedora20 PCs. Furthermore, this additional script also includes a line that adds a new group **plugdev** to the system; since the *udev-rules* file refers to the **plugdev** group as the assigned user group, the admin will need to add designated users to it before they can interact with the android devices using `adb`, etc. + +Please Note: +------------------ +The user will still need to be added to the *plugdev* group manually as so: +`gpasswd -a username plugdev` + +I'll look into adding this functionality to the script itself, though I'm not sure whether or not it'd be wise to do so. Feel free to share any thoughts/comments on the matter. diff --git a/installOnFedora.sh b/installOnFedora.sh new file mode 100755 index 0000000..e7c8fef --- /dev/null +++ b/installOnFedora.sh @@ -0,0 +1,26 @@ +ROOT_UID=0 +UDEV_RULES_DIR="/etc/udev/rules.d" +ANDROID_RULES_FILE="51-android.rules" + +if [ "$(id -u)" != $ROOT_UID ]; then + echo "Script requires root to complete install." + exit 1 +fi + +echo "Unplug all android devices, then hit ENTER." +read IGNORE + +cp $ANDROID_RULES_FILE $UDEV_RULES_DIR + +#chmod a+r $UDEV_RULES_DIR/$ANDROID_RULES_FILE +chmod 0644 $UDEV_RULES_DIR/$ANDROID_RULES_FILE -cR + +groupadd plugdev + +# Uncomment the following line for machines with **SysV init system** +#service udev restart > /dev/null + +# Reload *udev* service files on **systemd** machines +systemctl restart systemd-udevd.service > /dev/null + +echo "UDEV rules installed. Restart adb and connect Android devices."