Recently (i.e., July, 2013) I tried to install debian wheezy on my Seagate GoFlex Home (3TB), following the instruction at
http://projects.doozan.com/debian/
at first install_uboot_mtd0.sh complained that it could not detect my uboot version, after I forced "Seagate GoFlex Home" the installation then continued... until later it printed out "FATAL: kenel too old" and failed.
Since I don't see Jeff has actively posted to the forum for awhile, I felt kind of helpless.
I also checked archlinux ARM forum, some people reported problems on GoFlex Home with archlinux ARM, unfortunately, it seems not much helps there either.
At this point, I was quite reluctant to modify GoFlex Home's nandflash with new uboot/kernel/initrd, and seriously re-thought if I should.
My goal: to be able to run some applications that seagate does not include in the original GoFlex Home linux, for example,
1. some basic utilities, like diff
2. full version of vim
3. other applications such as tmux, htop, svn, git, bvi, etc.
4. a normal sshd that does not require me to use the super long username
Neither of these need the latest kernel, or the real debian system.
So I decided that I won't modify GoFlex Home's nandflash (uboot/kernel/initrd), instead, I just create an ext3 filesystem image, install applications there, then mount the image to /opt.
This works pretty well, now I have my GoFlex Home box running all my favorite applications in seagate's original linux system.
Pros:
1. this does NOT void seagate's warranty (no changes applied to nandflash, only small changes made to rootfs, all other changes are limited in the filesystem image on your harddisk/usb drive (mounted to /opt)
2. this does not brick GoFlex Home box (unless you do something like dd/nandwrite to mtd0)
3. if GoFlex Home box acts weird, you can always umount the filesystem image from /opt, worst case, re-flash to seagate's factory default should work
4. all seagate's service, like access from web/internet, system update, etc., should still work
Cons:
1. you cannot upgrade to a newer kernel, you have to stay with seagate's
2. you cannot upgrade to a new linux (basic rootfs) system, you have to stay with seagate's
Here's how I did it:
I created a 1GB filesystem image file:
LXLLOCALFS="/home/lxl/personal/lxllocal/lxllocal.ext3fs"
and wrote a shell script to check/mount/umount the filesystem image to/from /opt:
LXLCHKUSRLOCAL="/home/lxl/personal/bin/lxl_chk_localopt.sh"
another shell script for root to mount /opt at booting time and start dropbear:
"/root/bin/root_startup.sh"
also saved a flag file to be checked if the filesystem image is mounted to /opt:
OPTMOUNTEDFF="/opt/lxllocal"
=======================================================
changes to seagate's rootfs
=======================================================
1. created /etc/profile.d/lxl.sh
2. created /etc/ld.so.conf.d/opt.conf
3. logoff and re-login to load /etc/profile.d/lxl.sh
=======================================================
create filesystem image file
=======================================================
The reason I am using an ext3 filesystem image, not a softlink to a directory, is because NTFS fs does not handle softlink right.
1. go to the directory you want to keep the image file:
make sure create the image file on the harddisk or external usb drive, not in seagate's rootfs!
this is bad:
[ sghack ~ ] df .
Filesystem Size Used Avail Use% Mounted on
ubi0:rootfs 212M 162M 50M 77% /
this is good:
[ sghack ~/personal/lxllocal ] df .
Filesystem Size Used Avail Use% Mounted on
/dev/sda 2.8T 1.3T 1.5T 46% /home/lxl/GoFlex Home Personal
2. create a 1GB file, should be enough for many applcations... you can always recreate the image file with bigger size
3. test the filesystem image by mounting it:
if all works, umount it from 1g
=======================================================
install ipkg in filesystem image
=======================================================
1. mount the filesystem image to /opt
2. create the flag file /opt/lxllocal
3. install ipkg:
go to http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/
find ipkg-opt package file and download it
as the time of writing, the url is:
http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ipkg-opt_0.99.163-10_arm.ipk
as root (sudo):
search for dest root /
insert a line before it:
update /opt
=======================================================
install applications in filesystem image
=======================================================
as root, you can install packages you like, for example,
make sure /opt is mounted rw when you install packages.
=======================================================
use /opt
=======================================================
1. when use /opt normally, mount the filesystem image read-only
mount
or re-mount
2. only mount it read/write when you need to change /opt (install/uninstall
packages, modify conf, etc.)
3. if seagate has an package installed, you probably don't want to install it
in /opt, for a list of seagate's installed packages:
4. you can backup the filesystem image file when it's mounted read-only, simple copy/backup the file.
5. if you cannot umount /opt, use lsof to find out which process(es) is/are locking /opt:
[ sghack ~/personal/bin ] sudo /opt/sbin/lsof /opt
Password:
audit_log_user_command(): Connection refused
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dropbear 10209 root txt REG 7,1 182872 82715 /opt/sbin/dropbearmulti
lsof 15439 root txt REG 7,1 125544 82088 /opt/sbin/lsof
lsof 15455 root txt REG 7,1 125544 82088 /opt/sbin/lsof
dropbear 32378 root txt REG 7,1 182872 82715 /opt/sbin/dropbearmulti
=======================================================
use xfs (lxl_chk_localopt.sh) / root_startup.sh
=======================================================
to manually mount/umount /opt
xfs (lxl_chk_localopt.sh) can be used by normal user, if it needs root privilege it uses sudo and asks for password.
optionally, use root_startup.sh with crontab to automatically mount /opt and run service at system booting time, the script waits for harddisk is mounted and filesystem image is accessible, then mounts the image at /opt (read-only), then starts dropbear.
I actually installed dropbear (port 2222) along with seagate's original openssh server (port 22), so I can login with my normal user name (dropbear) or the long user name (port 22), I made the following changes in /opt
1. enable sftp-server from dropbear connections:
2. disable root:
add -w for dropbear
=======================================================
install software from source code
=======================================================
bvi is not available from optware release, so I installed it from source code
install develop tools, as root, with /opt mounted rw:
then download bvi source code, compile and install
That's pretty much of it. Here's a list of running processes in my GoFlex Home 3TB now (logged in from dropbear server, started tmux and htop)
http://projects.doozan.com/debian/
at first install_uboot_mtd0.sh complained that it could not detect my uboot version, after I forced "Seagate GoFlex Home" the installation then continued... until later it printed out "FATAL: kenel too old" and failed.
Since I don't see Jeff has actively posted to the forum for awhile, I felt kind of helpless.
I also checked archlinux ARM forum, some people reported problems on GoFlex Home with archlinux ARM, unfortunately, it seems not much helps there either.
At this point, I was quite reluctant to modify GoFlex Home's nandflash with new uboot/kernel/initrd, and seriously re-thought if I should.
My goal: to be able to run some applications that seagate does not include in the original GoFlex Home linux, for example,
1. some basic utilities, like diff
2. full version of vim
3. other applications such as tmux, htop, svn, git, bvi, etc.
4. a normal sshd that does not require me to use the super long username
Neither of these need the latest kernel, or the real debian system.
So I decided that I won't modify GoFlex Home's nandflash (uboot/kernel/initrd), instead, I just create an ext3 filesystem image, install applications there, then mount the image to /opt.
This works pretty well, now I have my GoFlex Home box running all my favorite applications in seagate's original linux system.
Pros:
1. this does NOT void seagate's warranty (no changes applied to nandflash, only small changes made to rootfs, all other changes are limited in the filesystem image on your harddisk/usb drive (mounted to /opt)
2. this does not brick GoFlex Home box (unless you do something like dd/nandwrite to mtd0)
3. if GoFlex Home box acts weird, you can always umount the filesystem image from /opt, worst case, re-flash to seagate's factory default should work
4. all seagate's service, like access from web/internet, system update, etc., should still work
Cons:
1. you cannot upgrade to a newer kernel, you have to stay with seagate's
2. you cannot upgrade to a new linux (basic rootfs) system, you have to stay with seagate's
Here's how I did it:
I created a 1GB filesystem image file:
LXLLOCALFS="/home/lxl/personal/lxllocal/lxllocal.ext3fs"
and wrote a shell script to check/mount/umount the filesystem image to/from /opt:
LXLCHKUSRLOCAL="/home/lxl/personal/bin/lxl_chk_localopt.sh"
another shell script for root to mount /opt at booting time and start dropbear:
"/root/bin/root_startup.sh"
also saved a flag file to be checked if the filesystem image is mounted to /opt:
OPTMOUNTEDFF="/opt/lxllocal"
=======================================================
changes to seagate's rootfs
=======================================================
1. created /etc/profile.d/lxl.sh
# make PATH fixed, order: goflexhome oringinal --> /opt --> user's # allow normal user to use admin cmds export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/sbin:/opt/bin:~/bin: export LC_ALL=en_US.UTF-8 export VIM=/opt/share/vim export EDITOR=vim alias xfs='/home/lxl/personal/bin/lxl_chk_localopt.sh' alias vi='/opt/bin/vim -N' # for ipkg list work on a read-only filesystem alias ipkg='ipkg --tmp-dir=/tmp'
2. created /etc/ld.so.conf.d/opt.conf
/opt/lib/
3. logoff and re-login to load /etc/profile.d/lxl.sh
=======================================================
create filesystem image file
=======================================================
The reason I am using an ext3 filesystem image, not a softlink to a directory, is because NTFS fs does not handle softlink right.
1. go to the directory you want to keep the image file:
cd /home/lxl/personal/lxllocal
make sure create the image file on the harddisk or external usb drive, not in seagate's rootfs!
this is bad:
[ sghack ~ ] df .
Filesystem Size Used Avail Use% Mounted on
ubi0:rootfs 212M 162M 50M 77% /
this is good:
[ sghack ~/personal/lxllocal ] df .
Filesystem Size Used Avail Use% Mounted on
/dev/sda 2.8T 1.3T 1.5T 46% /home/lxl/GoFlex Home Personal
2. create a 1GB file, should be enough for many applcations... you can always recreate the image file with bigger size
dd if=/dev/zero of=lxllocal.ext3fs bs=1024 count=1048576 mkfs.ext3 -j -m 10 -L LXLLOCAL lxllocal.ext3fs tune2fs -c -1 -i 0 lxllocal.ext3fs
3. test the filesystem image by mounting it:
mkdir 1g sudo mount -t ext3 -o loop,rw lxllocal.ext3fs 1g df 1g mount | grep 1g
if all works, umount it from 1g
sudo umount 1g rmdir 1g
=======================================================
install ipkg in filesystem image
=======================================================
1. mount the filesystem image to /opt
sudo mount -t ext3 -o loop,rw lxllocal.ext3fs /opt
2. create the flag file /opt/lxllocal
touch /opt/lxllocal
3. install ipkg:
go to http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/
find ipkg-opt package file and download it
as the time of writing, the url is:
http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ipkg-opt_0.99.163-10_arm.ipk
cd /tmp wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ipkg-opt_0.99.163-10_arm.ipk mkdir ipkg-opt cd ipkg-opt tar -zxvf ../ipkg-opt_0.99.163-10_arm.ipk mkdir data cd data tar -zxvf ../data.tar.gz
as root (sudo):
sudo cp -a opt/* /opt sudo /opt/bin/ipkg -force-reinstall install /tmp/ipkg-opt_0.99.163-10_arm.ipk
sudo vi /opt/etc/ipkg.conf
search for dest root /
insert a line before it:
src cs08q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable
update /opt
sudo ipkg update sudo ipkg upgrade
=======================================================
install applications in filesystem image
=======================================================
as root, you can install packages you like, for example,
sudo ipkg install lsof sudo ipkg install vim sudo ipkg install htop sudo ipkg install tmux
make sure /opt is mounted rw when you install packages.
=======================================================
use /opt
=======================================================
1. when use /opt normally, mount the filesystem image read-only
mount
sudo mount -t ext3 -o loop,ro lxllocal.ext3fs /opt
or re-mount
sudo mount -o remount,ro /opt
2. only mount it read/write when you need to change /opt (install/uninstall
packages, modify conf, etc.)
3. if seagate has an package installed, you probably don't want to install it
in /opt, for a list of seagate's installed packages:
rpm -qa
4. you can backup the filesystem image file when it's mounted read-only, simple copy/backup the file.
5. if you cannot umount /opt, use lsof to find out which process(es) is/are locking /opt:
[ sghack ~/personal/bin ] sudo /opt/sbin/lsof /opt
Password:
audit_log_user_command(): Connection refused
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dropbear 10209 root txt REG 7,1 182872 82715 /opt/sbin/dropbearmulti
lsof 15439 root txt REG 7,1 125544 82088 /opt/sbin/lsof
lsof 15455 root txt REG 7,1 125544 82088 /opt/sbin/lsof
dropbear 32378 root txt REG 7,1 182872 82715 /opt/sbin/dropbearmulti
=======================================================
use xfs (lxl_chk_localopt.sh) / root_startup.sh
=======================================================
to manually mount/umount /opt
xfs (lxl_chk_localopt.sh) can be used by normal user, if it needs root privilege it uses sudo and asks for password.
optionally, use root_startup.sh with crontab to automatically mount /opt and run service at system booting time, the script waits for harddisk is mounted and filesystem image is accessible, then mounts the image at /opt (read-only), then starts dropbear.
I actually installed dropbear (port 2222) along with seagate's original openssh server (port 22), so I can login with my normal user name (dropbear) or the long user name (port 22), I made the following changes in /opt
1. enable sftp-server from dropbear connections:
cd /opt/libexec sudo ln -sf /usr/libexec/openssh/sftp-server .
2. disable root:
sudo vi /opt/etc/init.d/S51dropbear
add -w for dropbear
=======================================================
install software from source code
=======================================================
bvi is not available from optware release, so I installed it from source code
install develop tools, as root, with /opt mounted rw:
sudo ipkg install gcc sudo ipkg install make sudo ipkg install libc-dev sudo ipkg install ncurses sudo ipkg install ncurses-dev
then download bvi source code, compile and install
wget http://prdownloads.sourceforge.net/bvi/bvi-1.3.2.src.tar.gz tar -zxvf bvi-1.3.2.src.tar.gz cd bvi-1.3.2 ./configure --prefix=/opt make sudo make install
That's pretty much of it. Here's a list of running processes in my GoFlex Home 3TB now (logged in from dropbear server, started tmux and htop)
[ sghack ~ ] pstree
init─┬─access-patrol───2*[{access-patrol}]
├─afpd
├─agetty
├─avahi-daemon───avahi-daemon
├─btsync───6*[{btsync}]
├─cnid_metad
├─crond
├─cupsd
├─dbus-daemon
├─dropbear───dropbear───bash───tmux
├─httpd───2*[httpd]
├─klogd
├─lld2d
├─locator-server
├─minidlna───{minidlna}
├─mt-daapd───{mt-daapd}
├─mynetworkd───{mynetworkd}
├─nmbd
├─ntpd───ntpd
├─oe-appserver
├─oe-spd
├─seagate-lifecyc───{seagate-lifecyc}
├─smbd───smbd
├─spindownd
├─sshd
├─syslogd
├─tmux─┬─bash───pstree
│ └─bash───htop
├─udevd
├─usbreaderd
└─vsftpd