[Pkg-libvirt-commits] [libguestfs] 102/165: appliance: init: properly set PS1 and TERM for virt-rescue (RHBZ#812970).

Hilko Bengen bengen at moszumanska.debian.org
Sat Aug 30 08:24:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit e6a858907fd7851148440dcfc7cbabc5cee75a71
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Tue Jun 10 15:18:38 2014 +0200

    appliance: init: properly set PS1 and TERM for virt-rescue (RHBZ#812970).
    
    Setting environment variables such as PS1 for bash before starting it
    might not be effective when the startup scripts provided by the
    distribution unconditionally change it.
    Hence, set PS1 and TERM in a ~/.bashrc, which will be source'd last and
    thus be able to set them the way we want.
---
 appliance/init | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/appliance/init b/appliance/init
index 8d13f2c..b407bf9 100755
--- a/appliance/init
+++ b/appliance/init
@@ -142,9 +142,10 @@ else
   # Remove LD_PRELOAD=libSegFault set above.
   unset LD_PRELOAD
 
-  eval $(grep -Eo 'TERM=[^[:space:]]+' /proc/cmdline)
-  PS1='><rescue> '
-  export TERM PS1
+  :> $HOME/.bashrc
+  grep -Eo 'TERM=[^[:space:]]+' /proc/cmdline >> $HOME/.bashrc
+  echo "PS1='><rescue> '" >> $HOME/.bashrc
+  echo "export TERM PS1" >> $HOME/.bashrc
 
   echo
   echo "------------------------------------------------------------"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list