DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#26 2011-04-11 23:35:14

tinybilbo
Member
Registered: 2011-04-02
Posts: 36

Re: Grub as a funplug

dhub wrote:

I have no idea, the only difference between what you are doing and how I install is that I tell zip to extract directly to \\nasname\Volume_1 via smb.

The only thing I can think of is that ftp is setting the permissions differently than SMB does.

What are the permissions of the files in the funplug.d/bin directory?  They all need to be executable (especially webselect which is the webserver)

I really need to make the thing a self extracting archive...

Boy I'm still struggling here...
I feel that I must be missing something glaringly obvious here!!

I've tried extracting directly to the Nas via mapped drive in windows.... and still nothing.
I've wiped the drive, tried different firmwares (I'm on 1.09 at the moment).
I've installed with fonz's funplug installed, then without.
All permissions in funplug.d/bin are executable (0777).

I can see the point at which the nas reads the fun_plug (I timed it with ffp and gaining a telnet session).
Fonz's fun_plug blinks the led just once, yours 2or 3 times, but nothing comes up...

I'm at a loss...

Offline

 

#27 2011-04-12 00:18:13

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Can you log in with fonz funplug and run my funplug script.  I'm curious if there is any error output and if /mnt/HD_a2/fun_plug.d/bin/webselect is getting started.

As far as I can tell you're using the exact same steps I'm using successfully...

Offline

 

#28 2011-04-12 14:07:55

tinybilbo
Member
Registered: 2011-04-02
Posts: 36

Re: Grub as a funplug

dhub wrote:

Can you log in with fonz funplug and run my funplug script.  I'm curious if there is any error output and if /mnt/HD_a2/fun_plug.d/bin/webselect is getting started.

As far as I can tell you're using the exact same steps I'm using successfully...

Hi dhub,

Thanks for getting back to me,
I have run the script as asked, here is the output from telnet session.
Note the funplug manager script is fun_plug.m

/ # cd /

/ # cd mnt

/mnt # ls
HD_a2     HD_a4     web_page

/mnt # cd HD_a2

/mnt/HD_a2 # ls
README.funplug_manager  ffp.log                 fun_plug.d
ffp                     fun_plug                fun_plug.m

/mnt/HD_a2 # sh fun_plug.m
fun_plug.m: /mnt/HD_a2/fun_plug.d/bin/fun_plug.common: line 15: current_default_
gateway: not found
rm: cannot remove '/mnt/HD_a2/fun_plug.d/funplugs/install/default': No such file
or directory
sh: you need to specify whom to kill
Can't bind
chmod: /mnt/HD_a2/fun_plug.d/funplugs/default: No such file or directory
fun_plug.m: line 128: /mnt/HD_a2/fun_plug.d/funplugs/default: not found

Offline

 

#29 2011-04-12 16:24:11

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Thanks for the output, I appreciate you taking the time.

> /mnt/HD_a2 # sh fun_plug.m
> fun_plug.m: /mnt/HD_a2/fun_plug.d/bin/fun_plug.common: line 15: current_default_gateway: not found

That sounds like you don't have a default gateway defined, which is rather odd and will certainly prevent the debian-reloaded install from working.  Does the command "/sbin/route -n|/bin/grep ^0.0.0.0" return anything?

> rm: cannot remove '/mnt/HD_a2/fun_plug.d/funplugs/install/default': No such file or directory

That's normal

> sh: you need to specify whom to kill

This makes sense, the script tries to kill the dlink web server twice so the second time it should give that message

> Can't bind

There's still another web server running, this is almost certainly the issue. 

The question is what is running and why.  I just built a new version http://ipkg.dhub.me/funplugs/funplug_manager-0_138.zip that should print netstat and ps output to provide some idea as to what is hogging the web port (it also tries again if the bind fails the first time, which might fix the issue)

> chmod: /mnt/HD_a2/fun_plug.d/funplugs/default: No such file or directory
> fun_plug.m: line 128: /mnt/HD_a2/fun_plug.d/funplugs/default: not found

That file is created by the webselect server when it exits, since it doesn't look like it started these errors make sense.

Last edited by dhub (2011-04-13 01:32:14)

Offline

 

#30 2011-04-13 00:27:50

tinybilbo
Member
Registered: 2011-04-02
Posts: 36

Re: Grub as a funplug

dhub wrote:

That sounds like you don't have a default gateway defined, which is rather odd and will certainly prevent the debian-reloaded install from working.  Does the command "/sbin/route -n|/bin/grep ^0.0.0.0" return anything?.

Lol, Nice catch...!!!

Because I had been having some trouble setting this up, I had wiped the drive, and reset the box's flash settings,
and in order to mess as little as possible with any settings, the only setting I altered was to enable the ftp.
I had left the box on DHCP. (I mostly have things on static, but I leave my router's DHCP server on for other visiting people's stuff, like iPhones and Psps.)

Just to test, I set the box to a static IP, Gateway, + DNS.
And your fun_plug manager booted first time!!!

So to check that I was'nt going mad, I did a reset of the box's flash, and left the LAN settings on its defaults.
I left the drive in exactly the state that had previously been working, and guess what...
Your fun_plug manager would'nt boot again, - I tested it at least 3 times, rebooting and shutting off as well, It just would'nt run.

Next, I left it on DHCP, but just set the DNS settings manually (which had been automatically set to my routers DNS (which has DNS-Relay), and it rebooted straight into your fun_plug manager again.

So I tested this a couple of more times, and the behaviour is entirely reproducable, as each time I reset the flash, your fun_plug manager would'nt work, until I manually set the DNS!!

So there we have it...

Some weird bug in the firmware's default DNS settings..., untill manually set..

Thanks for your help, and of course fun_plug manager, of which I going to play around with the debian installer..

By the way, your link the latest fun_plug manager link is to an internal IP on your network..

Last edited by tinybilbo (2011-04-13 01:29:54)

Offline

 

#31 2011-04-13 01:46:00

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Interesting, I wonder why the default gateway would cause that difference in behavior.  I'll have to play with it some tonight.

Offline

 

#32 2011-04-13 02:42:08

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Oh, in the most recent version of funplug_manager if you put a hostname or IP address of a syslog server in /mnt/HD_a2/funplug.d/conf/syslog.server funplugs that use the log function will log their output to the syslog server (which is really handy for troubleshooting)

Offline

 

#33 2011-04-13 03:07:18

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Note, the changes I made to the debian reloaded script to support a safe mode boot had a syntax error that was preventing it from working.

I've fixed it and the corrected debian reloaded funplug script is at: http://ipkg.dhub.me/funplugs/debian_reloaded
New debian reloaded installs done via funplug_manager should automatically get the corrected fun_plug

Last edited by dhub (2011-04-13 03:07:59)

Offline

 

#34 2011-04-13 19:39:22

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Ok, I got the mdadm install issue in the debian-reloaded installs firstboot script.  The debian firstboot start script now completes without hanging and results in a bootable disk image (big cheer). 

I'm going to make a copy of the funplug_manager I'm testing and put it in a release directory so future changes on my part don't cause this to break (murphy's law says I'll fat finger something when I move it and break it...)

Offline

 

#35 2011-04-13 23:09:44

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

New version, since this is the first real release with all the features I'd intended working I'll list the features instead of a change log. 

It's available at: http://ipkg.dhub.me/funplugs/release/fu … -0_147.zip

Install:
   1. Unzip the package to the root of the Volume_1 disk
   2. Reboot the DNS-323 using the dlink gui firmware
   3. Keep reloading the DNS-323 web page until funplug_manager loads (the dlink web interface will start for 15-30 seconds before funplug_manager loads)

Features:
   1. Safe installation of Debian Squeeze (not chroot) without any hardare modification (serial console or flashing the firmware).
   2. Allows boot time selection of fun plug script to load
   3. Has web based installers for some popular fun plugs (Fonz Fun Plug 0.5, Alt-F Funplug 0.1B7, and Debian Squeeze)
   4. Provides support functions to allow fun_plug writers to log to remote log servers and customize their funplug manager menu entry.
   5. Provides two comand line utilities that work in all three fun-plug environments:
        * funplugs - Lists available funplugs and shows which is active
        * rebootinto - Changes the active funplug to the one specified and reboots into it.

Issues:
  1. Debian reload functionality has only been tested on Rev-C1 hardware with Dlink firmware version 1.09 this may or may not work on other revisions.
  2. Debian does not have support for the fan at this time, the reloaded script "should" set the fan speed to high prior to switching to debian.

Notes:
  1. The Debian Squeeze install sets the root password to deb323 obviously this should be changed as soon as the install is finished
  2. The Debian Squeeze install copies over the the admin account from the dlink firmware and enables it for sudo.  So future versions may ship with a locked root account (it's not currently set this way in the event sudo fails to install)

Last edited by dhub (2011-04-13 23:17:26)

Offline

 

#36 2011-04-13 23:21:27

tinybilbo
Member
Registered: 2011-04-02
Posts: 36

Re: Grub as a funplug

dhub wrote:

New version, since this is the first real release with all the features I'd intended working I'll list the features instead of a change log. 

It's available at: http://ipkg.dhub.me/funplugs/release/fu … -0_147.zip

Thanks,
Will test it tomorrow...

Offline

 

#37 2011-04-14 03:45:42

m@2zo
Member
Registered: 2011-04-14
Posts: 5

Re: Grub as a funplug

Hi dhub,
it seems really interesting !
I quickly try to install funplug_manager but can't access the grub like menu.
I'm not sure I correctly understand the README file (but I'm quite tired).

== GETTING STARTED/INSTALL ==
1. Extract the funplug_manager.tar.gz file into the root of the
   volume.
Ok no problem.
2. This will create a fun_plug.d directory for storing fun_plug
   scripts.
It did it.
3. If you have an existing fun-plug file move and rename the existing
   fun plug into the fun_plug.d directory, giving it a descriptive
   name such as "fonz-0.5"
I don't have anything from a prior install. It's all clean.
4. Any new fun_plug scripts can be placed in this directory as
   well.
You say "can" so I don't need it, isn't it ?
5. Make the funplug_manager script the fun_plug script by
   copying the funplug_manager file to fun_plug on the root
   root volume.
Hum, I don't see any funplug_manager file. I presume it's already the fun_plug file (its content is clearly related to funplug_manager).
6. Upon starting up the nas, the fun plug selector can be found
   by pointing the web browser at http://yournasip:8000
I can't access anything at http://mynasip:8000. Only the dlink web app at http://mynasip.

I'll try again tomorrow and report results.

Offline

 

#38 2011-04-14 03:57:31

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

That's actually two documentation errors.

1. The funplug_manager funplug is now called fun_plug in the archive.
2. It no longer runs on port 8000 it replaces the dlink web interface instead.

Offline

 

#39 2011-04-14 05:28:24

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

New version http://ipkg.dhub.me/funplugs/release/fu … -0_149.zip

Install:
   1. Unzip the package to the root of the Volume_1 disk
   2. Reboot the DNS-323 using the dlink web interface
   3. Keep reloading http://nasip until the funplug loader starts

Changes:
   1. Updated/Corrected the documentation

Offline

 

#40 2011-04-14 15:53:52

m@2zo
Member
Registered: 2011-04-14
Posts: 5

Re: Grub as a funplug

Waouh, very nice !
I try it with only one disk and get a nice debian squeeze install without headache.

About the funplug_manager webapp :
- the message says "Booting into DLink Flash Firmware Unknown in 90 seconds if no selection is made" : in fact it should be something like "Booting into 'you precedent choice' or 'DLink Flash Firmware Unknown' in 90 seconds if no selection is made", isn't it ?
- the 90 seconds is good for first time config but I'd appreciate I could change this duration for simple reboots

The debian answer time is really good : it's a lot faster than with my different chroot tests (with lenny, not squeeze).
I'm going to try it with 2 disks in RAID1...

Offline

 

#41 2011-04-14 19:28:02

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

There is a line near the top of the fun_plug script for setting the timeout time (TIMEOUT=90), change the 90 to the desired number of seconds.  Also, If the file /mnt/HD_a2/fun_plug.d/conf/nodelay exists funplug manager will run the default funplug without prompting one time (this is how the rebootinto command is able to reboot and start a specific fun_plug without prompting)

I think I fixed the naming issue at the bottom of the screen in funplug_manager-0_150.zip but I haven't had time to test it.

Offline

 

#42 2011-04-14 19:32:34

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Oh, if you want to use LVM tell it to build a small raid1 (I normally select 50GB).  It will make a second raid0 using partition 3 that can be blown away and turned into LVM physical volumes without having the dlink firmware prompting to reformat the disk on every reboot. 

I have mine configured with debian on /dev/md0 raid and one LVM logical volume formatted ext4 that's mirrored via LVM and one that's not mirrored and formatted with btrfs.  Very nice

Offline

 

#43 2011-04-14 21:54:21

m@2zo
Member
Registered: 2011-04-14
Posts: 5

Re: Grub as a funplug

Thanks for informations.
I just tested with two disks in RAID1.
I launched the debian installation : I saw the ffp requirements and after the debian download and... nothing.
No more web/ssh/ping.
The main led keeps flahing. The disks leds don't.
I'll keep it so a little before power off.
Is there a way to access a log file ?

Offline

 

#44 2011-04-14 22:02:20

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

With raid the install takes longer, it downloads the raid management tools and triggers a rebuild of the boot image as well as all the kernel modules.  Which with the DNS-323's slow processor and the amount of data takes some time.

Offline

 

#45 2011-04-14 23:00:36

m@2zo
Member
Registered: 2011-04-14
Posts: 5

Re: Grub as a funplug

It makes 3 hours since I began the installation and I don't see anything else that the main led flahing. The other leds (disks and network) are still off.
No ping. I'm not really confident in the result...

Offline

 

#46 2011-04-15 00:12:59

dhub
Member
Registered: 2011-01-01
Posts: 112

Re: Grub as a funplug

Yeah, it shouldn't take that long.  I wonder where it failed.  The reloaded script writes a log to /mnt/HD_a2 but it generally doesn't show much. 

I'd be curious if there's a /mnt/Hd_a2/var/log/messages file since that would be the main debian log.

Offline

 

#47 2011-04-26 20:34:37

m@2zo
Member
Registered: 2011-04-14
Posts: 5

Re: Grub as a funplug

Hi dhub and sorry for the eastern delay...
There is no var/log/messages file.
It is the same symptom as I noticed with Alt-F in "DNS-323 rev C1 & Alt-F B7 : debian failed" thread.

Offline

 

#48 2012-03-08 12:06:27

jeffjoker
Member
Registered: 2011-11-23
Posts: 52

Re: Grub as a funplug

Hello Dhub,
Your "grub" for NAS is really interesting.
Do you know if it works on the DNS-320 ?
The main difference I see with the 323 is the Hard Drive path (/mnt/HD/HD_a2 instead of /mnt/HD_a2)...
I have not tried yet since I am careful not to brick my NAS

Also another question, it seems to run on top of the firmware, but can you make it run before ?
Meaning I want to try other builds (like native debian) without having the firmware running in background. Especially the 2.02 of the DNS-320 that makes the SMB transfers so slow and no way to roll back sad

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB