fdt_appendprop(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ fdt_appendprop(9) β€” Kernel API Manual ✨

okay so bestie, we're in <pink>fdt_appendprop(9)</pink> territory, from the Kernel API Manual, and honestly this one is kind of a slay. Device tree blob surgery, but make it append. πŸ’…


🌸 NAME 🌸

fdt_appendprop β€” append to or create a property

πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • fdt β€” pointer to the device tree blob. like, the whole vibe container, the thing you're editing 🫢
  • nodeoffset β€” offset of the node whose property to change. you gotta know exactly which node you're messing with, iykyk
  • name β€” name of the property to append to 🌸
  • val β€” pointer to data to append to the property value ✨
  • len β€” length of the data to append to the property value. yes bestie, you have to tell it how many bytes 😭

πŸ’– DESCRIPTION πŸ’–

fdt_appendprop appends the value to the named property in the given node, creating the property if it does not already exist. literally "add on if it's there, make it if it's not." main character energy πŸ”₯

vibe check, and it's lowkey a real one: this function may insert data into the blob, and will therefore change the offsets of some existing nodes. so any offsets you were holding onto? yeah, they might not be valid anymore. not me forgetting that and having a whole breakdown πŸ’€

πŸ‘‘ RETURN πŸ‘‘

  • 0 β€” on success. we love to see it πŸŽ‰
  • -FDT_ERR_NOSPACE β€” there is insufficient free space in the blob to contain the new property value 😭 the blob said "no room bestie"
  • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to FDT_BEGIN_NODE tag πŸ™ˆ
  • -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 β€” yep, again, standard meaning (it's listed twice in the original, and we are NOT editing the queen's list) πŸ’…
  • -FDT_ERR_TRUNCATED β€” standard meaning

(it literally says "standard meanings" for that whole lil cluster, so go check the standard, i'm just the messenger 🧚)

🌈 SEE ALSO 🌈

Kernel file ./scripts/dtc/libfdt/libfdt.h, and the whole extended family, no cap:


and that's the whole page, bestie, go append something iconic πŸ¦‹πŸ’œ

sign-off szn: this one lives in ./scripts/dtc/libfdt, dated October 2026. mwah πŸ«ΆπŸ’–
πŸ“¦ where this page comes from