ASAT
Senior Member
I discovered this simple trick, if you need a quick and dirty method to run Entware-ng or Optware-ng programs directly off your router /jffs folder. The patchelf program is capable of changing the run path and library path inside the ELF header of an ARM binary executable image. For example, it's lets you change /opt/lib to /jffs/lib inside an ARM executable program or library, so you can file copy the program from /opt to /jffs and it will run from /jffs without giving a missing library error.
HOW: Cross-compile the patchelf program on your Asuswrt-Merlin build box.
That's it. Now copy the patchelf program to the router /jffs folder.
I have tested it with only little programs and it seems to work fine.
HOW: Cross-compile the patchelf program on your Asuswrt-Merlin build box.
Code:
cd ~
wget http://nixos.org/releases/patchelf/patchelf-0.8/patchelf-0.8.tar.gz
tar xzvf patchelf-0.8.tar.gz
cd patchelf-0.8
./configure '--host=arm-brcm-linux-uclibcgnueabi' '--build=' CFLAGS="-static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99" CPPFLAGS="-static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99" CXXFLAGS="-static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99" LDFLAGS="-Wl,--gc-sections"
make
arm-brcm-linux-uclibcgnueabi-strip --strip-all ./src/patchelf
That's it. Now copy the patchelf program to the router /jffs folder.
I have tested it with only little programs and it seems to work fine.
Last edited: