Western Digital My Book 所使用的 BusyBox 可塑性还是很高的。
想到正好在用 PPA 在 PSP 上通过 WiFi 看电影,干脆把 nethostfs 服务也集成到 My Book 里面好了。(English Version)
前期准备:在 My Book 上加装 SSH 服务。
第一步:按照下面的方法下载 nethostfs v1.5 源代码,解包,编译。
bash
- wget http://www.snailium.net/mbwe/nethostfs15src.tar.gz
- tar -xzvf nethostfs15src.tar.gz
- cd nethostfs15src
- make
- cp nethostfs /usr/sbin
- chmod 755 /usr/sbin/nethostfs
- chown root:root /usr/sbin/nethostfs
第二步:通过 My Book 共享储存管理器建立 PSP 共享文件夹。
第三步:在 /etc/init.d/ 下建立 nethostfs 服务脚本。
/etc/init.d/nethostfs
- #!/bin/sh
- #
- # Starts or stops the nethostfs for remote PSP access.
-
- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- NAME="nethostfs"
- DESC="Remote PSP access"
-
- case "$1" in
- start)
- echo -n "Starting $DESC: $NAME"
- nice -n 10 nethostfs /shares/internal/PSP &
- echo "..."
- ;;
- stop)
- echo -n "Stopping $DESC: $NAME"
- killall nethostfs
- echo "."
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop}" >&2
- exit 2
- esac
-
- exit 0
-
第四步:在 /etc/init.d/ 下建立相关启动/关闭服务链接。
bash
- cd /etc/init.d/
- ln -s /etc/init.d/nethostfs S91nethostfs
- ln -s /etc/init.d/nethostfs K09nethostfs
第五步:重启 My Book。
注意 1:在服务脚本中,使用了 nice -n 10 调整进程的优先级,防止 nethostfs 占用过多资源。
注意 2:此方法也适用于 iRshell。(PPA 的 WiFi 部分使用的是 iRshell 的源代码)
添加评论