Page 1 of 1

Help on Debian Squeeze

PostPosted: Mon Jun 18, 2012 8:08 pm
by chlaussii
Hello Community

I installed the fvdw 12-1 firmware on my lacie today!
It is so great thank you fvdw team.
But, i have a problem.
I tried to install debian squeeze on my lacie ns2.
I did it like in this tutorial: http://lacie.nas-central.org/w/index.php?title=Category:2big_Network_2&section=50#STEP_2:_Installing_Squeeze_-_Method_1._The_Easy_Way_.28Prebuild.29
But at the last step it always says:
-sh: /root/.profile: line 2: syntax error: unexpected "("

If someone could help me it would be great.

Thank you fvdw Team

Re: Help on Debian Squeeze

PostPosted: Mon Jun 18, 2012 9:10 pm
by fvdw
:dontknow sorry I can not help you to answer that questions I never installed debian squeeze on a nwsp2

But at the last step it always says:
-sh: /root/.profile: line 2: syntax error: unexpected "("

This error message means that the file in folder /root with name .profile has a syntax error in line 2

You could try to see what is in that file

ps why do you want to install debia squeeze when you you have fvdw-sl-12-1 running ;)

Re: Help on Debian Squeeze

PostPosted: Tue Jun 19, 2012 5:13 pm
by chlaussii
Because i can install more applications then.
hmm but on the Lacie OS it worked and i can't find a syntax error in that file. :)

Re: Help on Debian Squeeze

PostPosted: Tue Jun 19, 2012 6:11 pm
by fvdw
it seems to try to run that file using the bourne shell (sh) I believe that the syntax of that shell does not allow use of "("
Maybe the command file is a bash script an should be run using the bash shell
When logging on to the NAS with root via ssh it uses standard the bourne shell

You could try to run the command file using
Code: Select all
bash name-of-your-command-file


replace name-of-your-command-file by the actual name of the script you want to run (including path)

(bash is included in 12-1 release)

Re: Help on Debian Squeeze

PostPosted: Tue Jun 19, 2012 7:11 pm
by fvdw
can you post the content of this profile file ?

Re: Help on Debian Squeeze

PostPosted: Tue Jun 19, 2012 7:20 pm
by fvdw
some reading learns me that the bourne shell can uses () to define functions and that this profile file you mention is used in a bourne shell command script.
This profile script seems to contain a function if I follow the links you posted. If it fails then there must be a syntax error. Note that the shell scripts must be unix format and not dos format with respect to line ends (no <CR><LF> but only <LF>

I made a small test script to see if it recognize function definitions and it does
Code: Select all
#!/bin/sh
# test script
dummy () {
 para1=$1
echo $para1
}
dummy fvdw


running it (the scrip is in root of system partition) gives this
Code: Select all
root@fvdwsl-nwsp2:/ # /effe
fvdw
root@fvdwsl-nwsp2:/ #

Re: Help on Debian Squeeze

PostPosted: Thu Jun 21, 2012 10:48 am
by chlaussii
Here is the Script: http://downloads.lacie.nas-central.org/ ... rofile.txt

I will try these things you said and thanks for your help!

Re: Help on Debian Squeeze

PostPosted: Thu Jun 21, 2012 6:46 pm
by fvdw
well there is a syntax error in this file "profile" if it is used in a bourne shell script (sh)

This profile file defines two functions and an alias, and it uses bash syntax for definition of the functions. However the file is used in a bourne shell script (sh), as result you get the error message

In the command files for the bourne shell the syntax to define a function is:
Code: Select all
example () {
  command1
  command2
}

so without the word "function" in front of example

This profile file use for definition of a function:
Code: Select all
function example () {
  command1
  command2
}


This type of definition of a function is bash shell syntax (ps in bash scripts also the definition without the word function in front can be used)

So you need to delete the words "function" in the script

The old profile looks like this
Code: Select all
########### For Squeeze
function mount4squeeze () {
        mount proc /debian-squeeze/proc -t proc 2>/dev/null && \
        mount sys /debian-squeeze/sys -t sysfs
        # mount udev /debian-squeeze/dev -t tmpfs && \
        mount usbfs /debian-squeeze/proc/bus/usb -t usbfs 2>/dev/null
        # mkdir /debian-squeeze/dev/pts 2>/dev/null
        # mount -vt devpts -o gid=4,mode=620 none /debian-squeeze/dev/pts -t devpts 2
        mount -t none /dev /debian-squeeze/dev -o bind

        mount /dev/seb1 /debian-squeeze/usbkey/ 2>/dev/null
        mount /dev/sda2 /debian-squeeze/sda2/ 2>/dev/null
}
function umount4squeeze () {
        umount /debian-squeeze/sda2/ 2>/dev/null
        umount /debian-squeeze/usbkey/ 2>/dev/null
        umount /debian-squeeze/dev 2>/dev/null
        umount /debian-squeeze/proc/bus/usb 2>/dev/null
        umount /debian-squeeze/sys 2>/dev/null
        umount /debian-squeeze/proc 2>/dev/null
}
alias squeeze='mount4squeeze ; chroot /debian-squeeze /bin/bash ; umount4squeeze'


Change it to this
Code: Select all
########### For Squeeze
mount4squeeze () {
        mount proc /debian-squeeze/proc -t proc 2>/dev/null && \
        mount sys /debian-squeeze/sys -t sysfs
        # mount udev /debian-squeeze/dev -t tmpfs && \
        mount usbfs /debian-squeeze/proc/bus/usb -t usbfs 2>/dev/null
        # mkdir /debian-squeeze/dev/pts 2>/dev/null
        # mount -vt devpts -o gid=4,mode=620 none /debian-squeeze/dev/pts -t devpts 2
        mount -t none /dev /debian-squeeze/dev -o bind

        mount /dev/seb1 /debian-squeeze/usbkey/ 2>/dev/null
        mount /dev/sda2 /debian-squeeze/sda2/ 2>/dev/null
}
umount4squeeze () {
        umount /debian-squeeze/sda2/ 2>/dev/null
        umount /debian-squeeze/usbkey/ 2>/dev/null
        umount /debian-squeeze/dev 2>/dev/null
        umount /debian-squeeze/proc/bus/usb 2>/dev/null
        umount /debian-squeeze/sys 2>/dev/null
        umount /debian-squeeze/proc 2>/dev/null
}
alias squeeze='mount4squeeze ; chroot /debian-squeeze /bin/bash ; umount4squeeze'


this file can be used as well in bourne (sh) as bash scripts
I attached it as profile2 (just unzip)
profile2.zip