Path 如何解决yocto中的sudoers路径问题

Path 如何解决yocto中的sudoers路径问题,path,yocto,sudo,dpkg,sudoers,Path,Yocto,Sudo,Dpkg,Sudoers,在我的Yocto图像(带有.deb包装)上,我设置了sudo,它工作正常。仅当我尝试安装带有以下内容的.deb包时: sudo dpkg -i package-name.deb 其结果是: dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: warning: 'start-stop-daemon' not found in PATH or not executable dpkg: error: 2 expect

在我的Yocto图像(带有.deb包装)上,我设置了sudo,它工作正常。仅当我尝试安装带有以下内容的.deb包时:

sudo dpkg -i package-name.deb
其结果是:

dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
我已经在/etc/sudoers中手动执行了以下操作:

## Uncomment to use a hard-coded PATH instead of the user's to find commands    
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
在那之后,sudo dpkg开始工作了

现在的问题是:

如何在yocto build中做到这一点,从而开箱即用地解决这个问题?如何更改/etc/sudoers文件,使此设置成为构建中的默认设置?或者还有其他解决方案吗

非常感谢你的帮助