fdt_set_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fdt_set_name β€” a kernel API manual, but make it make sense

okay so this is fdt_set_name(9) from the Kernel API Manual, and yes bestie it's a real page, sit down, we're learning ✨


🌸 NAME

fdt_set_name β€” change the name of a given node, literally just renaming a node, that's the whole vibe πŸŽ€


✨ SYNOPSIS

int fdt_set_name (void *fdt , int nodeoffset , const char *name );

🫢 ARGUMENTS

  • fdt β€” pointer to the device tree blob. it's the blob. the whole tree. your canvas πŸ’–
  • nodeoffset β€” structure block offset of a node. yes it's an offset, yes it's in the structure block, yes you need to get it right πŸ¦‹
  • name β€” the name to give the node. new name, new you, main character energy πŸ‘‘

πŸ’… DESCRIPTION

fdt_set_name replaces the name (including unit address, if any) of the given node with the given string. that's it, that's the function. new name, who dis 🌸

⚠️ NOTE: this function can't efficiently check if the new name is unique amongst the given node's siblings. results are undefined if this function is invoked with a name equal to one of the given node's siblings. so like… bestie… please check your siblings yourself, because this function is NOT doing it for you 😭 no cap, undefined results are not a vibe.

also β€” and this is the part that lowkey gets people β€” this function may insert or delete data from the blob, and will therefore change the offsets of some existing nodes. the way that a rename can just shuffle your whole offset situation 🫠 highkey important, keep your other offsets in check.


πŸ”₯ RETURN

  • 0 β€” on success, we ate, periodt ✨
  • -FDT_ERR_NOSPACE β€” there is insufficient free space in the blob to contain the new name. not enough room, the blob said no πŸ™ˆ
  • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to an FDT_BEGIN_NODE tag. wrong tag, wrong door πŸ’€
  • -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE β€” standard meanings, iykyk πŸ’œ

πŸ¦‹ SEE ALSO

okay this is the long part and no I'm not skipping any of it, the whole friend group is here πŸ₯° the kernel file is ./scripts/dtc/libfdt/libfdt.h, and here's everyone:


and that's the page!! 🧚 this one lives in ./scripts/dtc/libfdt and the version/date stamp on it is October 2026 β€” so yeah, it's giving future icon behavior πŸ’œ go rename a node bestie, just check your siblings first fr fr πŸ“

πŸ“¦ where this page comes from