General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Apr 24, 2017 3:33 am

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: FFP on the NSA-nnn
PostPosted: Tue Nov 02, 2010 2:36 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
Again ZyXEL managed to make their firmware incompatible with my script ;) , so I had to patch it. (The script, not the firmware).

This version is known to work on the NSA-210, 220, 221, 310, 320 and TDC Homedisk.

More info here

(BTW, there is no need to change anything if you have a working stick. It's still the same FFP)


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Fri Jul 15, 2011 6:25 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
Recently I retired my trusty NSA-220 as 'production server'. It's exchanged by a more powerful Kirkwood based NAS. (A Lacie 2Big Network 2, to be exact).

Now the box was available for some testing, and to my surprise the FFPStick didn't run on it! So I solved that problem, and added some new features:
  • An execute_outside_chroot function to be able to (duh!) execute things outside the chroot.
  • exit_ffp. A way to cleanly stop FFP and unmount it's mounts. I had the impression that some of my initial problems were caused by an unclean shutdown, so I added this feature. However, I was not able to confirm that this was really a problem. But I left the function.
  • Create a /mnt/HD_a2 symlink, to be more compatible with (tutorials about) the DNS-323.
  • Optionally create a /ffp symlink. To be able to use FFP tools in -for instance- PHP scripts running in firmware. This will only work when the firmware has a writable rootfs.
  • Optionally don't chroot FFP. This will only work if the /ffp symlink is made, and has some drawbacks. Read the wiki.

Further improvements:
  • When using a crappy (slow) USB stick, it turned out that the firmware interfered with the repartitioning. (It took too much time, and the firmware was already mounting the stick.) I changed the script to repartition and create filesystems while the firmware is waiting for usb_key_func.sh to return
  • On the same crappy stick it was not always possible to mount a partition directly after creating the filesystem. I added a retry function.
  • A clean FFP stick worked only once. On the second boot it refused to start. But when I installed some packages on the first boot, everything went OK.
    It turns out the firmware runs "rm ` find /mountpoint/of/stick -type l `" after mounting the stick, removing all symlinks. (This is on firmware 2.10, I don't know if newer versions still have this function.) . So I added a bunch of symlinks in the root of the ext3 partition. (64k filenamelength in total). Now the commandline for rm overflows, and nothing is deleted.
  • I splitted usb_key_func.sh in 2 scripts, to make it easier to change things without having to deal with new checksums. Now usb_key_func.sh executes fun_plug.sh, which does all the work

The new version can be downloaded here, and documentation is here.


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Aug 03, 2011 2:28 pm 
Offline

Joined: Tue Apr 05, 2011 8:07 am
Posts: 70
Thank you Mijzelf!

I will try this new version and see if it solve the multiple HDD listings I experience back in April when I first tested. I will report back how it works out...

Thanks again for your hard work!

/KC


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Aug 03, 2011 5:14 pm 
Offline

Joined: Tue Apr 05, 2011 8:07 am
Posts: 70
Seems to work OK but I still have the same issue with multiple HDD's listed. I've decided to do a Debian (Lenny) install on USB instead.

/KC


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 04, 2012 11:37 am 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
I am struggling for several days now... :(

Code:
Rotating logfiles...
Script fun_plug.sh version 20120319 running from /mnt/parnerkey
ffpstick started at Wed Apr 4 11:22:23 GMT 2012
Try to determine NAS type...
according to uname -r: 2.6.18.6->NSA220
type NSA220, fw V3.24(AFB.1)
Find the current usb device...usb device is /dev/sdc1 on device /dev/sdc
Check for filesystem...Filesystem is vfat
Check /dev/sdc for number of partitions.../dev/sdc has 1 partitions
Will have to repartition
Copy files to ramdisk...
Copied usb_key_func.sh nsa210_check_file md5sum nsa220_check_file NSA221_check_file salted_md5sum nsa310_check_file_C0 salted_md5sum_3x0 STG100_check_file STG211_check_file STG212_check_file mkdosfs after_booting.sh rootfs.tgz fun_plug.sh
Script fun_plug.sh version 20120319 running from /tmp/.ffpstick
Repartition /dev/sdc
unmount /mnt/parnerkey...done
Repartitioning...

The number of cylinders for this disk is set to 2801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 2801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): First cylinder (1-2801, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2801, default 2801):
Command (m for help): Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): First cylinder (24-2801, default 24): Using default value 24
Last cylinder or +size or +sizeM or +sizeK (24-2801, default 2801): Using default value 2801

Command (m for help): Partition number (1-4): Hex code (type L to list codes): Changed system type of partition 1 to 4 (FAT16 <32M)

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
Done. Creating and mounting filesystems...
Create ext3 filesystem on /dev/sdc2 and mount...
mke2fs 1.38 (30-Jun-2005)
Filesystem label=FFPROOT
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
250368 inodes, 500040 blocks
25002 blocks (5.00%) reserved for the super user
First data block=0
16 block groups
32768 blocks per group, 32768 fragments per group
15648 inodes per group
Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912

Writing inode tables:  0/16 1/16 2/16 3/16 4/16 5/16 6/16 7/16 8/16 9/1610/1611/1612/1613/1614/1615/16done                       
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
Mount /dev/sdc2 on /mnt/parnerkey type ext3...done
Move files to ext3 partition...after_booting.sh...rootfs.tgz...done
Create dummy symlinks...done
Unmount /dev/sdc2...done
Create FAT filesystem on /dev/sdc1 and mount...mkdosfs 2.11 (12 Mar 2005)
Mount /dev/sdc1 on /mnt/parnerkey type vfat...done
Move files to vfat partition...usb_key_func.sh...nsa210_check_file...md5sum...nsa220_check_file...NSA221_check_file...salted_md5sum...nsa310_check_file_C0...salted_md5sum_3x0...STG100_check_file...STG211_check_file...STG212_check_file...mkdosfs...fun_plug.sh...done
...And calling the script on stick again...
Script fun_plug.sh version 20120319 running from /mnt/parnerkey
ffpstick started at Wed Apr 4 11:23:22 GMT 2012
Try to determine NAS type...
according to uname -r: 2.6.18.6->NSA220
type NSA220, fw V3.24(AFB.1)
Find the current usb device...usb device is /dev/sdc1 on device /dev/sdc
No after_booting.sh in the root of the ffpstick found
This is not the first run, or FFP is supposed to run from a different place
Copy myself to /tmp...And execute...
/tmp/.ffpstick/fun_plug.sh BackgroundPolling -d /dev/sdc -n NSA220 -f "V3.24(AFB.1)" -r no -l &
Script fun_plug.sh version 20120319 running from /tmp/.ffpstick
Wait for the stick to be mounted again by the firmware...
Probe all mount points 0 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 10 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
found ffpstick on /e-data/4F7C-2F29, moving logfile
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 20 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 30 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 40 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 50 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 60 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 70 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
No /anymountpoint/ffproot/after_booting.sh found
60 seconds should be enough for anybody ;)
Will try to mount ffproot myself
Probe all mount points 80 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 90 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 100 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 110 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 120 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 130 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 140 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 150 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 160 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 170 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 180 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 190 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 200 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 210 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 220 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
...
Probe all mount points 890 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /i-data/f5f283bd...
probe /e-data/4F7C-2F29...
probe /e-data/654df940-1286-48ce-8a8c-721b16a133d9...
probe /usr/local/zy-pkgs...
probe /etc/zyxel/zy-pkgs...
probe /usr/local/apache/htdocs/pkg...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
/tmp/.ffpstick/fun_plug.sh: /tmp/.ffpstick/fun_plug.sh: 863: ReopenLogile: not found
Final attempt to mount the stick myself
mount: /dev/sdc2 already mounted or /tmp/ffproot busy
mount: according to mtab, /dev/sdc2 is already mounted on /tmp/ffproot
FATAL Mounting failed
FATAL Timeout & Giving up


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Thu Apr 05, 2012 7:17 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
goldlocke wrote:
I am struggling for several days now...
Do you mean this is reproducible?

For some reason the probe function cannot find after_booting.sh, which should be on the 2nd partition of the USB stick. This partition is mounted by the firmware (on /e-data/654df940-1286-48ce-8a8c-721b16a133d9), and after a minute of fruitless probing the script also mounts it itself (on /tmp/ffproot), but the probe function cannot find the contents. While it should be there:
ffpboot.log wrote:
Mount /dev/sdc2 on /mnt/parnerkey type ext3...done
Move files to ext3 partition...after_booting.sh...rootfs.tgz...done
Create dummy symlinks...done
Unmount /dev/sdc2...done

Can you have a look at the contents of the 2nd partition of the stick, using the webinterface or samba? It should contain a subdirectory ffproot, containing the files after_booting.sh and rootfs.tgz. Further the root of the partition contains a bunch of (hidden) symlinks with very long names. But I don't know if they should be visible using samba or the webinterface.


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Thu Apr 05, 2012 8:16 pm 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
Mijzelf wrote:
goldlocke wrote:
I am struggling for several days now...
Do you mean this is reproducible?
yep. tried 3 different USB sticks, all on firmware 3.24 (AFB.1)

Mijzelf wrote:
Can you have a look at the contents of the 2nd partition of the stick, using the webinterface or samba? It should contain a subdirectory ffproot, containing the files after_booting.sh and rootfs.tgz. Further the root of the partition contains a bunch of (hidden) symlinks with very long names. But I don't know if they should be visible using samba or the webinterface.

1.) ffproot is there but empty (no empty filedrawers), after_booting.sh and rootfs.tgz are missing
2.) I can see like 11 pages of these ".0LongNameLongNameLongName..." symlinks in the webinterface, not via samba
3.) I then pushed after_booting.sh and rootfs.tgz manually to the ffproot, restarted nas, but with no effect

thx for your help Mijzelf!


...trying to flash 3.22 to the nas next...


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Fri Apr 06, 2012 7:31 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
Weird.

goldlocke wrote:
3.) I then pushed after_booting.sh and rootfs.tgz manually to the ffproot, restarted nas, but with no effect
No effect as in
  • The stick was just ignored by the firmware. No new ffpboot.log was made.
  • The new ffpboot.log basically contains the same stuff, probing and no after_booting.sh found, while after_booting.sh was still there.
  • The new ffpboot.log basically contains the same stuff, probing and no after_booting.sh found, and indeed there was no after_booting.sh anymore.
  • Other.


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Mon Apr 09, 2012 9:03 pm 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
I am not sure anymore, but it definately was one of these two:
[*]The new ffpboot.log basically contains the same stuff, probing and no after_booting.sh found, while after_booting.sh was still there.
[*]The new ffpboot.log basically contains the same stuff, probing and no after_booting.sh found, and indeed there was no after_booting.sh anymore.

Right now I am on firmware 3.22...
Now the downloading of the funplug files works. So my ffproot partition got a size of approx. 154MB. But I still can not telnet the NAS.

Code:
Rotating logfiles...
Script fun_plug.sh version 20120319 running from /mnt/parnerkey
ffpstick started at Thu Apr 5 23:51:10 GMT 2012
Try to determine NAS type...
according to uname -r: 2.6.18.6->NSA220
type NSA220, fw V3.22(AFB.1)
Find the current usb device...usb device is /dev/sda1 on device /dev/sda
Check for filesystem...Filesystem is vfat
Check /dev/sda for number of partitions.../dev/sda has 1 partitions
Will have to repartition
Copy files to ramdisk...
Copied usb_key_func.sh nsa210_check_file md5sum nsa220_check_file NSA221_check_file salted_md5sum nsa310_check_file_C0 salted_md5sum_3x0 STG100_check_file STG211_check_file STG212_check_file mkdosfs after_booting.sh rootfs.tgz fun_plug.sh
Script fun_plug.sh version 20120319 running from /tmp/.ffpstick
Repartition /dev/sda
unmount /mnt/parnerkey...done
Repartitioning...

The number of cylinders for this disk is set to 2801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 2801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): First cylinder (1-2801, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2801, default 2801):
Command (m for help): Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): First cylinder (24-2801, default 24): Using default value 24
Last cylinder or +size or +sizeM or +sizeK (24-2801, default 2801): Using default value 2801

Command (m for help): Partition number (1-4): Hex code (type L to list codes): Changed system type of partition 1 to 4 (FAT16 <32M)

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
Done. Creating and mounting filesystems...
Create ext3 filesystem on /dev/sda2 and mount...
mke2fs 1.38 (30-Jun-2005)
Filesystem label=FFPROOT
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
250368 inodes, 500040 blocks
25002 blocks (5.00%) reserved for the super user
First data block=0
16 block groups
32768 blocks per group, 32768 fragments per group
15648 inodes per group
Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912

Writing inode tables:  0/16 1/16 2/16 3/16 4/16 5/16 6/16 7/16 8/16 9/1610/1611/1612/1613/1614/1615/16done                       
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
Mount /dev/sda2 on /mnt/parnerkey type ext3...done
Move files to ext3 partition...after_booting.sh...rootfs.tgz...done
Create dummy symlinks...done
Unmount /dev/sda2...done
Create FAT filesystem on /dev/sda1 and mount...mkdosfs 2.11 (12 Mar 2005)
Mount /dev/sda1 on /mnt/parnerkey type vfat...done
Move files to vfat partition...usb_key_func.sh...nsa210_check_file...md5sum...nsa220_check_file...NSA221_check_file...salted_md5sum...nsa310_check_file_C0...salted_md5sum_3x0...STG100_check_file...STG211_check_file...STG212_check_file...mkdosfs...fun_plug.sh...done
...And calling the script on stick again...
Script fun_plug.sh version 20120319 running from /mnt/parnerkey
ffpstick started at Thu Apr 5 23:52:10 GMT 2012
Try to determine NAS type...
according to uname -r: 2.6.18.6->NSA220
type NSA220, fw V3.22(AFB.1)
Find the current usb device...usb device is /dev/sda1 on device /dev/sda
No after_booting.sh in the root of the ffpstick found
This is not the first run, or FFP is supposed to run from a different place
Copy myself to /tmp...And execute...
/tmp/.ffpstick/fun_plug.sh BackgroundPolling -d /dev/sda -n NSA220 -f "V3.22(AFB.1)" -r no -l &
Script fun_plug.sh version 20120319 running from /tmp/.ffpstick
Wait for the stick to be mounted again by the firmware...
Probe all mount points 0 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /e-data/4F7E-3029...
found ffpstick on /e-data/4F7E-3029, moving logfile
probe /e-data/41f48300-d127-4e93-bebf-1f92fd489901...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 10 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /e-data/4F7E-3029...
probe /e-data/41f48300-d127-4e93-bebf-1f92fd489901...
No /anymountpoint/ffproot/after_booting.sh found
Probe all mount points 20 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /e-data/4F7E-3029...
probe /e-data/41f48300-d127-4e93-bebf-1f92fd489901...
No /anymountpoint/ffproot/after_booting.sh found

...

Probe all mount points 890 seconds...
probe /proc/bus/usb...
probe /lib/security...
probe /lib/modules...
probe /usr/local/etc...
probe /usr/local/var...
probe /usr/local/dmsf...
probe /etc/zyxel...
probe /e-data/4F7E-3029...
probe /e-data/41f48300-d127-4e93-bebf-1f92fd489901...
probe /tmp/ffproot...
No /anymountpoint/ffproot/after_booting.sh found
/tmp/.ffpstick/fun_plug.sh: /tmp/.ffpstick/fun_plug.sh: 863: ReopenLogile: not found
Final attempt to mount the stick myself
mount: /dev/sda2 already mounted or /tmp/ffproot busy
mount: according to mtab, /dev/sda2 is already mounted on /tmp/ffproot
FATAL Mounting failed
FATAL Timeout & Giving up


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Tue Apr 10, 2012 8:11 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
Basically this is the same log as on 3.24. It's a first boot.
The stick is
  • repartitioned: Repartition /dev/sda
  • Formatted: Create ext3 filesystem on /dev/sda2 and mount... and Create FAT filesystem on /dev/sda1 and mount...
  • The files (which were stored in RAM) are copied back: Move files to ext3 partition... after_booting.sh... rootfs.tgz... done and Move files to vfat partition... usb_key_func.sh... nsa210_check_file... md5sum... nsa220_check_file... NSA221_check_file... salted_md5sum... nsa310_check_file_C0... salted_md5sum_3x0... STG100_check_file... STG211_check_file... STG212_check_file... mkdosfs... fun_plug.sh... done
And while the ext3 partition is mounted, once by the firmware, and once by the script:
probe /e-data/41f48300-d127-4e93-bebf-1f92fd489901...
probe /tmp/ffproot...

Still ffproot/after_booting.sh can't be found.
No /anymountpoint/ffproot/after_booting.sh found

afterbooting.sh is responsible for downloading (if needed) and starting FFP. But it's never executed, and so no telnet daemon.

Can you check if after_booting.sh really isn't there, if not, put it (and rootfs.tgz) in /e-data/41f48300-d127-4e93-bebf-1f92fd489901/ffproot/ and reboot. If it still doesn't work, can you check if after_booting.sh is still there.

Do you have any ZyXEL packages installed?


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 11, 2012 12:20 am 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
So I checked now more closely...
No zyxel packs installed - no.

Repartitioning works fine, but ffproot is still empty except the 11 pages of symlinks and a .readme.
I then uploaded the after_booting.sh and the rootfs.tgz via the webinterface to ffproot.
restarting...
after_booting.sh and rootfs.tgz still there, but not extracted nor found. :(

maybe some permissions are not set correctly? How should I copy the files to the stick? via windows? via linux? via webinterface? via samba in windows?


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 11, 2012 7:55 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
goldlocke wrote:
ffproot is still empty except the 11 pages of symlinks and a .readme.I then uploaded the after_booting.sh and the rootfs.tgz via the webinterface to ffproot.
Wait, wait. The symlinks should be in /e-data/41f48300-d127-4e93-bebf-1f92fd489901/ (or a similar name, after repartitioning again), while after_booting.sh and rootfs.tgz should be in /e-data/41f48300-d127-4e93-bebf-1f92fd489901/ffproot/. (BTW, the .readme tells why the symlinks are there.)

goldlocke wrote:
maybe some permissions are not set correctly? How should I copy the files to the stick?
after_booting.sh should have the executable flag set. AFAIK all files copied via Samba have that flag set. Further it doesn't matter, I think. fun_plug.sh runs as root, so the read and write rights don't matter. You might have a problem if rootfs.tgz cannot be deleted. In that case it would be extracted again on subsequent boots, overwriting some settings. (Mainly user- and password management).


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 11, 2012 9:36 am 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
OK. I now started from scratch...

.) created new external volume on the NAS
.) copied FFP USBstick files over via samba
.) restarted NAS
.) waited 20-30mins
.) repartitioning worked, ffplug.tgz downloading and extracting worked - yeah!
.) telnet server started after ~ 45mins

yeah!

Difference now - I stayed completely within windows. Before I created the FAT partition of the stick with gparted on linux.

Thank you very much! ...I just now have to do some readup about linux sshd cmds, etc. ;)

edit: <sshd: no hostkeys available -- exiting> ... hmpf...reading up on SSH now ;)


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 11, 2012 10:07 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5979
Quote:
Difference now - I stayed completely within windows. Before I created the FAT partition of the stick with gparted on linux.
Actually, I don't see how this could influence the process. Once the script repartitions and reformats the stick, all traces of the initial partition table and partition are gone.

Quote:
45mins
:shock: Are you on a very slow internet? The FFP basefile for 0.7 is about 50MB.

goldlocke wrote:
sshd: no hostkeys available -- exiting
Did you start using the script?
Code:
sh /ffp/start/sshd.sh start


Top
 Profile  
 
 Post subject: Re: FFP on the NSA-nnn
PostPosted: Wed Apr 11, 2012 10:25 am 
Offline

Joined: Wed Apr 04, 2012 10:00 am
Posts: 17
Mijzelf wrote:
:shock: Are you on a very slow internet? The FFP basefile for 0.7 is about 50MB.

hehe, no. Actually I got 36Mbit/s down, but NAS cpu was most of the time at 95% usage - maybe mediaserver is rebuilding db. I'll turn it off for now.
The ext3 partition now is ~184MB big.

Mijzelf wrote:
goldlocke wrote:
sshd: no hostkeys available -- exiting
Did you start using the script?
Code:
sh /ffp/start/sshd.sh start
I typed:
chmod a+x /ffp/start/sshd.sh
/ffp/start/sshd.sh start

like in the wiki


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group