[lfs-support] PS1 for user lfs

Bruce Dubbs bruce.dubbs at gmail.com
Fri Apr 20 14:51:09 PDT 2012


Philippe Delavalade wrote:
> Le vendredi 20 avril à 23:22, Bruce Dubbs a écrit :
>> Philippe Delavalade wrote:
>>
>>> .bashrc and .bash_profile are exactly those of the book :-(
>>>
>>> My only deviation from the book is to have given a specific gid and uid to
>>> lfs when executing groupadd and useradd, but I think it's not the reason
>>> why PS1 goes wrong. 
>> Setting a specific uid and gid will not affect anything.
>>
>> What are the results of the host system requirements in section vii?
> 
> All seems correct ; I'm always very carefull with this each time.
> I can rerun the script and send you the output.
> 
>> What happens if you just run `env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' 
>> /bin/bash` from the command prompt?
> 
> Nothing change for the prompt :-(
> 
>> What is the full output of `set`?
> 
> Here it is :
> 
> BASH=/bin/bash
> BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
> BASH_ALIASES=()
> BASH_ARGC=()
> BASH_ARGV=()
> BASH_CMDS=()
> BASH_LINENO=()
> BASH_SOURCE=()
> BASH_VERSINFO=([0]="4" [1]="2" [2]="20" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
> BASH_VERSION='4.2.20(1)-release'
> COLUMNS=80
> DIRSTACK=()
> EUID=1004
> GROUPS=()
> HISTFILE=/home/lfs/.bash_history
> HISTFILESIZE=500
> HISTSIZE=500
> HOME=/home/lfs
> HOSTNAME=magellan
> HOSTTYPE=x86_64
> IFS=$' \t\n'
> LC_ALL=POSIX
> LFS=/lfs

This is a little unusual, but it's OK.

> LFS_TGT=x86_64-lfs-linux-gnu
> LINES=25
> MACHTYPE=x86_64-pc-linux-gnu
> MAILCHECK=60
> OPTERR=1
> OPTIND=1
> OSTYPE=linux-gnu
> PATH=/tools/bin:/bin:/usr/bin
> PIPESTATUS=([0]="0")
> PPID=25544
> PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
> PS2='> '
> PS4='+ '
> PWD=/lfs/sources
> SHELL=/bin/bash
> SHELLOPTS=braceexpand:emacs:histexpand:history:interactive-comments:monitor
> SHLVL=1
> TERM=linux
> UID=1004
> _=PATH

Everything except PS1 seems OK.

Did you do 4.3:  `su - lfs`  The dash is needed.  PS1 is not normally set when 
starting a login shell.  We set it explicitly.  In a non-login shell, it needs 
to be reset every time, usually by setting it in ~/.bashrc.

In this case, it is supposed to be set in the env statement.

   -- Bruce




More information about the lfs-support mailing list