etc: rename script more generic.
Signed-off-by: Steve Jeong <how2soft@gmail.com> Change-Id: Ia3cdc818a9156a4aaad346e63efdea6e32ab864b
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
LOCAL_PATH := $(my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := odroid-wpi-pwm.sh
|
||||
LOCAL_MODULE := odroid-allowuser.sh
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
||||
LOCAL_SRC_FILES := etc/$(LOCAL_MODULE)
|
||||
|
||||
2
debian/odroid-wiringpi.postrm
vendored
2
debian/odroid-wiringpi.postrm
vendored
@@ -5,7 +5,7 @@ set -e
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -f /etc/udev/rules.d/99-odroid-wiringpi-*
|
||||
rm -f /etc/odroid-wpi-pwm.sh
|
||||
rm -f /etc/odroid-allowuser.sh
|
||||
rm -f /etc/sudoers.d/odroid-wpi-sudoers
|
||||
;;
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# /etc/odroid-wpi-pwm.sh
|
||||
# /etc/odroid-allowuser.sh
|
||||
# written by Steve Jeong <how2soft@gmail.com>
|
||||
#
|
||||
# allow access pwm sys node (with odroid-wiringpi gpiomem).
|
||||
# udev rules: 99-odroid-wiringpi-pwm.rules
|
||||
# param: "/sys/class/pwm/pwmchip*" default.
|
||||
# allow access sys node (with odroid-wiringpi gpiomem).
|
||||
# udev rules: 99-odroid-wiringpi-*.rules
|
||||
|
||||
cutoff=0
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Allow members of the odroid group change permission of wpi
|
||||
%odroid ALL = (ALL) NOPASSWD: /usr/bin/sh /etc/odroid-wpi-pwm.sh*
|
||||
%odroid ALL = (ALL) NOPASSWD: /usr/bin/sh /etc/odroid-allowuser.sh*
|
||||
|
||||
@@ -1 +1 @@
|
||||
ACTION=="add", KERNEL=="pwmchip*", SUBSYSTEM=="pwm", RUN+="/bin/sh /etc/odroid-wpi-pwm.sh /sys/class/pwm/pwmchip*"
|
||||
ACTION=="add", KERNEL=="pwmchip*", SUBSYSTEM=="pwm", RUN+="/bin/sh /etc/odroid-allowuser.sh /sys/class/pwm/pwmchip*"
|
||||
|
||||
@@ -427,9 +427,9 @@ static int pwmSetup (int pin) {
|
||||
sprintf(pwmPinPath[pwmPin], "%s/pwm%d", sysPwmPath, (pwmPin % 2));
|
||||
strncpy(setupedPwmPinPath[pwmPin], pwmPinPath[pwmPin], (BLOCK_SIZE - 1));
|
||||
#ifdef ANDROID
|
||||
sprintf(cmd, "su -s sh -c %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "su -s sh -c %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#else
|
||||
sprintf(cmd, "sudo sh %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "sudo sh %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#endif
|
||||
inputToSysNode(sysPwmPath, "export", pwmExport);
|
||||
system(cmd);
|
||||
|
||||
@@ -340,9 +340,9 @@ static int pwmSetup (int pin) {
|
||||
sprintf(pwmPinPath[pwmPin], "%s/pwm%d", sysPwmPath, 0);
|
||||
strncpy(setupedPwmPinPath[pwmPin], pwmPinPath[pwmPin], (BLOCK_SIZE - 1));
|
||||
#ifdef ANDROID
|
||||
sprintf(cmd, "su -s sh -c %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "su -s sh -c %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#else
|
||||
sprintf(cmd, "sudo sh %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "sudo sh %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#endif
|
||||
inputToSysNode(sysPwmPath, "export", pwmExport);
|
||||
system(cmd);
|
||||
|
||||
@@ -412,9 +412,9 @@ static int pwmSetup (int pin) {
|
||||
sprintf(pwmPinPath[pwmPin], "%s/pwm%d", sysPwmPath, (pwmPin % 2));
|
||||
strncpy(setupedPwmPinPath[pwmPin], pwmPinPath[pwmPin], (BLOCK_SIZE - 1));
|
||||
#ifdef ANDROID
|
||||
sprintf(cmd, "su -s sh -c %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "su -s sh -c %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#else
|
||||
sprintf(cmd, "sudo sh %s %s", PWM_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
sprintf(cmd, "sudo sh %s %s", SYS_ACCESS_SCRIPT, pwmPinPath[pwmPin]);
|
||||
#endif
|
||||
inputToSysNode(sysPwmPath, "export", pwmExport);
|
||||
system(cmd);
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
// Module names
|
||||
#define AML_MODULE_I2C "aml_i2c"
|
||||
|
||||
// syspwm
|
||||
#define PWM_ACCESS_SCRIPT "/etc/odroid-wpi-pwm.sh"
|
||||
// sysnode
|
||||
#define SYS_ACCESS_SCRIPT "/etc/odroid-allowuser.sh"
|
||||
|
||||
// Threads
|
||||
#define PI_THREAD(X) void *X (UNU void *dummy)
|
||||
|
||||
Reference in New Issue
Block a user