NSA326 meta repo installed but not working

hazimozi
hazimozi Posts: 17  Freshman Member
First Comment Friend Collector First Anniversary

I just installed meta repo by web_prefix http://zyxel.ddnss.eu/Users/Mijzelf/zypkg-repo/ Download successful, installed packages successful.
But after all, apps do not work.
This is the system message:
root@NAS326 :/i-data/ffb0d2f0/.PKG/Transmission/config/Transmission# rsync
/i-data/ffb0d2f0/.PKG/RandomTools/bin/rsync-3.1.1: error while loading shared libraries: /i-data/ffb0d2f0/.PKG/RandomTools/lib/libiconv.so.2: file too short

root@NAS326 :/i-data/ffb0d2f0/.PKG/Transmission/config/Transmission# mc
/i-data/ffb0d2f0/.PKG/MidnightCommander/bin/mc: error while loading shared libraries: /i-data/ffb0d2f0/.PKG/MidnightCommander/lib/libiconv.so.2: file too short

Then I checked files and they are 0 byte. What went wrong?

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,941  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    Answer ✓

    Welcome in the wonderful world of embedded Linux hacking. I compiled those binaries for the NSA series, which have libiconv.so.2 in the library search path. Then ZyXEL came with the NAS series, which doesn't have libiconv.so.2. I could have created different packages for the NSA and the NAS, but instead I decided to put a check in the startscript. For rsync that is in .PKG/RandomTools/etc/custom_startscripts/00tools:

        if [ "${PKG_FIRMWARE}" = "4" ] ; then
                for tool in $RANDOMTOOLS_LIBICONV $RANDOMTOOLS_MAGIC
                do
                        SymlinkTool $tool
                done
        else
                local libiconv=${PKG_ROOT}/lib/libiconv.so.2
                [ ! -f ${libiconv} ] && wget ${PKG_DOWNLOAD_URL}/libiconv.so.2.gz -O - | gunzip >${libiconv}
                for tool in $RANDOMTOOLS_LIBICONV
                do
                        ScriptToolEnv $tool "LD_LIBRARY_PATH=${PKG_ROOT}/lib"
                done
        
                for tool in $RANDOMTOOLS_MAGIC
                do
                        ScriptToolEnv "$tool" "LD_LIBRARY_PATH=${PKG_ROOT}/lib MAGIC=${PKG_ROOT}/share/misc/magic.mgc"
                done
    
        fi 
    

    ${PKG_FIRMWARE} is 5, on a NAS, and so it checks if libiconv.so.2 exists, and else it downloads it from ${PKG_DOWNLOAD_URL}. That variable should point to the place where the package (RandomTools in this case) was downloaded, what in your case should point to http://zyxel.ddnss.eu/Users/Mijzelf/zypkg-repo/fw5/. But it didn't, or your box wasn't online when you started RandomTools for the first time. That yields a zero byte libiconv, due to the gunzip.

    The actual cause is hard to trace, but the remedy is simple. Download libiconv.so.2.gz, and extract it to the right lib directory.

All Replies

  • Mijzelf
    Mijzelf Posts: 2,941  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    Answer ✓

    Welcome in the wonderful world of embedded Linux hacking. I compiled those binaries for the NSA series, which have libiconv.so.2 in the library search path. Then ZyXEL came with the NAS series, which doesn't have libiconv.so.2. I could have created different packages for the NSA and the NAS, but instead I decided to put a check in the startscript. For rsync that is in .PKG/RandomTools/etc/custom_startscripts/00tools:

        if [ "${PKG_FIRMWARE}" = "4" ] ; then
                for tool in $RANDOMTOOLS_LIBICONV $RANDOMTOOLS_MAGIC
                do
                        SymlinkTool $tool
                done
        else
                local libiconv=${PKG_ROOT}/lib/libiconv.so.2
                [ ! -f ${libiconv} ] && wget ${PKG_DOWNLOAD_URL}/libiconv.so.2.gz -O - | gunzip >${libiconv}
                for tool in $RANDOMTOOLS_LIBICONV
                do
                        ScriptToolEnv $tool "LD_LIBRARY_PATH=${PKG_ROOT}/lib"
                done
        
                for tool in $RANDOMTOOLS_MAGIC
                do
                        ScriptToolEnv "$tool" "LD_LIBRARY_PATH=${PKG_ROOT}/lib MAGIC=${PKG_ROOT}/share/misc/magic.mgc"
                done
    
        fi 
    

    ${PKG_FIRMWARE} is 5, on a NAS, and so it checks if libiconv.so.2 exists, and else it downloads it from ${PKG_DOWNLOAD_URL}. That variable should point to the place where the package (RandomTools in this case) was downloaded, what in your case should point to http://zyxel.ddnss.eu/Users/Mijzelf/zypkg-repo/fw5/. But it didn't, or your box wasn't online when you started RandomTools for the first time. That yields a zero byte libiconv, due to the gunzip.

    The actual cause is hard to trace, but the remedy is simple. Download libiconv.so.2.gz, and extract it to the right lib directory.

  • hazimozi
    hazimozi Posts: 17  Freshman Member
    First Comment Friend Collector First Anniversary

    removed 0byte libiconv.so.2 file from MC and rsync lib directories and copied the downloaded libiconv.so.2, both are successfuly started and run. thx!

Consumer Product Help Center