TorizonCore Builder custom changes folder polkitd

Hi,

We are using torizoncore-builder to build images for colibri-imx7-emmc which works fine. We include custom files via customization->filesystem->changes section:

customization:
filesystem:
- changes/

We use a custom folder “company-name” where we place various files so that it appears in root folder “\company-name\*” once we flash our modules.

We now need to add +X permission to one of the files and can’t find a way to do it. I tried using .tcattr, however, I noticed that it only works for files in “usr/etc” directory and not our custom folder. I also noticed that all files and folders in our “company-name” folder are owned by some weird “polkitd” user with ID 999. Why is that? Is there something I can do? I believe that this is somehow related to ostree which expects us to save files in etc folder. However, we want to keep our custom folder and we don’t need any of ostree functionality.

Many thanks,
Matas

Hi @Matas ,

That’s a strange behavior. I did a quick test making an Apalis iMX6 image with a custom folder named company in / with some files inside it, and with .tcattr describing permissions for all files/folders.

I was able to successfully add execution permissions to a particular file in /company/. Everything was owned by the user ID I specified in .tcattr.

Did you try following our developer page on creating a .tcattr file? TorizonCore Builder Tool - Commands Manual | Toradex Developer Center

For reference, here is how I’ve organized the changes directory used for my test:

$ tree -a
.
├── company
│   ├── folder
│   │   └── text2.txt
│   ├── script.sh
│   └── text.txt
└── .tcattr

Contents of .tcattr:

# file: company
# owner: 1000
# group: 1000
user::rwx
group::r-x
other::r-x

# file: company/script.sh
# owner: 1000
# group: 1000
user::rwx
group::r-x
other::r-x

# file: company/text.txt
# owner: 1000
# group: 1000
user::rw-
group::---
other::---

# file: company/folder
# owner: 1000
# group: 1000
user::rwx
group::r-x
other::r-x

# file: company/folder/text2.txt
# owner: 1000
# group: 1000
user::rw-
group::r--
other::---

Check if your file organization and .tcattr are similar to the examples above.

Best regards,
Lucas Akira

Thank you for confirming that .tcattr works with custom folders. It turns out that problem was with our samba container which messes with folder permissions on boot. My bad.

Many thanks,
Matas

Glad you managed to solve your issue! Thank you for sharing your solution.

Best regards,
Lucas Akira