From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 21:47, 20 September 2006 by Ramuk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

LinkStation ('li[ng]k-'stA-sh&n), n. 1. A Linux Based NAS device. 2. highly modifiable standalone PowerPC, MIPS or ARM computer. Connectivity via Ethernet or USB.

Wiki (wee' kee), n. a type of website that allows anyone visiting the site to add, remove, or otherwise edit all content, quickly and easily, often without the need for registration. This ease of interaction and operation makes a wiki an effective tool for collaborative writing.


Huh? FreeLinkomatix

This project will be create a shell script like automatix that will use apt-get to install the commonly needed applications in Freelink. This will be similar to Andre's Web Installer (come to think of it we'll use that too!)


To come up with a script that will install the following on FreeLink for the LS1 and HG

  1. Install Samba
  2. Install Webmin
    1. Upgrade Webmin
    2. Install and use the Webmin 'Tiger' theme
  3. Free up space on hda1
  4. Access unstable branch
  5. Fix Time (NTP)
  6. Cups and USB mounting
  7. Upgrade to Kernel 2.6 using Andre's web installer
  8. Development tools
  9. Install ipkg

Freelink - Convert the LinkStation into a Full-fledged Debian Linux Server

Get Samba and webmin and update with apt-get

apt-get update
apt-get upgrade
apt-get install samba smbfs
apt-get install webmin webmin-core webmin-cpan webmin-inetd webmin-logrotate webmin-firewall
apt-get install webmin-samba

Troubleshooting Windows shares (samba) - guest access

1. Pick a directory you wish to share ie: /mnt/share and change the access permissions to make it readable and writable to everybody.

mkdir /mnt/share
chmod 777 /mnt/share

2. Add the [share] section to /etc/samba/smb.conf

 security = share
 workgroup = MSHOME
 create mode = 777
 directory mode = 777

 comment = LinkStation Share
 path = /mnt/share
 read only = no 
 public = yes

3. Restart Samba on the Linkstation with this command:

/etc/rc.d/init.d/smb restart

Install SSH and remove the Telnet Daemon from startup

apt-get install ssh
chmod 0644 /etc/init.d/S05utelnetd
rm /etc/rc.d/rc2.d/S05utelnetd

Freeing up space on hda1

cp -Rdp /home /mnt
rm -R   /home
ln -s /mnt/home /home
cp -Rdp /usr /mnt
rm -R   /usr
ln -s /mnt/usr /usr
cp -Rdp /var /mnt
rm -R   /var
ln -s /mnt/var /var

Get access to packages from the Debian unstable branch

1. Edit or create the file /etc/apt/apt.conf and add:


2. Edit /etc/apt/sources.list and add the following lines:

deb unstable main contrib non-free
deb-src unstable main contrib non-free

3. Then update:

apt-get update

Correct the system time and setup Network Time Protocol (NTP)

apt-get install ntp ntp-simple ntp-server ntpdate

USB devices including CUPS printing, scanners, and webcams

apt-get install hotplug usbview usbutils

Upgrade to the 2.6-kernel (ppc only)

tar -C / -xvzf latest-webinstaller.tar.gz

Precompiled C development environment, running on the LS

mkdir tmp
cd tmp
mkdir devtools
cd devtools
tar xzvf ../ppc-tools-2_1.tgz
tar -C / -xvjf kernel-headers-2.4.20_hglan_htgl-2.0.tar.bz2

Install Ipkg on the Linkstation (for end-users)

tar -C / -xvzf powerpc-hdhlan-ipkg-0.99.153-1.tgz
  • Add the following lines to the file /etc/ipkg.conf:
src nslu2-cross-stable
src nslu2-cross-unstable
src nslu2-native-stable
src nslu2-native-unstable
  • then
ipkg update

Optional Goals

  1. Install Netatalk, MtDaapd, rsync
  2. Install ccxstream for XBMC
  3. Install KAID
  4. ??? Install other Mediaservers???
  5. Install bwm-ng bandwidth monitor, top, iftop, and nmap
  6. Install SMART hard drive monitoring tools (For temperature)

Macintosh related configuration, netatalk, mt-daapd

tar -C / -xvzf libid3tag_0.15.1b-binaries-ppc.tar.gz
tar -C / -xvzf mtdaapd_0.2.4-binaries-ppc.tar.gz
mv /etc/mt-daapd.SAMPLE /etc/mt-daapd
  • Then edit /etc/mt-daapd/*. When done,
/etc/init.d/mt-daapd start

XBMC - Using Xbox Media Center with the LinkStation

ipkg install ccxstream
  • Edit the ccxstream start file and change the username and shared directory for your system



if [ -n "`pidof ccxstream`" ] ; then
   killall ccxstream 2>/dev/null

# see /opt/doc/ccxstream/README for the full summary on
# command-line options, but the terse summary is that
# -r is the directory to "share" using ccxstream, and is
# probably the option you most want to adjust.

sleep 2
/opt/sbin/ccxstream -r /mnt/share -u username -f -F /var/run/
  • Start the ccXStream daemon

KAID - XLink Kai online gaming for Xbox, 360, PS2 and PSP

unzip kaid-*
mv kaid-static* kaid
mv kaid /usr/local/sbin
chmod 755 /usr/local/sbin/kaid
  • create /etc/init.d/kaid
#! /bin/sh
export USER="root"
mkdir /var/misc
touch /var/misc/kaiSystemConfig.txt
touch /var/misc/kaiEnginePersist.txt
chmod ugo+w /var/misc/kaiSystemConfig.txt
chmod ugo+w /var/misc/kaiEnginePersist.txt
su - $USER -c"kaid"
su - $USER -c"killall kaid"
case "$1" in
echo -n "Starting Kaid: "
echo -n "Stopping Kaid "
echo -n "Restarting Kaid "
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
exit 0
  • Create a symbolic link to start kaid at every reboot and kill it at every shutdown automaticly:
chmod 755 /etc/init.d/kaid  
ln -s /etc/init.d/kaid /etc/rc.d/rc0.d/K99kaid
ln -s /etc/init.d/kaid /etc/rc.d/rc2.d/S99kaid
ln -s /etc/init.d/kaid /etc/rc.d/rc6.d/K99kaid
  • Create /etc/kaid.conf and put in your username/password
# Kai Engine Configuration File (
# This file contains the configuration options for Kai Engine.
# There are some fields which can be modified, the descriptions of these fields
# and their default values are listed below
# Verbosity : Debug output verbosity. Options are as follows:
# 0 - Silent apart from starting / stopping messages, and init failures.
# 1 - As 1, but shows import events such as UI attach/detach, console detection,
# orb connection / loss.
# 2 - As 2, but more detailed, showing thread start/stop events, DHCP
# events, and other important information.
# 3 - Debug - same as 2, but with lots of extra information - useful
# for diagnosing segfaults etc.
Verbosity = 1
# User : Specifies which system user to switch to after having
# allocated necessary privileged resources. (FreeBSD Only!)
User = daemon
# UIBind : Specifies which ip/port kaid will use to listen for controller
# UIs. You don't want to change this.
UIBind = :34522
# OrbPort : Specifies which port kaid will use to probe(UDP) and talk to
# Orbitals (TCP) . You don't want to change this.
OrbPort = 34525
# OrbDeepPort : Specified which port kaid will use to probe and talk to
# deep resolution servers. You don't want to change this.
OrbDeepPort = 34523
# EngineBind : Specifies the IP:port to listen for the engine (UDP socket);
# (port should be forwarded in your router if using NAT)
# Ex.:,, :37500
EngineBind = :0
# EngineDeepBind : Specifies the IP:port to listen for the engine (deep resolution)
# Do not enable this unless directed to.
# EngineDeepBind must be a different port than EngineBind if
# they use the same IP address
# Ex.:,, :37501
EngineDeepBind = :0
# Engine PAT : Tells the orbital server to use your perceived UDP port, as opposed to the
# one specified in EngineBind. Ignored if EngineBind is 0. Please don't turn this
# setting to 1, unless directed to do so in a troubleshooting session.
EnginePAT = 0
# SniffDevice : NIC to sniff for console traffic (eth0, ethX, ...). Will be used
# for packet injection too.
# Ex.: eth0 (default), en0 (Mac OSX), br0 (WRT54G)
SniffDevice = eth0
# LocalDevices : How many consoles to detect before the engine locks the pcap filter. Setting this to 0,
# means the engine will never lock - which means you can use any number of consoles, but
# you will notice a performance hit, if your network is busy with other traffic. The best
# thing to do here is to set the number to the number of consoles you own - that's why it
# defaults to 1 - because most people have just 1 console.
LocalDevices = 1
# ConfigURL : URL where orb list is published (and extra stuff) - best not to mess with this.
ConfigURL =
# ConfigCache : Location of cached orb list - this file is used if the ConfigURL is inaccessible
# Make sure this file is writable. WRT54G users might want to change it to a non-volatile
# location if that feature is available in their firmware
# (i.e. /jffs/tmp/ for DD-WRT, /usr/local/ for Sveasoft)
ConfigCache = /var/misc/kaiSystemConfig.txt
# CacheFile : Location of Kai engine cache information
# Make sure this file is writable. WRT54G users might want to change it to a non-volatile
# location if that feature is available in their firmware
# (i.e. /jffs/tmp/ for DD-WRT, /usr/local/ for Sveasoft)
CacheFile = /var/misc/kaiEnginePersist.txt
#Authentication : Set username and password and AutoLogin=1 for an easy life...
AutoLogin = 1
# Xbox DHCP setting : Please leave alone, unless playing with emulators or DoomX etc. You DO NOT need this set to 1
# to use XBMC as a dashboard - setting it to 1 will *break* your dashboards internet connectivity.
XBoxHomebrew = 0

Small and simple console-based bandwidth monitor, top, iftop, nmap

apt-get install bwm-ng
apt-get install top
apt-get install iftop
apt-get install nmap

S.M.A.R.T. hard drive monitoring

apt-get install smartmontools
  • Edit /etc/default/smartmontools
  • Edit the smartd config file /etc/smartd.conf
    • comment out: DEVICESCAN
    • add: /dev/hda -a -H -m root

This little script generates a small bit of html showing a number of system stats

 tc=$(smartctl -a /dev/hda | grep 194 | colrm 1 87)
 tf=$(echo "scale=2;((9/5) * $tc) + 32" |bc)
 echo " Used   %  Share"
 echo "------ --- -----"
 df -h | grep /dev/hda | colrm 1 27 | colrm 6 11
 df -h| colrm  45 55 | grep /dev/s | grep -v tmpfs | colrm 1 27 | colrm 6 11
 echo "<table>"
 echo "<tr><td>Users:</td><td>"
 echo "</td></tr>"
 echo "<tr><td>Uptime:</td><td> "
 uptime \
  | awk '{
   # chops off "up" and everything before it:
   sub(/.*up[ ]+/,"",$0)
   # chops off ", # users" and everything after it:
   sub(/,[ ]+[0-9]+ user.*/,"",$0)
   # cleans up extra spaces, i think:
   # obvious enough, prints the results
 echo "</td></tr>"
 echo "<tr><td>Load:</td><td>"
 uptime | sed 's/^.*average: / /'
 echo "</td></tr><tr><td>Temp:</td><td>"
 echo $tf " F"
 echo "</td></tr> </table>"
 echo "<hr>"
 date | colrm 20 30"
 echo "<hr>"