On 03/30/2018 11:10 AM, Bas Zoutendijk wrote:
> On Fri 30 Mar 2018 at 10:33:45 -0600, the...@sys-concept.com wrote:
>> I'm using a scrip to log-in/boot strap the system over NFS
>>
>> -----
>> #!/bin/sh
>>
>> HOST=${0##*/}
>> HOST=${HOST#*-}
>> ROOT=/mnt/${HOST}
>> ...
>> exec chroot '${ROOT}' /bin/bash -l
>> ---
>>
>> When I'm presented with bash prompt, it is the same as the one I logged
>> IN from.  So to eliminate the confusion I would like to change (add to)
>> the bash prompt the "HOST' name I log-in to.
>>
>> When I log-in I'm presented with: "syscon3 #"
>> I would like it to be: ROOT+HOST
>> eg.: syscon3-eden
> 
>   To change the prompt you want to set $PS1.  For example:
> 
>     echo 'export PS1="some string"; exec </dev/tty' | exec chroot $ROOT 
> /bin/bash -i
> 
> This command tells the Bash inside the chroot to first execute
> 
>     export PS1="some string"
> 
> and then to  continue as a regular log-in  shell.  The special syntax of
> the $PS1 string in described in the  Bash man page.  If you just want to
> prepend a string, you do not even have to bother with crafting a syntax:
> 
>     echo 'export PS1="(chroot '$HOST') $PS1"; exec <dev/tty' | exec chroot 
> $ROOT /bin/bash -i
> 
>                                                               Sincerely,
> 
>                                                                  Bas

Thank you for the input. I'll try it as soon as my box finished
compiling (-e @world), and post the complete script; to boot strap over
NFS (it might help others).

This method of compiling give some of my old (obsolete) system new lease
of life.
I've dusted off my retired (it hasn't been updated in over 250-days):
VIA Eden Processor 1200MHz  1GB of RAM
(was running asterisk, hylafax)

and updating it over NFS.
gcc-6.4.0-r1 took only 1:39hr to compile over NFS on:
AMD Ryzen 5 1400 Quad-Core Processor  16GB or RAM

When I was switching to a new profile on my another system (in production)
Intel(R) Atom(TM) CPU  330   @ 1.60GHz 2GB or RAM

and gcc-6.4.0-r1 with MAKEOPTS="-j5" would not compile; I had to
downgraded recompile gcc with MAKEOPTS="-j1"
gcc-6.4.0-r1 with MAKEOPTS="-j5" was running for over 6hr and
failed;with  MAKEOPTS="-j1" it took over 12hr to compile just
gcc-6.4.0-r1  :-/

What a wast of time! considering that on that network I have AMD 8-core
with 32GB of RAM idling.
If I implemented that bootstrap over NFS it would recompile my entire
@world in 1 days (or 12hr) instead of several several days.

Happy Easter to everybody!
--
Thelma

Reply via email to