Win10子系統Ubuntu18.04下編譯openwrt問題
- 現象:
- 分析:
- 解決:
現象:
find: The relative path ‘Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc’ is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH
package/Makefile:65: recipe for target ‘package/install’ failed
make[2]: *** [package/install] Error 1
分析:
環境變量PATH内,路徑:
'Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc’存在風險,當find -execdir指令執行時。
- shell執行echo $PATH,确實存在路徑:"/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc"
- 檢視此目錄下檔案為ubuntu1804.exe等,推測應該是Ubuntu系統的虛拟程式。
- 個人覺得這個路徑對Ubuntu系統無過多用,Ubuntu不支援exe的運作,當然wine除外,但是wine也無執行ubuntu1804.exe程式的必要。
- 不确定微軟添加此路徑的意圖,個人選擇從PATH内剔除這個路徑。
解決:
網上臨時修改環境變量的方法,不能根治。這裡采取針對使用者修改部署檔案,從PATH内剔除這個路徑。
- 測試變量替換指令
{string/old/new}
- 将string内old替換為new。
echo “${PATH/’/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc:’/}”
-
修改使用者部署檔案。
vim ~/.profile
在最後一行添加如下語句,删除指定路徑:
注:不同電腦路徑不一樣,請依據現象中報錯路徑指定。PATH="${PATH/'/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc:'/}"