You are not logged in.

#1 2009-03-18 04:03:41

dalingrin
Member
Registered: 2009-03-18
Posts: 128

while using chroot - want custom prompt

I just created a 32bit chroot which is working great but, I want an easy way to tell if I am using 64bit or 32bit root at the console.
I had the great idea of using .bashrc but then I realized I would need to script a way to differentiate between 32 and 64 bit. My first thought was uname -m but stupid me, didn't think about the fact that I am still using the same kernel so that won't work.
Any help is appreciated.

btw, first post as an Arch user, yay!


[Edit] - wait...just realized since it lists the user(root), that is probably enough for me to know the difference.
Looks like my first post is for not.

Last edited by dalingrin (2009-03-18 04:10:41)

Offline

#2 2009-03-18 05:05:28

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: while using chroot - want custom prompt

Hi,

use this command when you enter to 32 bit chroot:

linux32 chroot /path/to/chroot

So all programs see that are in 32 bit env

Good Luck!

Offline

#3 2009-03-18 14:24:36

ThomasR
Member
Registered: 2008-05-29
Posts: 5

Re: while using chroot - want custom prompt

This is what I use for bash. Make a file inside the root of your 32-bit chroot called inside-choot.
Then you add the following to your .bashrc:

if [[ -f /inside-chroot ]]; then
    PS1='\[\e[1;35m\]arch32 ch \u\[\e[m\] \[\e[1;36m\]\w\[\e[m\] \[\e[1;32m\]> \[\e[m\]\[\e[0;37m\]'
fi

Change the PS1 line to whatever you like, I think i found this from another thread in this forum. Anyway good luck:)

Offline

#4 2009-03-18 23:33:55

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: while using chroot - want custom prompt

djgera wrote:

Hi,

use this command when you enter to 32 bit chroot:

linux32 chroot /path/to/chroot

So all programs see that are in 32 bit env

Good Luck!

Thanks, I was wondering why applications were reporting x86_64

ThomasR wrote:

This is what I use for bash. Make a file inside the root of your 32-bit chroot called inside-choot.
Then you add the following to your .bashrc:

if [[ -f /inside-chroot ]]; then
    PS1='\[\e[1;35m\]arch32 ch \u\[\e[m\] \[\e[1;36m\]\w\[\e[m\] \[\e[1;32m\]> \[\e[m\]\[\e[0;37m\]'
fi

Change the PS1 line to whatever you like, I think i found this from another thread in this forum. Anyway good luck:)

That's perfect. Thank you!

Offline

#5 2009-04-25 11:00:08

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: while using chroot - want custom prompt

ThomasR wrote:

This is what I use for bash. Make a file inside the root of your 32-bit chroot called inside-choot.
Then you add the following to your .bashrc:

if [[ -f /inside-chroot ]]; then
    PS1='\[\e[1;35m\]arch32 ch \u\[\e[m\] \[\e[1;36m\]\w\[\e[m\] \[\e[1;32m\]> \[\e[m\]\[\e[0;37m\]'
fi

Change the PS1 line to whatever you like, I think i found this from another thread in this forum. Anyway good luck:)

! Very clever actually tongue

Offline

Board footer

Powered by FluxBB