[lfs-support] PS1 for user lfs

Bruce Dubbs bruce.dubbs at gmail.com
Sat Apr 21 09:48:39 PDT 2012


Andrew Benton wrote:
> On Fri, 20 Apr 2012 21:38:37 +0100
> Philippe Delavalade <philippe.delavalade at orange.fr> wrote:
> 
>> Hi.
>>
>> I'm building svn-9812 ; my host is debian/wheezy ; I encounter for the
>> first time a little problem in 4.4.
>>
>> When becoming user lfs and after having passed the command
>>
>> source .bash_profile
>>
>> I don't obtain the right prompt ; all variables are correct except PS1
>> which is
>>
>> PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
>>
>> Maybe it's not important (and I think so) but nevertheless, I fear that
>> this uncorrect value can hide other problems...
> 
> I've noticed the same issue when using Ubunut as a host, when I su to
> the user lfs I didn't get the bare bash prompt. Like you I worried that
> it might hide other environment variables that were being preserved
> from the host. Unlike you I've never taken the time to investigate it,
> I just cracked on and it all turned out fine so I didn't look back. I
> suspect that they compile a default PS1 into bash but it's just a
> suspicion.

On Debian based systems, PS1 is set to use debian_chroot in /etc/bash.bashrc. 
When we run

exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash

bash is rerun as an interactive shell and executes both /etc/bash.bashrc and 
~/.bashrc.

I'm not sure we need to worry about this, but I can't quite figure out how to 
only run ~/.bashrc.

   -- Bruce



More information about the lfs-support mailing list