代码之家  ›  专栏  ›  技术社区  ›  natenho

buildroot将错误的PREFIX附加到自定义包生成

  •  0
  • natenho  · 技术社区  · 9 年前

    我正在努力包括 WSO2 WSF/C 自定义包转换为buildroot交叉编译ARM项目。这是wsfc。mk文件到目前为止:

    ################################################################################
    #
    # WSO2 WSF/C 
    #
    ################################################################################
    
        WSFC_VERSION = 2.0.0
        WSFC_SOURCE_BASENAME = wso2-wsf-c-src-$(WSFC_VERSION)
        WSFC_SOURCE = $(WSFC_SOURCE_BASENAME).zip
        WSFC_SITE = $(BR2_EXTERNAL)/package/wsfc/
        WSFC_SITE_METHOD = file
        WSFC_PREFIX = /usr/local/wso/wsf_c/
        WSFC_CONF_OPTS = --prefix=$(WSFC_PREFIX) --exec-prefix=$(WSFC_PREFIX) \
                         --enable-rampart=no --enable-sandesha=no --enable-savan=no
    
        define WSFC_EXTRACT_CMDS
            unzip $(DL_DIR)/$(WSFC_SOURCE) -d $(@D)
            mv $(@D)/$(WSFC_SOURCE_BASENAME)/* $(@D)
            rmdir $(@D)/$(WSFC_SOURCE_BASENAME)
        endef
    
        $(eval $(autotools-package))
    

    问题是,

    什么时候 WSFC_PREFIX = /usr/local/wso/wsf_c/ ,它尝试在主机中安装示例,因此权限被拒绝

    [... lot of buildroot log output then:]
    /usr/bin/make  install-data-hook
    make[5]: Entering directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/axis2c'
    mkdir -p /usr/local/wso/wsf_c/samples/src/axis2c
    mkdir: cannot create directory ‘/usr/local/wso’: Permission denied
    make[5]: *** [install-data-hook] Error 1
    make[5]: Leaving directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/axis2c'
    make[4]: *** [install-data-am] Error 2
    make[4]: Leaving directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/axis2c'
    make[3]: *** [install-am] Error 2
    make[3]: Leaving directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/axis2c'
    make[2]: *** [install-recursive] Error 1
    make[2]: Leaving directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/axis2c'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0'
    make: *** [/home/masteruser/Downloads/buildroot-2015.05/output/build/wsfc-2.0.0/.stamp_target_installed] Error 2
    

    什么时候 WSFC_PREFIX = $(TARGET_DIR)/usr/local/wso/wsf_c/ ,没有错误,但它重复了前缀,在错误的位置安装了多个文件(..home../target/home/…)

    [... lot of buildroot log output then:]
    test -z "/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c" || /bin/mkdir -p "/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c"
    test -z "/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/docs" || /bin/mkdir -p "/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/docs"
     /usr/bin/install -c -m 644 'config/axis2.xml' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/axis2.xml'
     /usr/bin/install -c -m 644 'README' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/README'
     /usr/bin/install -c -m 644 'INSTALL' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/INSTALL'
     /usr/bin/install -c -m 644 'COPYING' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/COPYING'
     /usr/bin/install -c -m 644 'NEWS' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/NEWS'
     /usr/bin/install -c -m 644 'CREDITS' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/CREDITS'
     /usr/bin/install -c -m 644 'NOTICE' '/home/masteruser/Downloads/buildroot-2015.05/output/target/home/masteruser/Downloads/buildroot-2015.05/output/target/usr/local/wso/wsf_c/NOTICE'
    [... lot of buildroot log output ]
    

    我认为这需要修补程序才能修复,但我不熟悉自动工具,我不知道应该在哪里修补,也不知道buildroot如何在make过程中添加前缀以避免这种行为。

    1 回复  |  直到 9 年前
        1
  •  1
  •   Arnout    9 年前

    WSF/C源未正确使用自动工具。有一些手动编写的安装挂钩,但它们在目标位置不包含$(DESTDIR)/前缀。因此,这些东西安装在主机系统中,而不是安装在output/target目录中。

    最简单的解决方案是不安装样本。

    以下是修复源代码并将其集成到buildroot的文件和补丁。

    最小值.mk

    ################################################################################
    #
    # WSO2 WSF/C 
    #
    ################################################################################
    
    WSFC_VERSION = 2.0.0
    WSFC_SOURCE_BASENAME = wso2-wsf-c-src-$(WSFC_VERSION)
    WSFC_SOURCE = $(WSFC_SOURCE_BASENAME).zip
    WSFC_SITE = $(BR2_EXTERNAL)/package/wsfc/
    WSFC_SITE_METHOD = file
    WSFC_PREFIX = /usr/local/wso/wsf_c/
    WSFC_CONF_OPTS = --prefix=$(WSFC_PREFIX) --exec-prefix=$(WSFC_PREFIX) --enable-rampart=no --enable-sandesha=no --enable-savan=no
    
    define WSFC_EXTRACT_CMDS
        unzip $(DL_DIR)/$(WSFC_SOURCE) -d $(@D)
        mv $(@D)/$(WSFC_SOURCE_BASENAME)/* $(@D)
        rmdir $(@D)/$(WSFC_SOURCE_BASENAME)
    endef
    
    $(eval $(autotools-package))
    

    0001-示例-destdir-fix.patch

    diff -ENwbur wso2-wsf-c-src-2.0.0.orig/axis2c/Makefile.am wso2-wsf-c-src-2.0.0/axis2c/Makefile.am
    --- wso2-wsf-c-src-2.0.0.orig/axis2c/Makefile.am    2015-08-21 16:33:24.807351795 -0300
    +++ wso2-wsf-c-src-2.0.0/axis2c/Makefile.am 2015-08-21 16:37:58.994193027 -0300
    @@ -30,6 +30,8 @@
        rm -rf axis2c-bin-${PACKAGE_VERSION}-linux
    
     install-data-hook:
    -   mkdir -p $(samplesdir)/src/axis2c
    -   cp -rf samples/* $(samplesdir)/src/axis2c
    +   @:
    +
    +   #mkdir -p $(samplesdir)/src/axis2c
    +   #cp -rf samples/* $(samplesdir)/src/axis2c
    
    diff -ENwbur wso2-wsf-c-src-2.0.0.orig/axis2c/Makefile.in wso2-wsf-c-src-2.0.0/axis2c/Makefile.in
    --- wso2-wsf-c-src-2.0.0.orig/axis2c/Makefile.in    2015-08-21 16:33:25.191159781 -0300
    +++ wso2-wsf-c-src-2.0.0/axis2c/Makefile.in 2015-08-21 16:38:25.178193336 -0300
    @@ -823,8 +823,10 @@
        rm -rf axis2c-bin-${PACKAGE_VERSION}-linux
    
     install-data-hook:
    -   mkdir -p $(samplesdir)/src/axis2c
    -   cp -rf samples/* $(samplesdir)/src/axis2c
    +   @:
    +
    +   #mkdir -p $(samplesdir)/src/axis2c
    +   #cp -rf samples/* $(samplesdir)/src/axis2c
     # Tell versions [3.59,3.63) of GNU make to not export all variables.
     # Otherwise a system limit (for SysV at least) may be exceeded.
     .NOEXPORT:
    diff -ENwbur wso2-wsf-c-src-2.0.0.orig/Makefile.am wso2-wsf-c-src-2.0.0/Makefile.am
    --- wso2-wsf-c-src-2.0.0.orig/Makefile.am   2015-08-21 16:33:24.775367794 -0300
    +++ wso2-wsf-c-src-2.0.0/Makefile.am    2015-08-21 16:40:42.506194955 -0300
    @@ -10,24 +10,28 @@
        sh dist_hook.sh
    
     samples:
    -   sh build_samples.sh $(prefix)
    -   mkdir -p  $(samplesdir)/src/wsf_c
    -   cp -rf examples/* $(samplesdir)/src/wsf_c
    -   cd $(samplesdir)
    -   rm -rf `find $(samplesdir)/ -type d -name *.svn`
    -   rm -rf `find $(samplesdir)/ -type d -name *.libs`
    -   rm -rf `find $(samplesdir)/ -type d -name *.deps`
    -   rm -rf `find $(samplesdir)/ -type f -name Makefile`
    -   rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    -   cp config/axis2.xml $(prefix)
    +   @:
    +   
    +   #sh build_samples.sh $(prefix)
    +   #mkdir -p  $(samplesdir)/src/wsf_c
    +   #cp -rf examples/* $(samplesdir)/src/wsf_c
    +   #cd $(samplesdir)
    +   #rm -rf `find $(samplesdir)/ -type d -name *.svn`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.libs`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.deps`
    +   #rm -rf `find $(samplesdir)/ -type f -name Makefile`
    +   #rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    +   #cp config/axis2.xml $(prefix)
    
     install-data-hook:
    -   cp -rf docs/* $(docsdir)
    -   rm -rf `find $(samplesdir)/ -type d -name *.svn`
    -   rm -rf `find $(samplesdir)/ -type d -name *.libs`
    -   rm -rf `find $(samplesdir)/ -type d -name *.deps`
    -   rm -rf `find $(samplesdir)/ -type f -name Makefile`
    -   rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    +   @:
    +   
    +   #cp -rf docs/* $(docsdir)
    +   #rm -rf `find $(samplesdir)/ -type d -name *.svn`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.libs`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.deps`
    +   #rm -rf `find $(samplesdir)/ -type f -name Makefile`
    +   #rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    
     EXTRA_DIST=build_samples.sh config build.bat clean.bat docs CREDITS NOTICE examples LICENSE configure.in link_samples.sh link.sh build/build_optional.bat build/optional.mk build/init.bat build/versions.in test build/codegen
    
    diff -ENwbur wso2-wsf-c-src-2.0.0.orig/Makefile.in wso2-wsf-c-src-2.0.0/Makefile.in
    --- wso2-wsf-c-src-2.0.0.orig/Makefile.in   2015-08-21 16:33:26.042733811 -0300
    +++ wso2-wsf-c-src-2.0.0/Makefile.in    2015-08-21 16:41:35.322195578 -0300
    @@ -714,24 +714,28 @@
        sh dist_hook.sh
    
     samples:
    -   sh build_samples.sh $(prefix)
    -   mkdir -p  $(samplesdir)/src/wsf_c
    -   cp -rf examples/* $(samplesdir)/src/wsf_c
    -   cd $(samplesdir)
    -   rm -rf `find $(samplesdir)/ -type d -name *.svn`
    -   rm -rf `find $(samplesdir)/ -type d -name *.libs`
    -   rm -rf `find $(samplesdir)/ -type d -name *.deps`
    -   rm -rf `find $(samplesdir)/ -type f -name Makefile`
    -   rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    -   cp config/axis2.xml $(prefix)
    +   @:
    +   
    +   #sh build_samples.sh $(prefix)
    +   #mkdir -p  $(samplesdir)/src/wsf_c
    +   #cp -rf examples/* $(samplesdir)/src/wsf_c
    +   #cd $(samplesdir)
    +   #rm -rf `find $(samplesdir)/ -type d -name *.svn`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.libs`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.deps`
    +   #rm -rf `find $(samplesdir)/ -type f -name Makefile`
    +   #rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    +   #cp config/axis2.xml $(prefix)
    
     install-data-hook:
    -   cp -rf docs/* $(docsdir)
    -   rm -rf `find $(samplesdir)/ -type d -name *.svn`
    -   rm -rf `find $(samplesdir)/ -type d -name *.libs`
    -   rm -rf `find $(samplesdir)/ -type d -name *.deps`
    -   rm -rf `find $(samplesdir)/ -type f -name Makefile`
    -   rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
    +   @:  
    +
    +   #cp -rf docs/* $(docsdir)
    +   #rm -rf `find $(samplesdir)/ -type d -name *.svn`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.libs`
    +   #rm -rf `find $(samplesdir)/ -type d -name *.deps`
    +   #rm -rf `find $(samplesdir)/ -type f -name Makefile`
    +   #rm -rf `find $(samplesdir)/ -type d -name autom4te.cache`
     # Tell versions [3.59,3.63) of GNU make to not export all variables.
     # Otherwise a system limit (for SysV at least) may be exceeded.
     .NOEXPORT: