core-services/01-static-devnodes.sh breaks /dev/stdout on raspberry pi
aisecat opened this issue · 7 comments
Hi! From what I understood after some digging around, kmod's static-nodes command specifically writes it's output exactly to /dev/stdout file, which at the time of this script's execution does not yet exist on raspberry pi and instead a regular file is created in it's place with kmod's output inside.
This leads to modules not being loaded and /dev/stdout symlink not being created, since there's already this file in it's place.
I guess this might as well be a kmod issue, but I don't know how to report it there or fix it, since I'm only dabbling in understanding the boot process.
To reproduce on any machine, just delete the /dev/stdout link and run 'kmod static-nodes'.
Anyway, the solution that works for me is using 'kmod static-nodes -o /proc/self/fd/1'. Does this look ok? Should I open a pull request?
Reproducing is clear, but I think /dev/stdout should exist at that stage already.
Oh, udev creates it. Then the fix is ok, c.f. Debian in 2014: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757830
Alternatively we could patch kmod to use /dev/fd/1 by default (or use stdout, really).
Thank you for answering! I was also thinking this should be fixed in kmod since it prints everything just fine for any other of it's outputs. But I don't know how to patch anything, so I thought I'd just bring it up and ask what would be appropriate here.
Built and tested it, everything works, thank you very much!