coolmax CN-330; rooted, need help next step

Everything that does not fit anywhere else
Post Reply
jayshomebrew
Posts: 5
Joined: Wed Feb 27, 2013 10:28 pm

coolmax CN-330; rooted, need help next step

Post by jayshomebrew » Wed Feb 27, 2013 10:40 pm

I am new to the nas firmware mods, so it took me a couple of days to figure this out. With the help of nas-central how-to, I got this info so far:
================uname======================

Code: Select all

Linux (none) 2.6.15 #139 Fri Feb 5 10:33:18 CST 2010 armv4l unknown
================cpuinfo======================

Code: Select all

Processor	: FA526id(wb) rev 1 (v4l)
BogoMIPS	: 262.14
Features	: swp half 
CPU implementer	: 0x66
CPU architecture: 4
CPU variant	: 0x0
CPU part	: 0x526
CPU revision	: 1
Cache type	: write-back
Cache clean	: cp15 c7 ops
Cache lockdown	: format B
Cache format	: Harvard
I size		: 16384
I assoc		: 2
I line length	: 16
I sets		: 512
D size		: 8192
D assoc		: 2
D line length	: 16
D sets		: 256

Hardware	: GeminiA
Revision	: 0000
Serial		: 0000000000000000
================meminfo======================

Code: Select all

MemTotal:       125160 kB
MemFree:         84076 kB
Buffers:         16932 kB
Cached:          19100 kB
SwapCached:          0 kB
Active:           6672 kB
Inactive:        29788 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       125160 kB
LowFree:         84076 kB
SwapTotal:      522104 kB
SwapFree:       522104 kB
Dirty:           11332 kB
Writeback:           0 kB
Mapped:           1056 kB
Slab:             3348 kB
CommitLimit:    584684 kB
Committed_AS:     9048 kB
PageTables:         72 kB
VmallocTotal:   122880 kB
VmallocUsed:     16656 kB
VmallocChunk:   105980 kB
================mtd======================

Code: Select all

dev:    size   erasesize  name
mtd0: 00020000 00020000 "RedBoot"
mtd1: 00300000 00020000 "Kernel"
mtd2: 00600000 00020000 "Ramdisk"
mtd3: 00600000 00020000 "Application"
mtd4: 00020000 00020000 "VCTL"
mtd5: 000a0000 00020000 "CurConf"
mtd6: 00020000 00020000 "FIS directory"
================mount======================

Code: Select all

usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /tmpmnt type tmpfs (size=30m)
/dev/hda1 on /system type ext3 (rw)
/dev/hda2 on /mnt/ide1 type ext3 (usrquota,grpquota)
================lsmod======================

Code: Select all

Module                  Size  Used by    Tainted: P  
fuse 41428 0 - Live 0xbf049000
ufsd_lbd 293156 0 - Live 0xbf000000
================inetd======================

Code: Select all

telnet	stream	tcp	nowait	root	/usr/sbin/telnetd	telnetd
================fstab======================

Code: Select all

/dev/ram0 / ext2 defaults  1  1
none /proc proc defaults 0 0
/dev/hda1 /volume1 auto defaults,usrquota,grpquota 0 0
/dev/hda3  swap    swap defaults        0 0
================ps aux======================

Code: Select all

  PID  Uid     VmSize Stat Command
    1 root        540 S   init       
    3 root            SWN [ksoftirqd/0]
    2 root            SW  [Power LED]
    4 root            SW  [watchdog/0]
    5 root            SW< [events/0]
    6 root            SW< [khelper]
    7 root            SW< [kthread]
   15 root            SW< [kblockd/0]
   18 root            SW< [khubd]
   53 root            SW  [pdflush]
   54 root            SW  [pdflush]
   56 root            SW< [aio/0]
   59 root            SW< [xfslogd/0]
   55 root            SW  [kswapd0]
   57 root            SW  [cifsoplockd]
   58 root            SW  [cifsdnotifyd]
   60 root            SW< [xfsdatad/0]
   61 root            SW< [xfsbufd]
  647 root        208 S   init       
  648 root        540 S   /bin/sh /etc/rc 
  669 root        588 S   sh /etc/rc.start 
  680 root            Z   [tar]
  721 root            Z   [kjournald]
  727 root            SW  [kjournald]
  772 root            SW  [kjournald]
  866 root        628 R   ps aux 
It looks like this:
Image

I would like to add rsync if possible. Could you point me in the right direction?

Once I get a little further, I can post how I changed my root disk.

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: coolmax CN-330; rooted, need help next step

Post by Mijzelf » Thu Feb 28, 2013 9:09 am

A Gemini! Is that a new NAS?

Anyway, I think the easiest way to get rsync running is to install FFP. Download fun_plug.tgz. Create a directory ffp on your harddisk, and extract the tarball there. (Preferably using a shell).

Now create a symlink /ffp:

Code: Select all

ln -s /mnt/ide1/path/to/ffp /ffp
enable the rsync daemon

Code: Select all

chmod a+x /ffp/start/rsyncd.sh
and start FFP:

Code: Select all

/ffp/etc/rc start
You might want to exchange the root shell:

Code: Select all

sed -i " \|^root:|s|:\bin\sh|:\ffp\bin\sh|g" /etc/passwd
Now if you login you automatically get the FFP shell (with FFP path).

If you want this permanent, you'll need to find a way to run a user script on boot, which does:

Code: Select all

ln -s /volume1/path/to/ffp /ffp
/ffp/etc/rc start
It is possible that if you create a script /mnt/ide1/fun_plug, that it will be executed.

jayshomebrew
Posts: 5
Joined: Wed Feb 27, 2013 10:28 pm

Re: coolmax CN-330; rooted, need help next step

Post by jayshomebrew » Thu Feb 28, 2013 3:07 pm

This NAS came on sale to microcenter.com a few weeks ago for $50, so I picked one up. I think they're just trying to get rid of them, since they're old hardware, but nice for someone like me to tinker with.

There are several rc.start and rc.sh scripts that are all accessible so I can permanently add it to check for ffp on the sata disk and/or the usb stick.

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: coolmax CN-330; rooted, need help next step

Post by Mijzelf » Thu Feb 28, 2013 3:26 pm

jayshomebrew wrote:There are several rc.start and rc.sh scripts that are all accessible so I can permanently add it to check for ffp
Have you tried if it won't revert?
According to your mounts there is some 30MB ramdisk, which might contain your whole rootfs. In that case you can change what you want, after a reboot it's gone.

jayshomebrew
Posts: 5
Joined: Wed Feb 27, 2013 10:28 pm

Re: coolmax CN-330; rooted, need help next step

Post by jayshomebrew » Thu Feb 28, 2013 4:00 pm

I just followed nas-central's instructions on how to mount the root disk, modified it, then re-uploaded the firmware. If I do it this way, it keeps my changes.

ffp works great:

Code: Select all

scotchale login: root
Password:

BusyBox v1.00-rc3 (2010.02.05-02:33+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

scotchale> mount
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /system type ext3 (rw)
/dev/hda2 on /mnt/ide1 type ext3 (usrquota,grpquota)
/dev/sda1 on /mnt/usb1 type ext3 (rw)
scotchale> ls /mnt/usb1
ffp         lost+found
scotchale> ln -s /mnt/usb1/ffp /ffp
scotchale> chmod a+x /ffp/start/rsyncd.sh
scotchale> ls /ffp/start/
portmap.sh    kickwebs.sh   lighttpd.sh   telnetd.sh
rsyncd.sh     LOGIN.sh      SERVERS.sh    inetd.sh
nfsd.sh       sshd.sh       fp_master.sh
scotchale> chmod a+x /ffp/start/sshd.sh
scotchale> /ffp/etc/rc start
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh ...
WARNING: telnetd: Already running
* /ffp/start/sshd.sh ...
grep: /etc/shadow: No such file or directory
Generating public/private rsa1 key pair.
Your identification has been saved in /ffp/etc/ssh/ssh_host_key.
Your public key has been saved in /ffp/etc/ssh/ssh_host_key.pub.

jayshomebrew
Posts: 5
Joined: Wed Feb 27, 2013 10:28 pm

Re: coolmax CN-330; rooted, need help next step

Post by jayshomebrew » Sat Mar 02, 2013 5:15 pm

so I'm just getting around to modifying funplug.sh (http://ffp.inreto.de/ffp/0.7/oabi/fun_plug) script specifically for the CN-330.

Is $SETUP variable an error?

Code: Select all

if [ -x $FFP_SETUP_SCRIPT ]; then
    echo "* Running $SETUP ..."
    . $FFP_SETUP_SCRIPT
fi
Also, I'm not sure why we want to remove the tarball.. or maybe I'm reading this wrong.

Code: Select all

# install tarball
...
    rm $FFP_TARBALL
fi

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: coolmax CN-330; rooted, need help next step

Post by Mijzelf » Sat Mar 02, 2013 9:56 pm

jayshomebrew wrote:Is $SETUP variable an error?
Yes, I think so.
Also, I'm not sure why we want to remove the tarball.. or maybe I'm reading this wrong.
The existence of the tarball is the trigger to extract it at boot. So after extracting the tarball has either to be renamed or deleted.

The installation of FFP on the DNS323 involves writing the script fun_plug to the root of the harddisk, and the tarball. On boot the script will be executed, and the first time it extracts the tarball, and starts FFP. On subsequent boots only FFP has to be started.

fusion555
Posts: 2
Joined: Thu Mar 07, 2013 6:06 pm

Re: coolmax CN-330; rooted, need help next step

Post by fusion555 » Thu Mar 07, 2013 6:30 pm

Hi all, I stumbled on this thread when I was researching how to make fuse/libntfs work properly on this NAS. I also picked up the CN-330 at the microcenter sale to use as a media store.

Could you refer me to the documentation you found on modifying/reflashing the root disk? I have a series of commands that make the NAS perfectly functional for me but I have to run them manually every time I boot the device.

BTW, the reason I'm using NTFS is due to a limitation of Samsung BD-C5500 bluray player. It will play media on an external drive formatted ONLY as FAT32 or NTFS, so ext3 is out. FAT32 won't work due to the 4gig limit.

edit: I can't believe I missed it before. http://www.nas-central.org/wiki/General ... tion_guide
Sorry for being newbish.
Last edited by fusion555 on Fri Mar 08, 2013 6:35 pm, edited 1 time in total.

fusion555
Posts: 2
Joined: Thu Mar 07, 2013 6:06 pm

Re: coolmax CN-330; rooted, need help next step

Post by fusion555 » Fri Mar 08, 2013 6:29 pm

FYI - I found that even though it is not listed on the webpage, coolmax is hosting their firmware for this device which is flashable via the web interface. It could make modding the flash easier.

http://www.coolmaxusa.com/download/firm ... 30NTFS.ZIP

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: coolmax CN-330; rooted, need help next step

Post by Mijzelf » Fri Mar 08, 2013 8:24 pm

Wow. That one is easy to hack! No checksums, no nothing. The zipfile contains a gzipped ext2 image, which is the rootfs. Just mount it, change whatever you want, repack it, and upload to the NAS.

I think.

When you only need some script executed on boot, I think there is a symlink /usr/hddapp, which points to /mnt/<something>/hddapp, where /mnt/<something> is the mountpoint of a harddisk.
The executable scripts *.sh in /usr/hddapp/etc/init.d/ are executed on boot by /etc/rc.

jayshomebrew
Posts: 5
Joined: Wed Feb 27, 2013 10:28 pm

Re: coolmax CN-330; rooted, need help next step

Post by jayshomebrew » Sat Mar 09, 2013 4:49 am

This one works too, not sure what the diff is.
http://www.coolmaxusa.com/download/Firmware/CN-330.ZIP

I noticed that you can enable telnet just from here:
http://CN330-IP/cgi/telnet/telnet.cgi
Image

root passwd is admin


I just ended up adding
S99funplug.sh to the /etc/rc.d of the root disk, following the directions: nas-central

then I put this on my usb stick:
funplug_cn330.sh

then you should get this under your admin log: which loads ffp
Image

Also if you enable sshd funplug ver 0.7 will hang during boot. Edit the ffp script /ffp/start/sshd.sh (someone else on this forum gets credit for this help)
WAS:

Code: Select all

if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
IS:

Code: Select all

if [ ! -f /ffp/etc/ssh/ssh_host_ecdsa_key ]; then

pragyaware
Posts: 1
Joined: Fri May 03, 2013 11:07 am
Contact:

Re: coolmax CN-330; rooted, need help next step

Post by pragyaware » Fri May 03, 2013 11:12 am

fusion555 wrote:Hi all, I stumbled on this thread when I was researching how to make fuse/libntfs work properly on this NAS. I also picked up the CN-330 at the microcenter sale to use as a media store.

Could you refer me to the documentation you found on modifying/reflashing the root disk? I have a series of commands that make the NAS perfectly functional for me but I have to run them manually every time I boot the device.

BTW, the reason I'm using NTFS is due to a limitation of Samsung BD-C5500 bluray player. It will play media on an external drive formatted ONLY as FAT32 or NTFS, so ext3 is out. FAT32 won't work due to the 4gig limit.

edit: I can't believe I missed it before. http://www.nas-central.org/wiki/General ... tion_guide
Sorry for being newbish.
Thanks to share this informational link but your link doesn't work so please rectify it.

Post Reply