fdt_setprop(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, let me introduce you to fdt_setprop from the Kernel API Manual. this icon's whole job? create or change a property. that's it. that's the vibe. πŸ’…


✨ SYNOPSIS ✨

int fdt_setprop (void *fdt , int nodeoffset , const char *name , const void *val , int len );

πŸ’… ARGUMENTS πŸ’…

  • fdt β€” pointer to the device tree blob. like, the whole tree. the main character.
  • nodeoffset β€” offset of the node whose property you're about to change. know your node, bestie.
  • name β€” name of the property to change. yes, the actual string. be precise.
  • val β€” pointer to data to set the property value to. the new fit.
  • len β€” length of the property value. don't forget this or it's giving chaos.

πŸ¦‹ DESCRIPTION πŸ¦‹

so fdt_setprop sets the value of the named property in the given node to the given value and length, and it creates the property if it does not already exist. lowkey iconic? it does both. no cap.

⚠️ warning bestie: this function may insert or delete data from the blob, and will therefore change the offsets of some existing nodes. so if you're holding onto an offset, it might not be valid after this call. fr fr, keep that in mind. πŸ’€

πŸ”₯ RETURN πŸ”₯

here's the vibe check on return values:

  • 0 β€” on success. we ate. πŸ“
  • -FDT_ERR_NOSPACE β€” there is insufficient free space in the blob to contain the new property value. crying. 😭
  • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to FDT_BEGIN_NODE tag. wrong door, bestie.
  • -FDT_ERR_BADLAYOUT β€” standard meaning.
  • -FDT_ERR_BADMAGIC β€” standard meaning.
  • -FDT_ERR_BADVERSION β€” standard meaning.
  • -FDT_ERR_BADSTATE β€” standard meaning.
  • -FDT_ERR_BADSTRUCTURE β€” standard meaning.
  • -FDT_ERR_BADLAYOUT β€” standard meaning. (yes, it's listed twice in the source. not me being messy. iykyk.)
  • -FDT_ERR_TRUNCATED β€” standard meaning.

🌈 SEE ALSO 🌈

okay the friend group is HUGE but every single one is here, no skips, periodt. start with the kernel file, then go down the list:


and that's the whole page, bestie. this one lives at ./scripts/dtc/libfdt, dated October 2026, and it's all about fdt_setprop(9). now go set some properties, slay, and remember: offsets may change. bye! πŸ’–βœ¨

πŸ“¦ where this page comes from