maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] bash as the default shell (https://talk.maemo.org/showthread.php?t=14613)

ag2 2008-01-07 22:01

[Announce] bash as the default shell
 
Tired of the built-in busybox shell?

I've made a package of bash 3.2. Unlike other instances of bash floating around, this one is compatible with busybox and can be used as the default shell without sending your tablet into an infinite reboot cycle.

To make bash the default, edit /etc/passwd and replace /bin/sh with /bin/bash for users 'user' and 'root'. I have not yet felt adventurous enough to symlink /bin/sh to /bin/bash.

Download bash3 at http://nitapps.com

Note: install at your risk. Making bash the default shell may break your tablet, requiring a reflash. It works on my N810 with OS2008, but that's only a sample size of one.

fanoush 2008-01-07 23:30

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by ag2 (Post 122767)
.I have not yet felt adventurous enough to symlink /bin/sh to /bin/bash.

In theory this may cause longer boot time, less available RAM after system boots and even some breakage of badly written (boot or other) shell scripts already present on the device. But still might be interesting experiment. Let us know if you try it. I am curious if those effects on ram and boot time are significant (if the device boots fine at all).

Talon88 2008-01-07 23:42

Re: [Announce] bash as the default shell
 
:::

Any Screen Shot........??

:::

ag2 2008-01-08 00:13

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by Talon88 (Post 122829)
:::

Any Screen Shot........??

:::

Here you go:

$

Talon88 2008-01-08 00:29

Re: [Announce] bash as the default shell
 
::::

Woo......... Cool.....! :D

:::

fnordianslip 2008-01-08 01:05

Re: [Announce] bash as the default shell
 
i think that was photoshopped :-)

linuxrebel 2008-01-09 09:38

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by ag2 (Post 122856)
Here you go:

$

This message is why bosses hate people reading the web during a meeting, THANKS! [seriously]
@fanoush, if start times are a concern leaving roots shell as sh should be ok. Linux can handle the split.

aniruddha 2008-01-11 20:18

Re: [Announce] bash as the default shell
 
Great! This is just what I need, thanks a lot! :D

/*Eddie*/ 2008-01-23 22:42

Re: [Announce] bash as the default shell
 
Yeah... deleting /bin/sh and /bin/ash after I put bash in there was a nice way of requiring a reflash...

Can't say I wasn't warned :D

ag2 2008-01-24 02:25

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by /*Eddie*/ (Post 132743)
Yeah... deleting /bin/sh and /bin/ash after I put bash in there was a nice way of requiring a reflash...

Can't say I wasn't warned :D

/bin/sh is needed by startup scripts. Deleting it will definitely break your tablet.

To make bash the default shell, edit /etc/passwd and replace /bin/sh by /bin/bash for users 'user' and 'root'.

If you want to go a step farther, symlink /bin/sh and /bin/ash to /bin/bash. This may or may not break your tablet, I haven't tried this yet.

NullPointer 2008-02-03 04:23

Re: [Announce] bash as the default shell
 
Thanks for bash! working great. I haven't used *nix in ages and the default shell was killing me...

(also, thanks for nano too!)

qwerty12 2008-02-03 10:27

Re: [Announce] bash as the default shell
 
Could I make a slight request please? Is there anyway to modify the bash so when you run "sudo gainroot", it uses the "user" .bash-history? (I like how ash does that and when I need to be full root, I use the root command as per your easy root package).

Thanks.

Ulysses 2008-02-06 18:45

Re: [Announce] bash as the default shell
 
Just to confirm that your bash port installs and runs fine OS2007.
Thanks!

Alassiel 2008-02-06 21:39

Re: [Announce] bash as the default shell
 
A couple of quick questions from an N800 newbie. I need bash installed to be able to run a fix utility (script) for an e-mail app that I am running on my N800.

Is this bash package compatible with an N800 running OS2008?
After it's downloaded, how does it get installed?
What precautions should I take before starting any of this?

Appreciate hearing any thoughts.

ag2 2008-02-07 02:29

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by qwerty12 (Post 137550)
Could I make a slight request please? Is there anyway to modify the bash so when you run "sudo gainroot", it uses the "user" .bash-history? (I like how ash does that and when I need to be full root, I use the root command as per your easy root package).

Thanks.

When you do 'sudo gainroot', you are dropped back to ash. I made 'sudo gainroot' backward compatible by popular demand, and that's how the original 'sudo gainroot' behaves (it forces /bin/sh on you).

ag2 2008-02-07 02:31

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by Alassiel (Post 139148)
A couple of quick questions from an N800 newbie. I need bash installed to be able to run a fix utility (script) for an e-mail app that I am running on my N800.

Is this bash package compatible with an N800 running OS2008?
After it's downloaded, how does it get installed?
What precautions should I take before starting any of this?

Appreciate hearing any thoughts.

Works fine with OS2008. Install like you would install any other package.

Benz145 2008-02-07 03:34

Re: [Announce] bash as the default shell
 
I'm guessing Shell means a new GUI, is that right? Can anyone show what it looks like?

Edit: Oh I was thinking this was a whole new GUI for OS2008, but I suppose its just for an app called Busybox?

linuxrebel 2008-02-09 07:41

Re: [Announce] bash as the default shell
 
Well for reason of "eh" a week ago I bit the bullet and installed bash as the system shell ( rm /bin/sh then ln -s /bin/bash /bin/sh) Works well, nothing broke, overall it feels solid reboots work at the same speed. AND I got my finger board back.

qwerty12 2008-02-09 11:24

Re: [Announce] bash as the default shell
 
Thanks to linuxrebel, I can confirm that symlinking bash to /bin/sh & to /bin/ash works fine.

fnordianslip 2008-02-09 11:52

Re: [Announce] bash as the default shell
 
Hi. Does this bash package replace all the utilities in busybox as well as adding bash? Or does it at least allow me to replace them all without conflicts with busybox? Or does it just replace the shell, and leave the utilities pointing at busybox?

I'm keen to try this, but I'm unsure exactly what the result will be. Having written this out, I'm convinced it will be the third alternative from above, but just want to check. Ideally, I'd really like to replace the busybox utils with their fully fledged counterparts as well as having bash.

nan0meter 2010-11-03 22:42

Re: [Announce] bash as the default shell
 
Cheers, works perfectly! Just change the /etc/passwd, no need to symlink as that might break stuff ;)

009N 2010-11-30 06:36

Re: [Announce] bash as the default shell
 
1 Attachment(s)
Thanks for the tip and package! Bash is one of the most important features I need.

Running as user I can use bash with colors by editing .bashrc, but as root the shell falls back to busybox e.g. ls is busybox's and cannot recognize options like --color=auto and accept alias.

To solve this, I have to (as root):
1. copy these few lines from .bashrc to /etc/profile:
export LS_OPTIONs='--color=auto'
eval "`dircolors'"
alias ls='ls $LS_OPTIONS'
alias ls='ls $LS_OPTIONS -l'
alias ls='ls $LS_OPTIONS -la'

2. edit /etc/passwd
Not only "root" and "user", but "bin" also has to use "/bin/bash".

On top of that, it makes life easier to me to login as root in /home/user rather than /root. so in "root" /home/user (the second last item in "root") becomes the default dir. :D

Tigerite 2010-12-01 10:19

Re: [Announce] bash as the default shell
 
Thanks for the guidelines, though I had to do things a little differently myself.

Firstly, for dircolors to work, coreutils-gnu has to be installed - from titan, who else ;) http://maemo.org/packages/view/coreutils-gnu/

Once this is installed, then there are two options; either add /usr/bin/gnu to the PATH in /etc/profile (but ensure it is the first entry), or alias ls to use gls, so that the lines mentioned (which had a couple of typos) read:

Code:

export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='gls $LS_OPTIONS'
alias ll='gls $LS_OPTIONS -l'
alias l='gls $LS_OPTIONS -la'

I prefer the former method, as then you get the proper gnu versions of tar, dir, uname and many others, rather than the crippled busybox ones. Using this I also found that changing bin's shell to /bin/bash was unnecessary but YMMV.

Finally, I needed to add /sbin and /usr/sbin to the PATH in /etc/profile too as they are not there by default, but are in rootsh - talking of which, /usr/sbin/gainroot has to be changed for "sudo gainroot" to work, so that it uses /bin/bash and also .bash_history rather than .ash_history. It's a one-line change and really straightforward but I can post it if anyone is stuck.

Straycat 2010-12-01 11:22

Re: [Announce] bash as the default shell
 
Quote:

Originally Posted by Tigerite (Post 886781)
...

Finally, I needed to add /sbin and /usr/sbin to the PATH in /etc/profile too as they are not there by default, but are in rootsh - talking of which, /usr/sbin/gainroot has to be changed for "sudo gainroot" to work, so that it uses /bin/bash and also .bash_history rather than .ash_history. It's a one-line change and really straightforward but I can post it if anyone is stuck.

Please...

Thanks in advance.

Tigerite 2010-12-01 11:37

Re: [Announce] bash as the default shell
 
Okay :) as root, use an editor of your choice (personally mine is nano) and change

Code:

else
  echo 'Root shell enabled'
  HISTFILE=/root/.ash_history /bin/sh
fi

to

Code:

else
  echo 'Root shell enabled'
  HISTFILE=/root/.bash_history /bin/bash
fi

That's it :)

Tigerite 2010-12-01 12:34

Re: [Announce] bash as the default shell
 
Sorry, forgot to add that the PATH needs changing in the gainroot script too, so that /usr/bin/gnu is in it as in /etc/profile. It would also need to be the first entry if you want the gnu executables to replace the busybox defaults.

009N 2010-12-02 05:52

Re: [Announce] bash as the default shell
 
I am trying your method and have done these, but the shell (echo $SHELL)is still using busybox (/bin/sh), although gls /w colors is working.
  1. Installed coreutils-gnu
  2. In /etc/profile: export PATH="/usr/bin/gnu:/sbin:/usr/sbin:/bin:/usr/bin..."
  3. In /usr/sbin/gainroot: /usr/bin/gnu is the first in PATH; and HISTFILE=/root/.bash_history /bin/bash

Resource /etc/profile or reboot didn't change anything. :confused:

Tigerite 2010-12-02 08:46

Re: [Announce] bash as the default shell
 
I'm guessing you still have the entries in /etc/passwd so that user and root are using /bin/bash as shell (they're still required, of course)? If so then I'm stumped as to why it would default to /bin/sh..


All times are GMT. The time now is 21:08.

vBulletin® Version 3.8.8