Page 2 of 2

Re: Midnight Commander on NAS542

Posted: Fri 14. Aug 2026, 08:39
by Mijzelf
shv wrote: Fri 14. Aug 2026, 08:23 Can you please provide me your script for further analysis to find out the concrete procedure to create zpkg files?
GenerateZypkgFramework.zip
(8.26 KiB) Downloaded 1 time
It is desgined to be run in a subdirectory containing subdirectories data and control, and generates startscript, ZYPKG, control, ....
generate_package_tgz.zip
(515 Bytes) Downloaded 1 time
This one is much simpler, and only generates the zpkg, based on subdirectories data and control.

/Edit:
BTW, I have written a wiki page about the packages: link.

Re: Midnight Commander on NAS542

Posted: Fri 14. Aug 2026, 09:28
by shv
I've updated the package now. I used original NAS542 tar/gzip. Three files are changed:
  1. control.tar.gz: MidnightCommander.control
  2. control.tar.gz: MidnightCommander.postinst
  3. data.tar.gz: /etc/init.d/MidnightCommander
It is working as long the internal repository isn't used. While testing the file /tmp/.MetaRepository/tmp/lasturl was created and set to the internal repository where wget can't be used. Nevertheless I used my test repository on zyxel.ddnss.eu afterwards lasturl was still there and pointed to the internal repository. After I deleted the lasturl file the new MC package is able to download the libiconf.so.2.tar.gz file.

Re: Midnight Commander on NAS542

Posted: Fri 14. Aug 2026, 10:12
by shv
A better approach is to add libiconv.so.2 directly into the zkpg package and delete the library for fw4 devices in the startup script

Code: Select all

Startup()
{
        # Enable ld-linux.so on NAS5xx
        [ ! -f /lib/ld-linux.so.3 -a -f /lib/ld-linux-armhf.so.3 ] && ln -s ld-linux-armhf.so.3 /lib/ld-linux.so.3

        for file in /bin/mc /bin/mcview /bin/mcedit
        do
                local libiconv=${PKG_ROOT}/lib/libiconv.so.2
                if [ "${PKG_FIRMWARE}" = "4" ] ; then
                        ln -s ${PKG_ROOT}/bin/mc ${file}
                        [ -f ${libiconv} ] && rm ${libiconv}
                else
                        [ ! -f ${libiconv} ] && wget ${PKG_DOWNLOAD_URL}/libiconv.so.2.gz -O - | gunzip >${libiconv}
                        echo "#!/bin/sh" >${file}
                        echo LD_LIBRARY_PATH=${PKG_ROOT}/lib:${LD_LIBRARY_PATH} MC_DATADIR=${PKG_ROOT}/share/mc exec ${PKG_ROOT}${file} \"\$
                        chmod a+x ${file}
                fi
        done
}

Re: Midnight Commander on NAS542

Posted: Fri 14. Aug 2026, 10:57
by shv
The updated package is available in my test REPO https://zyxel.ddnss.eu/Users/Mijzelf/zy ... /test/shv/. Can you please check if it is working on your NAS520(fw4)?

Re: Midnight Commander on NAS542

Posted: Fri 14. Aug 2026, 17:50
by Mijzelf
I added your repo to MetaRepository, and after a refrash it detected an upgrade for mc, which installed without troubles.

BTW, the `520 is an fw5 device.