Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
new projects/external/mksh proposal… or replace sh?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mirabilos  
View profile  
 More options Dec 3 2009, 10:19 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Thu, 3 Dec 2009 07:19:09 -0800 (PST)
Local: Thurs, Dec 3 2009 10:19 am
Subject: new projects/external/mksh proposal… or replace sh?
Hi,

I’m the maintainer of the MirBSD Korn Shell – http://mirbsd.de/mksh
and have successfully
built a full Android tree with mksh (in two flavours, ① full+printf, ②
small) as an external project
(I’d like to not assign over copyright or equivalent for this, but
still like to get it integrated).

To the developer, it has tab completion, adb can be built withOUT the
evil -DSH_HISTORY
that causes so many problems, and it can be used as a minimal
scripting language as well.

The licence is similar to BSD, DFSG- and FSF-free and OSI and OKFN
approved. Some
auxiliary code (that can be omitted – setmode.c for the optional mknod
(1) builtin, and
printf.c for the optional printf(1) builtin) are under the 3-clause
UCB BSD licence.

If someone thinks this would benefit a replacement of the crappy
NetBSD® ash in its
ancient version, I’d love to hack it into projects/system/core/mksh
and retire sh. On the
bad side, it’s a little larger – on the bright side, it has Korn shell
functions (such as safe
[[ comparision), bash/ksh93/zsh-like extensions, Emacs (and, optional)
Vi editing modes,
and isn’t MUCH larger. It’s also used as /bin/sh by FreeWRT Embedded
GNU/Linux ADK,
so the precedence is set, and it’s very portable and embed-friendly.

-rwxr-xr-x 1 2423 5010 168232 Dec  1 16:56 out/target/product/generic/
system/bin/mksh
-rwxr-xr-x 1 2423 5010 139104 Dec  1 16:57 out/target/product/generic/
system/bin/mksh-small
-rwxr-xr-x 1 2423 5010  86848 Dec  1 15:37 out/target/product/generic/
system/bin/sh

Requirement is the main tree plus Gerrit changes 12676 and 12677.

These have been built from projects/external/mksh. I’ve also
successfully created an
NDK application tree from it, targetting Android 1.5 (with sys_signame
[] provided by
the build instead of Bionic libc).

Now, how do we go on? Is there interest? Should I publish what I
already have?
Where?

By the way, since I couldn’t get the emulator to do so, which encoding
is used by default?
When I print 'm\xe4h' or 'm\ue4h' I get 'mh' both times, seems as if
Terminal were 7bit?
mksh by default looks at setlocale and nl_langinfo(CODESET), which is
not available, so
the options are: look at ${LC_ALL:-${LC_CTYPE:-${LANG:-C}}}, enable
UTF-8 mode by
default, disable UTF-8 mode by default. The last two reduce code size
a little (not much);
I’ve chosen the latter option for now, but, since adb is usually used
from UTF-8 environments,
would enable UTF-8 by default if Terminal is indeed 7bit.

Thanks in advance,
//mirabilos
--
I believe no one can invent an algorithm. One just happens to hit upon
it
when God enlightens him. Or only God invents algorithms, we merely
copy them.
If you don't believe in God, just consider God as Nature if you won't
deny
existence.              -- Coywolf Qi Hunt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Dec 16 2009, 8:46 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Wed, 16 Dec 2009 05:46:48 -0800 (PST)
Local: Wed, Dec 16 2009 8:46 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
Hi again,

no feedback at all? Does nobody desire a shell with proper history,
tab completion, more secure builtins, etc. at not even two times
the size, either as /bin/sh or at least for development purposes?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joshua D  
View profile  
 More options Dec 17 2009, 12:25 pm
From: Joshua D <jd.jel...@gmail.com>
Date: Thu, 17 Dec 2009 09:25:59 -0800 (PST)
Local: Thurs, Dec 17 2009 12:25 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?
I'm currently using Bourne-again shell (BASH), but not sure if others
keep default.
Would be good to see a decent shell running on Android, the current
one is lacking.

I guess it's just like busybox (everyone uses it, except the AOSP) -
But perhaps due to licensing? I'm not sure.

On Dec 17, 12:46 am, mirabilos <tg+m...@mirbsd.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "new projects/external/mksh proposal. or replace sh?" by Ryan Beesley
Ryan Beesley  
View profile  
 More options Dec 17 2009, 2:33 pm
From: Ryan Beesley <Ryan.Bees...@swypeinc.com>
Date: Thu, 17 Dec 2009 13:33:27 -0600
Local: Thurs, Dec 17 2009 2:33 pm
Subject: RE: new projects/external/mksh proposal. or replace sh?
I'm more familiar with BASH, but I think any improvement to the current SH would be welcome.

/Ryan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "new projects/external/mksh proposal… or replace sh?" by Dennis.Yxun
Dennis.Yxun  
View profile  
 More options Dec 17 2009, 8:22 pm
From: "Dennis.Yxun" <dennis.y...@gmail.com>
Date: Fri, 18 Dec 2009 09:22:07 +0800
Local: Thurs, Dec 17 2009 8:22 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?

good to hear~
I would like a more advanced shell, I like tab completion
current one is quite dumb and lack functionality

for the binary size, not that much big, it should be acceptable

On Wed, Dec 16, 2009 at 9:46 PM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joshua D  
View profile  
 More options Dec 19 2009, 1:44 am
From: Joshua D <jd.jel...@gmail.com>
Date: Fri, 18 Dec 2009 22:44:46 -0800 (PST)
Local: Sat, Dec 19 2009 1:44 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
This to me seems a tough one. the shell the op mentions sounds good,
what does the ops suggestion have that bash dosnt? I think any shell
would be an improvement, but are we later going to want to move to
bash?
JD

On Dec 18, 12:22 pm, "Dennis.Yxun" <dennis.y...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Dec 22 2009, 3:24 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Tue, 22 Dec 2009 00:24:07 -0800 (PST)
Local: Tues, Dec 22 2009 3:24 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
For one thing, licencing. GNU bash is, well, GNU stuff; mksh is BSD
stuff.
Other than that, well, compare. For example, i386 linux glibc:

-rwxr-xr-x 1 root root 702160 May 12  2008 /bin/bash*
-rwxr-xr-x 1 root root 203132 Nov 23 14:10 /bin/mksh*

And that’s dynamically linked (mksh: libc, libbsd; bash: libc, libdl,
libncurses!).

Third, it is mostly bash/ksh93/zsh compatible and gets an increasing
featureset, but is a Korn shell and as such has some unique (except
ksh93 has them foo) functionality like co-processes, but for Android,
the thing I think most of you would find appealing is that it offers
good interactive behaviour (history, tab completion, etc.) that just
works (no ~/.inputrc, no ncurses, no readline) in a very small binary.

Here’s one (binary) for you to play with, to see how it “feels” like:
http://www.mirbsd.org/MirOS/dist/mir/mksh/ports/mksh-39.9.20091128-an...
Manpage: http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh.pdf

Besides, GNU bash is so much a GNU/Linux thing, while Android
takes more of the tools from ancient NetBSD® so this fits just right
in. Korn Shell is the default on very many Unicēs.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dennis.Yxun  
View profile  
 More options Dec 22 2009, 4:20 am
From: "Dennis.Yxun" <dennis.y...@gmail.com>
Date: Tue, 22 Dec 2009 17:20:37 +0800
Local: Tues, Dec 22 2009 4:20 am
Subject: Re: new projects/external/mksh proposal… or replace sh?

mirabilos:
    Great job!
    Would you kind public the source?
 I have a MIPS platform and would like to give a try

Dennis

On Tue, Dec 22, 2009 at 4:24 PM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Dec 22 2009, 4:46 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Tue, 22 Dec 2009 01:46:47 -0800 (PST)
Local: Tues, Dec 22 2009 4:46 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
On Dec 22, 10:20 am, "Dennis.Yxun" <dennis.y...@gmail.com> wrote:

>     Would you kind public the source?

Sure: https://eurynome.mirbsd.org/~tg/pub/android-ndk-1.6_r1~apps~mksh.tgz
is what I (think I) used to build that binary. Note it’s a draft, and
integration as
either projects/external/mksh or replacing /bin/sh will be done (only
slightly)
differently.

I just want to warm you people up to the idea first.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dennis.Yxun  
View profile  
 More options Dec 22 2009, 5:19 am
From: "Dennis.Yxun" <dennis.y...@gmail.com>
Date: Tue, 22 Dec 2009 18:19:21 +0800
Local: Tues, Dec 22 2009 5:19 am
Subject: Re: new projects/external/mksh proposal… or replace sh?

thanks , I may try it later and keep posting the result here

On Tue, Dec 22, 2009 at 5:46 PM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dennis.Yxun  
View profile  
 More options Dec 22 2009, 8:00 pm
From: "Dennis.Yxun" <dennis.y...@gmail.com>
Date: Wed, 23 Dec 2009 09:00:25 +0800
Local: Tues, Dec 22 2009 8:00 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?

HI Thorsten:
     I've integrated into my android platform, just simply throw into the
system
compile and run, then it works, perfect~
     Btw, I'm testing under MIPS platform
     Thank you for your great job

Dennis

On Tue, Dec 22, 2009 at 5:46 PM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shaunak saha  
View profile  
 More options Dec 22 2009, 5:51 am
From: shaunak saha <reach2shauna...@gmail.com>
Date: Tue, 22 Dec 2009 16:21:25 +0530
Local: Tues, Dec 22 2009 5:51 am
Subject: Re: new projects/external/mksh proposal… or replace sh?

Hi Mirabilos,

Thanks.Great job!
I just tried it.Its working fine for me.Tab completion is very helpful.

Thanks,
Shaunak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Jan 4 2010, 4:26 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Mon, 4 Jan 2010 01:26:54 -0800 (PST)
Local: Mon, Jan 4 2010 4:26 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
So,

now that people like it… what about my original question, whom do I
contact to get that thing integrated?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Turner  
View profile  
 More options Jan 6 2010, 7:16 pm
From: David Turner <di...@android.com>
Date: Wed, 6 Jan 2010 16:16:52 -0800
Local: Wed, Jan 6 2010 7:16 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?

You submit it to r.android.com as all other enhancements. This requires you
signing the Contributor License Agreement.
Then your patches will be reviewed and discussed by OHA engineers.

On Mon, Jan 4, 2010 at 1:26 AM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Jan 8 2010, 4:43 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Fri, 8 Jan 2010 01:43:04 -0800 (PST)
Local: Fri, Jan 8 2010 4:43 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
Two things…

One, it’s not possible since I cannot “checkout” a nonexisting
repository, it would
need to be created first.

(Or I’ll just send a patch that replaces the current sh… that’d be
even nicer.)

Second, will the licence terms (BSD/MIT-style) on the original source
code that
would be imported be preserved?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Turner  
View profile  
 More options Jan 8 2010, 5:09 pm
From: David Turner <di...@android.com>
Date: Fri, 8 Jan 2010 14:09:43 -0800
Local: Fri, Jan 8 2010 5:09 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?

On Fri, Jan 8, 2010 at 1:43 AM, mirabilos
<tg+m...@mirbsd.org<tg%2Bm...@mirbsd.org>

> wrote:
> Two things…

> One, it’s not possible since I cannot “checkout” a nonexisting
> repository, it would
> need to be created first.

> (Or I’ll just send a patch that replaces the current sh… that’d be
> even nicer.)

> Ah, good point. Replacing the current sh seems to be the simplest way for

now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chih-Wei  
View profile  
 More options Jan 9 2010, 12:21 am
From: Chih-Wei <cwhu...@android-x86.org>
Date: Fri, 8 Jan 2010 21:21:48 -0800 (PST)
Local: Sat, Jan 9 2010 12:21 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
Nice work!
Once you provide a patch (either in external/mksh or system/core)
I would like to try it on android-x86.

--
Android-x86 project
http://www.android-x86.org

On 1月8日, 下午5時43分, mirabilos <tg+m...@mirbsd.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dennis.Yxun  
View profile  
 More options Jan 10 2010, 9:28 pm
From: "Dennis.Yxun" <dennis.y...@gmail.com>
Date: Mon, 11 Jan 2010 10:28:40 +0800
Local: Sun, Jan 10 2010 9:28 pm
Subject: Re: new projects/external/mksh proposal… or replace sh?

Hi Chih-Wei:
     I've already tried on android-mips, it works.
    So I think it should be quite straight forward for you to try under x86.
One thing, if you want to try to call mksh via adb, you probably should
modify adb source code
change SHELL_COMMAND to /system/bin/mksh or simply overwrite /system/bin/sh
with mksh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Jan 12 2010, 11:58 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Tue, 12 Jan 2010 08:58:03 -0800 (PST)
Local: Tues, Jan 12 2010 11:58 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
Ok,, I’ve done so now.

You first need to apply this change:
https://review.source.android.com/#change,12676 • Change Iae258589:
Add declaration for sys_signame[] forgotten in change 12489

I have no idea how to mark it as dependency in Gerrit.

Then you apply the series of changes amounting to this:
https://review.source.android.com/#change,13148 • Change I5b5c9e78:
shlist.c is no longer needed without -DSH_HISTORY

That’s my replace-sh-with-mksh branch.

I’ve done a “make”, created my own AVD from it and booted it
successfully.
The shell works fine. The only thing missing is a default /.mkshrc
file, for
example for a nice prompt, but then, it’s already WAY better than the
old
NetBSD® ash-based shell.

Please test!

Thanks in advance,
//mirabilos


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Jan 29 2010, 10:53 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Fri, 29 Jan 2010 07:53:10 -0800 (PST)
Local: Fri, Jan 29 2010 10:53 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
Upgraded to mksh R39b, released today.
No really major changes, mostly minor bugfixes;
the snapshot was really close to the release anyway.

Now I think it’s ok for inclusion. I made an AVD out
of this and tested it in the emulator.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mirabilos  
View profile  
 More options Feb 25 2010, 5:13 am
From: mirabilos <tg+m...@mirbsd.org>
Date: Thu, 25 Feb 2010 02:13:48 -0800 (PST)
Local: Thurs, Feb 25 2010 5:13 am
Subject: Re: new projects/external/mksh proposal… or replace sh?
FYI:

Chih-Wei Huang just mailed round that mksh has been merged
into eclair-x86 and that it is repo-sync-able.

Thanks for the acceptance!

I’ll continue to provide updates via Gerrit, if that is desired.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "system/core/sh ← mksh (was Re: new projects/external/mksh proposal… or replace sh?)" by mirabilos
mirabilos  
View profile  
 More options Mar 27 2010, 8:14 pm
From: mirabilos <tg+m...@mirbsd.org>
Date: Sat, 27 Mar 2010 17:14:55 -0700 (PDT)
Local: Sat, Mar 27 2010 8:14 pm
Subject: system/core/sh ← mksh (was Re: new projects/external/mksh proposal… or replace sh?)
Ok, updated again, and rebased onto a freshly checked out repo.
(Please review at Gerrit again, the old 「+1」 was lost due to the
rebase process.)

You need the following change in bionic, as usual:
https://review.source.android.com/12676
repo download platform/bionic 12676/2

Then you get system/core to mksh with these changes (series):
(up to) https://review.source.android.com/14102
repo download platform/system/core 14102/1

New in this version:
• more up to date mksh base code
• EXECSHELL is now /system/bin/sh by default, fixing “adb install”
  and other things; thanks to Chih-Wei Huang
• there is a /system/etc/mkshrc which sets up a few environment
  variables, shell aliases, and a default prompt

XXX $HOME defaults to /data but now that I boot it I can see that the
user
XXX has no permissions on that; better suggestion other than "/"
anyone?

The EXECSHELL thing was responsible for failing to run the command
/system/bin/pm which does not begin with a shebang line (the shell
falls back to using ${EXECSHELL:-/bin/sh} then); I’ve made the default
configurable at compile-time in the upstream code, same for the path
to ~/.mkshrc (which are strictly(!) intended to be used for single-
user
and/or embedded systems, not for regular distro packages, mind you).

I also disabled the mknod(8) builtin, so that setmode.c is also no
longer compiled (licence and space reasons; the old sh had none,
and people probably don’t need it – otherwise just tell me and I
will re-enable it).

I kept the printf builtin in. It can be kept, gotten rid of, or even
(with
some glue code I need to hack, less than a dozen lines probably)
be made a toolbox-like approach with a printf→mksh symlink so
that it’s exposed to other apps, if you like. I recommend, however,
to keep printf’s floating point code (the rest of mksh has none, but
printf is third-party code from BSD) disabled…

If the shell’s too big, I suggest disabling the Vi editing mode first
by using -DMKSH_S_NOVI when compiling. If the result would still
be too big, talk to me. I’d like to get mksh into Android, and ex-
pose its users to as much of its useful functionality as possible.
The current size, which I think is reasonable, is:
-rwxr-xr-x 1 tglase 151888 Mar 28 00:02 out/target/product/generic/
system/bin/sh*

The code (including the EXECSHELL change, but not the mkshrc)
has undergone testing via Android-x86, so I think it’s (almost… see
the $HOME issue above) ready for mainstream, if you want it.

By the way, does anyone know how I can make the changes from
system/core depend on the change from bionic? Gerrit dependen-
cies appear to be within the same git part-repository, not project-
wide…

Thanks for listening!
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was
much
*much* more bare bones. But it turns out it beats the living hell out
of
ksh93 in that respect. I'd even consider it for my daily use if I
hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/
mksh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "system/core/sh ← mksh" by mirabilos
mirabilos  
View profile  
 More options Mar 27 2010, 8:20 pm
From: mirabilos <tg+m...@mirbsd.org>
Date: Sat, 27 Mar 2010 17:20:00 -0700 (PDT)
Subject: Re: system/core/sh ← mksh
I forgot to note:

I have disabled -fstack-protector-all in the explicit flags,
both for the NDK (flag test) and final build. On Android,
in contrast to Android-x86, it is still built with ProPolice
(-fstack-protector) on because that’s a global flag, so
no need to worry there.

I also nuked the NDK (app build) and mksh-small parts
from Android.mk – if anybody had use for them nowadays,
they’re easy to get back I think, but they were not worth
the additional maintenance, and I wanted it cleaned up
for possible inclusion.

//m


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »