博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Install ArchLinuxARM on the Seagate GoFlex Home
阅读量:6292 次
发布时间:2019-06-22

本文共 20821 字,大约阅读时间需要 69 分钟。

hot3.png

2011-04-28 23:14 | Category: ,  | Tags: , , , , 

Attention! This is an advanced topic! Do not engage in any activity if you're not cool with the Linux command line and ready to do something to your GoFlex Home that Seagate did not intend you to do! I've warned you.

 

The section describing the basic system setup is out of date as of 2013-06-05. Please refer to  for up-to-date information.

The Hardware

Images of the hardware to be found in the .

It's a fairly standard hardware platform commonly found in many consumer NAS products:

Type Component Used in Seagate GoFlex Home
CPU Marvell "Kirkwood" 88F6281 @ 1.2GHz () (ARMv5 (ARM9) based)
Ram 128 MB (Nanya , 64M x 16, 400MHz, 5-5-5)
Flash 512 MB
Network 10/100/1000 Marvell  Gigabit Ethernet
USB 1x USB 2.0 Marvell Orion EHCI
HDD Seagate ST31000528AS (1TB Version)

Information from the running Plugbox Linux system (that's what it was called when I started this post - now its Arch Linux ARM):

More on the hard and software of the GoFlex Home: .

The GoFlex Home has a  built right into its Kirkwood SoC: .

See the thread  in the ArchLinuxARM forum, Sebastien Lucas' blog post  and . See  and .

Initial installation of Arch Linux ARM (was: Plugbox Linux)

Arch Linux ARM / Plugbox Linux is based on Arch Linux so you can find a lot of information on their .

This section is outdated as it describes the installation of the former Plugbox Linux. As of 2012-03-01 you want to install Arch Linux ARM and the instructions can be found on  (click on Installation there).

  • How to connect via SSH to the original firmware:
    • and on : click on Installation

First connect your GoFlex Home to a router (it must receive an IP automatically via DHCP). Run the wizard on the website of the device (needs Internet connectivity – I had no problems with that) and create a user. Then connect using SSH on the terminal (XXXX-XXXX-XXXX-XXXX is the product key on the backside):

ssh USERNAME_hipserv2_seagateplug_XXXX-XXXX-XXXX-XXXX@YOUR_IP_ADDRESS

To gain root access run:

sudo -E -s

Now disable updates:

chmod -x /usr/bin/oe-update-checkerchmod -x /etc/cron.daily/update-checkerchmod -x /etc/cron.hourly/update-checkerchmod -x /etc/init.d/openvpnchmod -x /usr/sbin/openvpnchmod -x /var/www/admin/sshtunnel.pl

Install UBIT (when repeating this step later – so when Plugbox Linux is allready installed on the GoFlex – you  by running pacman -Sy cpio beforehand):

# Download the U-Boot Install Toolkit (UBIT) environmentcd /tmpwget http://jeff.doozan.com/debian/goflex/v0.6/uInitrdwget http://jeff.doozan.com/debian/goflex/v0.6/ubit_startchmod +x ubit_start

Start the UBIT environment where the prompt will read ubit0-6:~#:

./ubit_start

Install uboot and prepare your HDD for Plugbox Linux to be installed:

uboot_uptodatechain_install goflexhomefdisk /dev/sda# and enter `p`, `d 1`, `p`, `n`, `p`, `1`, then `ENTER` (default values) finally `w`.# Note: U-Boot does have partition size limitations.# If your install doesn't work on a large (1TB+ drive) try creating a small (~32GB) boot partition instead.mke2fs -j /dev/sda1

Download the Plugbox tarball and unpack the Plugbox tarball (this will take a long time):

on /dev/sda1 wget http://plugboxlinux.org/os/2011.02/PlugApps-Linux-2011.02-rootfs.tar.gz -O rootfs.tar.gzon /dev/sda1 tar -xzvf rootfs.tar.gz

You need to set the MAC address to the value printed on the back side label of your GoFlex Home:

ethaddr uu:vv:ww:xx:yy:zz

Still on the UBIT prompt: install the rescue system and mark the partition with the special label "rootfs"

on /dev/sda1 ubit_writetune2fs -L "rootfs" /dev/sda1

Leave the UBIT shell and reboot the device

exit/sbin/reboot

Run a full system update

pacman -Scc  pacman -Syyuf

In case of problems have a look at .

Prepare the HDD on an different system

Connect the HDD to a different Linux computer and run the following commands:

cd /media/boothddsudo wget http://plugboxlinux.org/os/2011.02/PlugApps-Linux-2011.02-rootfs.tar.gz -O rootfs.tar.gzsudo tar -xzvf rootfs.tar.gz

U-Boot rescue terminal

Format a usb stick with ext3 and get ubit boot files and modules:

cd /media/sticksudo wget http://jeff.doozan.com/debian/goflex/v0.6/v2.6.37/boot.tar.gzsudo wget http://jeff.doozan.com/debian/goflex/v0.6/v2.6.37/modules.tar.gzsudo tar -xf boot.tar.gzsudo tar -xf modules.tar.gzcp -R ./lib/modules/2.6.37-ubit-01715-g1e5cda0/* /lib/modules/cd ..sudo umount /media/stick

Going back to the original Firmware

The following site describes how to get the official firmware back on your Goflex Home:

Creating a Linux User Account

useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash philipp

Jumbo Frames (MTU > 1500)

The linux driver mv643xx_eth for the Marvell Ethernet Controller has support for jumbo frames (MTUs > 1500). However, hardware support for checksum calculation is .

I don't know if this is a limitation of the Ethernet controller, as the the ASUS NAS-M25 and the Synology DS211+  support jumbo frames officially (both using the Marvell 88E1116R Gigabit Ethernet Controller).

I tested to set the MTU to 4000 bytes:

ifconfig eth0 mtu 4000

To check the current value for the MTU run this:

ifconfig eth0 | grep MTU

I could increase the speed of a file transfer via SSH by ~10 % when the MTU was set to 4000 (on my computer and the GoFlex Home connected via a jumbo frame capable Netgear GS105 Gigabit Switch).

To test, if your jumbo packages get through, you can use the ping command ping -D -s 3800 IP_OF_GOFLEX (should be something like ping IP_OF_GOFLEX -f -l 3800 on Windows).

Controlling the LEDs

There are two control files for the LEDs in /sys/class/leds:

  • status:green:health and
  • status:orange:fault.

Examples:

echo heartbeat > /sys/class/leds/status\:green\:health/triggerecho default-on > /sys/class/leds/status\:orange\:fault/triggerecho none > /sys/class/leds/status\:orange\:fault/trigger

Since  iptables directly supports led indicators in order to let you see arriving Ethernet packages:

pacman -Sy iptablesmodprobe xt_LED

Set up a rule to blink the orange LED when you receive incoming SSH traffic:

iptables -A INPUT -p tcp --dport 22 -j LED --led-trigger-id ssh --led-delay 100echo netfilter-ssh > /sys/class/leds/status\:orange\:fault/trigger

If you want a the green LED off and the orange on when a shutdown is finished (safe to remove any drives), add the following two lines at the end of your /etc/init.d/halt:

echo none > /sys/class/leds/status\:green\:health/triggerecho default-on > /sys/class/leds/status\:orange\:fault/trigger

For more in-depth information on the LEDs, have a look at the additional file arch/arm/mach-kirkwood/goflexhome-setup.c in the Linux kernel as added in .

One may also be able to use the Sysfs Interface for Userspace framework in the linux kernel (GPIO SYSFS: /sys/class/gpio). Introductory information on this can be found in the section "Sysfs Interface for Userspace" of . The usage of it is well described on  and on . I don't know yet how to enable it.

Setting your Timezone

See 

# To check the current zone:timedatectl status# To list available zones (exit with 'q'):timedatectl list-timezones# To set your time zone run:timedatectl set-timezone Europe/Berlin

Controlling the hardware clock

On my box, the hardware clock was off quite a bit and I don't like the hwclock daemon. So I installed ntpd to synchronize time with NTP service automatically, replaced the hwclock daemon with it and set up a cron job to update the hardware clock accordingly:

pacman -S ntp

(On older installations I'd update my /etc/rc.conf to DAEMONS=(!hwclock ntpd [...]). Not needed anymore as of 2012-12.)

And my crontab -e:

# Set the hwclock to an NTP synced system clock:#47 */12 * * * ntpd -s; hwclock -w47 */12 * * * hwclock -w

Hard Disk Spindown

Manually force a spindown on the SATA drive:

hdparm -y /dev/sda

or on a connected USB hard disk:

sdparm --flexible --command=stop /dev/sdb

Package Management with Plugbox Linux

Install OpenVPN

pacman -Sy openvpn

Set up NFS

Install the packages for a NFS server:

pacman -Sy nfs-utils rpcbind

Relevant configuration files:

  • /etc/conf.d/nfs-common.conf
  • /etc/conf.d/nfs-server.conf

Plugbox Linux automatically mounts all partitions. To get the NAS partition mounted explicitly, add it to /etc/fstab:

/dev/sda3    /NASdata    ext3    defaults    0    0

(You might need to create the mountpoint), mount it and change the user rights (anyone may read and write):

mkdir /NASdatamount /NASdatachmod 777 /NASdata

Set up the exports using vi /etc/exports to enable network access to the storage:

/NASdata 192.168.1.1/24(rw,async,insecure,no_subtree_check)

This makes the folder writable for all clients in the network 192.168.1.1/24 (192.168.1.1 to 192.168.1.254).

And allow this network in /etc/hosts.allow:

nfsd: 192.168.1.0/255.255.255.0rpcbind: 192.168.1.0/255.255.255.0mountd: 192.168.1.0/255.255.255.0

Start the daemons when booting by adding the list rpcbind, nfs-common und nfs-server to the DAEMONS in /etc/rc.conf. For example:

DAEMONS=(syslog-ng network netfs crond sshd openntpd rpcbind nfs-common nfs-server)

Reboot. Now you can mount the folder using:

mkdir mountpointmount 192.168.1.42:/NASdata ./mountpoint

Setting It up as a Log Host for Syslog

Check out .

Transmission BT client

pacman -Sy transmission-cli

If you want to run the Transmission daemon at boot, add transmissiond to the DAEMONSarray in /etc/rc.conf. You have to set the user in /etc/conf.d/transmissiond.

adduser torrentTRANSMISSION_HOME=/NASdatacat << EOF >> /etc/conf.d/transmissiond TRANSMISSION_HOME=$TRANSMISSION_HOMETRANS_USER="torrent"TRANS_ARGS="-g $TRANSMISSION_HOME/.config/transmission-daemon"EOF

Change the configuration file:

# Create the configuration file by starting and stopping the daemon:/etc/rc.d/transmissiond start && /etc/rc.d/transmissiond stop# Edit the main configuration file:vi /NASdata/.config/transmission-daemon/settings.json# set "rpc-whitelist-enabled" to false.

To start the transmission daemon manually run:

/etc/rc.d/transmissiond start

To run Transmission on startup, add transmissiond to the DAEMONS in /etc/rc.conf:

vi /etc/rc.conf

The web configuration interface is then available on http://plug.ip.address:9091

 

Firefly Media Server

Attention! This mt-daapd / Firefly Media Server does not work with newer iTunes versions (iTunes keeps breaking compatibility with mt-daapd and it's always a fight to get it back working). I don't use it anymore!

pacman -Sy dbus mt-daapdvi /etc/mt-daapd/mt-daapd.conf
  • Change to admin_pw to a unique password.
  • Change the mp3_dir to your folder filled with MP3s on your external hard drive.
  • Change the servername to something you like. (This is what comes up in iTunes. I set it to goflex.)
  • Change runas to root.

Starting the Firefly Media Server manually:

/etc/rc.d/dbus start && /etc/rc.d/avahi-daemon start && /etc/rc.d/mt-daapd start

Add dbus avahi-daemon mt-daapd to the DAEMONS in /etc/rc.conf to start it automatically at startup.

The web configuration interface is then available on http://plug.ip.address:3689/

Afterwards it should appear in iTunes as a share. You can also add it to XMBC by adding an audio source: Zeroconf → goflex (iTunes Music Sharing) and you will get a path such as daap://your.ip:3689/goflex/ .

Apache, MySQL and PHP

pacman -Sy apache mysql php

For the installation log (containing hints on setting the MySQL password etc.) see .

iSCSI (not working yet)

The information on iSCSI below is outdated as of 2013-02-11. Check out  for more information.

pacman -Sy iscsitarget-svn

Change the iSCSI configuration. cat /etc/iet/ietd.conf:

iSNSServer 192.168.1.21iSNSAccessControl NoIncomingUser joe secretOutgoingUser jack 12charsecretiqn.2014-04.com.example:storage  #Lun 0 Path=/dev/sda3,Type=fileio  Lun 0 Path=/dev/sda3,Type=blockio

cat /etc/iet/initiators.allow:

iqn.2014-04.com.example:storage 192.168.1.1/24

restart the iscsi target service:

/etc/rc.d/iscsi-target stop/etc/rc.d/iscsi-target start

Currently this produces the error:

FATAL: Module iscsi_trgt not found.

open-iscsi (which is an iSCSI Initiator – a client that accesses an iSCSI target device and makes it available on the local system):

PlugUI

pacman -Sy plugui

After it installs, start it up with:

/etc/rc.d/plugui start

The Plug UI will be served as web site on port 80.

If you go to System → About Plug in the PlugUI, it gives you some information on the hardware:

Plug information / About your Device

Device: Seagate GoFlex Home
Processor: Feroceon 88FR131 rev 1 (v5l)
Architecture: armv5tel
Kernel: Linux 2.6.38 #1 PREEMPT Thu Apr 21 11:14:23 MDT 2011

MiniDLNA

MiniDLNA is a slim DLNA media server for photos, music and videos. You may install it via PlugUI or in Terminal (check the link above).

After you installed MiniDLNA, set the media directory and started it up, you can view your media via XBMC (in my case on a Mac) by adding an audio source: UPnP Devices → PlugApps: root. This will show you a path like UPNP://4D696E69-444C-164E-9D41-0010759629C8 which you can add and then you are able to play music from this source.

AFP and Time Machine support

Check the dedicated blog post . Here are the basics:

# Install Netatalk and its dependencies:pacman -Sy netatalk avahi dbus# Let's start setting it all up:echo "afpd: ALL" >> /etc/hosts.allowecho " - -transall -uamlist uams_randnum.so,uams_dhx2.so -nosavepassword -advertise_ssh" >> /etc/netatalk/afpd.confsed -i "s|#enable-dbus=yes|enable-dbus=yes|g" /etc/avahi/avahi-daemon.conf# Is this needed? I don't know but it doesn't hurt:echo "AVAHI_DAEMON_START=1" > /etc/default/avahi-daemon# Now let's create a directory for TimeMachine backups:mkdir -p /NASdata/TimeMachineecho '/NASdata/TimeMachine "Time Machine" cnidscheme:cdb options:usedots,upriv,tm' >> /etc/netatalk/AppleVolumes.default# ^ usedots: required if you want to use invisible files and folders (= starting with a dot)# ^ upriv: adds support for AFP3 unix file privileges# Set up the user philipp for use with Netatalk:touch /etc/netatalk/afppasswdafppasswd -a philipp#! Give it permissions to access the TimeMachine folder:chown philipp /NASdata/TimeMachinechmod 777 /NASdata/TimeMachine

Add dbus avahi-daemon afpd cnid to your DAEMONS in /etc/rc.conf and restart.

For the upcoming netatalk 3.0 the configuration will be simplified and you have to check the notes in the . Also read  (27th of March 2012).

SABnzbd

  • Official Website: 
  • Official Forum Post: 

SABnzbd is an Open Source Binary Newsreader written in Python.

SABnzbd makes Usenet as simple and streamlined as possible by automating everything we can. All you have to do is add an .nzb. SABnzbd takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction.

The installation is :

pacman -Syyupacman -S sabnzbd

To start and stop you do

/etc/rc.d/sabnzbd start/etc/rc.d/sabnzbd stop

The configuration file is /etc/conf.d/sabnzbd (You may want to change the IP to an external one in order to access the web interface via http://ip:8080). You can also add sabnzbd to the DAEMONS list at the end of /etc/rc.conf in order to have it run at system startup.

Running Postfix as MTA on the GoFlex Home

pacman -Syyupacman -S postfix

vsftpd

Although FTP is insecure by design (passwords being transmitted in clear text) I use it to transfer files on to my GoFlex on the local network. It's the fastest way (~ 30MB/s)!

pacman -S vsftpd

Now change the config file /etc/vsftpd.conf:

  • anonymous_enable=NO
  • local_enable=YES
  • write_enable=YES

start it:

rc.d start vsftpd

and / or add vsftpd to your DAEMONS=() in /etc/rc.conf.

You can also  but this will slow it down and means you could just as well use SSH / SFTP.

DownloadDaemon

 is can be used to get content shared on one-click hosters etc. Also check . Here is how to get it:

pacman -S yaourtyaourt -S downloaddaemon

Getting USB Sound Cards to Work – Installing Pulseaudio

I had to install Pulseaudio because my sound was crippled and bad via Alsa. Probably there is an easier solution directly via Alsa though: 

 More HowTos: , , , , about ,  and 

Helpful Posts in the Arch Linux ARM Forum: , 

pacman -S pulseaudio pulseaudio-alsa avahi dbus

Start avahi-daemon and dbus:

rc.d start dbus && rc.d start avahi-daemon

grep resample-method /etc/pulse/daemon.conf

; resample-method=speex-float-0resample-method = trivial

grep exit-idle-time /etc/pulse/daemon.conf

exit-idle-time = -1

grep native-protocol-tcp /etc/pulse/default.pa:

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.102.0/24 auth-anonymous=1

grep zeroconf-publish /etc/pulse/default.pa:

load-module module-zeroconf-publish

And set up ALSA to use Pulseaudio:

cat << EOF > /etc/asound.conf pcm.!default {    type pulse}ctl.!default {    type pulse}# Explicit PulseAudio devicepcm.pulse {    type pulse}ctl.pulse {    type pulse}EOF

ToDo:

  1. Create a /etc/rc.d/pulseaudio file containing something like pulseaudio --start -D -v
  2. Experiment with the sample rate. The current default is 48000 as grep defaults.pcm.dmix.rate /usr/share/alsa/alsa.conf reveals defaults.pcm.dmix.rate 48000.
  3. Trying to reduce lag:

To change to volume of my sound card, I have to run something like pacmd set-sink-volume 5 400 (read  for more information). This can probably also be done via amixer.

Getting the M-Audio Transit USB Sound Card to Work

pacman -S yaourt alsa-utilsyaourt -AS madfuload

Install ShairPort

With Shairport you can stream music from iTunes to your Arch Linux ARM box (running Pulseaudio with a USB sound card being connected). It works great for me!

mkdir -p /root/Downloadscd /root/Downloadsgit clone git://github.com/albertz/shairport.gitcd shairportmakeperl -MCPAN -e shell# ^ follow the CPAN autoconfiguration...# then enter:#  q# to quit the CPAN shell and open it again (RAM would be a problem otherwise):perl -MCPAN -e shell# and install the following:#  install HTTP::Request#  install HTTP::Message#  install Crypt::OpenSSL::RSA#  install IO::Socket::INET6#  q

If any of the above commands return an error, you might be missing some of the following packages  (I had a lot of that stuff installed already): avahi libao openssl perl-libwww perl-crypt-openssl-rsa (or from the Debian list: build-essential libssl-dev libcrypt-openssl-rsa-perl libao-dev libio-socket-inet6-perl libwww-perl avahi-utils pkg-config).

Run ShairPort as the user who started Pulseaudio like this:

perl /root/Downloads/shairport/shairport.pl --ao_driver=pulse --apname=SoundDistributor

More hints: . Use the option --help to see more configuration options:

perl /home/philipp/Downloads/shairport/shairport.pl --help

After installing Shairport the way described I realized, I would not need pearl: 

Install the Music Player Daemon - MPD

pacman -S mpdcp /usr/share/mpd/mpd.conf.example /etc/mpd.conf

Check  for clients. The standard MPD client is .

GLCD2USB LCD Display

GLCD2USB allows you to connect a LCD screen to the USB port. You can display all kinds of stuff on it. See .

I had problems getting this to work with lcd4linux.

Serdisplib works though

yaourt -S serdisplib# edit the PKGBUILD and replace with# https://gist.github.com/2774176#file_pkgbuild

Test using

testserdisp

More stuff I tried (with no great results):

Install [GraphLCD (also called glcdlib)][http://graphlcd.berlios.de/]

yaourt -S graphlcd-base-svn# adjust PKGBUILD to accept arm as arch and quickly remove any asm code from# /var/abs/local/yaourtbuild/graphlcd-base-svn/src/graphlcd-base-build/graphlcd-base/glcddrivers/port.c# copy http://svn.berlios.de/wsvn/graphlcd/trunk/graphlcd-base/graphlcd.conf# to /etc/yaourt -S lcdproc# adjust PKGBUILD to accept arm as archyaourt -S lcd4linux-svn

Temperature measurement using 1w / OneWire sensors

1-Wire (OneWire) is a device communications bus system that you can use for multiple electronic devices like small thermometers such as the DS18S20 / DS18B20 (good overview in German: ).

You may use the USB → Onewire Adapter DS9490R ( In Germany, you can buy it on ) via the .

Don Veino was working on this. See . To install owfs (including temploggerd) run pacman -S owfs. Some of the steps Don verified to work are:

owserver -F -s 4304 -d /dev/ttyUSB0owhttpd -F --readonly -s 4304 -p 3001mkdir /tmp/1wireowfs -F -s 4304 /tmp/1wirels /tmp/1wire

node-whatsapp

supacman -Su nodejsnpm install -g coffee-scriptsu philippcd ~git clone git://github.com/saschagehlich/node-whatsapp.gitcd node-whatsappnpm installcoffee ./index.coffee

resources

  • Information on the box (German): 
  • Information on installing Plugbox Linux on the box (German): 
  • Another good guide on setting up a Sheeva Plug: 
  • If you need a slightly stronger machine but still don't want to spend a lot of money and need it to be silent and low-power-consumption, you may want to have a look at the Foxconn NT-A3500 Netbox Fusion E350:
    • Compare prices in Germany: 
    • Producer Website: 
    • A review can be found on 

转载于:https://my.oschina.net/CasparLi/blog/818486

你可能感兴趣的文章
ubuntu-15.10-server-i386.iso 安装 Oracle 11gR2 数据库
查看>>
three.js贴图
查看>>
C++ ODB 框架(未实践使用)
查看>>
DBSCAN(Density-based spatial clustering of applications with noise)
查看>>
HTTP 2.0与HTTP 1.1区别
查看>>
项目中使用oracle序列
查看>>
HBase编程 API入门系列之put(客户端而言)(1)
查看>>
Oracle Form's Trigger Tutorial With Sample FMB
查看>>
Nuget很慢,我们该怎么办
查看>>
easyui filter 过滤时间段
查看>>
2017-01-03
查看>>
C++获取当前目录
查看>>
Genymotion 解决虚拟镜像下载速度特别慢的问题
查看>>
Oracle数据库的语句级读一致性
查看>>
Cannot run Eclipse; JVM terminated. Exit code=13
查看>>
sort与sorted
查看>>
linux下安装和卸载vmware产品
查看>>
Linux系统(一)文件系统、压缩、打包操作总结
查看>>
微信小程序把玩(四十)animation API
查看>>
Android Application中的Context和Activity中的Context的异同
查看>>