Hi all,
Platform: x86_64
I successfully installed a Linux Embedded Development Environment (LEDE) x86/64 (same as OpenWRT) to my virtual machine.
I developed a custom package "Hello World" for Linux Embedded Development Environment (LEDE) with SDK and cross-compiled it . Then, tested it on my virtual machine and it worked.
But, then I have my own code to port that is, for raw packet sniffer in c and I want to port that code. So, I copied same code under that same file that I used for "Hello world" (helloworld.c). Again, I successfully cross-compiled new binary "*.ipk format" then send it on my LEDE virtual machine and did opkg install xxxxxx.ipk
. It installed, but same output. I mean "Hello world".
I don't know how. Because, code changed this time. Then, again for testing a wrote a simple factorial code and again . During testing in virtual machine. I found that it didn't work because same output again that is, "Hello world".
Documentation:Hello world package for LEDE using LEDE Source I am developing using SDK instead of source.I followed every thing in Documentation excluding source compiling and all.
Documentation for SDK: Compile custom package using SDK
Makefile for Hello World code:
include $(TOPDIR)/rules.mk
# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
PKG_NAME:=helloworld
PKG_VERSION:=1.0
PKG_RELEASE:=1
# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
SOURCE_DIR:=/home/buildbot/helloworld
include $(INCLUDE_DIR)/package.mk
# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/helloworld
SECTION:=examples
CATEGORY:=Examples
TITLE:=Hello, World!
endef
# Package description; a more verbose description on what our package does
define Package/helloworld/description
A simple "Hello, world!" -application.
endef
# Package preparation instructions; create the build directory and copy the source code.
# The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
$(Build/Patch)
endef
# Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/helloworld.o -c $(PKG_BUILD_DIR)/helloworld.c
$(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/helloworld.o
endef
# Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
define Package/helloworld/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/usr/bin
endef
# This command is always the last, it uses the definitions and variables we give above in order to get the job done
$(eval $(call BuildPackage,helloworld))
I cross-compiled the same code again and tested it with LinkIt Smart 7688
and everything is working as expected. So, I think something went wrong with that LEDE Virtual Machine that I created for testing.
LinkIt Smart 7688: It is an open development board which is based on OpenWrt Linux distribution and MT7688. The platform also offers options to create device applications in Python, Node.js and C programming language.
So, I think It is one of the best board available for IoT things within 12.90 US Dollars.