Issue installing Entware on NAS540 from Github wiki

gsshelton
gsshelton Posts: 21  Freshman Member
First Anniversary Friend Collector First Comment
Following this guide :https://github.com/Entware/Entware/wiki/Install-on-Zyxel-NAS542

I have this firmware installed: V5.21(AATB.6)C0 which is the latest on the Zyxel site. The guide says firmware V5.21(BHAG.6)C0 or later is required. I'm not sure how the versioning works, but it would seem that the latest in on the Zyxel site is older than the required one? 

This is the result of mount command after creating the two files and restarting:

/proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)
ubi5:ubi_rootfs1 on /firmware/mnt/nand type ubifs (ro)
/dev/md0 on /firmware/mnt/sysdisk type ext4 (ro)
/firmware/mnt/sysdisk/sysdisk.img on /ram_bin type ext2 (ro)
/ram_bin/usr on /usr type none (ro,bind)
/ram_bin/lib/security on /lib/security type none (ro,bind)
/ram_bin/lib/modules on /lib/modules type none (ro,bind)
/ram_bin/lib/locale on /lib/locale type none (ro,bind)
/dev/ram0 on /tmp/tmpfs type tmpfs (rw,size=5m)
/tmp/tmpfs/usr_etc on /usr/local/etc type none (rw,bind)
ubi3:ubi_config on /etc/zyxel type ubifs (rw)
/dev/mapper/vg_91a35c72-lv_ea6cc4e6 on /i-data/ea6cc4e6 type ext4 (rw,noatime,usrquota,data=ordered,barrier=1)
/dev/mapper/vg_91a35c72-vg_info_area on /mnt/vg_info_area/vg_91a35c72 type ext4 (rw)
/i-data/ea6cc4e6/.system/zy-pkgs/pkggui on /usr/local/apache/htdocs/desktop,/pkg type none (rw,bind)
/tmp/tmpfs/block_python.sh on /usr/bin/python2.7 type none (rw,bind)
configfs on /sys/kernel/config type configfs (rw)

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    edited March 2021 Answer ✓
    I think you borked up your /i-data/.system/zy-pkgs/USRPKG_DEPS_START.
    If I take the scriplet I posted above, and assume that the contents of USRPKG_DEPS_START is

    ---------------------------------------------------
    touch
    <empty line>
    ---------------------------------------------------

    then the output is exactly

    ---------------------------------------------------
    - starting package "touch" ...
    grep: /i-data/.system/zy-pkgs/touch: No such file or directory
    ---> Error: start-up program "/etc/init.d/touch" is not existed or not excutable
    killall: zyxel_thumb_creator: no process killed
    BusyBox v1.19.4 (2020-06-04 10:09:11 CST) multi-call binary.

    Usage: basename FILE [SUFFIX]

    - starting package "" ...
    /etc/init.d/zypkg_controller.sh: line 411: /etc/init.d/: Permission denied
    ---> start "" failed.
    --------------------------------------------------

    So check it:

    cat /i-data/.system/zy-pkgs/USRPKG_DEPS_START

    It should show entware

«1

All Replies

  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    I'm not sure how the versioning works

    AFAIK the version string is major.minor(deviceid.revision)C0. That C0 is always C0, although it can be something different for a router, or something like that. Each NAS model has it's own deviceid, so the difference between V5.21(AATB.6)C0 and V5.21(BHAG.6)C0 can be NAS540 and NAS542.

    (The deviceid is stored in flash, as part of the bootloader environment. When flashing firmware the flash script checks the stored deviceid against the id in the new firmware, and if it doesn't match, it errors out. It is possible to change the stored id to cross-flash firmwares. Of course you should only do that if you know what you are doing)

    What is the output when you run (as root)

    sh -x /i-data/.system/zy-pkgs/entware









  • gsshelton
    gsshelton Posts: 21  Freshman Member
    First Anniversary Friend Collector First Comment
    Thanks again for helping me. 

    I ran the command sh -x /i-data/.system/zy-pkgs/entware and this is what was returned:
    + VOL=ea6cc4e6
    + mkdir -p /i-data/ea6cc4e6/opt
    + mkdir -p /opt
    + mount -o bind /i-data/ea6cc4e6/opt /opt
    + /opt/etc/init.d/rc.unslung start
    + echo export PATH=$PATH:/opt/bin:/opt/sbin
    + exit 0

    I then ran mount again and it came back with the right file paths.
    /i-data/ea6cc4e6/opt on /opt type none (rw,bind)

    I get to the reboot step and when I run mount, the path is gone from the results.


  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Hm. The instructions seem a bit faulty, to me. It's based on the start script /etc/init.d/zypkg_controller.sh, which does (on firmware V5.21(AASZ.0), but it has been this way since firmware 5.00) among other actions:

            # - start to startup packages according to ${USRPKG_DEPS_START}
            while read zypkg; do
                    bname=`basename ${zypkg}`
                    zypkg=${ZYPKG_PKG_SRC_PATH}/${bname}
                    Processed_Packages=${Processed_Packages}:${bname}
                    write_log "- starting package \"${bname}\" ..."
                    #ckeck ZYPKG_DEPS format
                    CHKVERSION=`grep "/i-data/" ${zypkg}`
                    if [ "$?" != "0" ]; then
                            PKGVOLPATH=`grep ${bname} ${PKGSTATUSFILE} |grep "Installed-Rule" |awk -F":" '{print $2}' |sed 's/\/
    $//g' |sed 's/ //g'`
                            zypkg=${PKGVOLPATH}/etc/init.d/${bname}
                    fi
                    if [ ! -x ${zypkg} ]; then
                            write_log "---> Error: start-up program \"${zypkg}\" is not existed or not excutable"
                    else
                            ${zypkg} startup
                            if [ "$?" == "0" ]; then
                                    write_log "---> start \"${bname}\" successfully."
                            else
                                    write_log "---> start \"${bname}\" failed."
                            fi
                    fi
            done < ${USRPKG_DEPS_START}

    As you can see ${USRPKG_DEPS_START} doesn't need to be executable, as the wiki states, though it doesn't hurt either. The entware script needs to be executable (if [ ! -x ${zypkg} ]; then error), which I can't find back in the wiki.




  • gsshelton
    gsshelton Posts: 21  Freshman Member
    First Anniversary Friend Collector First Comment
    edited March 2021
    I look at the file permissions and this is what is returned

    -rwxrwxrwx    1 root     root           155 Feb 27 14:13 USRPKG_DEPS_START
    lrwxrwxrwx    1 root     root            52 Jan 27 22:51 WordPress -> /i-data/ea6cc4e6/.PKG/WordPress/etc/init.d/WordPress
    -rwxrwxrwx    1 root     root       7133479 Jan 27 22:49 WordPress_4.4.1_arm_005.zpkg
    -rwxrwxrwx    1 root     root         10733 Feb 28 20:32 ZYPKGS
    -rwxrwxrwx    1 root     root           414 Feb 28 20:32 ZYPKG_DEPS
    -rwxrwxrwx    1 root     root           290 Feb 27 16:26 entware

    I had followed your suggestion from another post to make the entware script executable.

    In the guide it says:
    1. Put a line in that file called entware. This is the name of the script that the system will run when it boots.

    touch /i-data/.system/zy-pkgs/USRPKG_DEPS_START
    chmod +x /i-data/.system/zy-pkgs/USRPKG_DEPS_START
    echo entware > /i-data/.system/zy-pkgs/USRPKG_DEPS_START
    Is the the last line the line that is being referred to or do you have to have a line all by itself with the word entware? Also, would the fact that the entware-ng package from the MetaRepository had previously been installed be an issue?
    1. Mijzelf
      Mijzelf Posts: 2,600  Guru Member
      First Anniversary 10 Comments Friend Collector First Answer
      Is the the last line the line that is being referred to

      The script loops through all lines in USRPKG_DEPS_START, strips the directory from it, and puts /i-data/.system/zy-pkgs/ before it. If that file exists, and is executable, and contains the string '/i-data/', it's executed with the argument 'startup'.

      You can add several lines for several scripts.

      Also, would the fact that the entware-ng package from the MetaRepository had previously been installed be an issue?

      I wouldn't know how.


      You can try to restart the package system by hand (as root), to see if it spits some errors.

      Stop the packages with

      /etc/init.d/zypkg_controller.sh stop

      And then start with

      /etc/init.d/zypkg_controller.sh start


    2. gsshelton
      gsshelton Posts: 21  Freshman Member
      First Anniversary Friend Collector First Comment
      Result of stopping the packages
       /etc/init.d/zypkg_controller.sh stop
      Starting "/etc/init.d/zypkg_controller.sh".
      Stopping all zypkgs via "/etc/init.d/zypkg_controller.sh" ...
      - shutdowning package "pyLoad" ...
      grep: pyLoad: No such file or directory
      ---> Error: shutdown program "/etc/init.d/pyLoad" is not existed or not excutable
      - shutdowning package "Tftp" ...
      grep: Tftp: No such file or directory
      ---> Error: shutdown program "/etc/init.d/Tftp" is not existed or not excutable
      - shutdowning package "NFS" ...
      grep: NFS: No such file or directory
      ---> Error: shutdown program "/etc/init.d/NFS" is not existed or not excutable
      - shutdowning package "SqueezeCenter" ...
      grep: SqueezeCenter: No such file or directory
      ---> Error: shutdown program "/etc/init.d/SqueezeCenter" is not existed or not excutable
      - shutdowning package "ownCloud" ...
      grep: ownCloud: No such file or directory
      ---> Error: shutdown program "/etc/init.d/ownCloud" is not existed or not excutable
      - shutdowning package "gallery" ...
      grep: gallery: No such file or directory
      ---> Error: shutdown program "/etc/init.d/gallery" is not existed or not excutable
      - shutdowning package "WordPress" ...
      grep: WordPress: No such file or directory
      ---> Error: shutdown program "/etc/init.d/WordPress" is not existed or not excutable
      - shutdowning package "PHP-MySQL-phpMyAdmin" ...
      grep: PHP-MySQL-phpMyAdmin: No such file or directory
      ---> Error: shutdown program "/etc/init.d/PHP-MySQL-phpMyAdmin" is not existed or not excutable
      - shutdowning package "NZBGet" ...
      grep: NZBGet: No such file or directory
      ---> Error: shutdown program "/etc/init.d/NZBGet" is not existed or not excutable
      - shutdowning package "Transmission" ...
      grep: Transmission: No such file or directory
      ---> Error: shutdown program "/etc/init.d/Transmission" is not existed or not excutable
      - shutdowning package "Memopal" ...
      grep: Memopal: No such file or directory
      ---> Error: shutdown program "/etc/init.d/Memopal" is not existed or not excutable
      - shutdowning package "GoogleDriveClient" ...
      grep: GoogleDriveClient: No such file or directory
      kill: you need to specify whom to kill
      kill: you need to specify whom to kill
      ---> shutdown "GoogleDriveClient" successfully.
      - shutdowning package "myZyXELcloud-Agent" ...
      grep: myZyXELcloud-Agent: No such file or directory
      /i-data/ea6cc4e6/.PKG/myZyXELcloud-Agent/etc/init.d/myZyXELcloud-Agent: line 136: zyshclient: not found
      response: {"result":"success"}

      Success
      killall: start_cloudagent.sh: no process killed
      killall: set_upnp_to_router.sh: no process killed
      killall: get_xmpp_info.sh: no process killed
      killall: zyxel_device_register: no process killed
      killall: identify: no process killed
      killall: ffmpeg: no process killed
      killall: check_binding_failed_list.sh: no process killed
      killall: delete_user_binding_has_no_share.sh: no process killed
      killall: delete_user_binding: no process killed
      ---> shutdown "myZyXELcloud-Agent" successfully.
      - shutdowning package "DropboxClient" ...
      grep: DropboxClient: No such file or directory
      ---> Error: shutdown program "/etc/init.d/DropboxClient" is not existed or not excutable
      - shutdowning package "#Create" ...
      grep: /i-data/.system/zy-pkgs/#Create: No such file or directory
      ---> Error: shutdown program "/etc/init.d/#Create" is not existed or not excutable
      - shutdowning package "touch" ...
      grep: /i-data/.system/zy-pkgs/touch: No such file or directory
      ---> Error: shutdown program "/etc/init.d/touch" is not existed or not excutable
      BusyBox v1.19.4 (2020-06-04 10:09:11 CST) multi-call binary.

      Usage: basename FILE [SUFFIX]

      - shutdowning package "" ...
      /etc/init.d/zypkg_controller.sh: line 411: /etc/init.d/: Permission denied
      ---> shutdown "" failed.
      ---> start "Darkstat" successfully.
      ---> start "MetaRepository" successfully.
      Stopping Plex Media Server...done
      ---> start "PlexMediaServer" successfully.
      ---> start "RandomTools" successfully.
      ---> start "Tweaks" successfully.
      Finish "/etc/init.d/zypkg_controller.sh".

      Result of starting them:
       /etc/init.d/zypkg_controller.sh start
      Starting "/etc/init.d/zypkg_controller.sh".
      Starting all zypkgs via "/etc/init.d/zypkg_controller.sh" ...
      - starting package "PHP-MySQL-phpMyAdmin" ...
      grep: PHP-MySQL-phpMyAdmin: No such file or directory
      ---> Error: start-up program "/etc/init.d/PHP-MySQL-phpMyAdmin" is not existed or not excutable
      - starting package "gallery" ...
      grep: gallery: No such file or directory
      ---> Error: start-up program "/etc/init.d/gallery" is not existed or not excutable
      - starting package "WordPress" ...
      grep: WordPress: No such file or directory
      ---> Error: start-up program "/etc/init.d/WordPress" is not existed or not excutable
      - starting package "SqueezeCenter" ...
      grep: SqueezeCenter: No such file or directory
      ---> Error: start-up program "/etc/init.d/SqueezeCenter" is not existed or not excutable
      - starting package "ownCloud" ...
      grep: ownCloud: No such file or directory
      ---> Error: start-up program "/etc/init.d/ownCloud" is not existed or not excutable
      - starting package "NFS" ...
      grep: NFS: No such file or directory
      ---> Error: start-up program "/etc/init.d/NFS" is not existed or not excutable
      - starting package "Tftp" ...
      grep: Tftp: No such file or directory
      ---> Error: start-up program "/etc/init.d/Tftp" is not existed or not excutable
      - starting package "pyLoad" ...
      grep: pyLoad: No such file or directory
      ---> Error: start-up program "/etc/init.d/pyLoad" is not existed or not excutable
      - starting package "NZBGet" ...
      grep: NZBGet: No such file or directory
      ---> Error: start-up program "/etc/init.d/NZBGet" is not existed or not excutable
      - starting package "Transmission" ...
      grep: Transmission: No such file or directory
      ---> Error: start-up program "/etc/init.d/Transmission" is not existed or not excutable
      - starting package "Memopal" ...
      grep: Memopal: No such file or directory
      ---> Error: start-up program "/etc/init.d/Memopal" is not existed or not excutable
      - starting package "GoogleDriveClient" ...
      grep: GoogleDriveClient: No such file or directory
      ---> start "GoogleDriveClient" successfully.
      - starting package "myZyXELcloud-Agent" ...
      grep: myZyXELcloud-Agent: No such file or directory
      ---> start "myZyXELcloud-Agent" successfully.
      killall: zyxel_device_register: no process killed
      killall: zyxel_xmpp_client: no process killed
      killall: zyxel_enet_bridge: no process killed
      - starting package "DropboxClient" ...
      grep: DropboxClient: No such file or directory
      ---> Error: start-up program "/etc/init.d/DropboxClient" is not existed or not excutable
      killall: zyxel_file_monitor: no process killed
      - starting package "touch" ...
      grep: /i-data/.system/zy-pkgs/touch: No such file or directory
      ---> Error: start-up program "/etc/init.d/touch" is not existed or not excutable
      killall: zyxel_thumb_creator: no process killed
      BusyBox v1.19.4 (2020-06-04 10:09:11 CST) multi-call binary.

      Usage: basename FILE [SUFFIX]

      - starting package "" ...
      /etc/init.d/zypkg_controller.sh: line 411: /etc/init.d/: Permission denied
      ---> start "" failed.
      ---> start "Darkstat" successfully.
      ---> start "MetaRepository" successfully.
      Starting Plex Media Server...done
      ---> start "PlexMediaServer" successfully.
      ln: /bin/man: File exists
      ---> start "RandomTools" successfully.
      ---> start "Tweaks" successfully.
      killall: pkg_httpd: no process killed
      killall: pkg_httpd: no process killed
      killall: pkg_httpd: no process killed
      Finish "/etc/init.d/zypkg_controller.sh".

    3. Mijzelf
      Mijzelf Posts: 2,600  Guru Member
      First Anniversary 10 Comments Friend Collector First Answer
      edited March 2021 Answer ✓
      I think you borked up your /i-data/.system/zy-pkgs/USRPKG_DEPS_START.
      If I take the scriplet I posted above, and assume that the contents of USRPKG_DEPS_START is

      ---------------------------------------------------
      touch
      <empty line>
      ---------------------------------------------------

      then the output is exactly

      ---------------------------------------------------
      - starting package "touch" ...
      grep: /i-data/.system/zy-pkgs/touch: No such file or directory
      ---> Error: start-up program "/etc/init.d/touch" is not existed or not excutable
      killall: zyxel_thumb_creator: no process killed
      BusyBox v1.19.4 (2020-06-04 10:09:11 CST) multi-call binary.

      Usage: basename FILE [SUFFIX]

      - starting package "" ...
      /etc/init.d/zypkg_controller.sh: line 411: /etc/init.d/: Permission denied
      ---> start "" failed.
      --------------------------------------------------

      So check it:

      cat /i-data/.system/zy-pkgs/USRPKG_DEPS_START

      It should show entware

    4. gsshelton
      gsshelton Posts: 21  Freshman Member
      First Anniversary Friend Collector First Comment
      USRPKG_DEPS_START was the problem. The guide is confusing on this step. I thought the following needed to be what was in USRPKG_DEPS_START and not just the word entware.
      touch /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      chmod +x /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      echo entware > /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      Thanks again for all of your help!
    5. gsshelton
      gsshelton Posts: 21  Freshman Member
      First Anniversary Friend Collector First Comment
      I spoke too soon. On reboot mount doesn't show the file path anymore and opkg  returns an error. So misunderstood the directions and included the following lines in USRPKG_DEPS_START:
      touch /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      chmod +x /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      echo entware > /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      So I rm the file, rebooted, remade the file and tried again. But when I go back into the file it still contains the above code! What am I doing wrong?
    6. gsshelton
      gsshelton Posts: 21  Freshman Member
      First Anniversary Friend Collector First Comment
      edited March 2021
      I removed everything and started over. I get the the step to reboot, the file path exists, I create the shutdown scripts and I'm able to update opkg and install some packages. But then I reboot and the file path is gone, opkg returns an error and USRPKG_DEPS_START has the same code as above.
      touch /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      chmod +x /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      echo entware > /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      This is the result of # cat /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      touch /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      chmod +x /i-data/.system/zy-pkgs/USRPKG_DEPS_START
      echo entware > /i-data/.system/zy-pkgs/USRPKG_DEPS_START~ # 

    Consumer Product Help Center