public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: thelma@sys-concept.com
To: gentoo-user@lists.gentoo.org, Bas Zoutendijk <slzoutendijk@gmail.com>
Subject: Re: [gentoo-user] bash scrip prompt after bootstrap
Date: Fri, 30 Mar 2018 12:20:08 -0600	[thread overview]
Message-ID: <4014463a-7553-4216-3562-6b4695ac4b3d@sys-concept.com> (raw)
In-Reply-To: <20180330171045.GW7314@blackeye.localdomain>

On 03/30/2018 11:10 AM, Bas Zoutendijk wrote:
> On Fri 30 Mar 2018 at 10:33:45 -0600, thelma@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	other threads:[~2018-03-30 18:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 16:33 [gentoo-user] bash scrip prompt after bootstrap thelma
2018-03-30 17:10 ` Bas Zoutendijk
2018-03-30 18:20   ` thelma [this message]
2018-04-02  2:54   ` thelma
2018-04-02  8:00     ` Bas Zoutendijk
2018-04-02  8:25     ` David Haller
2018-04-02  9:29       ` Bas Zoutendijk
2018-04-02 15:14         ` [gentoo-user] " Ian Zimmerman
2018-04-02 15:55           ` Bas Zoutendijk
2018-04-02 16:25             ` Ian Zimmerman
2018-04-02 17:18               ` Bas Zoutendijk
2018-04-02 18:40                 ` Ian Zimmerman
2018-04-02 16:50         ` [gentoo-user] " thelma
2018-04-02 18:36     ` Tom H
2018-04-02 20:40       ` Bas Zoutendijk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4014463a-7553-4216-3562-6b4695ac4b3d@sys-concept.com \
    --to=thelma@sys-concept.com \
    --cc=gentoo-user@lists.gentoo.org \
    --cc=slzoutendijk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox