Howto change default term (CTRL+ALT+T) to bash

157 views
Skip to first unread message

ngharo

unread,
Dec 22, 2010, 9:31:39 PM12/22/10
to Chromium OS discuss
I'm lazy and wanted access to bash without typing 'shell' in crosh
(told you, i'm lazy). The window manager can be configured as to
which command to run upon CTRL+ALT+T. To edit this, look at /sbin/
window_manager_session.sh.

Inside you will see XTERM_COMMAND. I simply copied the existing cros-
term script it's pointing at and placed it in /usr/local/bin/bash-term
and then edited that file to exec /bin/bash instead of /usr/bin/crosh.

You must have / mounted RW to make changes to these files.

Since we're lacking a decent text editor, I used sed to do the edits.
Kinda whacky.

$ mkdir /usr/local/bin
$ cat /sbin/window_manager_session.sh | sed -e 's/\/usr\/bin\/cros-
term/\/usr\/local\/bin\/bash-term/' > /tmp/window
$ cat /usr/bin/cros-term | sed -e 's/\/usr\/bin\/crosh/\/bin\/bash/'
> /tmp/bash
$ sudo cp /tmp/window /sbin/window_manager_session.sh
$ sudo cp /tmp/bash /usr/local/bin/bash-term
$ sudo chmod +x /usr/local/bin/bash-term /sbin/
window_manager_session.sh

Peace

Ryan Afdahl

unread,
Dec 23, 2010, 1:30:55 AM12/23/10
to Chromium OS discuss
This didn't work for me. Maybe it's the returns in the code put into
this thread. Could you email me your lines?

~ Ryan

Wei Hu

unread,
Dec 23, 2010, 1:54:35 AM12/23/10
to Chromium OS discuss
As for editors, there's qemacs preinstalled. You can also copy busybox
that provides vi.

J.M

unread,
Dec 23, 2010, 11:02:34 AM12/23/10
to Chromium OS discuss
I pulled a 32-bit busybox binary from a Ubuntu box and this worked for
me.

However, I had to remount /dev/sda1 with exec so that the binary would
run from /mnt/stateful_partition/home/chronos/. Most directories in
the filesystem are mounted noexec (probably for a good reason).

Is there a place on the filesystem that is mounted with exec on
reboot? Or is the only solution here to simply re-mount /dev/sda1
every time you want to run your own binaries?

ngharo

unread,
Dec 23, 2010, 7:59:11 PM12/23/10
to Chromium OS discuss
On Dec 23, 10:02 am, "J.M" <john.m...@gmail.com> wrote:
> I pulled a 32-bit busybox binary from a Ubuntu box and this worked for
> me.
>
> However, I had to remount /dev/sda1 with exec so that the binary would
> run from /mnt/stateful_partition/home/chronos/. Most directories in
> the filesystem are mounted noexec (probably for a good reason).
>
> Is there a place on the filesystem that is mounted with exec on
> reboot? Or is the only solution here to simply re-mount /dev/sda1
> every time you want to run your own binaries?

I put user executables in /usr/local/bin (had to create directory,
already included in $PATH).

The list broke lines on commands in the OP. A full line starts with
$.

Also, there is a typo. the window manager file has dashes not
underscores.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages