来吧兄弟,一起玩一起讨论!
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 yumin9822 于 2014-9-23 15:34 编辑
本人DS213J 固件DSM4482测试通过,成功安装了nano aria2 ncdu等软件。红色字体部分为本人修改的部分。 高亮红色字体部分必须修改,要不然每次reboot后,环境变量会丢失!
Synology ds213joptware manual bootstrap guide.
Create optware root directory - # mkdir /volume1/@optware
- # mkdir /opt
- # mount -o bind /volume1/@optware /opt
复制代码
Setup ipkg- # feed=http://ftp.osuosl.org/pub/nslu2/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
复制代码
Set PATH /etc/profile and /root/.profile,PATH could be changed below: PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
Then make the profileeffective immediately. $ source /etc/profile
Create init scripts The following stepswill allow to automatically bind the /volume1/@optware directory to /opt andtrigger the /opt/etc/init.d/* scripts. 1. Create the/etc/rc.local file (chmod 755) and insert: - #!/bin/sh
- # Optware setup
- [ -x /etc/rc.optware ]&& /etc/rc.optware start
复制代码
2. Create the /etc/rc.optware file (chmod 755)and insert: - #! /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
复制代码
3. Create the /opt/etc/rc.optware file (chmod 755)and insert:
- #!/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
复制代码
Done
------------------- DSM系统升级后,由于profile文件被重置,需要重新执行下面命令以确定环境变量 Set PATH /etc/profile and /root/.profile,PATH could be changed below: PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
Then make the profile effective immediately. $ source /etc/profile |