2016-08-17 4 views
1

내가 openwrt에 소프트웨어를 수출하기 위해 노력하고있어 및 내가 IPK를 생성 할 수있어하지만 컴파일 된 파일은 항상 나에게오류 openwrt

-ash을이 오류를 제공하기위한 크로스 컴파일 된 프로그램이 실행되는 동안 : 찾을 수 없음

나는 모든 것을 시도했지만 제대로 작동하지 않습니다.

git clone git://github.com/openwrt/openwrt.git 
cd openwrt 
./scripts/feeds update -a 
./scripts/feeds install -a 
make defconfig 
make prereq 
make menuconfig 
    [here i selected the package with the M and saved the configuration] 
make tools/install 
make toolchain/install 
make package/scanReport_probe/compile 

내가 솔루션의 몇 가지 힌트를 필요로하므로이 오류를 해결하는 전혀 생각이 없다 : 이 내가 환경을 준비하기 위해 무엇을했는지이다 완료합니다. openwrt

include $(TOPDIR)/rules.mk 

# name of package 
# version number of the sources you're using 
# how many times you've released a package based on the above version number 
PKG_NAME:=scanReport_probe 
PKG_VERSION:=1.0 
PKG_RELEASE:=1 
PKG_LICENSE:=MIT 

# sources will be unpacked into this directory (you shouldn't need to change this) 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 

#needed 
include $(INCLUDE_DIR)/package.mk 


# Metadata; information about what the package is for the ipkg listings 
# to keep things simple, a number of fields have been left at their defaults 
# and are not shown here. 
define Package/scanReport_probe 
    SECTION:=utils 
    CATEGORY:=Utilities 
    TITLE:=scanReport_probe 
    URL:=https://github.com/luigiDB/scan-report_probe 
    TITLE:=Scan in monitor mode probe over wifi channel with periodic report to a server through http post. 
    MAINTAINER:=Please refer to github repository page 
endef 

define Package/scanReport_probe/description 
    This is the best tool ever. 
    Scan probe over wifi and at regualar interval send results via http post. 
endef 


define Build/Prepare 
    mkdir -p $(PKG_BUILD_DIR) 
    $(CP) ./src/* $(PKG_BUILD_DIR)/ 
endef 


CONFIGURE_VARS+= \ 
    CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" 


define Build/Compile 
    $(MAKE) -C $(PKG_BUILD_DIR)/scanReport_probe $(TARGET_CONFIGURE_OPTS) 
endef 

# We'll use the OpenWrt defaults to configure and compile the package. Otherwise we'd need to define 
# Build/Configure - commands to invoke a configure (or similar) script 
# Build/Compile - commands used to run make or otherwise build the source 

define Package/scanReport_probe/install 
    # Now that we have the source compiled (magic huh?) we need to copy files out of the source 
    # directory and into our ipkg file. These are shell commands, so make sure you start the lines 
    # with a TAB. $(1) here represents the root filesystem on the router. 
    # INSTALL_DIR, INSTALL_BIN, INSTALL_DATA are used for creating a directory, copying an executable, 
    # or a data file. +x is set on the target file for INSTALL_BIN, independent of it's mode on the host. 

    # make a directory for the config 
    $(INSTALL_DIR) $(1)/etc/scanReport_probe/ 

    # copy the config 
    $(INSTALL_CONF) $(PKG_BUILD_DIR)/scanReport_probe.conf $(1)/etc/scanReport_probe 

    # make a directory for some random data files required by scanReport_probe 
    $(INSTALL_DIR) $(1)/usr/share/scanReport_probe 

    # copy the data files 
    $(INSTALL_DATA) $(PKG_BUILD_DIR)/data/* $(1)/usr/share/scanReport_probe 

    #make directory bin 
    $(INSTALL_DIR) $(1)/bin 

    # copy the binary 
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/scanReport_probe/scanReportProbe $(1)/bin 

    #make the directory init.d in case isn't present 
    $(INSTALL_DIR) $(1)/etc/init.d 

    #copy script to init.d 
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/runScript/scanReportProbe $(1)/etc/init.d  
endef 


#runned post installation call the enable on the service 
define Package/scanReport_probe/postinst 
    #!/bin/sh 
    # check if we are on real system 
    if [ -z "$${IPKG_INSTROOT}" ]; then 
     echo "Enabling rc.d symlink for scanReportProbe" 
     /etc/init.d/scanReportProbe enable 
    fi 
    exit 0 
endef 


#runned pre uninstallation call the disable on the service 
define Package/scanReport_probe/prerm 
    #!/bin/sh 
    # check if we are on real system 
    if [ -z "$${IPKG_INSTROOT}" ]; then 
     echo "Removing rc.d symlink for scanReportProbe" 
     /etc/init.d/scanReportProbe disable 
    fi 
    exit 0 
endef 

$(eval $(call BuildPackage,scanReport_probe)) 

교류

에 대한

scanReport_probe 
├── LICENSE 
├── Makefile 
├── README.md 
└── src 
    ├── data 
    │ └── THIS IS FOR DATA FILES.txt 
    ├── runScript 
    │ └── scanReportProbe 
    ├── scanReport_probe 
    │ ├── a.c 
    │ └── makefile 
    └── scanReport_probe.conf 

메이크 파일 구조 : 나는 오류가 코드라고 생각하지만이 필요 Casse는에없는

내 프로그램입니다

#include <stdio.h> 
int main(void) 
{ 
     printf("Hello World\n"); 
     return 0; 
} 

c 프로그램 용 메이크 파일

+0

menuconfig에서 올바른 아키텍처를 선택하셨습니까? 'build_dir/target - */scanReport_probe */scanReportProbe' 파일은 무엇을 말합니까? 이것을 openwrt 장치의 바이너리와 비교하십시오 (예를 들어'/ bin/busybox를 호스트 컴퓨터에 복사하고'file'을 실행하십시오). –

+0

또한'define Build/Compile' 절과'CONFIGURE_VARS' 할당을 제거하십시오 - 기본값이 잘 작동 할 것입니다. –

+0

모든 것이 올바르게 구성되었습니다. 나는 왜이 저장소를 컴파일할지 모르지만 트렁크 대신에 git.openwrt.org/15.05/openwrt.git가 문제를 해결했다. – LuigiDB

답변

0

-ash의 경우 IIRC, 은 [부팅] 쉘입니다. 그것은 특정 명령을 찾을 수 없다는 말입니다.

그래서,이 중 하나가 될 수 있습니다

(1) rc 스크립트 섹션에서, 당신이하고있는 /etc/init.d/scanReportProbe enable을하지만, 당신이 구축하고있는 패키지 scanReport_probe를 사용합니다. 따라서 여기에 또는 그 밖의 다른 이름을 추가하거나 제거해야 할 수도 있습니다.

(2) 제공 한 파일 구조가 마지막 파일 인 경우 스크립트가 올바른 디렉토리에 있는지 확실하지 않습니다.

(3) 스크립트 사용 권한이 수정 되었습니까?

+0

설치가 끝나면 모든 파일이 올바른 디렉토리에 있고 나는 init.d 스크립트 없이도 테스트를 거쳤습니다. bin 폴더 아래의 실행 파일은'-rwxr-xr-x 1 루트 루트 1527 년 8 월 17 일 17시 15 분 scanReportProbe' 권한을 가지지 만'/ bin/scanReportProbe' 또한 동일한 오류가 발생합니다. 나는 또한 내가 온라인에서 발견 한 다른 저장소를 테스트하고 모두가 나에게 같은 오류를 준다. – LuigiDB

관련 문제