【问题标题】:Using Optware packages and startup scripts on dd-wrt router在 dd-wrt ​​路由器上使用 Optware 软件包和启动脚本
【发布时间】:2014-03-30 02:17:21
【问题描述】:

我正在尝试在我的 dd-wrt ​​路由器 (Buffalo WZR-HP-AG300H) 上运行一个 mumble 服务器 (umurmur)。我在设备上刷了一个最新的社区版本的 dd-wrt(SVN 版本:23320),它内部有一个 Atheros CPU。

之后,我使用这些指南(Guide 1Guide 2)将 USB pendrive 安装到文件系统中并创建了可写目录。这是我保存到 nvram 的启动脚本(通过 web-gui)

编辑:USB pendrive 应在与 DD-Wrt 一起使用之前进行分区。

#!/bin/sh

sleep 5
insmod mbcache
insmod jbd
insmod ext3

mkdir '/mnt/part1'
mkdir '/mnt/part2'
mount -t ext3 -o noatime /dev/sda5 /mnt/part1   # /dev/sda5 -> partition on USB pendrive
mount -t ext3 -o noatime /dev/sda7 /mnt/part2   # /dev/sda7 -> partition on USB pendrive
swapon /dev/sda6                                # /dev/sda6 -> partition on USB pendrive

sleep 2
if [ -f /mnt/part1/optware.enable ];then 
#mount -o bind /mnt/part2 /mnt/part1/root
mount -o bind /mnt/part1        /jffs
mount -o bind /mnt/part1/etc    /etc
mount -o bind /mnt/part1/opt    /opt 
mount -o bind /mnt/part1/root   /tmp/root
else
exit
fi

if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib:/opt/lib:/opt/usr/lib:/jffs/usr/lib:/jffs/usr/local/lib
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/jffs/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
export IPKG_INSTROOT=/opt
else
exit
fi 

脚本运行良好,我可以使用 opkg 安装软件包。我也可以手动运行 umurmur,但我正在努力让 umurmur 自动启动。我认识到放在/opt/etc/init.d/ 中的umurmur 启动脚本需要startstop 之类的参数,但似乎它们被调用时没有任何参数。

here 描述的另一种方式也不起作用。

有没有人针对此类问题提供有效的解决方案?请帮忙!

【问题讨论】:

    标签: linux embedded-linux dd-wrt


    【解决方案1】:

    Optware 仅在 Broadcom 路由器上运行。你的有 Atheros 芯片组。

    取自此页面:Link

    【讨论】:

    • 该站点链接到一个线程,该线程描述了 Atheros 设备的 opkg 分发方法。
    【解决方案2】:

    我不清楚你提到的页面已经改变 - 事实上我的设置与你的完全不同,但为了让脚本在启动时工作我做了以下 -

    • mkdir -p /jffs/etc/config
    • 将脚本复制到/jffs/etc/config目录,重命名为以.startup结尾
    • chmod 755 /jffs/etc/config/scriptname.startup

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-26
      • 2017-04-03
      • 2019-09-14
      • 1970-01-01
      • 2013-01-19
      • 2015-03-26
      • 1970-01-01
      • 2011-06-08
      相关资源
      最近更新 更多