Build Error: The relative path 'OPATH' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH

I'm trying to build a new image so that I can use a usb drive for more space.

My device does not have much space:

Filesystem Size Used Available Use% Mounted on

/dev/root                 4.0M      4.0M         0 100% /rom
tmpfs                    60.6M      1.2M     59.4M   2% /tmp
/dev/mtdblock6            2.7M      1.9M    784.0K  72% /overlay
overlayfs:/overlay        2.7M      1.9M    784.0K  72% /
tmpfs                   512.0K         0    512.0K   0% /dev

Prerequisites installed: Yes

Command used:

make image PROFILE="asus_rt-n56u" PACKAGES="block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci"

Error:

wrt/openwrt-imagebuilder-ramips-rt3883.Linux-x86_64/staging_dir/host/bin/find: The relative path 'OPATH' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find.  Please remove that entry from $PATH
make[2]: *** [Makefile:176: prepare_rootfs] Error 1
make[1]: *** [Makefile:125: _call_image] Error 2
make: *** [Makefile:242: image] Error 2

Any help is appreciated here.

Which part (or path, phun intended) do you need help with ?

Hi @frollic. I need help figuring out where the error is coming from and if possible how to resolve it so I can build the image. Somewhere in the scripts it adds a relative path "OPATH" to $PATH and it doesn't like that. I'm under the impression the image builder should be able to complete building without configuration errors like $PATH, maybe there is a bug. I don't know what's in the code and I'm not a Perl developer.

All that to say do you know why the error I pasted is happening and do you know how to fix it?

So this is now solved. Looks like I had some very old paths being added in my $PATH variable from .bashrc. I was playing around with Google Go and Android studio and had those in my $PATH using a relative path.

The find command does not like that.

Once I removed those from $PATH the build completed successfully.

Consider this one an ID10T error on my part :smile:

Learned that in the past. Nowadays, I do these kind of experiments in virtual machines (VirtualBox).

Sounds like my new modus operandi.

Get a free for life (or one year, depending on which provider you choose) cloud host from Oracle, Amazon or Microsoft.

Ssh to it, set up the build environment, and let it do the job for you.
It'll be slow - 2 cores, but it's free, and you can always reimage.

Re-imaging is not as flexible as VirtualBox. You can take a snapshot before you experiment different schemes/solutions and more snapshots when you go down further. Revert back is just a click of a button. It does have a steeper learning curve but not too bad. I especially like the feature of shared folder which allows you to move files between the Host system and the Guest systems (virtual machine) easily.

Disclaimer: I am not associated with Oracle in any way.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.