openwrt之install: cannot remove ‘/usr/local/lib/pkgconfig/libzstd.pc‘: Permission denied

openwrt 19.07.05

  • 编译报错:
make[3]: Entering directory '/home/eric/Documents/work/mt7628/openwrt/tools/zstd'
CFLAGS="-O2 -I/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/include " CPPFLAGS="-I/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/include " CXXFLAGS="" LDFLAGS="-L/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/lib " make  -C /home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4 PREFIX=/home/eric/Documents/work/mt7628/openwrt/staging_dir/host HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 install
make[4]: Entering directory '/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4'
make[5]: Entering directory '/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/lib'
install: cannot remove '/usr/local/lib/pkgconfig/libzstd.pc': Permission denied
make[5]: *** [Makefile:255: install-pc] Error 1
make[5]: Leaving directory '/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/lib'
make[4]: *** [Makefile:161: install] Error 2
make[4]: Leaving directory '/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4'
make[3]: *** [Makefile:20: /home/eric/Documents/work/mt7628/openwrt/staging_dir/host/stamp/.zstd_installed] Error 2
make[3]: Leaving directory '/home/eric/Documents/work/mt7628/openwrt/tools/zstd'
time: tools/zstd/compile#0.07#0.04#0.10
    ERROR: tools/zstd failed to build.
make[2]: *** [tools/Makefile:158: tools/zstd/compile] Error 1
make[2]: Leaving directory '/home/eric/Documents/work/mt7628/openwrt'
make[1]: *** [tools/Makefile:154: /home/eric/Documents/work/mt7628/openwrt/staging_dir/host/stamp/.tools_compile_yyynyynnyyynyyyyyynyynnyyyynyyyyyyyyyyyyyyynynynnyyyyyyy] Error 2
make[1]: Leaving directory '/home/eric/Documents/work/mt7628/openwrt'
make: *** [/home/eric/Documents/work/mt7628/openwrt/include/toplevel.mk:242:world] 错误 2
  • 提示无权限,单独sudo安装libzstd(避免sudo模式编译openwrt)
    进入目录openwrt/tools/zstd,执行命令(命令复制上面报错字段,加上sudo)
eric@eric-PC:~/Documents/work/mt7628/openwrt/tools/zstd$ sudo CFLAGS="-O2 -I/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/include " CPPFLAGS="-I/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/include " CXXFLAGS="" LDFLAGS="-L/home/eric/Documents/work/mt7628/openwrt/staging_dir/host/lib " make  -C /home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4 PREFIX=/home/eric/Documents/work/mt7628/openwrt/staging_dir/host HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 install
请输入密码
[sudo] eric 的密码:
验证成功
make: 进入目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4”
make[1]: 进入目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/lib”
Installing static library
Installing shared library
Installing includes
zstd static and shared library installed
make[1]: 离开目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/lib”
make[1]: 进入目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/programs”
Installing binaries
Installing man pages
zstd installation completed
make[1]: 离开目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4/programs”
make: 离开目录“/home/eric/Documents/work/mt7628/openwrt/build_dir/host/zstd-1.4.4”

  • 修改文件openwrt/tools/Makefile,去除zstd选项,以便编译openwrt的时候,跳过编译zstd.
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Main makefile for the host tools
#
curdir:=tools

# subdirectories to descend into
tools-y :=

ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
  BUILD_TOOLCHAIN := y
  ifdef CONFIG_GCC_USE_GRAPHITE
    BUILD_ISL = y
  endif
endif
ifneq ($(CONFIG_SDK)$(CONFIG_PACKAGE_kmod-b43)$(CONFIG_PACKAGE_b43legacy-firmware)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
  BUILD_B43_TOOLS = y
endif

tools-y += autoconf autoconf-archive automake bc bison cmake dosfstools
tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
tools-y += libressl libtool lzma m4 make-ext4fs missing-macros mkimage
tools-y += mklibs mm-macros mtd-utils mtools padjffs2 patch-image
tools-y += patchelf pkgconf quilt squashfskit4 sstrip zip zlib 
#zstd eric++
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(BUILD_TOOLCHAIN) += expat gmp libelf mpc mpfr
tools-$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini) += genext2fs
tools-$(CONFIG_TARGET_ath79) += lzma-old squashfs
tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
tools-$(CONFIG_TARGET_x86) += qemu
tools-$(CONFIG_USES_MINOR) += kernel2minor
tools-$(CONFIG_USE_SPARSE) += sparse


猜你喜欢

转载自blog.csdn.net/pyt1234567890/article/details/111993121
今日推荐