Plug Computers Project Page
(Please be aware that you are responsible for any damage to your hardware, software, or files, so use extreme caution when following guides/instructons on this site. NO warranty is explicitly or implicitly provided. It is assumed that you know what you are doing and if not, get assistance from somebody that does, or do not perform the installation.)
A lot of packages are getting upgraded. You might want to upgrade everything by:
"ipkg update" "ipkg upgrade"
If you do not want your setup overwritten, follow the prompts. Probably would be a good idea to make back ups before. If you have enough disk space, whenever I install a package I also download the actual .ipk package from http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ so that if I have problems with the new version, I have the option of reloading the old version. Here is a link to the Packages information, just like the one you get with "ipkg info" but it contains "all" the packages - http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/Packages.
Remember, to see ipkg options, just type "ipkg".
Setting the ipkg repository
For users of Pogoplugs (V1, V2, Pogoplug Pro/Video/V3(P21) (see installation about wget) and Biz) and Dockstars/GoFlex who are running Optware ( defunct OpenPogo ), and want to install more software. You can directly link to the original repository by changing the source. To do this:
A. Change to the ipkg configuration directory
B. Check the name of the conf file
C. Should see some filename with .conf in the ending, then edit this file
vi or nano filename.conf (probably armel-feed.conf)
D. Comment out current repo
"src cross http://openpogo.com/repo" to "#src cross http://openpogo.com/repo"
E. Then add the new repo underneath
src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable
F. Exit from your editor, then reboot your system
G. Once rebooted, log back in to your system and do an update
At this point you are now linked to the main repository and can update packages. If you feel brave enough and have backed up everything, you can do an ipkg upgrade, and follow the prompts. You may need to check /opt/etc/ipkg.conf to see if there is also a reference to the openpogo repo and change that to the nslu2 optware repository.
Miscellaneous Package Information
To see how to set up some packages, you can go back to the Packages page. Suggested packages to install to improve your Linux experience are "procps", "psmisc", and "coreutils" (see installation page for Pro). To actually get these packages working, you need to modify your PATH. There are two ways, probably doing both would cover all circumstances. One is to modify you "/etc/profile" if you have one so:
"mount -o rw,remount /"
Then reboot your system. The second is to modify your .bash_profile in your home directory:
"PS1='[\u@\h \W]\$ '"
Then log out and then log in again. In both cases make sure your "/opt" subdirectories are first so that the new utilities will overide the original. Modify the PATH to what is appropriate for your system if you have installed other packages.
To set up a new installation of Optware on Pogoplug/Dockstar then see Optware installation. You can perform a quick install with files from http://tech.groups.yahoo.com/group/nslu2-general/files/Plug%20Files/ if you know Linux (Use at your own risk, as-is no warranty, read the readme.txt).
This article plus the existing articles in the Time Machine Backups How To are great guides in the setup of a Pogoplug Pro Time Machine, but could also work for other Plug Platforms or the NSLU2 et al. If you want to set up AFP it is also a good guide and seems to be faster than Samba.
Building Repository Packages
If you would like to see about making/building the repository packages, you can do this on a desktop or on your plug computer. Install the Optware development package "ipkg install optware-devel" (this will install autoconf , automake , bash , bison , bzip2 , coreutils , diffutils , file , findutils , flex , gawk , groff , gzip , libstdc++ , libtool , make , m4 , ncurses , openssl , patch , perl , pkgconfig , python25 , rsync , sed , svn , tar , tcl , wget-ssl , binutils , libc-dev , gcc). Warning: wget-ssl in optware-devel might be missing a dependency - libidn, so before installing optware-devel, do "ipkg install libidn". Go to the subdirectory that you will use for making packages and then type:
"svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware"
This will make an optware subdirectory and download the build packages. Then, go into the optware subdirectory and type "make sheevaplug-target". On the desktop, this could take some time because it will download the toolchain. Then, type "cd sheevaplug" to get into the sheevaplug directory. Then type "make directories toolchain ipkg-utils". If you want to make a package, type "make packagename", and to create the ipkg, type "make packagename-ipk". There might be some errors if you have not installed some base packages but you can install them at that point and make again. More details are at Add a package to optware.
If you want to cross-compile on the desktop, outside of the packages, you will need a Linux environment. If you are using windows, you can use virtualbox or some other virtualization software to set up a Linux environment. Then you can set up a CodeSourcery environment by borrowing a script from NAS central:
"http://general.nas-central.org/wiki/Setting_up_the_codesourcery_toolchain_for_X86_to_ARM9_cross_compiling" or "http://ftp.maddes.net/hardware/Linkstation/setup_codesourcery.sh"
and modifying the script for arm-2008q1 (originally for V2 and earlier use this, unless CE updates this also, for later see below):
If this location changes just look for Sourcery G++ Lite 2008q1-126 for ARM GNU/Linux package on CodeSourcery site.
Building the kernel and modules
You can also download and recompile the kernel by going to the pogoplug.com site (thank you cloudengines), under Developers/Open Source. Get the address of the kernel e.g.
Use "wget" to download this file. Install this archive with "tar xjvf". Then go into the kernel subdirectory and type
"cp pogoplug_kernel.config linux-220.127.116.11/.config".
Then change directory to the linux subdirectory "cd linux-18.104.22.168". If you are using the plug computer as your development platform, you need to make a simple alteration to the Makefile. Edit the makefile and there are 4 lines to modify:
#ARCH ?= $(SUBARCH)
ARCH ?= $(SUBARCH)
config %config: scripts_basic outputmakefile FORCE to %config: scripts_basic outputmakefile FORCE and / %/: prepare scripts FORCE to %/: prepare scripts FORCE
I believe the lines are around 391 and 1445 respectively.
"mount -t cifs //servername/share -o username=myusername,password=mypassword /tmp/somemountname".
The Pogoplug Pro/Video/V3(P21)/B0Xs/OXNAS Kernel requires toolchain arm-2008q3 or newer. Download the sourcecode:
You can also download the source code for busybox from the Pogoplug developer's site: http://download.pogoplug.com/opensource/pro/busybox-1.16.1.tar.bz2
Just untar it and use "make menuconfig" to modify it to your needs (you can probably find the renamed .config that Cloud Engines used). You can use this to enable, for example mdev, pivot root, and add more functions to utilities such as wget.
To get the time zone (Pacific Time will be used as an example).
"mount -o rw,remount /"
To get a list of time zones:
For the US: Pacific - PST8PDT, Mountain - MST7MDT,
Central - CST6CDT, Eastern - EST5EDT.
"mount -o rw,remount /"
You can edit "/opt/etc/ntp/ntp.conf" to set your servers and settings.
Even better and simpler, add a GPS USB dongle and install gpsd "ipkg install gpsd" then "gpsd -n /dev/ttyUSB0". Make sure you do this after making the root filesystem writeable with "mount -o rw,remount /". You will probably need to add some kernel modules (usbserial.ko, garmin_gps.ko, pl2303.ko, etc.) depending on what dongle you use (see above how to build kernel modules). You then need to set up the serial device ttyUSB0:
Create a uucp user and group. In your /etc/passwd, there should be an entry like "uucp:x:503:503:Linux User,,,:/home/uucp:/bin/sh" and in /etc/group, like "uucp:x:503:". The UID and GID can be different from 503 if it is already in use. then you can type:
"mknod /dev/ttyUSB0 c 188 0" "chmod 0660 /dev/ttyUSB0" "chgrp uucp /dev/ttyUSB0"
Check your installation with "dmesg" and "more /proc/devices". Make sure your dongle is in binary mode (google this). Verify gpsd with "gpsd -n -N -D2 /dev/ttyUSB0". Change "-D" debug level as needed. You can test with "cgps", or if it is a SIRF dongle "sirfmon".
You can then add the GPS server lines "127.127.28.0" to your /opt/etc/ntp/ntp.conf:
#Default conf file for ntpd driftfile /var/spool/ntp/ntp.drift tinker panic 0 tos mindist 0.050 server 127.127.28.0 minpoll 4 maxpoll 4 prefer fudge 127.127.28.0 time1 0.796 refid GPS server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org
Adjust time1 offset to match your system.
You can create a start file "/opt/etc/init.d/S75gpsd" with the contents:
#!/bin/sh if [ -n "`pidof gpsd`" ]; then /usr/bin/killall gpsd 2>/dev/null fi /opt/sbin/gpsd -n /dev/ttyUSB0 /bin/sleep 1
Place the start file call before the one for ntpd in your /etc/init.d/rcS or /etc/init.d/mount_optextX and adjust sleep delay for your system. Now your plug not only should keep time correctly, but can function as a local time server. Check function with "ntpq -p" and make adjustments as needed. Good references on the internet are "http://gpsd.berlios.de/", "http://www.lammertbies.nl/comm/info/GPS-time.html", and "http://www.meinberg.de/english/info/ntp.htm". Just remember that the USB interface has no mechanism to transfer a pulse signal so no PPS. Make sure after making your modifications to make the root filesystem read only with "mount -o ro,remount /" or reboot the system.
Setting up Syslogd
On non-Pro versions, you can use the native busybox syslogd. The busybox syslogd performs it's own log rogrotation. The messages are kept in /tmp so they dissappear when the system is rebooted and do not cause wear if you are using a flash drive. For the Pro, you can replace its busybox with the same as the other plugs (copy from another plug or compile from the pogoplug.com-Developer's section) or install Syslog-ng. You can create the script S11syslogd (Be sure to place an entry in /etc/init.d/rcS) with the content:
#!/bin/sh if [ -n "`pidof syslogd`" ]; then /usr/bin/killall syslogd 2>/dev/null fi /bin/mount -o rw,remount / /sbin/syslogd -O /tmp/messages -b 2 /bin/sleep 1 /bin/mount -o ro,remount /
Setting up cron is staightforward and involves installing, configuring, and set up to run at start up:
1. Type "mount -o rw,remount /" 2. Type "ipkg install cron" 3. Change to /opt/etc directory "cd /opt/etc" 4. Edit crontab and place your script, then save:
SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/sbin:/opt/bin MAILTO="" HOME=/ # ---------- ---------- Default is Empty ---------- ---------- # * * * * * root /opt/sbin/yourscript.sh
5. Test by running "/opt/etc/init.d/S10cron" and fix any errors. 6. Add "/opt/etc/init.d/S10cron" to your rcS or mount_optextX. 7. Make root file system read only with "mount -o ro,remount /".
For more information on cron "http://www.linuxhelp.net/guides/cron/". You can type "crontab -l" to list or "crontab -e" to edit (in vi).
So busybox plugs do not have a shutdown command, only poweroff, halt, and of course reboot. But you can setup a shutdown script that is automatically called when poweroff, halt, and reboot are called. In "/etc/inittab" make an entry:
In "/etc/init.d/rc.shutdown", you need to create and modify this to suit your system.
#!/bin/sh #### Turns off the front pogoplug light to show that the script started. /sbin/rmmod xce #### Logs the shutdown time. /bin/echo "Shutdown Time is `date`" > /opt/var/log/lastshutdown.txt #### Paranoia on my part to make sure all files are written to. /bin/sync /bin/sync #### Turn off swap. I had to explicitly use the device name. /sbin/swapoff /dev/your-swap-device-name #### Shutdown Processes except for the one running the script. /usr/bin/killall -15 processes-that-do-not-use-start-stop /opt/etc/init.d/SXXprocess stop #### Unmount data drives. /bin/umount -r /tmp/data-drive /bin/umount -r /tmp/data-drive #### If it is a hard drive, spin it down (ipkg install sdparm). #### Remember /dev/sda not /dev/sda1. /opt/bin/sdparm --command=stop /dev/data-drive #### Unmount opt drive. /bin/umount -r /opt /bin/umount -r /opt #### More paranoia. Although swapoff -a did not work for me. /bin/sync /bin/sync /sbin/swapoff -a /bin/umount -a -r
* Off topic, if you are using your plug as a file server, sometimes you get disconnections from your drive, or drive clicking, your usb drive cable may be marginal. I use both usb powered and external powered usb drives and find that the external ones are more reliable. You can also try a shorter, better shielded cable.
Credits to: fenschop, bturrie, Irregular Shed and bzhou.