systemd-udevd substitutes variables starting with $ in the PROGRAM argument. If a shell variable is to be used, two $ need to be used to escape properly. This fixes three instances of the following warning: Invalid value "..." for PROGRAM (char 58: invalid substitution type), ignoring, but please fix it.
36 lines
829 B
Plaintext
36 lines
829 B
Plaintext
|
|
KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\
|
|
ALIASES=/proc/device-tree/aliases; \
|
|
if cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \
|
|
echo 0;\
|
|
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \
|
|
echo 1; \
|
|
else \
|
|
exit 1; \
|
|
fi\
|
|
'", SYMLINK+="serial%c"
|
|
|
|
KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\
|
|
ALIASES=/proc/device-tree/aliases; \
|
|
if [ -e /dev/ttyAMA0 ]; then \
|
|
exit 1; \
|
|
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \
|
|
echo 0;\
|
|
elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \
|
|
echo 1; \
|
|
else \
|
|
exit 1; \
|
|
fi\
|
|
'", SYMLINK+="serial%c"
|
|
|
|
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
|
|
ALIASES=/proc/device-tree/aliases; \
|
|
if cmp -s $$ALIASES/uart1 $$ALIASES/serial0; then \
|
|
echo 0; \
|
|
elif cmp -s $$ALIASES/uart1 $$ALIASES/serial1; then \
|
|
echo 1; \
|
|
else \
|
|
exit 1; \
|
|
fi \
|
|
'", SYMLINK+="serial%c"
|