From 332dbe851c44543b69e516439baf203c9bebcadc Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 20 Feb 2020 10:43:36 +0200 Subject: QEMU image build improvements * Added missed package dependencies (for Debian 10 based builders) * Added additional options, which can be passed to the playbook: * iso_local - path to local ISO file * disk_size - target disk image size * cloud_init - enable or disable Cloud-init integration to an image * cloud_init_ds - set custom list of data sources for Cloud-init * Added a version number and Cloud-init mark to a QCOW2 image name * Cloud-init installation procedure tuned to use packages from a proper one VyOS repository, according to VyOS and Debian version * Added workaround for /etc/network/interfaces to allow Cloud-init initialize network in a native way * Replaced default config file to Jinja2 template * Fixed GRUB installation on UEFI builders - added target i386-pc * Replaced GRUB configuration: * enable both KVM and Serial console for all images (Serial by default) * added password recovery option for all images * added 5 seconds of a timeout to allow select proper menu entry * fixed booting for 1.3 VyOS * Added loop device detach after image build - allows to build images multiple times without exhausting loop device limit * Added fstrim applying for image - theoretically, this may save some space * Enabled compression for QCOW2 image - this reduces image size significantly * Added RAW image deletion after conversion to more accurate cleanup --- roles/install-grub/templates/boot/grub/grub.cfg.j2 | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'roles/install-grub/templates') diff --git a/roles/install-grub/templates/boot/grub/grub.cfg.j2 b/roles/install-grub/templates/boot/grub/grub.cfg.j2 index 45f48ab..0440442 100644 --- a/roles/install-grub/templates/boot/grub/grub.cfg.j2 +++ b/roles/install-grub/templates/boot/grub/grub.cfg.j2 @@ -1,7 +1,25 @@ -set default=0 -set timeout=0 +set default=1 +set timeout=5 +serial --unit=0 +terminal_output --append serial +terminal_input serial console -menuentry "VyOS {{ vyos_platform }} Image {{ vyos_version }}" { - linux /boot/{{ vyos_version }}/vmlinuz boot=live selinux=0 vyos-union=/boot/{{ vyos_version }} console=tty1 +menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} (KVM console)" { + linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=ttyS0 console=tty0 + initrd /boot/{{ vyos_version }}/initrd.img +} + +menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} (Serial console)" { + linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=tty0 console=ttyS0 + initrd /boot/{{ vyos_version }}/initrd.img +} + +menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} - password reset (KVM console)" { + linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=ttyS0 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset + initrd /boot/{{ vyos_version }}/initrd.img +} + +menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} - password reset (Serial console)" { + linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=tty0 console=ttyS0 init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/{{ vyos_version }}/initrd.img } -- cgit v1.2.3