LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   basic question on proceeding through the instructions of LFS? (https://www.linuxquestions.org/questions/linux-from-scratch-13/basic-question-on-proceeding-through-the-instructions-of-lfs-4175599111/)

joecoc1916 02-06-2017 08:32 AM

basic question on proceeding through the instructions of LFS?
 
I have done some reading ahead of where I have actually succeeded in executing the processes, if that is understandable.

Simply put, I am not sure how I can check when I am on the Host System doing work, or when I am on the target system doing work?

I would think this is important. Is it? And if so how can I clear up this ambiguity that I am having?

Hope I am making sense?

Thank you ahead of time!!!

Joe

spiky0011 02-06-2017 11:29 AM

No it dosn;t. If you are building lfs CH5 you should be logged in as user lfs, also you should have LFS set as the variable check with
Code:

echo $LFS
which should result in /mnt/lfs. When building your lfs you would be in $LFS/sources = /mnt/lfs/sources How to check "pwd" will show which dir you are in.

So simple steps login as lfs echo $LFS, cd $LFS/sources

best I can do hope this helps

hazel 02-06-2017 11:59 AM

It depends on whether you are in Chapter 5 or Chapter 6. In Chapter 5 you work exclusively on the host system as the lfs user. In Chapter 6, you work in the target system as root. You add enough bits and pieces to make it into a functional Linux system and then use the chroot command to move across.

You can usually tell easily whether you are in the host or the new system by observing your root prompt. Most Linux distros give root a red prompt; the new system will have a default white one.

joecoc1916 02-06-2017 12:44 PM

Terminal Color Schemes... To help identifying "WhoAmI"
 
Automatically give different terminal colors each time I open terminal

I did a search on google with "Automatically get different terminal colors each time I open terminal".

Gives good ideas but too much work on the return for investment.

I created multiple terminal color schemes through the preferences option on the drop down menu "Edit" in the terminal.
, achieves manageable results...

Luridis 02-07-2017 02:28 AM

If you followed sections 4.3 & 4.4 correctly, you did this:

Code:

cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF

Inside the LFS user's home directory. The "\u" means display the user-name at the prompt, so it should look like this:

username:current-directory$ _

That's how you know you're in the lfs account on the host system. The second half (Chapter 6) is tricky because you're running as root inside a chroot. You can make that prompt stand out by adding something like an underscore or a double hash at the beginning of the prompt. Just add it to the chroot options in section 6.4.

Code:

chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='##-\u-##:\w\$ '              \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

Which would make your prompt look like this...

##-username-##:current-directory$ _

And give you an easily visible indication that you're root-within-chroot instead of root at the host, as the latter wouldn't display the hashes.


All times are GMT -5. The time now is 01:57 PM.