Comments (8)
After comparing the bitbake files to the postinst
script found in the .deb
package, I discovered that the permissions are not set correctly in Yocto. If you have the time, feel free to post me an update ... Here are the commands I had to run:
mkdir -p /home/adu /home/do
chown adu:adu /home/adu
chown do:do /home/do
chmod u=rwx,g=rx /home/adu
chmod u=rwx,g=rx/home/do
chmod u=rwx,g=rx /home/do
chown "root:adu" /usr/lib/adu/adu-shell
chmod u=rxs /usr/lib/adu/adu-shell
setfacl -m "group::---" /usr/lib/adu/adu-shell
setfacl -m "user::r--" /usr/lib/adu/adu-shell
setfacl -m "user:adu:r-x" /usr/lib/adu/adu-shell
from iot-hub-device-update.
Hi @SimonSimCity,
Thank you for raising this issue. We will investigate and add a fix in our code.
from iot-hub-device-update.
I tried to pack those lines mentioned into my recipe, but that complained about not finding setfacl
. As I've tried, it doesn't work if I just set the permission to something different.
I noticed that the script didn't set the group of the file to adu
, but left it as root
. Therefore, I replaced all ${PN}-adu
parameters by ${PN}
- removing the -adu
and removed the EXTRA_USERS_PARAMS
setting from the file meta-azure-device-update/conf/layer.conf
- otherwise the user and group adu
and do
were created too late for the script to use it on install. Before I had a ton of problems because the permissions weren't applied.
Now that the permissions are set correctly, all makes sense again; let me explained:
The update service is running as adu
, so this user should be able to flash the device; but flashing is only permitted by root
. This can be achieved by setting the s
flag for the file. As pointed out at the comment on the question https://unix.stackexchange.com/questions/118853/what-does-the-s-attribute-in-file-permissions-mean#comment186210_118854:
If setuid bit is set, it executes with ITS owner's permissions (usually root's), no matter who calls it.
This also means, that there wasn't a need for changing the permissions - the problem really was, that the users and groups were created too late in the process, so the install script gave the file a group-relation of root
instead of adu
.
from iot-hub-device-update.
I've created a repository to document my changes of the yocto layer. Here's the commit to fix this problem: munit-solutions/meta-azure-device-update@58a74e3
from iot-hub-device-update.
I've created a repository to document my changes of the yocto layer. Here's the commit to fix this problem: SimonSimCity/meta-azure-device-update@58a74e3
@SimonSimCity Hi, thank you for the investigation and contribution! But I cannot access this link (maybe I don't have permission to your fork) - do you mind creating a Pull Request to our repo so I can read/merge it?
from iot-hub-device-update.
I've created a repository to document my changes of the yocto layer. Here's the commit to fix this problem: SimonSimCity/meta-azure-device-update@58a74e3
@SimonSimCity Hi, thank you for the investigation and contribution! But I cannot access this link (maybe I don't have permission to your fork) - do you mind creating a Pull Request to our repo so I can read/merge it?
Okie I found the link from another open issue. munit-solutions/meta-azure-device-update@53a54e7
This is actually out of scope of this iot-hub-device-update repo, so I understand that no PR will be created.
Is your problem resolved with your changes?
from iot-hub-device-update.
@shiyi-peng Sorry for the late answer on this ticket. I've moved the repo to a different organization lately, so that's where the error comes from. Here's the correct link of the referred change: munit-solutions/meta-azure-device-update@58a74e3
If you apply this patch the users should be created by Yocto as expected.
As said, those changes are only related to yocto-scripts, which are not yet in a repository but only provided as an artefact. I've created a repository for the yocto meta-layer, so the community can work on improving the layer for everyone.
from iot-hub-device-update.
Closing this issue as there has been no activity on this thread. Please feel free to open an issue if needed.
Our Yocto layers published in this repo and will be maintained for our releases: https://github.com/Azure/iot-hub-device-update-yocto
from iot-hub-device-update.
Related Issues (20)
- Default Credentials HOT 1
- docs/agent-reference/how-to-build-agent-code.md contains text referencing deleted content HOT 5
- Azure Device Update over IoT Hub for RHEL device. HOT 6
- Replacement workflow not working HOT 8
- JSON parser error with colon symbol HOT 7
- ScriptHandler crashs ADU HOT 3
- Question: How to make custom DTMI model private for ADU HOT 2
- Please provide `.deb` packages for Debian 11/12 armhf & arm64 HOT 6
- Device Update Agent attempting MQTT connection over TLSv1 HOT 2
- Device Update Free Edition HOT 1
- Device Update not applying due to lower case conversion of compat property HOT 7
- Device update group not created based on tags in DeviceTwin HOT 13
- Device not added in Azure Device Update Groups in IoT Hub HOT 5
- Cannot Install device update agent 1.0.3 beta version for Debian11 Arm64 on Debian 11.8 running on Raspberry Pi 4 HOT 1
- Configuration file deviceupdate-agent.service is marked executable HOT 7
- Yocto Rpi3 Device is restarting again and again in a loop HOT 2
- Failed parse of JSON file in Rpi4 device HOT 6
- /usr/bin/adu-swupdate.sh never runs (swupdate:2 never used even when registered?) HOT 7
- The packages deployed through device update are not reflecting in the device hosted on ubuntu 22.04 HOT 2
- Ignore duplicate deployment workflow not working as expected HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot-hub-device-update.