Midnight Commander on NAS542

NAS326, NAS520, NAS540, NAS542
Mijzelf
Posts: 54
Joined: Wed 14. Nov 2018, 19:50

Re: Midnight Commander on NAS542

Post 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) Not downloaded yet
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) Not downloaded yet
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.
User avatar
shv
Posts: 41
Joined: Sat 10. Nov 2018, 17:36

Re: Midnight Commander on NAS542

Post 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.
User avatar
shv
Posts: 41
Joined: Sat 10. Nov 2018, 17:36

Re: Midnight Commander on NAS542

Post 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
}
User avatar
shv
Posts: 41
Joined: Sat 10. Nov 2018, 17:36

Re: Midnight Commander on NAS542

Post 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)?
Mijzelf
Posts: 54
Joined: Wed 14. Nov 2018, 19:50

Re: Midnight Commander on NAS542

Post 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.
Post Reply