[yocto] bash getcwd errors when running under OverlayFS
Craig McQueen
craig.mcqueen at innerrange.com
Tue Jul 7 22:07:28 PDT 2015
I am using an OverlayFS patch for kernel 3.14.x obtained from OpenWRT. Once I started using OverlayFS, I found that bash shell scripts would give a lot of errors, something like:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Success
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: Bad file descriptor
It seems that this can be traced to an internal implementation of getcwd() in bash. When cross-compiled, it can't check for getcwd() use of malloc, so it is cautious and sets GETCWD_BROKEN and uses an internal implementation of getcwd(). This internal implementation doesn't seem to work well with OverlayFS.
A simple fix in Yocto is to put the following in a recipes-extended/bash/bash_4.3.bbappend in your own layer:
EXTRA_OECONF += "bash_cv_getcwd_malloc=yes"
--
Craig McQueen
More information about the yocto
mailing list