0
  • FYI, I installed the R-PI minimal image with dd myself onto an sd card

I was messing with the boot config when I realized that this file was set as executable. Looking at the config, I don't see why it would need the execute permissions. Additionally according to the short documentation page here, there is no mention of having to set the execute bit on creating your own config.txt file. Also the docs just say that the config is read on boot, not executed. Lastly, the execution bit is set on all users which seems like a mistake, as the file is only ever utilized by root during the boot process

Can I remove the execute permissions? Or is there a reason that it is default set to execute?

asked Mar 15, 2019 at 18:02
1
  • It's on a FAT partition so the executable bit is completely ignored. The /boot partition is mounted with NOEXEC anyway. Commented Oct 21, 2023 at 9:04

1 Answer 1

3

The files in the /boot directory are from the first partition of the SD card that's been mounted there during the boot process. Because the first partition is formatted as a FAT filesystem the files don't have the same meta-data available as when using, for example, the ext4 filesystem.

The mount command used to mount the partition has to somehow map the meta-data expected by the underlying filesystem from the mounted filesystem and this ends up with some of the flags being meaningless or mapped to different meanings. In your example, the File Allocation Tables on the SD card has no concept of a file being "executable" (I believe that actual vFAT systems look at the file extension to figure out if it's executable or not: it's a function of the OS, not the filesystem) so all the files will have the executable bit set when mounted.

There are other features missing in "vFAT" that can lead to odd behaviour when being mounted, such as no UID/GID; coarser timestamps that start at a different Epoch and restricted filenames for example. You can adjust how some of these are "handled", look at some of the options listed under the "Mount options for fat" section in the man 8 mount pages.

See also https://en.wikipedia.org/wiki/File_system_permissions#Operating_system_variations

answered Mar 15, 2019 at 18:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.