[Libguestfs] [PATCH] appliance: move virt-rescue welcome to /etc/issue

Cédric Bosdonnat cbosdonnat at suse.com
Thu Jul 21 08:26:16 UTC 2016


To allow easier downstream tweaks to the virt-rescue welcome message,
just output the content of the /etc/issue file in the appliance.
Thus, a new extras.tar.gz file appeared in supermin.d containing
the etc/issue file and future tweaks like this one.
---
 appliance/Makefile.am | 11 +++++++++++
 appliance/init        | 11 ++---------
 appliance/issue       |  9 +++++++++
 3 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100644 appliance/issue

diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index e23778e..f26c4d4 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -36,6 +36,7 @@ EXTRA_DIST = \
 	guestfs_shadow.aug \
 	hostfiles.in \
 	init \
+	issue \
 	libguestfs-make-fixed-appliance.in \
 	libguestfs-make-fixed-appliance.pod \
 	make.sh.in \
@@ -49,6 +50,7 @@ superminfs_DATA = \
 	supermin.d/base.tar.gz \
 	supermin.d/daemon.tar.gz \
 	supermin.d/excludefiles \
+	supermin.d/extras.tar.gz \
 	supermin.d/hostfiles \
 	supermin.d/init.tar.gz \
 	supermin.d/packages \
@@ -107,6 +109,15 @@ supermin.d/excludefiles: excludefiles.in Makefile
 	cmp -s $@ excludefiles-t || mv excludefiles-t $@
 	rm -f excludefiles-t
 
+supermin.d/extras.tar.gz: issue
+	rm -f $@ $@-t
+	rm -rf tmp-d
+	mkdir -p tmp-d/etc
+	cp issue tmp-d/etc 
+	( cd tmp-d && tar zcf - * ) > $@-t
+	rm -r tmp-d
+	mv $@-t $@
+
 supermin.d/hostfiles: hostfiles.in Makefile
 	m4 $(PACKAGELIST_CPP_FLAGS) $< | \
 	grep -v '^[[:space:]]*$$' | grep -v '^#' > hostfiles-t
diff --git a/appliance/init b/appliance/init
index 3816dfd..e549df0 100755
--- a/appliance/init
+++ b/appliance/init
@@ -184,15 +184,8 @@ else
   echo "PS1='><rescue> '" >> $HOME/.bashrc
   echo "export TERM PS1" >> $HOME/.bashrc
 
-  echo
-  echo "------------------------------------------------------------"
-  echo
-  echo "Welcome to virt-rescue, the libguestfs rescue shell."
-  echo
-  echo "Note: The contents of / are the rescue appliance."
-  echo "You have to mount the guest's partitions under /sysroot"
-  echo "before you can examine them."
-  echo
+  cat /etc/issue
+
   bash -i
   echo
   echo "virt-rescue: Syncing the disk now before exiting ..."
diff --git a/appliance/issue b/appliance/issue
new file mode 100644
index 0000000..40b8e17
--- /dev/null
+++ b/appliance/issue
@@ -0,0 +1,9 @@
+
+------------------------------------------------------------
+
+Welcome to virt-rescue, the libguestfs rescue shell.
+  
+Note: The contents of / are the rescue appliance.
+You have to mount the guest's partitions under /sysroot
+before you can examine them.
+
-- 
2.6.6




More information about the Libguestfs mailing list