[PATCH v2] launch: add support for autodetection of appliance image format
by Pavel Butsykin
This feature allows you to use different image formats for the fixed
appliance. The raw format is used by default.
Signed-off-by: Pavel Butsykin <pbutsykin(a)virtuozzo.com>
---
lib/launch-direct.c | 2 ++
lib/launch-libvirt.c | 19 ++++++++++++-------
m4/guestfs_appliance.m4 | 11 +++++++++++
3 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/lib/launch-direct.c b/lib/launch-direct.c
index 0be662e25..b9b54857a 100644
--- a/lib/launch-direct.c
+++ b/lib/launch-direct.c
@@ -592,7 +592,9 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
append_list ("id=appliance");
append_list ("cache=unsafe");
append_list ("if=none");
+#ifndef APPLIANCE_FMT_AUTO
append_list ("format=raw");
+#endif
} end_list ();
start_list ("-device") {
append_list ("scsi-hd");
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index 4adb2cfb3..030ea6911 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -212,9 +212,10 @@ get_source_format_or_autodetect (guestfs_h *g, struct drive *drv)
/**
* Create a qcow2 format overlay, with the given C<backing_drive>
- * (file). The C<format> parameter, which must be non-NULL, is the
- * backing file format. This is used to create the appliance overlay,
- * and also for read-only drives.
+ * (file). The C<format> parameter is the backing file format.
+ * The C<format> parameter can be NULL, in this case the backing
+ * format will be determined automatically. This is used to create
+ * the appliance overlay, and also for read-only drives.
*/
static char *
make_qcow2_overlay (guestfs_h *g, const char *backing_drive,
@@ -223,8 +224,6 @@ make_qcow2_overlay (guestfs_h *g, const char *backing_drive,
char *overlay;
struct guestfs_disk_create_argv optargs;
- assert (format != NULL);
-
if (guestfs_int_lazy_make_tmpdir (g) == -1)
return NULL;
@@ -232,8 +231,10 @@ make_qcow2_overlay (guestfs_h *g, const char *backing_drive,
optargs.bitmask = GUESTFS_DISK_CREATE_BACKINGFILE_BITMASK;
optargs.backingfile = backing_drive;
- optargs.bitmask |= GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK;
- optargs.backingformat = format;
+ if (format) {
+ optargs.bitmask |= GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK;
+ optargs.backingformat = format;
+ }
if (guestfs_disk_create_argv (g, overlay, "qcow2", -1, &optargs) == -1) {
free (overlay);
@@ -461,7 +462,11 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
/* Note that appliance can be NULL if using the old-style appliance. */
if (appliance) {
+#ifdef APPLIANCE_FMT_AUTO
+ params.appliance_overlay = make_qcow2_overlay (g, appliance, NULL);
+#else
params.appliance_overlay = make_qcow2_overlay (g, appliance, "raw");
+#endif
if (!params.appliance_overlay)
goto cleanup;
}
diff --git a/m4/guestfs_appliance.m4 b/m4/guestfs_appliance.m4
index 81c43879f..4e1ec8135 100644
--- a/m4/guestfs_appliance.m4
+++ b/m4/guestfs_appliance.m4
@@ -139,3 +139,14 @@ AC_SUBST([GUESTFS_DEFAULT_PATH])
AC_DEFINE_UNQUOTED([GUESTFS_DEFAULT_PATH], ["$GUESTFS_DEFAULT_PATH"],
[Define guestfs default path.])
+
+AC_ARG_ENABLE([appliance-fmt-auto],
+ [AS_HELP_STRING([--enable-appliance-fmt-auto],
+ [enable autodetection of appliance image format @<:@default=no@:>@])],
+ [ENABLE_APPLIANCE_FMT_AUTO="$enableval"],
+ [ENABLE_APPLIANCE_FMT_AUTO=no])
+
+if test "x$ENABLE_APPLIANCE_FMT_AUTO" = "xyes"; then
+ AC_DEFINE([APPLIANCE_FMT_AUTO], [1],
+ [Define to 1 if enabled autodetection of appliance image format.])
+fi
--
2.13.0
4 years, 10 months
Virtualbox vdi Input Format and man pages
by stef204
Hi,
I am new to v2v/libguestfs.
I need to convert a 30 GB virtual machine running Windows7 64 bit (a guest on a Linux system) from Virtualbox vdi format to qcow2 (or raw/img--another debate in itself) so I can use libvirt/qemu/kvm to run it and completely migrate away from Virtualbox.
The vdi machine is a mission critical production environment and I cannot afford to mess it up, etc. Will keep original vdi intact until have successfully converted and tested.
I have done some research and come upon v2v which seems to be just what the doctor ordered except that, in "local" man pages of version 1.36.4 which I have installed, there is NO mention of vdi compatibility as input format.
However, on these online man pages <https://linux.die.net/man/1/virt-v2v> I see a section called "Local VirtualBox guests" which seems to indicate that vdi is indeed accepted as input format.
Can anyone provide feedback as to the above?
v2v seems to be a tool I could use to more easily deal with this conversion/migration than just using qemu-img convert and having to then deal with the other bits and pieces such as virtio drivers, etc.
Thanks for any helpful feedback and pointers.
7 years, 2 months
[PATCH v12 00/11] Reimplement inspection in the daemon.
by Richard W.M. Jones
This fixes almost everything. Note that it adds an extra commit which
fixes the whole utf8/iconv business.
It's probably better to list what isn't fixed:
(1) I didn't leave the osinfo code around because I'm still haven't
looked too closely at virt-builder-repository. Can't we just fetch
this code from the git history when we need it?
(2) I didn't change the way that parse_os_release work fundamentally
to reduce the risk of adding new bugs in this series. However I do
agree that we need to improve them after this series.
Rich.
7 years, 2 months
The issue about code coverage for libguestfs
by Yongkui Guo
Hi,
I tried to do code coverage testing for libguestfs with gcov.
The steps are shown as follows:
1. Download and install the source package(libguestfs-1.36.5-1.el7.src.rpm)
2. Modify libguestfs.spec file
#diff -u libguestfs.spec libguestfs.spec.modify
---------------------------------------------------------------------------------------
--- libguestfs.spec 2017-08-29 02:44:35.623751541 -0400
+++ libguestfs.spec.modify 2017-08-29 06:09:49.650654223 -0400
@@ -14,7 +14,7 @@
Name: libguestfs
Epoch: 1
Version: 1.36.5
-Release: 1%{?dist}
+Release: 1.gcov%{?dist}
License: LGPLv2+
# Source and patches.
@@ -69,7 +69,7 @@
Patch0034: 0034-RHEL-7-v2v-disable-unconfig-of-manually-installed-VM.patch
Patch0035: 0035-v2v-i-ova-Prefer-pigz-or-pxz-for-uncompressing-OVA-f.patch
Patch0036: 0036-resize-handle-empty-UUIDs-for-swap-partitions-RHBZ-1.patch
-
+Patch0037: 0037-possible-link-fix.patch
# Use git for patch management.
BuildRequires: git
@@ -815,6 +815,8 @@
%build
+CFLAGS="-fprofile-arcs -ftest-coverage -g -O0"; export CFLAGS
+LDFLAGS="-fprofile-arcs -ftest-coverage -lgcov"; export LDFLAGS
# Test if network is available.
ip addr list ||:
ip route list ||:
@@ -852,6 +854,7 @@
--disable-golang \
$extra
+sed -i 's/^CFLAGS = -fprofile-arcs -ftest-coverage -g -O0/CFLAGS = /g' /home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml/Makefile
# Building index-parse.c by hand works around a race condition in the
# autotools cruft, where two or more copies of yacc race with each
# other, resulting in a corrupted file.
------------------------------------------------------------------------------------------
3.Execute rpmbuild command, but it failed with some errors.
#rpmbuild -ba SPECS/libguestfs.spec
------------------------------------------------------------------------------------------
...
gcc -std=gnu99 -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -DGUESTFS_PRIVATE=1 -I.. -I/usr/lib64/ocaml -I../ocaml -I../common/utils -I../common/utils -I../lib -I../lib -I../gnulib/lib -I../gnulib/lib -fno-common -W -Wabi -Waddress -Waggressive-loop-optimizations -Wall -Wattributes -Wbad-function-cast -Wbuiltin-macro-redefined -Wchar-subscripts -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wold-style-declaration -Wold-style-definition -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wswitch -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-macros -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Wnormalized=nfc -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=5000 -Wstack-usage=10000 -fPIC -fno-strict-overflow -Wno-strict-overflow -c -o ../common/utils/libguestfsocaml_a-utils.o `test -f '../common/utils/utils.c' || echo './'`../common/utils/utils.c
ocamlfind ocamlc -g -annot -warn-error CDEFLMPSUVYZX-3 -package unix -c guestfs.ml -o guestfs.cmo
ocamlfind ocamlopt -g -annot -warn-error CDEFLMPSUVYZX-3 -package unix -c guestfs.ml -o guestfs.cmx
rm -f libguestfsocaml.a
ar cr libguestfsocaml.a libguestfsocaml_a-guestfs-c.o libguestfsocaml_a-guestfs-c-actions.o libguestfsocaml_a-guestfs-c-errnos.o ../common/utils/libguestfsocaml_a-utils.o ../gnulib/lib/libgnu.la
ranlib libguestfsocaml.a
ocamlmklib -o mlguestfs \
libguestfsocaml_a-guestfs-c.o libguestfsocaml_a-guestfs-c-actions.o libguestfsocaml_a-guestfs-c-errnos.o ../common/utils/libguestfsocaml_a-utils.o guestfs.cmo \
-fprofile-arcs -ftest-coverage -lgcov \
\
-L../lib/.libs -lguestfs
Unknown option -fprofile-arcs
Unknown option -ftest-coverage
ocamlmklib -o mlguestfs \
libguestfsocaml_a-guestfs-c.o libguestfsocaml_a-guestfs-c-actions.o libguestfsocaml_a-guestfs-c-errnos.o ../common/utils/libguestfsocaml_a-utils.o guestfs.cmx \
-fprofile-arcs -ftest-coverage -lgcov \
\
-L../lib/.libs -lguestfs
Unknown option -fprofile-arcs
Unknown option -ftest-coverage
touch stamp-mlguestfs
Warning: Element Unix.error not found
make[2]: Leaving directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml'
Making all in ocaml/examples
make[2]: Entering directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml/examples'
ocamlfind ocamlopt -cclib -L../../lib/.libs -package unix -linkpkg \
-warn-error A -I .. mlguestfs.cmxa create_disk.ml -o create_disk
ocamlfind ocamlopt -cclib -L../../lib/.libs -package unix -linkpkg \
-warn-error A -I .. mlguestfs.cmxa debug_logging.ml -o debug_logging
../libmlguestfs.a(libguestfsocaml_a-utils.o): In function `guestfs_int_string_is_valid':
utils.c:(.text+0xb99): undefined reference to `c_isalpha'
utils.c:(.text+0xbbf): undefined reference to `c_isdigit'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make[2]: *** [debug_logging] Error 2
make[2]: *** Waiting for unfinished jobs....
../libmlguestfs.a(libguestfsocaml_a-utils.o): In function `guestfs_int_string_is_valid':
utils.c:(.text+0xb99): undefined reference to `c_isalpha'
utils.c:(.text+0xbbf): undefined reference to `c_isdigit'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make[2]: *** [create_disk] Error 2
make[2]: Leaving directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5/ocaml/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.36.5'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.JoY6TA (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.JoY6TA (%build)
---------------------------------------------------------------------------------------
The patch in attachment added in libguestfs.spec aims to resolve the above issue. But it seems to have no effect. Any idea how to resolve this issue? Thanks.
Best Regards
Yongkui Guo
IRC: yoguo
Tel: 15010777318
7 years, 3 months
libguestfs binaries missing when built from source code
by emlyn.jose@wipro.com
Hello,
This is regarding the binary missing from libguestfs built from the source code(v 1.30.3).
Here there are some binaries missing when compared to the libguestfs rpm installed from the rhel6-server repo.
Below are the list of binaries
>From the os rpm libguestfs-tools-c-1.20.11-2.el6.x86_64:
>From the one built from source code(v 1.30.3) is :
guestfish
guestfish
guestmount
guestmount
virt-alignment-scan
virt-alignment-scan
virt-cat
virt-cat
virt-copy-in
virt-copy-in
virt-copy-out
virt-copy-out
virt-df
virt-df
virt-edit
virt-edit
virt-filesystems
virt-filesystems
virt-format
virt-format
virt-inspector2
virt-inspector
virt-ls
virt-ls
virt-rescue
virt-rescue
virt-resize
virt-sparsify
virt-sysprep
virt-tar-in
virt-tar-in
virt-tar-out
virt-tar-out
The highlighted binaries are missing from the v 1.30.3.
Below is the content inside the tar file:
[root(a)rhel6.3 SOURCES]# ls
appliance-1.30.1.tar.xz gdk-pixbuf-2.21.7.tar.gz libguestfs-1.30.3 linsee.env
atk-1.29.2.tar.gz glib-2.27.3.tar.gz libguestfs-1.30.3.tar.gz seehelp.content
augeas-1.0.0.tar.gz gtk+-2.24.4.tar.gz libguestfs-post.env seehelp.template
[root(a)rhel6.3 SOURCES]# cd libguestfs-1.30.3
[root(a)rhel6.3 libguestfs-1.30.3]# ls
aclocal.m4 configure.ac gnulib Makefile.in sparsify
align contrib GNUmakefile make-fs src
appliance COPYING gobject mllib subdir-rules.mk
AUTHORS COPYING.LIB golang ocaml sysprep
autogen.sh csharp guestfs-release-notes.pod ocaml-link.sh tests
bash customize guestfs-release-notes.txt p2v test-tool
bindtests daemon HACKING perl tmp
bootstrap df haskell php TODO
BUGS dib html pick-guests.pl.in tools
bugs-in-changelog.sh diff inspector po update-bugs.sh
build-aux edit installcheck.sh.in po-docs v2v
builder erlang java podwrapper.pl.in valgrind-suppressions
cat examples libtool-kill-dependency_libs.sh python zanata-pull.sh
cfg.mk fish logo README zanata.xml
ChangeLog format lua rescue
common-rules.mk fuse m4 resize
config.h.in generator maint.mk ruby
configure get-kernel Makefile.am run.in
What is missing here that results in missing those binaries?
Regards,
Emlyn Jose
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
7 years, 3 months
Regarding libguestfs
by abinaya.manikandan@wipro.com
Hi Team,
We are trying to build libguestfs-1.34.6 on RHEL7 host.
We have installed all the dependencies which is showing while running ./configure command in inside the source code of libguestfs.
But while running make we are facing below issue:
/usr/include/pango-1.0/pango/pango-version-macros.h:251:60: error: missing binary operator before token "("
#define PANGO_VERSION_CUR_STABLE (G_ENCODE_VERSION (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR))
^
/usr/include/pango-1.0/pango/pango-version-macros.h:313:42: note: in expansion of macro 'PANGO_VERSION_CUR_STABLE'
# define PANGO_VERSION_MAX_ALLOWED (PANGO_VERSION_CUR_STABLE)
^
/usr/include/pango-1.0/pango/pango-version-macros.h:623:5: note: in expansion of macro 'PANGO_VERSION_MAX_ALLOWED'
#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_42
^
make[2]: *** [virt_p2v-main.o] Error 1
make[2]: Leaving directory `/root/rpmbuild/BUILD/libguestfs-1.34.6/p2v'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libguestfs-1.34.6'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.DQIKk5 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.DQIKk5 (%build)
Can anyone help me and let me know why the issue is coming.
Regards,
Abinaya sandhiya
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
7 years, 3 months
[PATCH] fish: add small documentation bit about format of URIs (RHBZ#1450325)
by Pino Toscano
Mention which format URIs follow, with a small example on escaping
special characters.
---
fish/guestfish.pod | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
index c3f684563..1201176e9 100644
--- a/fish/guestfish.pod
+++ b/fish/guestfish.pod
@@ -1225,6 +1225,16 @@ The equivalent API command would be:
><fs> add /disk protocol:ssh server:tcp:example.com [username:user]
+Note that the URIs follow the syntax of
+L<RFC 3986|https://tools.ietf.org/html/rfc3986>: in particular, there
+are restrictions on the allowed characters for the various components
+of the URI. Characters such as C<:>, C<@>, and C</> B<must> be
+percent-encoded:
+
+ $ guestfish -a ssh://user:pass%40word@example.com/disk.img
+
+In this case, the password is C<pass@word>.
+
=head1 PROGRESS BARS
Some (not all) long-running commands send progress notification
--
2.13.5
7 years, 3 months
[PATCH] v2v: warn when the guest has hostdev devices (RHBZ#1472719)
by Pino Toscano
virt-v2v obviously cannot convert this kind of devices, since they are
specific to the host of the hypervisor. Thus, emit a warning about the
presence of passthrough host devices, so at least this can be noticed
when converting a guest.
---
v2v/parse_libvirt_xml.ml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
index 84c5d4fc7..c71707000 100644
--- a/v2v/parse_libvirt_xml.ml
+++ b/v2v/parse_libvirt_xml.ml
@@ -460,6 +460,22 @@ let parse_libvirt_xml ?conn xml =
done;
List.rev !nics in
+ (* Check for hostdev devices. (RHBZ#1472719) *)
+ let () =
+ let obj = Xml.xpath_eval_expression xpathctx "/domain/devices/hostdev" in
+ let nr_nodes = Xml.xpathobj_nr_nodes obj in
+ if nr_nodes > 0 then (
+ (* Sadly fn_ in ocaml-gettext seems broken, and always returns the
+ * singular string no matter what. Work around this by using a simple
+ * string with sn_ (which works), and outputting it as a whole.
+ *)
+ let msg = sn_ "this guest has a passthrough host device which will be ignored"
+ "this guest has passthrough host devices which will be ignored"
+ nr_nodes in
+ warning "%s" msg
+ )
+ in
+
({
s_hypervisor = hypervisor;
s_name = name; s_orig_name = name;
--
2.13.5
7 years, 3 months
[PATCH 1/2] builder/templates/debian.preseed: enable serial console
by Florian Klink
Also unify .index-fragment files
---
builder/templates/debian-7.index-fragment | 7 -------
builder/templates/debian-8.index-fragment | 7 -------
builder/templates/debian-9.index-fragment | 18 ++++++------------
builder/templates/debian.preseed | 1 +
builder/templates/make-template.ml | 6 ------
5 files changed, 7 insertions(+), 32 deletions(-)
diff --git a/builder/templates/debian-7.index-fragment b/builder/templates/debian-7.index-fragment
index 7d868e63c..37e72f7f5 100644
--- a/builder/templates/debian-7.index-fragment
+++ b/builder/templates/debian-7.index-fragment
@@ -19,13 +19,6 @@ notes=Debian 7 (Wheezy).
builder/website/debian.preseed
builder/website/debian.sh
- This image is so very minimal that it only includes an ssh
- server and no virtual consoles. To enable virtual consoles
- use this virt-builder option:
-
- virt-builder debian-7 \
- --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,'
-
This image does not contain SSH host keys. To regenerate them use:
--firstboot-command "dpkg-reconfigure openssh-server"
diff --git a/builder/templates/debian-8.index-fragment b/builder/templates/debian-8.index-fragment
index d8387c327..68017fbd0 100644
--- a/builder/templates/debian-8.index-fragment
+++ b/builder/templates/debian-8.index-fragment
@@ -21,10 +21,3 @@ notes=Debian 8 (Jessie).
This image does not contain SSH host keys. To regenerate them use:
--firstboot-command "dpkg-reconfigure openssh-server"
-
- The serial console is not working in this image. To enable it, do:
-
- --edit '/etc/default/grub:
- s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"/' \
- --run-command update-grub
-
diff --git a/builder/templates/debian-9.index-fragment b/builder/templates/debian-9.index-fragment
index 293f9117f..5eb7146bc 100644
--- a/builder/templates/debian-9.index-fragment
+++ b/builder/templates/debian-9.index-fragment
@@ -10,20 +10,14 @@ compressed_size=203644432
expand=/dev/sda1
notes=Debian 9 (stretch)
- This is a minimal Debian install.
+ This is a default Debian install.
- This image is so very minimal that it only includes an ssh server
- and no virtual consoles. To enable virtual consoles use this
- virt-builder option:
+ The preseed and virt-install scripts that produced this image
+ can be found in the libguestfs source tree:
- --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,'
+ builder/website/debian.preseed
+ builder/website/debian.sh
This image does not contain SSH host keys. To regenerate them use:
- --firstboot-command "dpkg-reconfigure openssh-server"
-
- This template was generated by a script in the libguestfs source tree:
- builder/templates/make-template.ml
- Associated files used to prepare this template can be found in the
- same directory.
-
+ --firstboot-command "dpkg-reconfigure openssh-server"
diff --git a/builder/templates/debian.preseed b/builder/templates/debian.preseed
index 3cffb3b9b..1f13eadbd 100644
--- a/builder/templates/debian.preseed
+++ b/builder/templates/debian.preseed
@@ -439,4 +439,5 @@ d-i finish-install/reboot_in_progress note
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
+d-i preseed/late_command string in-target sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8"/g; s/# *GRUB_TERMINAL=console/GRUB_TERMINAL=serial/g' /etc/default/grub; in-target update-grub
diff --git a/builder/templates/make-template.ml b/builder/templates/make-template.ml
index 7b46bdacb..42ff48eb9 100755
--- a/builder/templates/make-template.ml
+++ b/builder/templates/make-template.ml
@@ -1027,14 +1027,8 @@ and notes_of_os os arch nvram =
add ""
| Debian ((8|9), _) ->
reconfigure_ssh_host_keys_debian ();
- fix_serial_console_debian ();
| Debian _ ->
add "This image is so very minimal that it only includes an ssh server";
- add "and no virtual consoles. To enable virtual consoles use this";
- add "virt-builder option:";
- add "";
- add " --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,'";
- add "";
reconfigure_ssh_host_keys_debian ();
| Ubuntu ("16.04", _) ->
builder_account_warning ();
--
2.14.1
7 years, 3 months