Synology usage series 0b – Bootstrapping DS213j


Source https://github.com/trepmag/ds213j-optware-bootstrap

Some essential steps were missing from the source, so I create this post again in case I need to repeat again.

  1. Telnet to Diskstation as root. Execute the command below (must follow the same sequence please)

    # mkdir /volume1/@optware
    # mkdir /opt
    # mount -o bind /volume1/@optware /opt
    # feed=http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
    # ipk_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
    # wget $feed/$ipk_name
    # tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf -
    # mkdir -p /opt/etc/ipkg
    # echo "src cross $feed" > /opt/etc/ipkg/feeds.conf

  2. Edit /etc/profile, add the following line at the end of the file

    PATH=/opt/bin:/opt/sbin:$PATH

  3. Edit /root/.profile, add the following lines at the end of the

    PATH=/opt/bin:/opt/sbin:$PATH
    export PATH

  4. Create the /etc/rc.local file with the following contents
    #!/bin/sh
    
    # Optware setup
    [ -x /etc/rc.optware ] && /etc/rc.optware start
    
    
  5. Create the file /etc/rc.optware with the following contents
    #! /bin/sh
    
    if test -z "${REAL_OPT_DIR}"; then
    # next line to be replaced according to OPTWARE_TARGET
    REAL_OPT_DIR=/volume1/@optware
    fi
    
    case "$1" in
        start)
            echo "Starting Optware."
            if test -n "${REAL_OPT_DIR}"; then
                if ! grep ' /opt ' /proc/mounts >/dev/null 2>&1 ; then
                    mkdir -p /opt
                    mount -o bind ${REAL_OPT_DIR} /opt
                fi  
            fi
        [ -x /opt/etc/rc.optware ] && /opt/etc/rc.optware
        ;;
        reconfig)
        true
        ;;
        stop)
            echo "Shutting down Optware."
        true
        ;;
        *)
            echo "Usage: $0 {start|stop|reconfig}"
            exit 1
    esac
    
    exit 0
  6. Create the file /opt/etc/rc.optware with the following contents
    #!/bin/sh
    
    # Start all init scripts in /opt/etc/init.d
    # executing them in numerical order.
    #
    for i in /opt/etc/init.d/S??* ;do
    
            # Ignore dangling symlinks (if any).
            [ ! -f "$i" ] && continue
    
            case "$i" in
               *.sh)
                    # Source shell script for speed.
                    (
                            trap - INT QUIT TSTP
                            set start
                            . $i
                    )
                    ;;
               *)
                    # No sh extension, so fork subprocess.
                    $i start
                    ;;
            esac
    done
  7. Execute the command below


    # chmod 755 /etc/rc.local
    # chmod 755 /etc/rc.optware
    # chmod 755 /opt/etc/rc.optware

  8. Restart DS213j. Then test the ipkg with the command below.

    # ipkg update
    # ipkg list

Let me know if I missed something.





3 thoughts


Leave a Reply

Your email address will not be published. Required fields are marked *