Discussion:
[yocto] [meta-raspberrypi]
Markus W
2018-11-05 21:10:00 UTC
Permalink
Hi!

I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I can´t figure out how to do that.

I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.

Not sure why this is not working. Any suggestions?

90-interfaces.rules file:

SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"

SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

Regards,
Markus
--
Markus W
2018-11-06 04:56:42 UTC
Permalink
Hi!

I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I can´t figure out how to do that.

I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.

Not sure why this is not working. Any suggestions?

90-interfaces.rules file:

SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"

SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

Regards,
Markus
--
Outback Dingo
2018-11-06 13:05:56 UTC
Permalink
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I can´t figure out how to do that.
I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
--
Markus W
2018-11-07 09:44:01 UTC
Permalink
I have resolved this issue. My problem was that in my layer I have a
recipe-core and within that I had the following structure
udev/udev-extra-rules and udev-extra-rules.bb file and a files dir on
the same level.

By renaming udev/udev-extra-rules to my-udev/my-udev-extra-rules it
suddenly worked.

Regards,
Markus
Post by Outback Dingo
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I can´t figure out how to do that.
I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
--
Outback Dingo
2018-11-07 09:53:17 UTC
Permalink
Post by Markus W
I have resolved this issue. My problem was that in my layer I have a
recipe-core and within that I had the following structure
udev/udev-extra-rules and udev-extra-rules.bb file and a files dir on
the same level.
By renaming udev/udev-extra-rules to my-udev/my-udev-extra-rules it
suddenly worked.
Cool
Regards,
Markus
Post by Outback Dingo
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I canÂŽt figure out how to do that.
I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
Markus W
2018-11-07 11:46:56 UTC
Permalink
This my bb file and than I have added the following to local.conf
IMAGE_INSTALL_append = " my-rules ...".

SUMMARY = "My rules"
LICENSE = "CLOSED"
PR = "r1"

SRC_URI = "file://90-interfaces.rules"

do_install[nostamp] = "1"
do_unpack[nostamp] = "1"

do_install () {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0666 ${WORKDIR}/90-interfaces.rules
${D}/etc/udev/rules.d/90-interfaces.rules

}

FILES_${PN} += " /etc/udev/rules.d/90-interfaces.rules"

PACKAGES = "${PN}"
PROVIDES = "my-rules"

Hope this helps

/Markus
so curious, as im trying to add 2 udev rules also that i require in my
build, so how was your recipe configured?
mine keeps telling me i have a conflict between packages as they both
install files to the same name and same place
Post by Markus W
I have resolved this issue. My problem was that in my layer I have a
recipe-core and within that I had the following structure
udev/udev-extra-rules and udev-extra-rules.bb file and a files dir on
the same level.
By renaming udev/udev-extra-rules to my-udev/my-udev-extra-rules it
suddenly worked.
Cool
Regards,
Markus
Post by Outback Dingo
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below
from
Post by Markus W
Post by Outback Dingo
Post by Markus W
within my own recipe. I canÂŽt figure out how to do that.
I have tried to add those rules as separate rules file in a recipe
in
Post by Markus W
Post by Outback Dingo
Post by Markus W
my own layer. After the build I can see that the rules file is in
the
Post by Markus W
Post by Outback Dingo
Post by Markus W
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r
i2c;
Post by Markus W
Post by Outback Dingo
Post by Markus W
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
Outback Dingo
2018-11-07 11:58:58 UTC
Permalink
couldnt this have been a udev_append.bb

instead of writing your own my-rules
This my bb file and than I have added the following to local.conf IMAGE_INSTALL_append = " my-rules ...".
SUMMARY = "My rules"
LICENSE = "CLOSED"
PR = "r1"
SRC_URI = "file://90-interfaces.rules"
do_install[nostamp] = "1"
do_unpack[nostamp] = "1"
do_install () {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0666 ${WORKDIR}/90-interfaces.rules ${D}/etc/udev/rules.d/90-interfaces.rules
}
FILES_${PN} += " /etc/udev/rules.d/90-interfaces.rules"
PACKAGES = "${PN}"
PROVIDES = "my-rules"
Hope this helps
/Markus
so curious, as im trying to add 2 udev rules also that i require in my
build, so how was your recipe configured?
mine keeps telling me i have a conflict between packages as they both
install files to the same name and same place
Post by Markus W
I have resolved this issue. My problem was that in my layer I have a
recipe-core and within that I had the following structure
udev/udev-extra-rules and udev-extra-rules.bb file and a files dir on
the same level.
By renaming udev/udev-extra-rules to my-udev/my-udev-extra-rules it
suddenly worked.
Cool
Regards,
Markus
Post by Outback Dingo
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules below from
within my own recipe. I can´t figure out how to do that.
I have tried to add those rules as separate rules file in a recipe in
my own layer. After the build I can see that the rules file is in the
correct directory /etc/udev/rules.d (next to 99-com.rules) but the
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r i2c;
-r gpio") in a different layer with a higher priority than the layer
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
--
Markus W
2018-11-07 13:20:40 UTC
Permalink
Probably, I'm learning ;-)
Post by Outback Dingo
couldnt this have been a udev_append.bb
instead of writing your own my-rules
Post by Markus W
This my bb file and than I have added the following to local.conf
IMAGE_INSTALL_append = " my-rules ...".
Post by Markus W
SUMMARY = "My rules"
LICENSE = "CLOSED"
PR = "r1"
SRC_URI = "file://90-interfaces.rules"
do_install[nostamp] = "1"
do_unpack[nostamp] = "1"
do_install () {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0666 ${WORKDIR}/90-interfaces.rules
${D}/etc/udev/rules.d/90-interfaces.rules
Post by Markus W
}
FILES_${PN} += " /etc/udev/rules.d/90-interfaces.rules"
PACKAGES = "${PN}"
PROVIDES = "my-rules"
Hope this helps
/Markus
so curious, as im trying to add 2 udev rules also that i require in my
build, so how was your recipe configured?
mine keeps telling me i have a conflict between packages as they both
install files to the same name and same place
Post by Markus W
I have resolved this issue. My problem was that in my layer I have a
recipe-core and within that I had the following structure
udev/udev-extra-rules and udev-extra-rules.bb file and a files dir
on
Post by Markus W
Post by Markus W
the same level.
By renaming udev/udev-extra-rules to my-udev/my-udev-extra-rules it
suddenly worked.
Cool
Regards,
Markus
Post by Outback Dingo
Post by Markus W
Hi!
I want to append the rules in the
recipe-core/udev/udev-rules-rpi/99-com.rules with the rules
below from
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
within my own recipe. I canÂŽt figure out how to do that.
I have tried to add those rules as separate rules file in a
recipe in
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
my own layer. After the build I can see that the rules file is
in the
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
correct directory /etc/udev/rules.d (next to 99-com.rules) but
the
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
rules didn't get applied. The groups below I have created by
inheriting the useradd class (GROUPADD_PARAM_${PN} = "-r spi; -r
i2c;
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
-r gpio") in a different layer with a higher priority than the
layer
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
with the rules recipe.
Not sure why this is not working. Any suggestions?
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770
/sys/class/gpio;\
Post by Markus W
Post by Markus W
Post by Outback Dingo
Post by Markus W
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770
/sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
might help to post the recipe used.....
Post by Markus W
Regards,
Markus
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
Loading...