Hi everyone,
I'm newbie in OpenWRT and i want to build a firmware for Buffalo WHR-HP-G300N with OpenWRT,
So I follow this tutorial http://www.ccs.neu.edu/home/noubir/Cour … torial.pdf
But i can't build package Helloworld like this tutorial
My package include:
openwrt/openwrt-sdk/package/helloworld/src/helloworld.c
#include <stdio.h>
int main()
{
printf("Hello world, Ken! \n");
return 0;
}
openwrt/openwrt-sdk/package/helloworld/src/Makefile
CC = gcc
FLAG = -Wall
helloworld:
$(CC) $(FLAG) helloworld.c -o helloworld
openwrt/openwrt-sdk/package/helloworld/Makefile
include $(TOPDIR)/rules.mk
PKG_NAME:=helloworld
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mkdefine Package/helloworld
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Helloworld Program written by Ken
endefdefine Package/helloworld/description
a sample OpenWRT helloworld program
endefdefine Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endefdefine Package/helloworld/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hellowolrd $(1)/usr/bin
endef$(eval $(call BuildPackage,helloworld))
when i compile with command
ken@Ken-Laptop-Ubuntu:~/openwrt/openwrt-sdk$ make package/helloworld/compile V=99
and this
#
# using defaults found in .config
#
*** End of OpenWrt configuration.
*** Execute 'make' to build the OpenWrt or try 'make help'.
make[4]: Entering directory `/home/ken/openwrt/openwrt-sdk/package/helloworld'
make[4]: Leaving directory `/home/ken/openwrt/openwrt-sdk/package/helloworld'
make[1]: Entering directory `/home/ken/openwrt/openwrt-sdk'
make[2]: Entering directory `/home/ken/openwrt/openwrt-sdk/package/helloworld'
mkdir -p /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld
cp -fpR ./src/* /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/
touch /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/.prepared_76ff201936867f921fa2d353dd9528be
(cd /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/./; if [ -x ./configure ]; then /home/ken/openwrt-sdk/staging_dir/host/bin/find /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ -name config.guess | xargs -r chmod u+w; /home/ken/openwrt-sdk/staging_dir/host/bin/find /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ -name config.guess | xargs -r -n1 cp /home/ken/openwrt/openwrt-sdk/scripts/config.guess; /home/ken/openwrt-sdk/staging_dir/host/bin/find /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ -name config.sub | xargs -r chmod u+w; /home/ken/openwrt-sdk/staging_dir/host/bin/find /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ -name config.sub | xargs -r -n1 cp /home/ken/openwrt/openwrt-sdk/scripts/config.sub; AR=-openwrt-linux-ar AS="-openwrt-linux-gcc -c -fhonour-copts" LD=-openwrt-linux-ld NM=-openwrt-linux-nm CC="-openwrt-linux-gcc" GCC="-openwrt-linux-gcc" CXX="no" RANLIB=-openwrt-linux-ranlib STRIP=-openwrt-linux-strip OBJCOPY=-openwrt-linux-objcopy OBJDUMP=-openwrt-linux-objdump SIZE=-openwrt-linux-size CFLAGS=" -fhonour-copts " CXXFLAGS=" -fhonour-copts " CPPFLAGS="-I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/include " LDFLAGS="-L/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/usr/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/usr/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/lib " ./configure --target=-openwrt-linux --host=-openwrt-linux --build=i686-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls --disable-largefile --disable-ipv6 ; fi; )
touch /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/.configured_
CFLAGS=" -fhonour-copts -I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/include " CXXFLAGS=" -fhonour-copts -I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/usr/include -I/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/include " LDFLAGS="-L/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/usr/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/target-_-/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/usr/lib -L/home/ken/openwrt/openwrt-sdk/staging_dir/toolchain-_gcc-_-/lib " make -C /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/. AR=-openwrt-linux-ar AS="-openwrt-linux-gcc -c -fhonour-copts" LD=-openwrt-linux-ld NM=-openwrt-linux-nm CC="-openwrt-linux-gcc" GCC="-openwrt-linux-gcc" CXX="no" RANLIB=-openwrt-linux-ranlib STRIP=-openwrt-linux-strip OBJCOPY=-openwrt-linux-objcopy OBJDUMP=-openwrt-linux-objdump SIZE=-openwrt-linux-size CROSS="-openwrt-linux-" ARCH="" ;
make[3]: Entering directory `/home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld'
make[3]: `helloworld' is up to date.
make[3]: Leaving directory `/home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld'
touch /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/.built
rm -rf /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld
mkdir -p /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL
echo "Package: helloworld" > /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL/control
echo "Version: 1" >> /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL/control
( DEPENDS=''; for depend in ; do DEPENDS=${DEPENDS:+$DEPENDS, }${depend##+}; done; echo "Depends: $DEPENDS"; echo "Provides: "; echo "Source: package/helloworld"; echo "Section: utils"; echo "Status: unknown ok not-installed"; echo "Essential: no"; echo "Priority: optional"; echo "Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>"; echo "Architecture: "; echo "Installed-Size: 0"; echo -n "Description: "; getvar V_Package_helloworld_description | sed -e 's,^[[:space:]]*, ,g'; ) >> /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL/control
chmod 644 /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL/control
(cd /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/CONTROL; )
install -d -m0755 /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/usr/bin
install -m0755 /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/hellowolrd /home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/ipkg-/helloworld/usr/bin
install: cannot stat '/home/ken/openwrt/openwrt-sdk/build_dir/target-_-/helloworld/hellowolrd': No such file or directory
make[2]: *** [/home/ken/openwrt/openwrt-sdk/bin//packages/helloworld_1_.ipk] Error 1
make[2]: Leaving directory `/home/ken/openwrt/openwrt-sdk/package/helloworld'
make[1]: *** [package/helloworld/compile] Error 2
make[1]: Leaving directory `/home/ken/openwrt/openwrt-sdk'
make: *** [package/helloworld/compile] Error 2
i dont know why "install: cannot stat"
Any suggestion for this case ?
Thanks for reading
(Last edited by hoangvu23108 on 6 Nov 2014, 14:45)