Reply
Thread Tools
xaccrocheur's Avatar
Posts: 73 | Thanked: 24 times | Joined on Jan 2010 @ Paris
#1
Hi all ; Sorry if this info exists elsewhere, I searched for it but the search engine is weird...

I installed BASH4 but I can't seem to use it, no matter what I do, echo $SHELL returns /bin/sh

How can I make BASH the default shell for both user and root ?
 
Posts: 99 | Thanked: 42 times | Joined on Jan 2011 @ Germany
#2
I once replaced the default shell by the z-shell (zsh). However, I wasn't able to reboot then (Maemo didn't come up --> reflash).

So if there is a possibility to change the default shell, it's not replacing the entry in /etc/passwd...
 

The Following User Says Thank You to D.Cent For This Useful Post:
Posts: 346 | Thanked: 271 times | Joined on Jan 2010
#3
Replacing the entry in /etc/passwd works if the shell is compatible with the Maemo scripts which are run at boot. Bash 3.2 is compatible, I run it for a long time as the default shell with no problems. Bash 4 SHOULD be compatible but I haven't tested it (no need for it), you can try replacing the entries in /etc/passwd (ONLY for user, root and eventually others users that you created) but make a backup first.
 

The Following 2 Users Say Thank You to Megaltariak For This Useful Post:
jd4200's Avatar
Posts: 451 | Thanked: 424 times | Joined on Apr 2010 @ England
#4
I've been using bash4 as the default shell for a few weeks now, and I've had no issues.

As Megaltariak said, you need to edit your /etc/passwd, and replace /bin/sh with /bin/bash, for root and user; be careful as a typo, or replacing the wrong entry will lead to problems.

e.g. change
user:XXXX.XXXX:XXX:XXX::/home/user:/bin/sh
to
user:XXXX.XXXX:XXX:XXX::/home/user:/bin/bash

the XXX's in your case will be a bunch of digits.
 

The Following User Says Thank You to jd4200 For This Useful Post:
Posts: 19 | Thanked: 3 times | Joined on Jun 2010 @ New Jersey, USA
#5
So I'm not sure if there is something I've done wrong here, but following jd4200's advice above, I am now not able to boot the N900. Here is what I did exactly:

1. I previously had Bash 3.2 installed and working on the N900 X Terminal, but was hoping to update to Bash 4.
2. I installed Bash 4 from Extras-Dev
3. I uninstalled Bash 3.2 using App Manager (HAM).
4. In the X Terminal (now running Busybox), I used 'sudo vi /etc/passwd' to update the passwd file, replacing '/bin/sh' with '/bin/bash' for user and root and saved.
5. When restarting X Terminal, it errored out and quit (I'm not sure where the log files are for X Terminal, so if there is more I can provide let me know where to pull it).
6. When restarting the device, the N900 hangs indefinitely.
7. I restarted using the rescue initrd and changed the /etc/passwd file back to using '/bin/sh' for user and root.
8. N900 still does not boot up.

Since I am able to get to the device, I have no issue rescuing my data and flashing the device (I've done this plenty of times), but I am not sure if I did something wrong or if the instructions above are incorrect.

Let me know if you have any comments on what I could have done wrong - otherwise, I'll let this stand as a warning for anyone looking to the directions above.
 

The Following User Says Thank You to nathanbibb For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#6
Originally Posted by nathanbibb View Post
2. I installed Bash 4 from Extras-Dev
3. I uninstalled Bash 3.2 using App Manager (HAM).
4. In the X Terminal (now running Busybox), I used 'sudo vi /etc/passwd' to update the passwd file, replacing '/bin/sh' with '/bin/bash' for user and root and saved.
Bash 4 executable is /bin/bash4, isn't it?
 
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#7
Originally Posted by int_ua View Post
Bash 4 executable is /bin/bash4, isn't it?
Code:
ln -s /bin/bash4 /bin/bash
Fixes issues with ez-debian trying to use bash4.
__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.
 
spanner's Avatar
Posts: 253 | Thanked: 184 times | Joined on Nov 2009 @ Bristol, UK
#8
Out of paranoia, I use a .profile entry that checks whether 'sh' is being run in interactive mode AND whether bash is available, and if so execs it:

Code:
if [ $SHELL = "/bin/sh" ]; then
  if [ -x /bin/bash ]; then
    case $- in
      *i*) exec bash $@;;
    esac
  fi
fi
I didn't want to mess with /etc/passwd or inadvertently remove bash only to find my device unusable, and this does the trick for me.
 

The Following 6 Users Say Thank You to spanner For This Useful Post:
Posts: 172 | Thanked: 170 times | Joined on Jan 2010 @ Sweden
#9
The simple way to do this is to run:

chsh

Then give it the path to the shell you want to run. I think chsh is installed by default.
 

The Following User Says Thank You to stefanmohl For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:40.