Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Issue 2733001: initial add of chromeos shell and cros-term (Closed)

Created:
10 years, 6 months ago by rginda
Modified:
9 years, 7 months ago
CC:
chromium-os-reviews_chromium.org
Base URL:
ssh://git@chromiumos-git//window_manager.git
Visibility:
Public.

Description

initial add of chromeos shell and cros-term BUG=chromium-os:3884 TEST=None yet. cros-term takes care of launching the appropriate xterm stand-in, with a suitable environment. crosh is a read-eval-print loop with a whitelisted set of commands. It is intended to be started by our xterm, instead of bash, so that we don't have to give a full bash prompt. I don't believe platform/window-manager is really the correct place to stash these scripts in the long term. Short term, we'd like to land this in time to cherry-pick into R7, and window-manager seems like the best of the wrong places. If this ends up being something we keep around, it probably deserves its own repo.

Patch Set 1 #

Total comments: 3

Patch Set 2 : change username/hostname validation #

Patch Set 3 : chmod +x cros-term #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -0 lines) Patch
A bin/cros-term View 1 2 1 chunk +3 lines, -0 lines 1 comment Download
A bin/crosh View 1 1 chunk +128 lines, -0 lines 5 comments Download
A bin/crosh-dev View 1 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
rginda
I'll be fixing the aterm sizing issues in another CL.
10 years, 6 months ago (2010-06-07 23:21:52 UTC) #1
Daniel Erat
This looks okay to me, but you should probably find someone who knows more about ...
10 years, 6 months ago (2010-06-07 23:41:16 UTC) #2
Daniel Erat
http://codereview.chromium.org/2733001/diff/1/3 File bin/crosh (right): http://codereview.chromium.org/2733001/diff/1/3#newcode86 bin/crosh:86: expr "$1" : '^[[:alnum:].]*$' > /dev/null On 2010/06/07 23:41:16, ...
10 years, 6 months ago (2010-06-07 23:42:15 UTC) #3
rginda
http://codereview.chromium.org/2733001/diff/1/3 File bin/crosh (right): http://codereview.chromium.org/2733001/diff/1/3#newcode86 bin/crosh:86: expr "$1" : '^[[:alnum:].]*$' > /dev/null On 2010/06/07 23:42:15, ...
10 years, 6 months ago (2010-06-08 00:02:02 UTC) #4
Will Drewry
10 years, 6 months ago (2010-06-08 15:11:15 UTC) #5
A few nits, but seems fine for now.  We should really just rewrite the wrapper
with a small bit of C, but this seems like it'll work for now -- and it's not
like it _actually_ acts as a security barrier -- more as gentle discouragement.

thanks for pulling it together quickly.

http://codereview.chromium.org/2733001/diff/11001/12001
File bin/cros-term (right):

http://codereview.chromium.org/2733001/diff/11001/12001#newcode1
bin/cros-term:1: #!/bin/bash
Why not just use /bin/sh?

http://codereview.chromium.org/2733001/diff/11001/12002
File bin/crosh (right):

http://codereview.chromium.org/2733001/diff/11001/12002#newcode1
bin/crosh:1: #!/bin/bash
Make sure that you add bash to a dependency somewhere in the ebuild since I
think the only package holding it in the image now is the memento_updater.sh

http://codereview.chromium.org/2733001/diff/11001/12002#newcode18
bin/crosh:18: if [ "$1" == "--dev" -o -f "/root/.dev_mode" ]; then
can we _not_ encode /root/.dev_mode here too or do you really need it here? 
/root/.dev_mode is/was? a temporary hack until we expose dev_mode via /sys/.... 
On real hardware, we won't change the read-only partition to have this file. 
(At best, we can mount --bind over /root/ but that seems like a hack to fix a
hack.)

If you need it, at least add a TODO :/

http://codereview.chromium.org/2733001/diff/11001/12002#newcode92
bin/crosh:92: function check_hostname() {
two check_hostnames? :)

http://codereview.chromium.org/2733001/diff/11001/12002#newcode99
bin/crosh:99: expr "$1" : '^[[:alnum:]][[:alnum:].~%$^\-]*$' > /dev/null
Are these characters just to cover the weird overloaded cases you see with
things like hydras?  (You may want to include a colon too fwiw)

Otherwise, most usernames don't have tilde, etc...

http://codereview.chromium.org/2733001/diff/11001/12002#newcode103
bin/crosh:103: expr "$1" : '^[[:digit:].]*$' > /dev/null
Why is the dot in there?

Powered by Google App Engine
This is Rietveld 408576698