mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
rescue: Pass $TERM from library into the virt-rescue appliance.
We set it on the kernel command line, then get it out from there when the rescue appliance boots.
This commit is contained in:
@@ -78,7 +78,7 @@ if ! grep -sq guestfs_rescue=1 /proc/cmdline; then
|
||||
fi
|
||||
|
||||
# Use appliance in rescue mode, also used by the virt-rescue command.
|
||||
TERM=linux ;# XXX library should pass this from library's environment
|
||||
eval $(grep -Eo 'TERM=[^[:space:]]+' /proc/cmdline)
|
||||
PS1='><rescue> '
|
||||
export TERM PS1
|
||||
echo
|
||||
|
||||
@@ -1257,10 +1257,12 @@ guestfs__launch (guestfs_h *g)
|
||||
"%s " /* (selinux) */
|
||||
"%s " /* (vmchannel) */
|
||||
"%s " /* (verbose) */
|
||||
"TERM=%s " /* (TERM environment variable) */
|
||||
"%s", /* (append) */
|
||||
g->selinux ? "selinux=1 enforcing=0" : "selinux=0",
|
||||
vmchannel ? vmchannel : "",
|
||||
g->verbose ? "guestfs_verbose=1" : "",
|
||||
getenv ("TERM") ? : "linux",
|
||||
g->append ? g->append : "");
|
||||
|
||||
add_cmdline (g, "-kernel");
|
||||
|
||||
Reference in New Issue
Block a user