This message appear every time I shutdown g/fbsd (any version) in this context: * Unmounting /usr /lib/rc/sh/runscript.sh: printf: not found * Unmounting * in use but fuser finds nothing [!!] Maybe some script invokes `/usr/bin/printf' after /usr being unmounted. I suspect it is `/lib/rc/sh/rc-mount.sh' Reproducible: Always
Actually, "printf" is shell built-in command on bash. OpenRC default to use /bin/sh to execute their scripts and /bin/sh is usually bash on Linux, so there's no problem on Linux. OTOH on FreeBSD /bin/sh is not bash. FreeBSD /bin/sh doesn't have shell built-in printf, so this problem occur. OpenRC team, What this "printf" mean? I cannot get what this code want to do, so I can't think of alternative ways.
After looking at the code briefly, I'm wondering if "echo -n" is what we want here. Does anyone else on the team have any suggestions?
no. `echo -n` is not portable. `printf` however is required by POSIX to be available. if g/fbsd is not providing it (either via the shell or a dedicated binary in $PATH), then it is broken.
# equery b /usr/bin/printf * Searching for /usr/bin/printf ... sys-freebsd/freebsd-ubin-8.2 (/usr/bin/printf) Just move freebsd-ubin' printf to /bin and we should be good for that case when /usr is unmounted.
Created attachment 282749 [details, diff] freebsd-ubin-8.2.ebuild.patch This simple change to freebsd-ubin-8.2.ebuild is to move printf to /bin.
makes sense to me
Applied in cvs, thanks.