Richard W.M. Jones
2016-Nov-28 10:40 UTC
[Libguestfs] [PATCH] builder: Rearrange how template-building scripts work.
Create a new directory (builder/template). Integrate all of the scripts into a single program, so that templates are generated more consistently. This also changes how the index file is generated. The script now generates the index file fragment and saves it under version control, and then generates the final index file by concatenating these. (Previously the index was written by hand which was tedious and error-prone.) The new script also saves the generated kickstart under version control so it can be referenced later. --- Makefile.am | 8 +- builder/{website => templates}/Makefile.am | 42 +- builder/templates/centos-6.index-fragment | 23 + builder/templates/centos-7.0.index-fragment | 19 + builder/templates/centos-7.1.index-fragment | 19 + .../templates/centos-7.2-aarch64.index-fragment | 19 + builder/templates/centos-7.2.index-fragment | 19 + builder/templates/cirros-0.3.1.index-fragment | 19 + builder/templates/debian-6.index-fragment | 32 + builder/templates/debian-7-sparc64.index-fragment | 35 + builder/templates/debian-7.index-fragment | 32 + builder/templates/debian-8.index-fragment | 30 + builder/{website => templates}/debian.preseed | 2 +- builder/templates/fedora-18.index-fragment | 22 + builder/templates/fedora-19.index-fragment | 23 + builder/templates/fedora-20.index-fragment | 23 + builder/templates/fedora-21-aarch64.index-fragment | 25 + builder/templates/fedora-21-armv7l.index-fragment | 22 + builder/templates/fedora-21-ppc64.index-fragment | 23 + builder/templates/fedora-21-ppc64le.index-fragment | 23 + builder/templates/fedora-21.index-fragment | 23 + builder/templates/fedora-22-aarch64.index-fragment | 25 + builder/templates/fedora-22-armv7l.index-fragment | 22 + builder/templates/fedora-22-i686.index-fragment | 22 + builder/templates/fedora-22.index-fragment | 22 + builder/templates/fedora-23-aarch64.index-fragment | 25 + builder/templates/fedora-23-armv7l.index-fragment | 22 + builder/templates/fedora-23-i686.index-fragment | 23 + builder/templates/fedora-23-ppc64.index-fragment | 22 + builder/templates/fedora-23-ppc64le.index-fragment | 23 + builder/templates/fedora-23.index-fragment | 23 + builder/templates/fedora-24-aarch64.index-fragment | 25 + builder/templates/fedora-24-armv7l.index-fragment | 22 + builder/templates/fedora-24-i686.index-fragment | 22 + builder/templates/fedora-24.index-fragment | 22 + builder/templates/fedora-25-aarch64.index-fragment | 25 + builder/templates/fedora-25-armv7l.index-fragment | 22 + builder/templates/fedora-25-i686.index-fragment | 22 + builder/templates/fedora-25-ppc64.index-fragment | 23 + builder/templates/fedora-25-ppc64le.index-fragment | 23 + builder/templates/fedora-25.index-fragment | 22 + builder/templates/make-template.ml | 1014 ++++++++++++++++++++ builder/templates/scientificlinux-6.index-fragment | 23 + builder/templates/ubuntu-10.04.index-fragment | 25 + builder/templates/ubuntu-12.04.index-fragment | 25 + builder/templates/ubuntu-14.04.index-fragment | 31 + builder/templates/ubuntu-16.04.index-fragment | 38 + builder/{website => templates}/ubuntu.preseed | 0 builder/{website => templates}/validate.sh | 6 +- .../virt-builder/repos.d/libguestfs.conf.in | 2 +- builder/virt-builder.pod | 4 +- builder/website/.gitignore | 1 - builder/website/centos-aarch64.sh | 93 -- builder/website/centos.sh | 101 -- builder/website/compress.sh | 42 - builder/website/debian.sh | 84 -- builder/website/fedora-aarch64.sh | 109 --- builder/website/fedora-armv7l.sh | 97 -- builder/website/fedora-i686.sh | 105 -- builder/website/fedora-ppc64.sh | 97 -- builder/website/fedora-ppc64le.sh | 97 -- builder/website/fedora-s390x.sh | 97 -- builder/website/fedora.sh | 105 -- builder/website/rhel-aarch64.sh | 165 ---- builder/website/rhel-ppc64.sh | 145 --- builder/website/rhel-ppc64le.sh | 145 --- builder/website/rhel.sh | 230 ----- builder/website/scientificlinux.sh | 91 -- builder/website/test-guest.sh | 90 -- builder/website/ubuntu-ppc64le.sh | 76 -- builder/website/ubuntu.sh | 80 -- configure.ac | 2 +- .../website => website/download/builder}/README | 9 +- .../website => website/download/builder}/index | 381 ++++---- .../website => website/download/builder}/index.asc | 0 75 files changed, 2265 insertions(+), 2285 deletions(-) rename builder/{website => templates}/Makefile.am (66%) create mode 100644 builder/templates/centos-6.index-fragment create mode 100644 builder/templates/centos-7.0.index-fragment create mode 100644 builder/templates/centos-7.1.index-fragment create mode 100644 builder/templates/centos-7.2-aarch64.index-fragment create mode 100644 builder/templates/centos-7.2.index-fragment create mode 100644 builder/templates/cirros-0.3.1.index-fragment create mode 100644 builder/templates/debian-6.index-fragment create mode 100644 builder/templates/debian-7-sparc64.index-fragment create mode 100644 builder/templates/debian-7.index-fragment create mode 100644 builder/templates/debian-8.index-fragment rename builder/{website => templates}/debian.preseed (99%) create mode 100644 builder/templates/fedora-18.index-fragment create mode 100644 builder/templates/fedora-19.index-fragment create mode 100644 builder/templates/fedora-20.index-fragment create mode 100644 builder/templates/fedora-21-aarch64.index-fragment create mode 100644 builder/templates/fedora-21-armv7l.index-fragment create mode 100644 builder/templates/fedora-21-ppc64.index-fragment create mode 100644 builder/templates/fedora-21-ppc64le.index-fragment create mode 100644 builder/templates/fedora-21.index-fragment create mode 100644 builder/templates/fedora-22-aarch64.index-fragment create mode 100644 builder/templates/fedora-22-armv7l.index-fragment create mode 100644 builder/templates/fedora-22-i686.index-fragment create mode 100644 builder/templates/fedora-22.index-fragment create mode 100644 builder/templates/fedora-23-aarch64.index-fragment create mode 100644 builder/templates/fedora-23-armv7l.index-fragment create mode 100644 builder/templates/fedora-23-i686.index-fragment create mode 100644 builder/templates/fedora-23-ppc64.index-fragment create mode 100644 builder/templates/fedora-23-ppc64le.index-fragment create mode 100644 builder/templates/fedora-23.index-fragment create mode 100644 builder/templates/fedora-24-aarch64.index-fragment create mode 100644 builder/templates/fedora-24-armv7l.index-fragment create mode 100644 builder/templates/fedora-24-i686.index-fragment create mode 100644 builder/templates/fedora-24.index-fragment create mode 100644 builder/templates/fedora-25-aarch64.index-fragment create mode 100644 builder/templates/fedora-25-armv7l.index-fragment create mode 100644 builder/templates/fedora-25-i686.index-fragment create mode 100644 builder/templates/fedora-25-ppc64.index-fragment create mode 100644 builder/templates/fedora-25-ppc64le.index-fragment create mode 100644 builder/templates/fedora-25.index-fragment create mode 100755 builder/templates/make-template.ml create mode 100644 builder/templates/scientificlinux-6.index-fragment create mode 100644 builder/templates/ubuntu-10.04.index-fragment create mode 100644 builder/templates/ubuntu-12.04.index-fragment create mode 100644 builder/templates/ubuntu-14.04.index-fragment create mode 100644 builder/templates/ubuntu-16.04.index-fragment rename builder/{website => templates}/ubuntu.preseed (100%) rename builder/{website => templates}/validate.sh (84%) delete mode 100644 builder/website/.gitignore delete mode 100755 builder/website/centos-aarch64.sh delete mode 100755 builder/website/centos.sh delete mode 100644 builder/website/compress.sh delete mode 100755 builder/website/debian.sh delete mode 100755 builder/website/fedora-aarch64.sh delete mode 100755 builder/website/fedora-armv7l.sh delete mode 100755 builder/website/fedora-i686.sh delete mode 100755 builder/website/fedora-ppc64.sh delete mode 100755 builder/website/fedora-ppc64le.sh delete mode 100755 builder/website/fedora-s390x.sh delete mode 100755 builder/website/fedora.sh delete mode 100755 builder/website/rhel-aarch64.sh delete mode 100755 builder/website/rhel-ppc64.sh delete mode 100755 builder/website/rhel-ppc64le.sh delete mode 100755 builder/website/rhel.sh delete mode 100755 builder/website/scientificlinux.sh delete mode 100755 builder/website/test-guest.sh delete mode 100755 builder/website/ubuntu-ppc64le.sh delete mode 100755 builder/website/ubuntu.sh rename {builder/website => website/download/builder}/README (82%) rename {builder/website => website/download/builder}/index (99%) rename {builder/website => website/download/builder}/index.asc (100%) diff --git a/Makefile.am b/Makefile.am index 0756fbc..a477a97 100644 --- a/Makefile.am +++ b/Makefile.am @@ -146,7 +146,7 @@ if HAVE_OCAML SUBDIRS += \ mllib \ customize \ - builder builder/website \ + builder builder/templates \ get-kernel \ resize \ sparsify \ @@ -248,12 +248,6 @@ EXTRA_DIST = \ zanata.xml \ zanata-pull.sh -# XXX Eventually move builder/website under website/ top level directory. -BUILDERFILES = \ - builder/website/README \ - builder/website/index \ - builder/website/index.asc - WEBSITEDIR = $(HOME)/d/websites/libguestfs noinst_DATA = \ diff --git a/builder/website/Makefile.am b/builder/templates/Makefile.am similarity index 66% rename from builder/website/Makefile.am rename to builder/templates/Makefile.am index d79b9a0..d1b89f9 100644 --- a/builder/website/Makefile.am +++ b/builder/templates/Makefile.am @@ -1,5 +1,5 @@ # libguestfs virt-builder tool -# Copyright (C) 2013 Red Hat Inc. +# Copyright (C) 2013-2016 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,33 +17,25 @@ include $(top_srcdir)/subdir-rules.mk +index_fragments = $(wildcard *.index-fragment) + EXTRA_DIST = \ - .gitignore \ - compress.sh \ - test-guest.sh \ - validate.sh \ - README \ - index \ - index.asc \ - centos.sh \ - centos-aarch64.sh \ + $(index_fragments) \ + *.ks \ debian.preseed \ - debian.sh \ - fedora.sh \ - fedora-aarch64.sh \ - fedora-armv7l.sh \ - fedora-i686.sh \ - fedora-ppc64.sh \ - fedora-ppc64le.sh \ - fedora-s390x.sh \ - rhel.sh \ - rhel-aarch64.sh \ - rhel-ppc64.sh \ - rhel-ppc64le.sh \ - scientificlinux.sh \ + make-template.ml \ ubuntu.preseed \ - ubuntu.sh \ - ubuntu-ppc64le.sh + validate.sh + +# Create the index file under the top level website/ directory. +noinst_DATA = $(top_builddir)/website/download/builder/index + +$(top_builddir)/website/download/builder/index: $(index_fragments) + rm -f $@ $@-t + cat *.index-fragment > $@-t + mv $@-t $@ + @echo "NOTE: $@.asc must be updated by running:" + @echo " gpg --clearsign --armor $@" # Validates the index file. TESTS_ENVIRONMENT = $(top_builddir)/run --test diff --git a/builder/templates/centos-6.index-fragment b/builder/templates/centos-6.index-fragment new file mode 100644 index 0000000..8bda956 --- /dev/null +++ b/builder/templates/centos-6.index-fragment @@ -0,0 +1,23 @@ +[centos-6] +name=CentOS 6.6 +osinfo=centos6.6 +arch=x86_64 +file=centos-6.xz +revision=6 +checksum=fc403ea3555a5608a25ad30ce2514b67288311a7197ddf9fb664475820f26db2bd95a86be9cd6e3f772187b384a02e0965430456dd518d343a80457057bc5441 +format=raw +size=6442450944 +compressed_size=199265736 +expand=/dev/sda3 +notes=CentOS 6.6 + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos.sh + + Note that `virt-builder centos-6' will always install the latest + 6.x release. + diff --git a/builder/templates/centos-7.0.index-fragment b/builder/templates/centos-7.0.index-fragment new file mode 100644 index 0000000..77f06bb --- /dev/null +++ b/builder/templates/centos-7.0.index-fragment @@ -0,0 +1,19 @@ +[centos-7.0] +name=CentOS 7.0 +osinfo=centos7.0 +arch=x86_64 +file=centos-7.0.xz +checksum=cf9ae295f633fbd04e575eeca16f372e933c70c3107c44eb06864760d04354aa94b4f356bfc9a598c138e687304a52e96777e4467e7db1ec0cb5b2d2ec61affc +format=raw +size=6442450944 +compressed_size=213203844 +expand=/dev/sda3 +notes=CentOS 7.0 + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos.sh + diff --git a/builder/templates/centos-7.1.index-fragment b/builder/templates/centos-7.1.index-fragment new file mode 100644 index 0000000..d8f7c18 --- /dev/null +++ b/builder/templates/centos-7.1.index-fragment @@ -0,0 +1,19 @@ +[centos-7.1] +name=CentOS 7.1 +osinfo=centos7.1 +arch=x86_64 +file=centos-7.1.xz +checksum=4bd2536710daa27a70ff69a96d8a694bde1ecf48d811e75d5e6881cfdcd214c0af6949d5a8252ace06e4e8b33337f65ccb16305c85ff88156d49ac559e840b5c +format=raw +size=6442450944 +compressed_size=238579176 +expand=/dev/sda3 +notes=CentOS 7.1 + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos.sh + diff --git a/builder/templates/centos-7.2-aarch64.index-fragment b/builder/templates/centos-7.2-aarch64.index-fragment new file mode 100644 index 0000000..dcd80b8 --- /dev/null +++ b/builder/templates/centos-7.2-aarch64.index-fragment @@ -0,0 +1,19 @@ +[centos-7.2] +name=CentOS 7.2 (aarch64) +osinfo=centos7.2 +arch=aarch64 +file=centos-7.2-aarch64.xz +checksum=e61c5381026c419110ec42626c1cbb0e081240ae4d8c70f5bac2c80d771d5159b72dd3723068cf3cc9339e095b05b62d29ba9c22ef199f53a4e89c07e5615ca3 +format=raw +size=6442450944 +compressed_size=248167668 +expand=/dev/sda4 +notes=CentOS 7.2 (aarch64) + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos-aarch64.sh + diff --git a/builder/templates/centos-7.2.index-fragment b/builder/templates/centos-7.2.index-fragment new file mode 100644 index 0000000..a05a559 --- /dev/null +++ b/builder/templates/centos-7.2.index-fragment @@ -0,0 +1,19 @@ +[centos-7.2] +name=CentOS 7.2 +osinfo=centos7.2 +arch=x86_64 +file=centos-7.2.xz +checksum=b32e6003d1f15e3a97e3644e35bb3fdc345a9b2e7448655d951ec331af6cd2b5548d6acfc9d92f09ac3a8a6439069c27fa539997118cb8a3f77d3bfa45c659d0 +format=raw +size=6442450944 +compressed_size=252158848 +expand=/dev/sda3 +notes=CentOS 7.2 + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos.sh + diff --git a/builder/templates/cirros-0.3.1.index-fragment b/builder/templates/cirros-0.3.1.index-fragment new file mode 100644 index 0000000..da9cdeb --- /dev/null +++ b/builder/templates/cirros-0.3.1.index-fragment @@ -0,0 +1,19 @@ +[cirros-0.3.1] +name=CirrOS 0.3.1 +arch=x86_64 +file=cirros-0.3.1.xz +checksum=096209f00eb62d5722accf3d22ca3a4ee5baaac6d7d4ce0be93b56bbd1c8ab2e3eb4f5db1deffcb570e2c3d41f4d721798a1c499675346cee9546554a4b10388 +format=raw +size=41126400 +compressed_size=11419004 +expand=/dev/sda1 +notes=CirrOS 0.3.1 + + CirrOS is a commonly used test image, ideal because it is very + small and boots into a minimally usable Linux system. + + Note this is not a real Linux distribution, and several virt-builder + features such as installing packages will not (and cannot) work. + + This CirrOS image comes from https://launchpad.net/cirros + diff --git a/builder/templates/debian-6.index-fragment b/builder/templates/debian-6.index-fragment new file mode 100644 index 0000000..3b0c78d --- /dev/null +++ b/builder/templates/debian-6.index-fragment @@ -0,0 +1,32 @@ +[debian-6] +name=Debian 6 (Squeeze) +osinfo=debian6 +arch=x86_64 +file=debian-6.xz +revision=2 +checksum=bff9c28da0375fde65fa238d7a2ea644cbfad0ea3246783a2f44a98f2374850987679c3f1032a632d3c6238de8d9e43291d07a82efc1e824945000e206b9f6cc +format=raw +size=4294967296 +compressed_size=139615908 +expand=/dev/sda1 +notes=Debian 6 (Squeeze). + + This is a default Debian install. + + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + 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-6 \ + --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-7-sparc64.index-fragment b/builder/templates/debian-7-sparc64.index-fragment new file mode 100644 index 0000000..31bd824 --- /dev/null +++ b/builder/templates/debian-7-sparc64.index-fragment @@ -0,0 +1,35 @@ +[debian-7] +name=Debian 7 (Wheezy) (sparc64) +osinfo=debian7 +arch=sparc64 +file=debian-7-sparc64.xz +checksum=a81530ec2335d578e54fcf3c62b979a2985faee8e6480a49e7d24269097c89585f39a04b00d99e82aca00f3304c44dfbed843ce6ce5dcd7828256a51219b701f +format=raw +size=4294967296 +compressed_size=96292208 +expand=/dev/sda3 +notes=Debian 7 (Wheezy). + + This is a Debian 7 (Wheezy) sparc64 image. This was not built using + a reproducible script, but by installing Debian by hand, so don't use + this in production. + + There is also a 'debian' account which you should be aware of and + may need to remove. + + To build the image, use: + + virt-builder [...] \ + --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,' \ + --firstboot-command "dpkg-reconfigure openssh-server" + + Resizing the image will not work because virt-builder does not + understand the partition format. + + To boot the image: + + qemu-system-sparc64 -drive file=debian-7.img,format=raw -serial stdio + + Console messages are lost after the bootconsole is disabled, but it + is still booting and will eventually give you a login prompt. + diff --git a/builder/templates/debian-7.index-fragment b/builder/templates/debian-7.index-fragment new file mode 100644 index 0000000..7d868e6 --- /dev/null +++ b/builder/templates/debian-7.index-fragment @@ -0,0 +1,32 @@ +[debian-7] +name=Debian 7 (Wheezy) +osinfo=debian7 +arch=x86_64 +file=debian-7.xz +revision=2 +checksum=c980a7d878c086b14619b3b9f644ab131c1f88b87729062f2832de12a938ba9e5a511c49402a9d02b740a30876f51889d20e7d0ed4997755f542650b8485f013 +format=raw +size=4294967296 +compressed_size=150734028 +expand=/dev/sda1 +notes=Debian 7 (Wheezy). + + This is a default Debian install. + + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + 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 new file mode 100644 index 0000000..d8387c3 --- /dev/null +++ b/builder/templates/debian-8.index-fragment @@ -0,0 +1,30 @@ +[debian-8] +name=Debian 8 (Jessie) +osinfo=debian8 +arch=x86_64 +file=debian-8.xz +checksum=67700928c435a7a3cd3b611a390ae3f3dfb1b4d882157b6617aa7ea5d693dff3eb4951e5968bdb6859b5f82aa6fe95cc636f053344867d34178ecd5acefe8e91 +format=raw +size=4294967296 +compressed_size=229866456 +expand=/dev/sda1 +notes=Debian 8 (Jessie). + + This is a default Debian install. + + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + 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" + + 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/website/debian.preseed b/builder/templates/debian.preseed similarity index 99% rename from builder/website/debian.preseed rename to builder/templates/debian.preseed index faa4430..54d4253 100644 --- a/builder/website/debian.preseed +++ b/builder/templates/debian.preseed @@ -99,7 +99,7 @@ d-i netcfg/wireless_wep string d-i mirror/country string manual d-i mirror/http/hostname string ftp.uk.debian.org d-i mirror/http/directory string /debian -d-i mirror/http/proxy string @CACHE@ +#d-i mirror/http/proxy string # Suite to install. #d-i mirror/suite string testing diff --git a/builder/templates/fedora-18.index-fragment b/builder/templates/fedora-18.index-fragment new file mode 100644 index 0000000..d57e8b4 --- /dev/null +++ b/builder/templates/fedora-18.index-fragment @@ -0,0 +1,22 @@ +[fedora-18] +name=Fedora® 18 +osinfo=fedora18 +arch=x86_64 +file=fedora-18.xz +checksum=12435775193b69f6e22658aaa001d4ca9b15fd68a04b4b7e9be20b3b517e857e417dc3268a302979d4a702b20f25754025f7ae0e9fb7088419a4ca1669585e6f +format=raw +size=6442450944 +compressed_size=148947524 +expand=/dev/sda3 +notes=Fedora 18. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-19.index-fragment b/builder/templates/fedora-19.index-fragment new file mode 100644 index 0000000..681c541 --- /dev/null +++ b/builder/templates/fedora-19.index-fragment @@ -0,0 +1,23 @@ +[fedora-19] +name=Fedora® 19 +osinfo=fedora19 +arch=x86_64 +file=fedora-19.xz +revision=2 +checksum=acecd8d4bca0d6a3f937e0c9386f3185c916df3eaf5f825988c73d41e946a6dc4fda06cdd74a12bc60932edd65846097547b11aca2309a61dd6d0e91ab9d16f3 +format=raw +size=6442450944 +compressed_size=169531628 +expand=/dev/sda3 +notes=Fedora 19. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-20.index-fragment b/builder/templates/fedora-20.index-fragment new file mode 100644 index 0000000..3c7071f --- /dev/null +++ b/builder/templates/fedora-20.index-fragment @@ -0,0 +1,23 @@ +[fedora-20] +name=Fedora® 20 +osinfo=fedora20 +arch=x86_64 +file=fedora-20.xz +revision=2 +checksum=983a1b33c34cb311ea3a283f06312d24dc81041b64ebc90e40ef2fd7587362acd1a5654b13252f9f57001870aa95495065537e730d5225b49389c1a0478cb028 +format=raw +size=6442450944 +compressed_size=181164220 +expand=/dev/sda3 +notes=Fedora 20. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-21-aarch64.index-fragment b/builder/templates/fedora-21-aarch64.index-fragment new file mode 100644 index 0000000..7914b7a --- /dev/null +++ b/builder/templates/fedora-21-aarch64.index-fragment @@ -0,0 +1,25 @@ +[fedora-21] +name=Fedora® 21 Server (aarch64) +osinfo=fedora21 +arch=aarch64 +file=fedora-21-aarch64.xz +checksum=57026dd867cbc2e49894dd056ffdc1c397548f4f7e296f393a77ee55343a17f684ddcd3ff7661f514b54209c472f41fce809f2e36064fb66d4f92d8dce5e9b62 +format=raw +size=6442450944 +compressed_size=186616612 +expand=/dev/sda4 +notes=Fedora 21 Server (aarch64) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-aarch64.sh + + Please note you will need to use the associated EFI NVRAM variables: + http://libguestfs.org/download/builder/fedora-21-aarch64-nvram.xz + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-21-armv7l.index-fragment b/builder/templates/fedora-21-armv7l.index-fragment new file mode 100644 index 0000000..8af4a3e --- /dev/null +++ b/builder/templates/fedora-21-armv7l.index-fragment @@ -0,0 +1,22 @@ +[fedora-21] +name=Fedora® 21 Server (armv7l) +osinfo=fedora21 +arch=armv7l +file=fedora-21-armv7l.xz +checksum=eb44c66f04781064850380fa1747cadc8645c2f3fd8f2dc1b45cbf5b3f31b91383fa9b7b8b2c951556de2ca499a9251487845208aa1a3881ada6d15e49d24300 +format=raw +size=6442450944 +compressed_size=199232964 +expand=/dev/sda3 +notes=Fedora 21 Server (armv7l) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-armv7l.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-21-ppc64.index-fragment b/builder/templates/fedora-21-ppc64.index-fragment new file mode 100644 index 0000000..f79a778 --- /dev/null +++ b/builder/templates/fedora-21-ppc64.index-fragment @@ -0,0 +1,23 @@ +[fedora-21] +name=Fedora® 21 Server (ppc64) +osinfo=fedora21 +arch=ppc64 +file=fedora-21-ppc64.xz +revision=3 +checksum=acdd9bbd2a434cae48b8f8cf715b00a0cedbb8d276d76a9d4a4f1d469c9522755e82dd03e5f499c1447e09d9bb5a33ada8a061a601d91c007704edfdd80cddb2 +format=raw +size=6442450944 +compressed_size=233099788 +expand=/dev/sda3 +notes=Fedora 21 Server (ppc64 big endian) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-21-ppc64le.index-fragment b/builder/templates/fedora-21-ppc64le.index-fragment new file mode 100644 index 0000000..d12f579 --- /dev/null +++ b/builder/templates/fedora-21-ppc64le.index-fragment @@ -0,0 +1,23 @@ +[fedora-21] +name=Fedora® 21 Server (ppc64le) +osinfo=fedora21 +arch=ppc64le +file=fedora-21-ppc64le.xz +revision=3 +checksum=490aeb5f1bd8754a3c2ed705d3ca84ccec26f839492c6955f40289c4ce9754ad40f22710e24449aeda4177ae16541dc61c989e3c1751f657ffbd4740240c13c4 +format=raw +size=6442450944 +compressed_size=233706980 +expand=/dev/sda3 +notes=Fedora 21 Server (ppc64le) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64le.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-21.index-fragment b/builder/templates/fedora-21.index-fragment new file mode 100644 index 0000000..b899da7 --- /dev/null +++ b/builder/templates/fedora-21.index-fragment @@ -0,0 +1,23 @@ +[fedora-21] +name=Fedora® 21 Server +osinfo=fedora21 +arch=x86_64 +file=fedora-21.xz +revision=1 +checksum=4dc92cbf540d3a0745ffe1fa01ffae15f17e7a8aa45c70ad975a1dda82b7f1ebe42f912be74d91a5866a91ee2ca3be3c2be274b5da29db930fe1ec8c2286575b +format=raw +size=6442450944 +compressed_size=209059864 +expand=/dev/sda3 +notes=Fedora 21 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-22-aarch64.index-fragment b/builder/templates/fedora-22-aarch64.index-fragment new file mode 100644 index 0000000..390e8fe --- /dev/null +++ b/builder/templates/fedora-22-aarch64.index-fragment @@ -0,0 +1,25 @@ +[fedora-22] +name=Fedora® 22 Server (aarch64) +osinfo=fedora22 +arch=aarch64 +file=fedora-22-aarch64.xz +checksum=a9606947c036d3aade6a0680857adf4bcfb31a62833475466ff4502087cc427926a28d89b684fbe882a65752be263c567b655a988ff5563fee002e2d6f1ccecb +format=raw +size=6442450944 +compressed_size=215050068 +expand=/dev/sda4 +notes=Fedora 22 Server (aarch64) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-aarch64.sh + + Please note you will need to use the associated EFI NVRAM variables: + http://libguestfs.org/download/builder/fedora-22-aarch64-nvram.xz + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-22-armv7l.index-fragment b/builder/templates/fedora-22-armv7l.index-fragment new file mode 100644 index 0000000..1a04c7a --- /dev/null +++ b/builder/templates/fedora-22-armv7l.index-fragment @@ -0,0 +1,22 @@ +[fedora-22] +name=Fedora® 22 Server (armv7l) +osinfo=fedora22 +arch=armv7l +file=fedora-22-armv7l.xz +checksum=8c5c39890409e3fe6f0204834289776bb7a8dca95da2f4d3459a99282f5ed100d7ada1caac2234dd0b357ad4047ef441b128c9ba6256b76df79dee6b5c9e33f8 +format=raw +size=6442450944 +compressed_size=242234088 +expand=/dev/sda3 +notes=Fedora 22 Server (armv7l) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-armv7l.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-22-i686.index-fragment b/builder/templates/fedora-22-i686.index-fragment new file mode 100644 index 0000000..1f81fd8 --- /dev/null +++ b/builder/templates/fedora-22-i686.index-fragment @@ -0,0 +1,22 @@ +[fedora-22] +name=Fedora® 22 Server (i686) +osinfo=fedora22 +arch=i686 +file=fedora-22-i686.xz +checksum=3547b94d5c418792e722786cfae41decd41f0725d529d65a2c719094c0b815eaa4fae195514a14d42fa19b57b895bcdbfdb305edf918b1b3722f30f338042d31 +format=raw +size=6442450944 +compressed_size=225185592 +expand=/dev/sda3 +notes=Fedora 22 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-22.index-fragment b/builder/templates/fedora-22.index-fragment new file mode 100644 index 0000000..cc8ec3b --- /dev/null +++ b/builder/templates/fedora-22.index-fragment @@ -0,0 +1,22 @@ +[fedora-22] +name=Fedora® 22 Server +osinfo=fedora22 +arch=x86_64 +file=fedora-22.xz +checksum=59f8b32ba363b64ad37a4bd3d17abd049e80691b84ea9b6c4f0485bcc743b6c8dff5bacd4ed838c555487f750edfd132a22421976a0821d82f16811361d4d98d +format=raw +size=6442450944 +compressed_size=228011712 +expand=/dev/sda3 +notes=Fedora 22 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23-aarch64.index-fragment b/builder/templates/fedora-23-aarch64.index-fragment new file mode 100644 index 0000000..72fb635 --- /dev/null +++ b/builder/templates/fedora-23-aarch64.index-fragment @@ -0,0 +1,25 @@ +[fedora-23] +name=Fedora® 23 Server (aarch64) +osinfo=fedora23 +arch=aarch64 +file=fedora-23-aarch64.xz +checksum=aa1359b2a81841ac07e4e25bef9d3ef3b7cf10c171403505cbbd732644fe6c37938cf6c9e3251dae201b659b47033fb792cb29f587fd4d4816b6c0d100dc5be8 +format=raw +size=6442450944 +compressed_size=216417776 +expand=/dev/sda4 +notes=Fedora 23 Server (aarch64) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-aarch64.sh + + You may need to use the associated EFI NVRAM variables: + http://libguestfs.org/download/builder/fedora-23-aarch64-nvram.xz + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23-armv7l.index-fragment b/builder/templates/fedora-23-armv7l.index-fragment new file mode 100644 index 0000000..9c3199e --- /dev/null +++ b/builder/templates/fedora-23-armv7l.index-fragment @@ -0,0 +1,22 @@ +[fedora-23] +name=Fedora® 23 Server (armv7l) +osinfo=fedora23 +arch=armv7l +file=fedora-23-armv7l.xz +checksum=e2c74544b3e9d25c92724536875a3cbcee0c4c4774bb3956ce6938fdbf1588781a1eb3b54a5fad8cc0d63f0af0c699f7e322c613e13552591eec641edf401d78 +format=raw +size=6442450944 +compressed_size=241758696 +expand=/dev/sda3 +notes=Fedora 23 Server (armv7l) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-armv7l.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23-i686.index-fragment b/builder/templates/fedora-23-i686.index-fragment new file mode 100644 index 0000000..85ff268 --- /dev/null +++ b/builder/templates/fedora-23-i686.index-fragment @@ -0,0 +1,23 @@ +[fedora-23] +name=Fedora® 23 Server (i686) +osinfo=fedora23 +arch=i686 +file=fedora-23-i686.xz +revision=2 +checksum=4b1badbb92f40ca1b3336e70b2564755d643bc00005fd6364c389a1f3078952968a6887c36c4f79fe3873cf42d41cb36dd226521fee32ed6e08c65d6d059af3c +format=raw +size=6442450944 +compressed_size=322831152 +expand=/dev/sda3 +notes=Fedora 23 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23-ppc64.index-fragment b/builder/templates/fedora-23-ppc64.index-fragment new file mode 100644 index 0000000..db1e8f2 --- /dev/null +++ b/builder/templates/fedora-23-ppc64.index-fragment @@ -0,0 +1,22 @@ +[fedora-23] +name=Fedora® 23 Server (ppc64) +osinfo=fedora23 +arch=ppc64 +file=fedora-23-ppc64.xz +checksum=99e0c8186b21525d49c0db074fd25bf6631d2fd2cef2ac22f1b1beb6cb492cfc9aed632a2ea091d39d8762fa892b6d2393fecbde7e140236ba4a88d8c54c3152 +format=raw +size=6442450944 +compressed_size=280692072 +expand=/dev/sda3 +notes=Fedora 23 Server (ppc64 big endian) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23-ppc64le.index-fragment b/builder/templates/fedora-23-ppc64le.index-fragment new file mode 100644 index 0000000..54873f3 --- /dev/null +++ b/builder/templates/fedora-23-ppc64le.index-fragment @@ -0,0 +1,23 @@ +[fedora-23] +name=Fedora® 23 Server (ppc64le) +osinfo=fedora23 +arch=ppc64le +file=fedora-23-ppc64le.xz +revision=2 +checksum=bb6a4cb02a4d7f99f3b8a0f73faa585a4c14e0120a4ace584e0c86062736302bd293072513510378ad30bbdb5fc905077f15ecb8fb5f2ab6ef50b0532af6b8a7 +format=raw +size=6442450944 +compressed_size=278241384 +expand=/dev/sda3 +notes=Fedora 23 Server (ppc64le) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64le.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-23.index-fragment b/builder/templates/fedora-23.index-fragment new file mode 100644 index 0000000..8982a43 --- /dev/null +++ b/builder/templates/fedora-23.index-fragment @@ -0,0 +1,23 @@ +[fedora-23] +name=Fedora® 23 Server +osinfo=fedora23 +arch=x86_64 +file=fedora-23.xz +revision=3 +checksum=90cd606923e16e2c01a08eaa360e213cdd49462e259a04cc6efb1d2516215fb4ac3c62811dfd1646d89650f717da030fa6dec693571e027a644eee589accb78d +format=raw +size=6442450944 +compressed_size=317209280 +expand=/dev/sda3 +notes=Fedora 23 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-24-aarch64.index-fragment b/builder/templates/fedora-24-aarch64.index-fragment new file mode 100644 index 0000000..abf3b58 --- /dev/null +++ b/builder/templates/fedora-24-aarch64.index-fragment @@ -0,0 +1,25 @@ +[fedora-24] +name=Fedora® 24 Server (aarch64) +osinfo=fedora24 +arch=aarch64 +file=fedora-24-aarch64.xz +checksum=d17a0ee0e5f661f9d2cbffe12dae306f295a0716ef440a12944d3d2805f5a5c637766c98267e914f588502d7ba7eca888edd93ae34a15e30faf907d8c55f4689 +format=raw +size=6442450944 +compressed_size=287727544 +expand=/dev/sda4 +notes=Fedora 24 Server (aarch64) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-aarch64.sh + + You may need to use the associated EFI NVRAM variables: + http://libguestfs.org/download/builder/fedora-24-aarch64-nvram.xz + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-24-armv7l.index-fragment b/builder/templates/fedora-24-armv7l.index-fragment new file mode 100644 index 0000000..516168d --- /dev/null +++ b/builder/templates/fedora-24-armv7l.index-fragment @@ -0,0 +1,22 @@ +[fedora-24] +name=Fedora® 24 Server (armv7l) +osinfo=fedora24 +arch=armv7l +file=fedora-24-armv7l.xz +checksum=7d9a5ce8e10c13e8d07ace42555183bfee5e561464e9fc439d0fefc3e85048bdc0c14d44d5584029d4015d0f3316c7583af8ae6d4c0ff8bcfcdb9037a37cacc0 +format=raw +size=6442450944 +compressed_size=324231484 +expand=/dev/sda3 +notes=Fedora 24 Server (armv7l) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-armv7l.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-24-i686.index-fragment b/builder/templates/fedora-24-i686.index-fragment new file mode 100644 index 0000000..8320113 --- /dev/null +++ b/builder/templates/fedora-24-i686.index-fragment @@ -0,0 +1,22 @@ +[fedora-24] +name=Fedora® 24 Server (i686) +osinfo=fedora24 +arch=i686 +file=fedora-24-i686.xz +checksum=1461da1557327e0641987654919698a6b7c2df1c58f76a4a4d61fb66476dac1b19fe6e3650b82a246df7d241037725c7b8e57e73d3312e370dfb132f54b5cbf4 +format=raw +size=6442450944 +compressed_size=319087504 +expand=/dev/sda3 +notes=Fedora 24 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-24.index-fragment b/builder/templates/fedora-24.index-fragment new file mode 100644 index 0000000..e0c1719 --- /dev/null +++ b/builder/templates/fedora-24.index-fragment @@ -0,0 +1,22 @@ +[fedora-24] +name=Fedora® 24 Server +osinfo=fedora24 +arch=x86_64 +file=fedora-24.xz +checksum=907656be1f0bb4ed221a54f4339660d02071bdf79acd1644087e5ca20e315ba8e4b9008d7f0814a840904198a54499556f226db8b32f96a01ecd20370da8d03d +format=raw +size=6442450944 +compressed_size=321359432 +expand=/dev/sda3 +notes=Fedora 24 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25-aarch64.index-fragment b/builder/templates/fedora-25-aarch64.index-fragment new file mode 100644 index 0000000..5eaa029 --- /dev/null +++ b/builder/templates/fedora-25-aarch64.index-fragment @@ -0,0 +1,25 @@ +[fedora-25] +name=Fedora® 25 Server (aarch64) +osinfo=fedora25 +arch=aarch64 +file=fedora-25-aarch64.xz +checksum=ad8283c6ac4e0b297fd2413d3ffd231bdfbbb0609960d6fd1af45d8047652f7d515398d97345b0d837eca244a501279f9920c6149e00b6504bd08ab965ef19ac +format=raw +size=6442450944 +compressed_size=294070292 +expand=/dev/sda4 +notes=Fedora 25 Server (aarch64) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-aarch64.sh + + You may need to use the associated EFI NVRAM variables: + http://libguestfs.org/download/builder/fedora-25-aarch64-nvram.xz + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25-armv7l.index-fragment b/builder/templates/fedora-25-armv7l.index-fragment new file mode 100644 index 0000000..9c18ea8 --- /dev/null +++ b/builder/templates/fedora-25-armv7l.index-fragment @@ -0,0 +1,22 @@ +[fedora-25] +name=Fedora® 25 Server (armv7l) +osinfo=fedora25 +arch=armv7l +file=fedora-25-armv7l.xz +checksum=3303230d3e907524817ed95504b7b7a5f6a3e167d9564193fdd0781207b1ca841b244d47778ea639e2af709bb8838256f18503b76f1ede06ca7bb9f72693c538 +format=raw +size=6442450944 +compressed_size=270482468 +expand=/dev/sda3 +notes=Fedora 25 Server (armv7l) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-armv7l.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25-i686.index-fragment b/builder/templates/fedora-25-i686.index-fragment new file mode 100644 index 0000000..1027558 --- /dev/null +++ b/builder/templates/fedora-25-i686.index-fragment @@ -0,0 +1,22 @@ +[fedora-25] +name=Fedora® 25 Server (i686) +osinfo=fedora25 +arch=i686 +file=fedora-25-i686.xz +checksum=17cdf048a3961a316ac32aa084b4b7d20d0ff4756bd5e942c1aae29c6e8b3cf2a41516e87e301ee1122643aca14ca252554ebbadbe468a582c10591edc56177a +format=raw +size=6442450944 +compressed_size=247412792 +expand=/dev/sda3 +notes=Fedora 25 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25-ppc64.index-fragment b/builder/templates/fedora-25-ppc64.index-fragment new file mode 100644 index 0000000..6ffe3f3 --- /dev/null +++ b/builder/templates/fedora-25-ppc64.index-fragment @@ -0,0 +1,23 @@ +[fedora-25] +name=Fedora® 25 Server (ppc64) +osinfo=fedora25 +arch=ppc64 +file=fedora-25-ppc64.xz +revision=2 +checksum=6cbe13eab5b4ece19c263163d947072c644ee234e3d116e6fdf517206b7bea10d870933b31f8ab970480aa5a09cd75b04858b46bbe85dcfc6820069523bd4b9d +format=raw +size=6442450944 +compressed_size=311245832 +expand=/dev/sda3 +notes=Fedora 25 Server (ppc64 big endian) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25-ppc64le.index-fragment b/builder/templates/fedora-25-ppc64le.index-fragment new file mode 100644 index 0000000..b89c809 --- /dev/null +++ b/builder/templates/fedora-25-ppc64le.index-fragment @@ -0,0 +1,23 @@ +[fedora-25] +name=Fedora® 25 Server (ppc64le) +osinfo=fedora25 +arch=ppc64le +file=fedora-25-ppc64le.xz +revision=2 +checksum=b51f8ad21862db31540a489e0fd070054789be1c054f6d30d03d8284320bb84bc025ae71e7b4f7d386a5ff074dacbf84b9724eaf74d31b13bda8776756717bf4 +format=raw +size=6442450944 +compressed_size=336716660 +expand=/dev/sda3 +notes=Fedora 25 Server (ppc64le) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-ppc64le.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/fedora-25.index-fragment b/builder/templates/fedora-25.index-fragment new file mode 100644 index 0000000..3e21f2b --- /dev/null +++ b/builder/templates/fedora-25.index-fragment @@ -0,0 +1,22 @@ +[fedora-25] +name=Fedora® 25 Server +osinfo=fedora25 +arch=x86_64 +file=fedora-25.xz +checksum=fd7f8c9c7f6093b0c8c154ab12a116952745a00f5634ee8ded8c81d5f3b9b614558b11109de98f814f4f57fb2c0a394fba43d8a9ed127b99b78ff02c39957f7b +format=raw +size=6442450944 +compressed_size=337395436 +expand=/dev/sda3 +notes=Fedora 25 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + diff --git a/builder/templates/make-template.ml b/builder/templates/make-template.ml new file mode 100755 index 0000000..71940ff --- /dev/null +++ b/builder/templates/make-template.ml @@ -0,0 +1,1014 @@ +#!/usr/bin/env ocaml +(* libguestfs + * Copyright (C) 2016 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +(* This script is used to create the virt-builder templates hosted + * http://libguestfs.org/download/builder/ + * + * Usage: + * ./make-template.ml os version [arch] + * eg: + * ./make-template.ml fedora 25 + * ./make-template.ml rhel 7.3 ppc64le + * + * The arch defaults to x86_64. Note that i686 is a separate arch. + * + * Prior to November 2016, the templates were generated using + * shell scripts located in libguestfs.git/builder/website. + *) + +open Printf + +let prog = "make-template" + +(* Check we are being run from the correct directory. We must do this + * before attempting to load libraries below. + *) +let () + if not (Sys.file_exists "debian.preseed") then ( + eprintf "%s: run this script from the builder/templates subdirectory\n" + prog; + exit 1 + );; + +#load "str.cma";; +#load "unix.cma";; +#directory "../../ocaml";; +#load "mlguestfs.cma";; + +type os + | CentOS of int * int (* major, minor *) + | RHEL of int * int + | Debian of int * string (* version, dist name like "wheezy" *) + | Ubuntu of string * string + | Fedora of int (* version number *) +type arch = X86_64 | Aarch64 | Armv7 | I686 | PPC64 | PPC64le | S390X + +let quote = Filename.quote +let (//) = Filename.concat + +let virtual_size_gb = 6 + +let rec main () + assert (Sys.word_size = 64); + Random.self_init (); + + (* Get the os, version, arch from the command line. *) + if Array.length Sys.argv < 3 || Array.length Sys.argv > 4 then ( + eprintf "%s os version [arch]\n" prog; + exit 1 + ); + + let os = os_of_string Sys.argv.(1) Sys.argv.(2) + and arch + if Array.length Sys.argv <= 3 then X86_64 + else arch_of_string Sys.argv.(3) in + + (* Set the path to use locally built copies of the virt-* tools. *) + let () + let orig_path = Unix.getenv "PATH" in + let paths = ["builder"; "customize"; "sparsify"; "sysprep"] in + let prefix = Sys.getcwd () // ".." // ".." in + let paths = List.map ((//) prefix) paths in + let new_path = String.concat ":" (paths @ [orig_path]) in + Unix.putenv "PATH" new_path in + + (* For OSes which require a kickstart, this generates one. + * For OSes which require a preseed file, this returns one (we + * don't generate preseed files at the moment). + *) + let ks = make_kickstart_or_preseed os arch in + + (* Find the virt-install --location for this OS. *) + let location = make_location os arch in + + (* RHEL guests require alternate yum configuration pointing to + * Red Hat's internal servers. + *) + let yum_conf + match os with + | RHEL (major, minor) when major >= 5 -> + Some (make_rhel_yum_conf major minor arch) + | _ -> None in + + (* Choose a random temporary name for the libvirt domain. We will + * also have to clean this up after running virt-install. + *) + let tmpname = sprintf "tmp-%s" (random8 ()) in + + (* Choose a random temporary disk name. *) + let tmpout = sprintf "%s.img" tmpname in + + (* Some architectures need EFI boot. *) + let tmpefivars + match os, arch with + | (Fedora _|RHEL _), Aarch64 -> + let vars = sprintf "%s.vars" tmpname in + let cmd + sprintf "cp /usr/share/edk2/aarch64/vars-template-pflash.raw %s" + (quote vars) in + if Sys.command cmd <> 0 then exit 1; + Some ("/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw", vars) + | _ -> None in + + (* Now construct the virt-install command. *) + let vi = make_virt_install_command os arch ks tmpname tmpout tmpefivars + location in + (* Make sure that temporary guest and temporary files are removed + * if we exit for any reason. + *) + let cleanup_libvirt_guest () + let cmd + sprintf "virsh undefine%s %s >&/dev/null" + (if tmpefivars = None then "" else " --nvram") + (quote tmpname) in + ignore (Sys.command cmd) + in + at_exit ( + fun () -> + cleanup_libvirt_guest (); + (try Unix.unlink tmpout with _ -> ()); + (match tmpefivars with + | Some (_, vars) -> (try Unix.unlink vars with _ -> ()) + | None -> ()); + ); + + (* Print the virt-install command just before we run it, because + * this is expected to be long-running. + *) + Array.iter ( + fun arg -> + if arg.[0] = '-' then printf "\\\n %s " arg + else printf "%s " arg + ) vi; + printf "\n%!"; + + (* Run the virt-install command. *) + let pid = Unix.fork () in + if pid = 0 then Unix.execvp "virt-install" vi; + let _, pstat = Unix.waitpid [] pid in + check_process_status_for_errors pstat; + cleanup_libvirt_guest (); + + (* Get the root filesystem which is the one which will be + * expanded. Since we never use LVM, this should return a + * plain partition. However virt-builder can deal with LVM + * so we may need to revisit this. + *) + let g = open_guest tmpout in + let roots = g#inspect_get_roots () in + let expandfs = g#canonical_device_name roots.(0) in + assert (String.sub expandfs 0 7 = "/dev/sd"); + + (* Some guests are special flowers. *) + (match os with + | Debian _ -> + (* Remove apt proxy configuration (thanks: Daniel Miranda). *) + g#rm_f "/etc/apt/apt.conf"; + g#touch "/etc/apt/apt.conf"; + | _ -> () + ); + (match yum_conf with + | Some yum_conf -> + g#write yum_conf "/etc/yum.repos.d/download.devel.redhat.com.repo"; + | None -> () + ); + + g#shutdown (); + g#close (); + + (match os with + | Ubuntu (ver, _) when ver >= "14.04" -> + (* In Ubuntu >= 14.04 you can't complete the install without creating + * a user account. We create one called 'builder', but we also + * disable it. XXX Combine with virt-sysprep step. + *) + let cmd + sprintf "virt-customize -a %s --password builder:disabled" + (quote tmpout) in + if Sys.command cmd <> 0 then exit 1 + | _ -> () + ); + + (* Sysprep. Relabel SELinux-using guests. *) + printf "Sysprepping ...\n"; + let cmd + sprintf "virt-sysprep --quiet -a %s%s" + (quote tmpout) + (if is_selinux_os os then " --selinux-relabel" else "") in + if Sys.command cmd <> 0 then exit 1; + + (* Create the final output name (actually not quite final because + * we will xz-compress it). + *) + let output = filename_of_os os arch "" in + + (* Sparsify and copy to output name. *) + printf "Sparsifying ...\n"; + let cmd + sprintf "virt-sparsify --quiet %s %s" (quote tmpout) (quote output) in + if Sys.command cmd <> 0 then exit 1; + Unix.unlink tmpout; + + (* Compress the output. *) + printf "Compressing ...\n"; + let cmd + sprintf "xz -f --best --block-size=16777216 %s" (quote output) in + if Sys.command cmd <> 0 then exit 1; + let output = output ^ ".xz" in + + (* If there were NVRAM variables, move them to the final name and + * compress them too. + *) + let nvram + match tmpefivars with + | Some (_, vars) -> + let f = sprintf "%s-nvram" output in + let cmd = sprintf "mv %s %s-nvram" (quote vars) (quote f) in + if Sys.command cmd <> 0 then exit 1; + let cmd = sprintf "xz -f --best %s-nvram" (quote f) in + if Sys.command cmd <> 0 then exit 1; + Unix.unlink vars; + Some (f ^ ".xz") + | None -> None in + printf "Template completed: %s\n" output; + + (* Construct the index fragment, but don't create this for the private + * RHEL images. + *) + (match os with + | RHEL _ -> () + | _ -> + let index_fragment = filename_of_os os arch ".index-fragment" in + (* If there is an existing file, read the revision and increment it. *) + let revision = read_revision index_fragment in + let revision = match revision with None -> None | Some i -> Some (i+1) in + make_index_fragment os arch index_fragment output nvram revision expandfs; + + (* Validate the fragment we have just created. *) + let cmd = sprintf "virt-index-validate %s" (quote index_fragment) in + if Sys.command cmd <> 0 then exit 1; + printf "Index fragment created: %s\n" index_fragment + ) + +and os_of_string os ver + match os, ver with + | "centos", ver -> let maj, min = parse_major_minor ver in CentOS (maj, min) + | "rhel", ver -> let maj, min = parse_major_minor ver in RHEL (maj, min) + | "debian", "6" -> Debian (6, "squeeze") + | "debian", "7" -> Debian (7, "wheezy") + | "debian", "8" -> Debian (8, "jessie") + | "ubuntu", "10.04" -> Ubuntu (ver, "lucid") + | "ubuntu", "12.04" -> Ubuntu (ver, "precise") + | "ubuntu", "14.04" -> Ubuntu (ver, "trusty") + | "ubuntu", "16.04" -> Ubuntu (ver, "xenial") + | "fedora", ver -> Fedora (int_of_string ver) + | _ -> + eprintf "%s: unknown or unsupported OS\n" prog; exit 1 + +and parse_major_minor ver + let rex = Str.regexp "^\\([0-9]+\\)\\.\\([0-9]+\\)$" in + if Str.string_match rex ver 0 then ( + int_of_string (Str.matched_group 1 ver), + int_of_string (Str.matched_group 2 ver) + ) + else ( + eprintf "%s: cannot parse major.minor\n" prog; + exit 1 + ) + +and arch_of_string = function + | "x86_64" -> X86_64 + | "aarch64" -> Aarch64 + | "armv7l" -> Armv7 + | "i686" -> I686 + | "ppc64" -> PPC64 + | "ppc64le" -> PPC64le + | "s390x" -> S390X + | _ -> + eprintf "%s: unknown or unsupported arch\n" prog; exit 1 + +and string_of_arch = function + | X86_64 -> "x86_64" + | Aarch64 -> "aarch64" + | Armv7 -> "armv7l" + | I686 -> "i686" + | PPC64 -> "ppc64" + | PPC64le -> "ppc64le" + | S390X -> "s390x" + +and filename_of_os os arch ext + match os with + | Fedora ver -> + if arch = X86_64 then sprintf "fedora-%d%s" ver ext + else sprintf "fedora-%d-%s%s" ver (string_of_arch arch) ext + | CentOS (major, minor) -> + if arch = X86_64 then sprintf "centos-%d.%d%s" major minor ext + else sprintf "centos-%d.%d-%s%s" major minor (string_of_arch arch) ext + | RHEL (major, minor) -> + if arch = X86_64 then sprintf "rhel-%d.%d%s" major minor ext + else sprintf "rhel-%d.%d-%s%s" major minor (string_of_arch arch) ext + | Debian (ver, _) -> + if arch = X86_64 then sprintf "debian-%d%s" ver ext + else sprintf "debian-%d-%s%s" ver (string_of_arch arch) ext + | Ubuntu (ver, _) -> + if arch = X86_64 then sprintf "ubuntu-%s%s" ver ext + else sprintf "ubuntu-%s-%s%s" ver (string_of_arch arch) ext + +and string_of_os os arch = filename_of_os os arch "" + +(* This is what virt-builder called "os-version". *) +and string_of_os_noarch = function + | Fedora ver -> sprintf "fedora-%d" ver + | CentOS (major, minor) -> sprintf "centos-%d.%d" major minor + | RHEL (major, minor) -> sprintf "rhel-%d.%d" major minor + | Debian (ver, _) -> sprintf "debian-%d" ver + | Ubuntu (ver, _) -> sprintf "ubuntu-%s" ver + +and is_selinux_os = function + | RHEL _ | CentOS _ | Fedora _ -> true + | Debian _ | Ubuntu _ -> false + +and make_kickstart_or_preseed os arch + match os with + (* Kickstart. *) + | Fedora _ | CentOS _ | RHEL _ -> + let ks_filename = filename_of_os os arch ".ks" in + make_kickstart_common ks_filename os arch + + (* Preseed. *) + | Debian _ -> copy_preseed_to_temporary "debian.preseed" + | Ubuntu _ -> copy_preseed_to_temporary "ubuntu.preseed" + +and make_kickstart_common ks_filename os arch + let buf = Buffer.create 4096 in + let bpf fs = bprintf buf fs in + + bpf "\ +# Kickstart file for %s +# Generated by libguestfs.git/builder/templates/make-template.ml + +install +text +reboot +lang en_US.UTF-8 +keyboard us +network --bootproto dhcp +rootpw builder +firewall --enabled --ssh +timezone --utc America/New_York +" (string_of_os os arch); + + (match os with + | RHEL (3, _) -> + bpf "\ +langsupport en_US +mouse generic +"; + | _ -> () + ); + + (match os with + | RHEL (3, _) -> () + | _ -> bpf "selinux --enforcing\n" + ); + + (match os with + | RHEL (5, _) -> bpf "key --skip\n" + | _ -> () + ); + bpf "\n"; + + bpf "bootloader --location=mbr --append=\"%s\"\n" + (kernel_cmdline_of_os os arch); + bpf "\n"; + + (match os with + | CentOS _ -> + bpf "\ +zerombr +clearpart --all --initlabel +part /boot --fstype=ext4 --size=512 --asprimary +part swap --size=1024 --asprimary +part / --fstype=ext4 --size=1024 --grow --asprimary +"; + | RHEL ((3|4), _) -> + bpf "\ +zerombr +clearpart --all --initlabel +part /boot --fstype=ext2 --size=512 --asprimary +part swap --size=1024 --asprimary +part / --fstype=ext3 --size=1024 --grow --asprimary +"; + | RHEL (5, _) -> + bpf "\ +zerombr +clearpart --all --initlabel +part /boot --fstype=ext2 --size=512 --asprimary +part swap --size=1024 --asprimary +part / --fstype=ext4 --size=1024 --grow --asprimary +"; + | RHEL (6, _) -> + bpf "\ +zerombr +clearpart --all --initlabel +part /boot --fstype=ext4 --size=512 --asprimary +part swap --size=1024 --asprimary +part / --fstype=ext4 --size=1024 --grow --asprimary +"; + | RHEL (7, _) -> + bpf "\ +zerombr +clearpart --all --initlabel +part /boot --fstype=ext4 --size=512 --asprimary +part swap --size=1024 --asprimary +part / --fstype=xfs --size=1024 --grow --asprimary +"; + | _ -> + bpf "\ +zerombr +clearpart --all --initlabel +autopart --type=plain +"; + ); + bpf "\n"; + + (match os with + | RHEL (3, _) -> () + | _ -> + bpf "\ +# Halt the system once configuration has finished. +poweroff +"; + ); + bpf "\n"; + + bpf "\ +%%packages +@core +"; + + (match os with + | RHEL ((3|4|5), _) -> () + | _ -> + bpf "%%end\n" + ); + bpf "\n"; + + (* Generate the %post script section. The previous scripts did + * many different things here. The current script tries to update + * the packages and enable Xen drivers only. + *) + (match os with + | Fedora _ -> + bpf "%%post\n"; + bpf "\ +# Ensure the installation is up-to-date. +dnf -y --best upgrade +"; + if arch = X86_64 then bpf "\ +# Enable Xen domU support. +pushd /etc/dracut.conf.d +echo 'add_drivers+=\"xen:vbd xen:vif\"' > virt-builder-xen-drivers.conf +popd + +# To make the Xen change permanent, we need to rerun dracut. +# Rerun dracut for the installed kernel (not the running kernel). +# See commit 0fa52e4e45d80874bc5ea5f112f74be1d3f3472f and +# https://www.redhat.com/archives/libguestfs/2014-June/thread.html#00045 +KERNEL_VERSION=$(rpm -q kernel --qf '%%{version}-%%{release}.%%{arch}\\n') +dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION +"; + bpf "%%end\n\n" + | _ -> () + ); + + bpf "# EOF\n"; + + (* Write out the kickstart file. *) + let chan = open_out (ks_filename ^ ".new") in + Buffer.output_buffer chan buf; + close_out chan; + let cmd + sprintf "mv %s %s" (quote (ks_filename ^ ".new")) (quote ks_filename) in + if Sys.command cmd <> 0 then exit 1; + + (* Return the kickstart filename. *) + ks_filename + +and copy_preseed_to_temporary source + (* d-i only works if the file is literally called "/preseed.cfg" *) + let d = "/tmp" // random8 () ^ ".tmp" in + let f = d // "preseed.cfg" in + Unix.mkdir d 0o700; + let cmd = sprintf "cp %s %s" (quote source) (quote f) in + if Sys.command cmd <> 0 then exit 1; + f + +and make_location os arch + match os, arch with + | CentOS (major, _), Aarch64 -> + (* XXX This always points to the latest CentOS, so + * effectively the minor number is always ignored. + *) + sprintf "http://mirror.centos.org/altarch/%d/os/aarch64/" major + + | CentOS (major, _), X86_64 -> + (* For 6.x we rebuild this every time there is a new 6.x release, and bump + * the revision in the index. + * For 7.x this always points to the latest CentOS, so + * effectively the minor number is always ignored. + *) + sprintf "http://mirror.centos.org/centos-7/%d/os/x86_64/" major + + | Debian (_, dist), X86_64 -> + sprintf "http://ftp.uk.debian.org/debian/dists/%s/main/installer-amd64" + dist + + | Fedora ver, Aarch64 -> + sprintf "https://download.fedoraproject.org/pub/fedora-secondary/releases/%d/Server/aarch64/os/" ver + + | Fedora ver, Armv7 -> + sprintf "http://mirror.bytemark.co.uk/fedora/linux/releases/%d/Server/armhfp/os/" ver + + | Fedora ver, X86_64 when ver < 21 -> + sprintf "http://mirror.bytemark.co.uk/fedora/linux/releases/%d/Fedora/x86_64/os/" ver + + | Fedora ver, X86_64 -> + sprintf "http://mirror.bytemark.co.uk/fedora/linux/releases/%d/Server/x86_64/os/" ver + + | Fedora ver, I686 when ver < 21 -> + sprintf "http://mirror.bytemark.co.uk/fedora/linux/releases/%d/Fedora/i386/os/" ver + + | Fedora ver, I686 -> + sprintf "http://mirror.bytemark.co.uk/fedora/linux/releases/%d/Server/i386/os/" ver + + | Fedora ver, PPC64 -> + sprintf "https://download.fedoraproject.org/pub/fedora-secondary/releases/%d/Server/ppc64/os/" ver + + | Fedora ver, PPC64le -> + sprintf "https://download.fedoraproject.org/pub/fedora-secondary/releases/%d/Server/ppc64le/os/" ver + + | Fedora ver, S390X -> + sprintf "https://download.fedoraproject.org/pub/fedora-secondary/releases/%d/Server/s390x/os/" ver + + | RHEL (3, minor), X86_64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-3/U%d/AS/x86_64/tree" minor + + | RHEL (4, minor), X86_64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-4/U%d/AS/x86_64/tree" minor + + | RHEL (5, minor), X86_64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-5-Server/U%d/x86_64/os" minor + + | RHEL (6, minor), X86_64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-6/6.%d/Server/x86_64/os" minor + + | RHEL (7, minor), X86_64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-7/7.%d/Server/x86_64/os" minor + + | RHEL (7, minor), Aarch64 -> + sprintf "http://download.eng.bos.redhat.com/released/RHEL-7/7.%d/Server/aarch64/os" minor + + | RHEL (7, minor), PPC64 -> + sprintf "http://download.devel.redhat.com/released/RHEL-7/7.%d/Server/ppc64/os" minor + + | RHEL (7, minor), PPC64le -> + sprintf "http://download.devel.redhat.com/released/RHEL-7/7.%d/Server/ppc64le/os" minor + + | Ubuntu (_, dist), X86_64 -> + sprintf "http://archive.ubuntu.com/ubuntu/dists/%s/main/installer-amd64" + dist + + | Ubuntu (_, dist), PPC64le -> + sprintf "http://ports.ubuntu.com/ubuntu-ports/dists/%s/main/installer-ppc64el" dist + + | _ -> + eprintf "%s: don't know how to calculate the --location for this OS and architecture\n" prog; + exit 1 + +(* NB: Arguments do not need to be quoted, because we pass them + * directly to exec(2). + *) +and make_virt_install_command os arch ks tmpname tmpout tmpefivars location + let args = ref [] in + let add arg = args := arg :: !args in + + add "virt-install"; + add (sprintf "--name=%s" tmpname); + + (*add "--print-xml";*) + + (match arch with + | PPC64 | PPC64le -> add "--ram=4096" + | _ -> add "--ram=2048" + ); + + (match arch with + | X86_64 -> + (* XXX This assumes the host is always x86_64. *) + add "--cpu=host"; + add "--vcpus=4" + | PPC64 -> + add "--arch=ppc64"; + add "--machine=pseries"; + add "--cpu=POWER7"; + add "--vcpus=1" + | PPC64le -> + add "--arch=ppc64le"; + add "--machine=pseries"; + add "--cpu=POWER8"; + add "--vcpus=1" + | arch -> + add (sprintf "--arch=%s" (string_of_arch arch)); + add "--vcpus=1" + ); + + add "--os-type=linux"; + add (sprintf "--os-variant=%s" (os_variant_of_os os arch)); + + (match tmpefivars with + | Some (code, vars) -> + add "--boot"; + add (sprintf "loader=%s,loader_ro=yes,loader_type=pflash,nvram=%s" + code vars) + | _ -> () + ); + + add (sprintf "--initrd-inject=%s" ks); + let os_extra + match os with + | Debian _ | Ubuntu _ -> "auto" + | Fedora _ | RHEL _ | CentOS _ -> + sprintf "ks=file:/%s" (Filename.basename ks) in + add (sprintf "--extra-args=%s %s" (* sic: does NOT need to be quoted *) + os_extra (kernel_cmdline_of_os os arch)); + + add (sprintf "--disk=%s,size=%d,format=raw" + (Sys.getcwd () // tmpout) virtual_size_gb); + + add "--serial=pty"; + add (sprintf "--location=%s" location); + add "--nographics"; + add "--noreboot"; + + (* Return the command line (list of arguments). *) + Array.of_list (List.rev !args) + +and os_variant_of_os os arch + match os, arch with + (* This case is needed to workaround a bug in virt-install: + * https://bugzilla.redhat.com/show_bug.cgi?id=1399083 + *) + | Fedora _, (PPC64|PPC64le) -> "fedora22" + | Fedora ver, _ when ver <= 23 -> + sprintf "fedora%d" ver + | Fedora _, _ -> "fedora23" (* max version known in Fedora 24 *) + | CentOS (major, minor), _ when (major, minor) <= (7,0) -> + sprintf "centos%d.%d" major minor + | CentOS _, _ -> "centos7.0" (* max version known in Fedora 24 *) + | RHEL (major, minor), _ when (major, minor) <= (7,2) -> + sprintf "rhel%d.%d" major minor + | RHEL _, _ -> "rhel7.2" (* max version known in Fedora 24 *) + | Debian (ver, _), _ -> sprintf "debian%d" ver + | Ubuntu (ver, _), _ -> sprintf "ubuntu%s" ver + +(* Same as the above, but we print the "true" os-variant, even + * if osinfo itself might not support it yet. + *) +and true_os_variant_of_os = function + | Fedora ver -> sprintf "fedora%d" ver + | CentOS (major, minor) -> sprintf "centos%d.%d" major minor + | RHEL (major, minor) -> sprintf "rhel%d.%d" major minor + | Debian (ver, _) -> sprintf "debian%d" ver + | Ubuntu (ver, _) -> sprintf "ubuntu%s" ver + +and kernel_cmdline_of_os os arch + match os, arch with + | _, X86_64 + | _, I686 + | _, S390X -> + "console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" + | _, Aarch64 -> + "console=ttyAMA0 earlyprintk=pl011,0x9000000 ignore_loglevel no_timer_check printk.time=1 rd_NO_PLYMOUTH" + | _, Armv7 -> + "console=tty0 console=ttyAMA0,115200 rd_NO_PLYMOUTH" + | (Debian _|Fedora _|Ubuntu _), (PPC64|PPC64le) -> + "console=tty0 console=hvc0 rd_NO_PLYMOUTH" + | (RHEL _|CentOS _), PPC64 + | (RHEL _|CentOS _), PPC64le -> + "console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" + +and make_rhel_yum_conf major minor arch + let buf = Buffer.create 4096 in + let bpf fs = bprintf buf fs in + + let baseurl, srpms, optional + match major, arch with + | 5, X86_64 -> + let topurl + sprintf "http://download.devel.redhat.com/released/RHEL-5-Server/U%d" + minor in + sprintf "%s/x86_64/os/Server" topurl, + sprintf "%s/source/SRPMS" topurl, + None + | 6, X86_64 -> + let topurl + sprintf "http://download.devel.redhat.com/released/RHEL-%d/%d.%d" + major major minor in + sprintf "%s/Server/%s/os" (string_of_arch arch) topurl, + sprintf "%s/source/SRPMS" topurl, + Some (sprintf "%s/Server/optional/%s/os" (string_of_arch arch) topurl, + sprintf "%s/Server/optional/source/SRPMS" topurl) + | 7, (X86_64|Aarch64|PPC64|PPC64le) -> + let topurl + sprintf "http://download.devel.redhat.com/released/RHEL-%d/%d.%d" + major major minor in + sprintf "%s/Server/%s/os" (string_of_arch arch) topurl, + sprintf "%s/source/SRPMS" topurl, + Some (sprintf "%s/Server-optional/%s/os" (string_of_arch arch) topurl, + sprintf "%s/Server-optional/source/tree" topurl) + | _ -> assert false in + + bpf "\ +# Yum configuration pointing to Red Hat servers. + +[rhel%d] +name=RHEL %d Server +baseurl=%s +enabled=1 +gpgcheck=0 +keepcache=0 + +[rhel%d-source] +name=RHEL %d Server Source +baseurl=%s +enabled=0 +gpgcheck=0 +keepcache=0 +" major major baseurl major major srpms; + + (match optional with + | None -> () + | Some (optionalbaseurl, optionalsrpms) -> + bpf "\ + +[rhel%d-optional] +name=RHEL %d Server Optional +baseurl=%s +enabled=1 +gpgcheck=0 +keepcache=0 + +[rhel%d-optional-source] +name=RHEL %d Server Optional +baseurl=%s +enabled=0 +gpgcheck=0 +keepcache=0 +" major major optionalbaseurl major major optionalsrpms + ); + + Buffer.contents buf + +and make_index_fragment os arch index_fragment output nvram revision expandfs + let chan = open_out (index_fragment ^ ".new") in + let fpf fs = fprintf chan fs in + + fpf "[%s]\n" (string_of_os_noarch os); + fpf "name=%s\n" (long_name_of_os os arch); + fpf "osinfo=%s\n" (true_os_variant_of_os os); + fpf "arch=%s\n" (string_of_arch arch); + fpf "file=%s\n" output; + (match revision with + | None -> () + | Some i -> fpf "revision=%d\n" i + ); + fpf "checksum[sha512]=%s\n" (sha512sum_of_file output); + fpf "format=raw\n"; + fpf "size=%d\n" (virtual_size_gb * 1024 * 1024 * 1024); + fpf "compressed_size=%d\n" (size_of_file output); + fpf "expand=%s\n" expandfs; + + let notes = notes_of_os os arch nvram in + (match notes with + | first :: notes -> + fpf "notes=%s\n" first; + List.iter (fpf " %s\n") notes + | [] -> assert false + ); + fpf "\n"; + + close_out chan; + let cmd + sprintf "mv %s %s" + (quote (index_fragment ^ ".new")) (quote index_fragment) in + if Sys.command cmd <> 0 then exit 1 + +and long_name_of_os os arch + match os, arch with + | CentOS (major, minor), X86_64 -> + sprintf "CentOS %d.%d" major minor + | CentOS (major, minor), arch -> + sprintf "CentOS %d.%d (%s)" major minor (string_of_arch arch) + | Debian (ver, dist), X86_64 -> + sprintf "Debian %d (%s)" ver dist + | Debian (ver, dist), arch -> + sprintf "Debian %d (%s) (%s)" ver dist (string_of_arch arch) + | Fedora ver, X86_64 -> + sprintf "Fedora® %d Server" ver + | Fedora ver, arch -> + sprintf "Fedora® %d Server (%s)" ver (string_of_arch arch) + | RHEL (major, minor), X86_64 -> + sprintf "Red Hat Enterprise Linux® %d.%d" major minor + | RHEL (major, minor), arch -> + sprintf "Red Hat Enterprise Linux® %d.%d (%s)" + major minor (string_of_arch arch) + | Ubuntu (ver, dist), X86_64 -> + sprintf "Ubuntu %s (%s)" ver dist + | Ubuntu (ver, dist), arch -> + sprintf "Ubuntu %s (%s) (%s)" ver dist (string_of_arch arch) + +and notes_of_os os arch nvram + let args = ref [] in + let add arg = args := arg :: !args in + + add (long_name_of_os os arch); + add ""; + + (match os with + | CentOS _ -> + add "This CentOS image contains only unmodified @Core group packages." + | Debian _ -> + add "This is a minimal Debian install." + | Fedora _ -> + add "This Fedora image contains only unmodified @Core group packages."; + add ""; + add "Fedora and the Infinity design logo are trademarks of Red Hat, Inc."; + add "Source and further information is available from http://fedoraproject.org/" + | RHEL _ -> assert false (* cannot happen, see caller *) + | Ubuntu _ -> + add "This is a minimal Ubuntu install." + ); + add ""; + + (* Specific notes for particular versions. *) + let reconfigure_ssh_host_keys_debian () + add "This image does not contain SSH host keys. To regenerate them use:"; + add ""; + add " --firstboot-command \"dpkg-reconfigure openssh-server\""; + add ""; + in + let fix_serial_console_debian () + add "The serial console is not working in this image. To enable it, do:"; + add ""; + add " --edit '/etc/default/grub:"; + add " s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"console=tty0 console=ttyS0,115200n8\"/' \\"; + add " --run-command update-grub"; + add "" + in + let builder_account_warning () + add "IMPORTANT WARNING:"; + add "It seems to be impossible to create an Ubuntu >= 14.04 image using"; + add "preseed without creating a user account. Therefore this image"; + add "contains a user account 'builder'. I have disabled it, so that"; + add "people who don't read release notes don't get caught out, but you"; + add "might still wish to delete it completely."; + add "" + in + (match os with + | CentOS (6, _) -> + add "‘virt-builder centos-6’ will always install the latest 6.x release."; + add "" + | Debian (8, _) -> + 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,'\n"; + add ""; + reconfigure_ssh_host_keys_debian (); + | Ubuntu ("16.04", _) -> + builder_account_warning (); + fix_serial_console_debian (); + reconfigure_ssh_host_keys_debian (); + | Ubuntu (ver, _) when ver >= "14.04" -> + builder_account_warning (); + reconfigure_ssh_host_keys_debian (); + | Ubuntu _ -> + reconfigure_ssh_host_keys_debian (); + | _ -> () + ); + + (match nvram with + | Some vars -> + add "You will need to use the associated UEFI NVRAM variables file:"; + add (sprintf " http://libguestfs.org/download/builder/%s" vars); + add ""; + | None -> () + ); + + add "This template was generated by a script in the libguestfs source tree:"; + add " builder/templates/make-template.ml"; + add "Associated files used to prepare this template can be found in the"; + add "same directory."; + + List.rev !args + +and read_revision filename + match (try Some (open_in filename) with Sys_error _ -> None) with + | None -> None + | Some chan -> + let r = ref None in + let rex = Str.regexp "^revision=\\([0-9]+\\)$" in + (try + let rec loop () + let line = input_line chan in + if Str.string_match rex line 0 then ( + r := Some (int_of_string (Str.matched_group 1 line)); + raise End_of_file + ); + loop () + in + loop () + with End_of_file -> () + ); + close_in chan; + !r + +and sha512sum_of_file filename + let cmd = sprintf "sha512sum %s | awk '{print $1}'" (quote filename) in + let chan = Unix.open_process_in cmd in + let line = input_line chan in + let pstat = Unix.close_process_in chan in + check_process_status_for_errors pstat; + line + +and size_of_file filename = (Unix.stat filename).Unix.st_size + +and open_guest filename + let g = new Guestfs.guestfs () in + g#add_drive_opts ~format:"raw" filename; + g#launch (); + + let roots = g#inspect_os () in + if Array.length roots = 0 then ( + eprintf "%s: cannot inspect this guest\n" prog; + exit 1 + ); + let root = roots.(0) in + + let mps = g#inspect_get_mountpoints root in + let cmp (a,_) (b,_) = compare (String.length a) (String.length b) in + let mps = List.sort cmp mps in + List.iter ( + fun (mp, dev) -> + try g#mount_ro dev mp + with Guestfs.Error msg -> eprintf "%s (ignored)\n" msg + ) mps; + + g + +and check_process_status_for_errors = function + | Unix.WEXITED 0 -> () + | Unix.WEXITED i -> + eprintf "command exited with %d\n%!" i; + exit 1 + | Unix.WSIGNALED i -> + eprintf "command killed by signal %d\n%!" i; + exit 1 + | Unix.WSTOPPED i -> + eprintf "command stopped by signal %d\n%!" i; + exit 1 + +and random8 + let chars = "abcdefghijklmnopqrstuvwxyz0123456789" in + fun () -> + String.concat "" ( + List.map ( + fun _ -> + let c = Random.int 36 in + let c = chars.[c] in + String.make 1 c + ) [1;2;3;4;5;6;7;8] + ) + +let () = main () diff --git a/builder/templates/scientificlinux-6.index-fragment b/builder/templates/scientificlinux-6.index-fragment new file mode 100644 index 0000000..e9d0cd0 --- /dev/null +++ b/builder/templates/scientificlinux-6.index-fragment @@ -0,0 +1,23 @@ +[scientificlinux-6] +name=Scientific Linux 6.5 +osinfo=centos6.5 +arch=x86_64 +file=scientificlinux-6.xz +revision=5 +checksum=be42b0e97d256ab5476079fe71411bebf59abe9c6ff4a7d27330aa5383fac9507472c06d11ef061d3c0e6695bec5ac9cfb7fbfd86fdbb5649e5cb535e2ac5b88 +format=raw +size=6442450944 +compressed_size=191667880 +expand=/dev/sda3 +notes=Scientific Linux 6.5 + + This Scientific Linux image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/scientificlinux.sh + + Note that `virt-builder scientificlinux-6' will always install the + latest 6.x release. + diff --git a/builder/templates/ubuntu-10.04.index-fragment b/builder/templates/ubuntu-10.04.index-fragment new file mode 100644 index 0000000..f360261 --- /dev/null +++ b/builder/templates/ubuntu-10.04.index-fragment @@ -0,0 +1,25 @@ +[ubuntu-10.04] +name=Ubuntu 10.04 (Lucid) +osinfo=ubuntulucid +arch=x86_64 +file=ubuntu-10.04.xz +checksum=9e322782bc77c740ce956d57d0d89ec9ac9f2b890c474ac937f400db848df3e164683eaf4631b989f8b4771f64e0c0972452d1555a15c65714b5ceefb295fb7e +format=raw +size=4294967296 +compressed_size=149728112 +expand=/dev/sda1 +notes=Ubuntu 10.04 (Lucid). + + This is a minimal Ubuntu 10.04 (Lucid) install. + + Only the openssh-server package is selected in tasksel. + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + builder/website/ubuntu.preseed + builder/website/ubuntu.sh + + This image does not contain SSH host keys. To regenerate them use: + + --firstboot-command "dpkg-reconfigure openssh-server" + diff --git a/builder/templates/ubuntu-12.04.index-fragment b/builder/templates/ubuntu-12.04.index-fragment new file mode 100644 index 0000000..23ee7b8 --- /dev/null +++ b/builder/templates/ubuntu-12.04.index-fragment @@ -0,0 +1,25 @@ +[ubuntu-12.04] +name=Ubuntu 12.04 (Precise) +osinfo=ubuntuprecise +arch=x86_64 +file=ubuntu-12.04.xz +checksum=15eab4610a44bf28423c08982cec47f6c3d43f29834791440249916ed76cc2dfeaf0405fddc8627086257bbbdaa4016c8982ad9b269f57f8f625b0e70d09e4e0 +format=raw +size=4294967296 +compressed_size=168593316 +expand=/dev/sda1 +notes=Ubuntu 12.04 (Precise). + + This is a minimal Ubuntu 12.04 (Precise) install. + + Only the openssh-server package is selected in tasksel. + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + builder/website/ubuntu.preseed + builder/website/ubuntu.sh + + This image does not contain SSH host keys. To regenerate them use: + + --firstboot-command "dpkg-reconfigure openssh-server" + diff --git a/builder/templates/ubuntu-14.04.index-fragment b/builder/templates/ubuntu-14.04.index-fragment new file mode 100644 index 0000000..7cf3b98 --- /dev/null +++ b/builder/templates/ubuntu-14.04.index-fragment @@ -0,0 +1,31 @@ +[ubuntu-14.04] +name=Ubuntu 14.04 (Trusty) +osinfo=ubuntutrusty +arch=x86_64 +file=ubuntu-14.04.xz +checksum=dbc5505c7cfbfb48275b09e91f781dfd7f8d521db577f0c31e0a70b13fbd18c8bcec97b1e274b28062ebc3aba70d68e64c84b9c9690ff7dfca9e81f813047e8a +format=raw +size=4294967296 +compressed_size=206250764 +expand=/dev/sda1 +notes=Ubuntu 14.04 (Trusty). + + This is a minimal Ubuntu 14.04 (Trusty) install. + + Only the openssh-server package is selected in tasksel. + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + builder/website/ubuntu.preseed + builder/website/ubuntu.sh + + This image does not contain SSH host keys. To regenerate them use: + + --firstboot-command "dpkg-reconfigure openssh-server" + + IMPORTANT NOTE: It seems to be impossible to create an Ubuntu >= 14.04 + image using preseed without creating a user account. Therefore this + image contains a user account 'builder'. I have disabled it, so that + people who don't read release notes don't get caught out, but you might + still wish to delete it completely. + diff --git a/builder/templates/ubuntu-16.04.index-fragment b/builder/templates/ubuntu-16.04.index-fragment new file mode 100644 index 0000000..8c85963 --- /dev/null +++ b/builder/templates/ubuntu-16.04.index-fragment @@ -0,0 +1,38 @@ +[ubuntu-16.04] +name=Ubuntu 16.04 (Xenial) +osinfo=ubuntuxenial +arch=x86_64 +file=ubuntu-16.04.xz +checksum=56f9f7621fc5f60a01d0c2471fcddaa449979871aeaacb4d936b733f031dd40bb3c29fe73f8636dcaceb6c1413ebb1feff7381f1b24695e9750d106e243884d1 +format=raw +size=4294967296 +compressed_size=232828552 +expand=/dev/sda1 +notes=Ubuntu 16.04 (Xenial). + + This is a minimal Ubuntu 16.04 (Xenial) install. + + Only the openssh-server package is selected in tasksel. + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + builder/website/ubuntu.preseed + builder/website/ubuntu.sh + + 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 (apparently a bug + in Ubuntu). 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 + + IMPORTANT NOTE: It seems to be impossible to create an Ubuntu >= 14.04 + image using preseed without creating a user account. Therefore this + image contains a user account 'builder'. I have disabled it, so that + people who don't read release notes don't get caught out, but you might + still wish to delete it completely. + diff --git a/builder/website/ubuntu.preseed b/builder/templates/ubuntu.preseed similarity index 100% rename from builder/website/ubuntu.preseed rename to builder/templates/ubuntu.preseed diff --git a/builder/website/validate.sh b/builder/templates/validate.sh similarity index 84% rename from builder/website/validate.sh rename to builder/templates/validate.sh index 2a7ba32..9582611 100755 --- a/builder/website/validate.sh +++ b/builder/templates/validate.sh @@ -1,6 +1,6 @@ #!/bin/bash - # libguestfs virt-builder validate index -# Copyright (C) 2013 Red Hat Inc. +# Copyright (C) 2013-2016 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,8 +24,8 @@ fn=test-filename-for-index-validate rm -f $fn touch $fn -$VG virt-index-validate $srcdir/index -$VG virt-index-validate $srcdir/index.asc +$VG virt-index-validate ../../website/download/builder/index +$VG virt-index-validate ../../website/download/builder/index.asc $VG virt-index-validate $fn rm $fn diff --git a/builder/test-website/virt-builder/repos.d/libguestfs.conf.in b/builder/test-website/virt-builder/repos.d/libguestfs.conf.in index 7bbc28d..7118529 100644 --- a/builder/test-website/virt-builder/repos.d/libguestfs.conf.in +++ b/builder/test-website/virt-builder/repos.d/libguestfs.conf.in @@ -1,3 +1,3 @@ [libguestfs.org] -uri=file://@abs_top_srcdir@/builder/website/index.asc +uri=file://@abs_top_srcdir@/website/download/builder/index.asc gpgkey=file://@abs_top_srcdir@/builder/libguestfs.gpg diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod index 831c59f..76ad3b1 100644 --- a/builder/virt-builder.pod +++ b/builder/virt-builder.pod @@ -1235,7 +1235,7 @@ out the information in this index file. The templates hosted on libguestfs.org were created using shell scripts, kickstart files and preseed files which can be found in the -libguestfs source tree, in C<builder/website>. +libguestfs source tree, in C<builder/templates>. =head3 Setting up the repository @@ -1273,7 +1273,7 @@ Export your GPG public key: There are many ways to create the templates. For example you could clone existing guests (see L<virt-sysprep(1)>), or you could install a guest by hand (L<virt-install(1)>). To see how the templates were -created for virt-builder, look at the scripts in C<builder/website> +created for virt-builder, look at the scripts in C<builder/templates> For best results when compressing the templates, use the following xz options (see L<nbdkit-xz-plugin(1)> for further explanation): diff --git a/builder/website/.gitignore b/builder/website/.gitignore deleted file mode 100644 index 65e1fc6..0000000 --- a/builder/website/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.xz diff --git a/builder/website/centos-aarch64.sh b/builder/website/centos-aarch64.sh deleted file mode 100755 index b70a4b4..0000000 --- a/builder/website/centos-aarch64.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=centos-$version-aarch64 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -case $version in - 7.*) - major=7 - # XXX This always points to the latest CentOS 7, so - # effectively the minor number is always ignored. - tree=http://mirror.centos.org/altarch/$major/os/aarch64/ - ;; -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=ttyAMA0 earlyprintk=pl011,0x9000000 ignore_loglevel no_timer_check printk.time=1 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=cortex-a57 --vcpus=2 \ - --os-type=linux --os-variant=centos$major.0 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/centos.sh b/builder/website/centos.sh deleted file mode 100755 index 69670fe..0000000 --- a/builder/website/centos.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=centos-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -case $version in - 6) - # We rebuild this every time there is a new 6.x release, and bump - # the revision in the index. - tree=http://mirror.bytemark.co.uk/centos/$version/os/x86_64/ - major=6 - ;; - 7.*) - major=7 - # XXX This always points to the latest CentOS 7, so - # effectively the minor number is always ignored. - tree=http://mirror.centos.org/centos-7/$major/os/x86_64/ - ;; -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -part /boot --fstype=ext4 --size=512 --asprimary -part swap --size=1024 --asprimary -part / --fstype=ext4 --size=1024 --grow --asprimary - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=host --vcpus=2 \ - --os-type=linux --os-variant=rhel$major \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/compress.sh b/builder/website/compress.sh deleted file mode 100644 index 1036a60..0000000 --- a/builder/website/compress.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Common code which syspreps, sparsifies and compresses the templates. - -output=$1 - -relabel_args=() - -if [ -n "$DO_RELABEL" ]; then - relabel_args="--selinux-relabel" -fi - -# Sysprep (removes logfiles and so on). -virt-sysprep -a $output $relabel_args - -# Sparsify. -mv $output $output.old -virt-sparsify $output.old $output -rm $output.old - -# Compress. -xz --best --block-size=16777216 $output - -# Result. These can be copied into the index file directly. -echo -n compressed_size= ; stat -c %s $output.xz -echo -n checksum= ; sha512sum $output.xz | awk '{print $1}' diff --git a/builder/website/debian.sh b/builder/website/debian.sh deleted file mode 100755 index ca18f2d..0000000 --- a/builder/website/debian.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -# libguestfs -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# The basic plan comes from: -# http://honk.sigxcpu.org/con/Preseeding_Debian_virtual_machines_with_virt_install.html -# https://wiki.debian.org/DebianInstaller/Preseed - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 2 ]; then - echo "$0 VERSION DIST" - exit 1 -fi - -# Some configuration. -version=$1 -dist=$2 -if [ "$dist" = "jessie" ]; then - # Until virt-install learns about debianjessie. - osvariant=debianwheezy -else - osvariant=debian$dist -fi -location=http://ftp.uk.debian.org/debian/dists/$dist/main/installer-amd64 -output=debian-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Make sure it's being run from the correct directory. -if [ ! -f debian.preseed ]; then - echo "You are running this script from the wrong directory." - exit 1 -fi - -# Note that the injected file must be called "/preseed.cfg" in order -# for d-i to pick it up. -sed -e "s,@CACHE@,$http_proxy,g" < debian.preseed > preseed.cfg - -# Clean up function. -cleanup () -{ - rm -f preseed.cfg - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=1024 \ - --os-type=linux --os-variant=$osvariant \ - --initrd-inject=$(pwd)/preseed.cfg \ - --extra-args="auto console=tty0 console=ttyS0,115200" \ - --disk=$(pwd)/$output,size=4,format=raw \ - --serial pty \ - --location=$location \ - --nographics \ - --noreboot - -# Remove apt proxy configuration (thanks: Daniel Miranda). -guestfish -a $output -i <<EOF - rm /etc/apt/apt.conf - touch /etc/apt/apt.conf -EOF - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-aarch64.sh b/builder/website/fedora-aarch64.sh deleted file mode 100755 index cfa938d..0000000 --- a/builder/website/fedora-aarch64.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Build Fedora images for aarch64 (secondary arch). - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/$version/Server/aarch64/os/ -output=fedora-$version-aarch64 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=ttyAMA0 earlyprintk=pl011,0x9000000 ignore_loglevel no_timer_check printk.time=1 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine --nvram $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -# virt-install nvram_template option is broken for non-root users -# https://bugzilla.redhat.com/show_bug.cgi?id=1189143 -# work around it: -vars=$(mktemp) -cp /usr/share/edk2/aarch64/vars-template-pflash.raw $vars - -virt-install \ - --name=$tmpname \ - --ram=4096 \ - --vcpus=1 \ - --os-type=linux --os-variant=fedora21 \ - --arch aarch64 \ - --boot loader=/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw,loader_ro=yes,loader_type=pflash,nvram=$vars \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -# NB: We need to preserve the nvram after installation since -# it contains the EFI boot variables set by grub. -cp $vars $output-nvram -xz --best $output-nvram - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-armv7l.sh b/builder/website/fedora-armv7l.sh deleted file mode 100755 index 1ff7ec8..0000000 --- a/builder/website/fedora-armv7l.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Build Fedora images for armv7l. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -tree=http://mirror.bytemark.co.uk/fedora/linux/releases/$version/Server/armhfp/os/ -output=fedora-$version-armv7l -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyAMA0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --vcpus=1 \ - --arch armv7l \ - --os-type=linux --os-variant=fedora22 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyAMA0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-i686.sh b/builder/website/fedora-i686.sh deleted file mode 100755 index 92d3f21..0000000 --- a/builder/website/fedora-i686.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# This script was used to create the Fedora templates used by -# virt-builder. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -if [ $version -lt 21 ]; then - tree=http://mirror.bytemark.co.uk/fedora/linux/releases/$version/Fedora/i386/os/ -else - tree=http://mirror.bytemark.co.uk/fedora/linux/releases/$version/Server/i386/os/ -fi -output=fedora-$version-i686 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Enable Xen domU support: -pushd /etc/dracut.conf.d -echo 'add_drivers+="xen:vbd xen:vif"' > virt-builder-xen-drivers.conf -popd -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=host --vcpus=2 \ - --os-type=linux --os-variant=fedora22 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-ppc64.sh b/builder/website/fedora-ppc64.sh deleted file mode 100755 index c8eafe2..0000000 --- a/builder/website/fedora-ppc64.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Build Fedora images for ppc64 big endian (secondary arch). - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/$version/Server/ppc64/os/ -output=fedora-$version-ppc64 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=hvc0 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=lvm - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=4096 \ - --vcpus=1 \ - --os-type=linux --os-variant=fedora22 \ - --arch ppc64 --machine pseries \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=hvc0 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-ppc64le.sh b/builder/website/fedora-ppc64le.sh deleted file mode 100755 index 3b18c5b..0000000 --- a/builder/website/fedora-ppc64le.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Build Fedora images for ppc64le (secondary arch). - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/$version/Server/ppc64le/os/ -output=fedora-$version-ppc64le -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=hvc0 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=lvm - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=4096 \ - --vcpus=1 \ - --os-type=linux --os-variant=fedora22 \ - --arch ppc64le --machine pseries --cpu POWER8 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=hvc0 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora-s390x.sh b/builder/website/fedora-s390x.sh deleted file mode 100755 index 8fb3120..0000000 --- a/builder/website/fedora-s390x.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Build Fedora images for s390x (secondary arch). - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -tree=https://dl.fedoraproject.org/pub/fedora-secondary/releases/$version/Server/s390x/os/ -output=fedora-$version-s390x -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --arch=s390x \ - --ram=2048 \ - --vcpus=1 \ - --os-type=linux --os-variant=fedora23 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/fedora.sh b/builder/website/fedora.sh deleted file mode 100755 index 8911d14..0000000 --- a/builder/website/fedora.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# This script was used to create the Fedora templates used by -# virt-builder. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -if [ $version -lt 21 ]; then - tree=http://mirror.bytemark.co.uk/fedora/linux/releases/$version/Fedora/x86_64/os/ -else - tree=http://mirror.bytemark.co.uk/fedora/linux/releases/$version/Server/x86_64/os/ -fi -output=fedora-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Enable Xen domU support: -pushd /etc/dracut.conf.d -echo 'add_drivers+="xen:vbd xen:vif"' > virt-builder-xen-drivers.conf -popd -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION - -# Ensure the installation is up-to-date: -dnf -y --best upgrade -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=host --vcpus=2 \ - --os-type=linux --os-variant=fedora22 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/rhel-aarch64.sh b/builder/website/rhel-aarch64.sh deleted file mode 100755 index 3a618c3..0000000 --- a/builder/website/rhel-aarch64.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -# Hack for RWMJ -unset http_proxy - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=rhel-$version-aarch64 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) -guestroot=/dev/sda4 - -case $version in - 7.*) - major=7 - topurl=http://download.eng.bos.redhat.com/released/RHEL-7/$version/ - tree=$topurl/Server/aarch64/os - baseurl=$tree - srpms=$topurl/Server/source/tree - optional=$topurl/Server-optional/x86_64/os - optionalsrpms=$topurl/Server-optional/source/tree - bootfs=ext4 - rootfs=xfs - ;; - *) - echo "$0: version $version not supported by this script yet" - exit 1 -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=ttyAMA0 earlyprintk=pl011,0x9000000 ignore_loglevel no_timer_check printk.time=1 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=plain - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end - -%post -# Rerun dracut for the installed kernel (not the running kernel): -KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n') -dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION -%end -EOF - -# Yum configuration. -yum=$(mktemp) -cat > $yum <<EOF -[rhel$major] -name=RHEL $major Server -baseurl=$baseurl -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-source] -name=RHEL $major Server Source -baseurl=$srpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF - -if [ -n "$optional" ]; then -cat >> $yum <<EOF -[rhel$major-optional] -name=RHEL $major Server Optional -baseurl=$optional -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-optional-source] -name=RHEL $major Server Optional -baseurl=$optionalsrpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF -fi - -# Clean up function. -cleanup () -{ - rm -f $ks - rm -f $yum - virsh undefine --nvram $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -# virt-install nvram_template option is broken for non-root users -# https://bugzilla.redhat.com/show_bug.cgi?id=1189143 -# work around it: -vars=$(mktemp) -cp /usr/share/edk2/aarch64/vars-template-pflash.raw $vars - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --vcpus=1 \ - --os-type=linux --os-variant=rhel$major \ - --arch aarch64 \ - --boot loader=/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw,loader_ro=yes,loader_type=pflash,nvram=$vars \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -# NB: We need to preserve the nvram after installation since -# it contains the EFI boot variables set by grub. -cp $vars $output-nvram - -# We have to replace yum config so it doesn't try to use RHN (it -# won't be registered). -guestfish --rw -a $output -m $guestroot \ - upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/rhel-ppc64.sh b/builder/website/rhel-ppc64.sh deleted file mode 100755 index 32148ae..0000000 --- a/builder/website/rhel-ppc64.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -# Hack for RWMJ -unset http_proxy - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=rhel-$version-ppc64 -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) -guestroot=/dev/rhel/root - -case $version in - 7.*) - major=7 - topurl=http://download.devel.redhat.com/released/RHEL-$major/$version - tree=$topurl/Server/ppc64/os - baseurl=$tree - srpms=$topurl/Server/source/tree - optional=$topurl/Server-optional/ppc64/os - optionalsrpms=$topurl/Server-optional/source/tree - ;; - *) - echo "$0: version $version not supported by this script yet" - exit 1 -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<EOF -install -text -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -timezone --utc America/New_York -selinux --enforcing -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=lvm - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end -EOF - -# Yum configuration. -yum=$(mktemp) -cat > $yum <<EOF -[rhel$major] -name=RHEL $major Server -baseurl=$baseurl -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-source] -name=RHEL $major Server Source -baseurl=$srpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF - -if [ -n "$optional" ]; then -cat >> $yum <<EOF -[rhel$major-optional] -name=RHEL $major Server Optional -baseurl=$optional -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-optional-source] -name=RHEL $major Server Optional -baseurl=$optionalsrpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF -fi - -# Clean up function. -cleanup () -{ - rm -f $ks - rm -f $yum - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=4096 \ - --vcpus=1 \ - --os-type=linux --os-variant=rhel$major \ - --arch ppc64 --machine pseries \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -# We have to replace yum config so it doesn't try to use RHN (it -# won't be registered). -guestfish --rw -a $output -m $guestroot \ - upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/rhel-ppc64le.sh b/builder/website/rhel-ppc64le.sh deleted file mode 100755 index 83e6391..0000000 --- a/builder/website/rhel-ppc64le.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -# Hack for RWMJ -unset http_proxy - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=rhel-$version-ppc64le -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) -guestroot=/dev/rhel/root - -case $version in - 7.*) - major=7 - topurl=http://download.devel.redhat.com/released/RHEL-$major/$version - tree=$topurl/Server/ppc64le/os - baseurl=$tree - srpms=$topurl/Server/source/tree - optional=$topurl/Server-optional/ppc64le/os - optionalsrpms=$topurl/Server-optional/source/tree - ;; - *) - echo "$0: version $version not supported by this script yet" - exit 1 -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<EOF -install -text -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -timezone --utc America/New_York -selinux --enforcing -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -autopart --type=lvm - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end -EOF - -# Yum configuration. -yum=$(mktemp) -cat > $yum <<EOF -[rhel$major] -name=RHEL $major Server -baseurl=$baseurl -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-source] -name=RHEL $major Server Source -baseurl=$srpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF - -if [ -n "$optional" ]; then -cat >> $yum <<EOF -[rhel$major-optional] -name=RHEL $major Server Optional -baseurl=$optional -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-optional-source] -name=RHEL $major Server Optional -baseurl=$optionalsrpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF -fi - -# Clean up function. -cleanup () -{ - rm -f $ks - rm -f $yum - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=4096 \ - --vcpus=1 \ - --os-type=linux --os-variant=rhel$major \ - --arch ppc64le --machine pseries --cpu POWER8 \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -# We have to replace yum config so it doesn't try to use RHN (it -# won't be registered). -guestfish --rw -a $output -m $guestroot \ - upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/rhel.sh b/builder/website/rhel.sh deleted file mode 100755 index fcb7315..0000000 --- a/builder/website/rhel.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -# Hack for RWMJ -unset http_proxy - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=rhel-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) -guestroot=/dev/sda3 - -case $version in - 3.*) - major=3 - minor=`echo $version | awk -F. '{print $2}'` - topurl=http://download.devel.redhat.com/released/RHEL-$major/U$minor/AS - tree=$topurl/x86_64/tree - baseurl=$tree - srpms=$topurl/x86_64/tree/SRPMS - bootfs=ext2 - rootfs=ext3 - guestroot=/dev/sda2 - ;; - 4.*) - major=4 - minor=`echo $version | awk -F. '{print $2}'` - topurl=http://download.devel.redhat.com/released/RHEL-$major/U$minor/AS - tree=$topurl/x86_64/tree - baseurl=$tree - srpms=$topurl/x86_64/tree/SRPMS - bootfs=ext2 - rootfs=ext3 - guestroot=/dev/sda2 - ;; - 5.*) - major=5 - minor=`echo $version | awk -F. '{print $2}'` - topurl=http://download.devel.redhat.com/released/RHEL-$major-Server/U$minor - tree=$topurl/x86_64/os - baseurl=$tree/Server - srpms=$topurl/source/SRPMS - bootfs=ext2 - rootfs=ext4 - guestroot=/dev/sda2 - ;; - 6.*) - major=6 - topurl=http://download.devel.redhat.com/released/RHEL-$major/$version - tree=$topurl/Server/x86_64/os - baseurl=$tree - srpms=$topurl/source/SRPMS - optional=$topurl/Server/optional/x86_64/os - optionalsrpms=$topurl/Server/optional/source/SRPMS - bootfs=ext4 - rootfs=ext4 - ;; - 7.*) - major=7 - topurl=http://download.devel.redhat.com/released/RHEL-$major/$version - tree=$topurl/Server/x86_64/os - baseurl=$tree - srpms=$topurl/Server/source/tree - optional=$topurl/Server-optional/x86_64/os - optionalsrpms=$topurl/Server-optional/source/tree - bootfs=ext4 - rootfs=xfs - ;; - *) - echo "$0: version $version not supported by this script yet" - exit 1 -esac - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -timezone --utc America/New_York -EOF - -if [ $major -le 4 ]; then -cat >> $ks <<EOF -langsupport en_US -mouse generic -EOF -fi - -if [ $major -ge 4 ]; then -cat >> $ks <<EOF -selinux --enforcing -EOF -fi - -if [ $major -eq 5 ]; then -cat >> $ks <<EOF -key --skip -EOF -fi - -cat >> $ks <<EOF -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -part /boot --fstype=$bootfs --size=512 --asprimary -part swap --size=1024 --asprimary -part / --fstype=$rootfs --size=1024 --grow --asprimary - -EOF - -if [ $major -ge 4 ]; then -cat >> $ks <<EOF -# Halt the system once configuration has finished. -poweroff - -EOF -fi - -cat >> $ks <<EOF -%packages -@core -EOF - -# RHEL 5 didn't understand the %end directive, but RHEL >= 6 -# requires it. -if [ $major -ge 6 ]; then -cat >> $ks <<EOF -%end -EOF -fi - -# Yum configuration. -yum=$(mktemp) -cat > $yum <<EOF -[rhel$major] -name=RHEL $major Server -baseurl=$baseurl -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-source] -name=RHEL $major Server Source -baseurl=$srpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF - -if [ -n "$optional" ]; then -cat >> $yum <<EOF -[rhel$major-optional] -name=RHEL $major Server Optional -baseurl=$optional -enabled=1 -gpgcheck=0 -keepcache=0 - -[rhel$major-optional-source] -name=RHEL $major Server Optional -baseurl=$optionalsrpms -enabled=0 -gpgcheck=0 -keepcache=0 -EOF -fi - -# Clean up function. -cleanup () -{ - rm -f $ks - rm -f $yum - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=host --vcpus=2 \ - --os-type=linux --os-variant=rhel$major \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -if [ $major -ge 5 ]; then -# We have to replace yum config so it doesn't try to use RHN (it -# won't be registered). -guestfish --rw -a $output -m $guestroot \ - upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo -fi - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/scientificlinux.sh b/builder/website/scientificlinux.sh deleted file mode 100755 index 2cd2c8f..0000000 --- a/builder/website/scientificlinux.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -ne 1 ]; then - echo "$0 VERSION" - exit 1 -fi - -version=$1 -output=scientificlinux-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) -major=$(echo $version | awk -F. '{print $1}') - -# We rebuild this every time there is a new 6.x release, and bump -# the revision in the index. -tree=http://www.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/$version/x86_64/os - -rm -f $output $output.old $output.xz - -# Generate the kickstart to a temporary file. -ks=$(mktemp) -cat > $ks <<'EOF' -install -text -reboot -lang en_US.UTF-8 -keyboard us -network --bootproto dhcp -rootpw builder -firewall --enabled --ssh -selinux --enforcing -timezone --utc America/New_York -bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH" -zerombr -clearpart --all --initlabel -part /boot --fstype=ext4 --size=512 --asprimary -part swap --size=1024 --asprimary -part / --fstype=ext4 --size=1024 --grow --asprimary - -# Halt the system once configuration has finished. -poweroff - -%packages -@core -%end -EOF - -# Clean up function. -cleanup () -{ - rm -f $ks - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=2048 \ - --cpu=host --vcpus=2 \ - --os-type=linux --os-variant=rhel$major \ - --initrd-inject=$ks \ - --extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \ - --disk $(pwd)/$output,size=6,format=raw \ - --serial pty \ - --location=$tree \ - --nographics \ - --noreboot - -DO_RELABEL=1 - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/test-guest.sh b/builder/website/test-guest.sh deleted file mode 100755 index 7854aeb..0000000 --- a/builder/website/test-guest.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash - -# virt-builder -# Copyright (C) 2013 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# This is not part of the automated test suite. It's a manual test -# run by the maintainer which must be run on each new guest to ensure -# that all the virt-builder features work on the new guest. -# -# Usage: -# ./run builder/website/test-guest.sh os-version [extra virt-builder args] -# Then read the instructions ... - -export LANG=C -set -e - -if ! virt-builder --help >/dev/null 2>&1 || [ ! -f builder/virt-builder.pod ]; then - echo "$0: running the test from the wrong directory, or libguestfs has not been built" - exit 1 -fi - -if [ $# -lt 1 ]; then - echo "$0: missing os-version" - echo "try: ./run virt-builder -l" - exit 1 -fi - -osversion="$1" -shift -output="$osversion.img" - -virt-builder "$osversion" \ - --no-cache -v \ - --size 10G \ - --root-password password:123456 \ - --hostname test.example.com \ - --install scrub \ - --edit '/etc/issue: s/(.*)/$lineno: $1/' \ - --upload builder/virt-builder.pod:/virt-builder.pod \ - --run-command 'echo RUN COMMAND 1 >> /run-command.log' \ - --run-command 'echo RUN COMMAND 2 >> /run-command.log' \ - --run-command 'echo RUN COMMAND 3 >> /run-command.log' \ - --firstboot-command 'useradd -m -p "" rjones ; chage -d 0 rjones' \ - --firstboot-command 'echo FIRSTBOOT COMMAND 1' \ - --firstboot-command 'echo FIRSTBOOT COMMAND 2' \ - --firstboot-command 'echo FIRSTBOOT COMMAND 3' \ - "$@" |& tee "$osversion.log" - -# Boot the guest. -qemu-system-x86_64 \ - -m 1024 \ - -drive "file=$output,format=raw,snapshot=on,if=ide" & - -cat <<EOF - - =======================================-The "$osversion" guest is being booted. -The trace file is here: "$osversion.log" - -Checklist: - - 1: Root password is 123456 - 2: Hostname is test.example.com - 3: scrub package is installed - 4: /etc/issue has line numbers - 5: /virt-builder.pod exists and looks reasonable - 6: /run-command.log exists and has 3 lines in correct order - 7: /root/virt-sysprep-firstboot.log exists and has 3 entries in correct order - 8: rjones account exists, with no password - 9: rjones password must be changed at first login -10: /home/rjones exists and is populated -11: random-seed file was created or modified - =======================================- -EOF - -#rm $output diff --git a/builder/website/ubuntu-ppc64le.sh b/builder/website/ubuntu-ppc64le.sh deleted file mode 100755 index a362547..0000000 --- a/builder/website/ubuntu-ppc64le.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# libguestfs -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# The basic plan comes from: -# http://honk.sigxcpu.org/con/Preseeding_Debian_virtual_machines_with_virt_install.html -# https://wiki.debian.org/DebianInstaller/Preseed -# https://help.ubuntu.com/10.04/installation-guide/i386/preseed-using.html - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -lt 2 -o $# -gt 3 ]; then - echo "$0 VERSION DIST [OSVARIANT]" - exit 1 -fi - -# Some configuration. -version=$1 -dist=$2 -osvariant=$3 -if [ -z "$osvariant" ]; then osvariant=ubuntu$dist; fi -location=http://ports.ubuntu.com/ubuntu-ports/dists/$dist/main/installer-ppc64el -output=ubuntu-$version-ppc64le -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Make sure it's being run from the correct directory. -if [ ! -f ubuntu.preseed ]; then - echo "You are running this script from the wrong directory." - exit 1 -fi - -# Note that the injected file must be called "/preseed.cfg" in order -# for d-i to pick it up. -sed -e "s,@CACHE@,$http_proxy,g" < ubuntu.preseed > preseed.cfg - -# Clean up function. -cleanup () -{ - rm -f preseed.cfg - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=1024 \ - --os-type=linux --os-variant=$osvariant \ - --arch ppc64le --machine pseries \ - --initrd-inject=$(pwd)/preseed.cfg \ - --extra-args="auto console=tty0 console=hvc0" \ - --disk=$(pwd)/$output,size=4,format=raw \ - --serial pty \ - --location=$location \ - --nographics \ - --noreboot - -source $(dirname "$0")/compress.sh $output diff --git a/builder/website/ubuntu.sh b/builder/website/ubuntu.sh deleted file mode 100755 index bf0166c..0000000 --- a/builder/website/ubuntu.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -# libguestfs -# Copyright (C) 2013-2016 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# The basic plan comes from: -# http://honk.sigxcpu.org/con/Preseeding_Debian_virtual_machines_with_virt_install.html -# https://wiki.debian.org/DebianInstaller/Preseed -# https://help.ubuntu.com/10.04/installation-guide/i386/preseed-using.html - -unset CDPATH -export LANG=C -set -e -set -x - -if [ $# -lt 2 -o $# -gt 3 ]; then - echo "$0 VERSION DIST [OSVARIANT]" - exit 1 -fi - -# Some configuration. -version=$1 -dist=$2 -osvariant=$3 -if [ -z "$osvariant" ]; then osvariant=ubuntu$dist; fi -location=http://archive.ubuntu.com/ubuntu/dists/$dist/main/installer-amd64 -output=ubuntu-$version -tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8) - -rm -f $output $output.old $output.xz - -# Make sure it's being run from the correct directory. -if [ ! -f ubuntu.preseed ]; then - echo "You are running this script from the wrong directory." - exit 1 -fi - -# Note that the injected file must be called "/preseed.cfg" in order -# for d-i to pick it up. -sed -e "s,@CACHE@,$http_proxy,g" < ubuntu.preseed > preseed.cfg - -# Clean up function. -cleanup () -{ - rm -f preseed.cfg - virsh undefine $tmpname ||: -} -trap cleanup INT QUIT TERM EXIT ERR - -virt-install \ - --name=$tmpname \ - --ram=1024 \ - --os-type=linux --os-variant=$osvariant \ - --initrd-inject=$(pwd)/preseed.cfg \ - --extra-args="auto console=tty0 console=ttyS0,115200" \ - --disk=$(pwd)/$output,size=4,format=raw \ - --serial pty \ - --location=$location \ - --nographics \ - --noreboot - -# In Ubuntu >= 14.04 you can't complete the install without creating -# a user account. We create one called 'builder', but we also -# disable it. -virt-customize -a $output --password builder:disabled - -source $(dirname "$0")/compress.sh $output diff --git a/configure.ac b/configure.ac index bc050a3..114110e 100644 --- a/configure.ac +++ b/configure.ac @@ -175,10 +175,10 @@ AC_CONFIG_FILES([Makefile builder/Makefile builder/libguestfs.conf builder/opensuse.conf + builder/templates/Makefile builder/test-config/virt-builder/repos.d/test-index.conf builder/test-simplestreams/virt-builder/repos.d/cirros.conf builder/test-website/virt-builder/repos.d/libguestfs.conf - builder/website/Makefile cat/Makefile csharp/Makefile customize/Makefile diff --git a/builder/website/README b/website/download/builder/README similarity index 82% rename from builder/website/README rename to website/download/builder/README index c8b6d8f..50eb380 100644 --- a/builder/website/README +++ b/website/download/builder/README @@ -12,16 +12,15 @@ templates. It has the canonical URL: If you are looking at this file in the git repository ----------------------------------------------------- -libguestfs.git/builder/website/ contains a copy of the website, minus -the huge OS template files (because of their size, they are stored -elsewhere and merged into the website when it is uploaded). +libguestfs.git/builder/templates/ contains the program used to +generate the template files, the source for the index, kickstart files +and more. When you use the ./run script to run virt-builder without installing, the ./run script sets $VIRT_BUILDER_SOURCE to point to this directory. If you actually want to use this configuration for anything except simple testing, you will have to download one or more OS templates -from the libguestfs website and put them into the builder/website/ -directory. +from the libguestfs website and put them into this directory. ie: diff --git a/builder/website/index b/website/download/builder/index similarity index 99% rename from builder/website/index rename to website/download/builder/index index 82e8312..fffe580 100644 --- a/builder/website/index +++ b/website/download/builder/index @@ -60,25 +60,6 @@ notes=CentOS 7.1 builder/website/centos.sh [centos-7.2] -name=CentOS 7.2 -osinfo=centos7.2 -arch=x86_64 -file=centos-7.2.xz -checksum=b32e6003d1f15e3a97e3644e35bb3fdc345a9b2e7448655d951ec331af6cd2b5548d6acfc9d92f09ac3a8a6439069c27fa539997118cb8a3f77d3bfa45c659d0 -format=raw -size=6442450944 -compressed_size=252158848 -expand=/dev/sda3 -notes=CentOS 7.2 - - This CentOS image contains only unmodified @Core group packages. - - It is thus very minimal. The kickstart and install script can be - found in the libguestfs source tree: - - builder/website/centos.sh - -[centos-7.2] name=CentOS 7.2 (aarch64) osinfo=centos7.2 arch=aarch64 @@ -97,6 +78,25 @@ notes=CentOS 7.2 (aarch64) builder/website/centos-aarch64.sh +[centos-7.2] +name=CentOS 7.2 +osinfo=centos7.2 +arch=x86_64 +file=centos-7.2.xz +checksum=b32e6003d1f15e3a97e3644e35bb3fdc345a9b2e7448655d951ec331af6cd2b5548d6acfc9d92f09ac3a8a6439069c27fa539997118cb8a3f77d3bfa45c659d0 +format=raw +size=6442450944 +compressed_size=252158848 +expand=/dev/sda3 +notes=CentOS 7.2 + + This CentOS image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/centos.sh + [cirros-0.3.1] name=CirrOS 0.3.1 arch=x86_64 @@ -149,38 +149,6 @@ notes=Debian 6 (Squeeze). --firstboot-command "dpkg-reconfigure openssh-server" [debian-7] -name=Debian 7 (Wheezy) -osinfo=debian7 -arch=x86_64 -file=debian-7.xz -revision=2 -checksum=c980a7d878c086b14619b3b9f644ab131c1f88b87729062f2832de12a938ba9e5a511c49402a9d02b740a30876f51889d20e7d0ed4997755f542650b8485f013 -format=raw -size=4294967296 -compressed_size=150734028 -expand=/dev/sda1 -notes=Debian 7 (Wheezy). - - This is a default Debian install. - - The preseed and virt-install scripts that produced this image - can be found in the libguestfs source tree: - - 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" - -[debian-7] name=Debian 7 (Wheezy) (sparc64) osinfo=debian7 arch=sparc64 @@ -215,6 +183,38 @@ notes=Debian 7 (Wheezy). Console messages are lost after the bootconsole is disabled, but it is still booting and will eventually give you a login prompt. +[debian-7] +name=Debian 7 (Wheezy) +osinfo=debian7 +arch=x86_64 +file=debian-7.xz +revision=2 +checksum=c980a7d878c086b14619b3b9f644ab131c1f88b87729062f2832de12a938ba9e5a511c49402a9d02b740a30876f51889d20e7d0ed4997755f542650b8485f013 +format=raw +size=4294967296 +compressed_size=150734028 +expand=/dev/sda1 +notes=Debian 7 (Wheezy). + + This is a default Debian install. + + The preseed and virt-install scripts that produced this image + can be found in the libguestfs source tree: + + 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" + [debian-8] name=Debian 8 (Jessie) osinfo=debian8 @@ -314,29 +314,6 @@ notes=Fedora 20. Source and further information is available from http://fedoraproject.org/ [fedora-21] -name=Fedora® 21 Server -osinfo=fedora21 -arch=x86_64 -file=fedora-21.xz -revision=1 -checksum=4dc92cbf540d3a0745ffe1fa01ffae15f17e7a8aa45c70ad975a1dda82b7f1ebe42f912be74d91a5866a91ee2ca3be3c2be274b5da29db930fe1ec8c2286575b -format=raw -size=6442450944 -compressed_size=209059864 -expand=/dev/sda3 -notes=Fedora 21 Server. - - This Fedora image contains only unmodified @Core group packages. - - It is thus very minimal. The kickstart and install script can be - found in the libguestfs source tree: - - builder/website/fedora.sh - - Fedora and the Infinity design logo are trademarks of Red Hat, Inc. - Source and further information is available from http://fedoraproject.org/ - -[fedora-21] name=Fedora® 21 Server (aarch64) osinfo=fedora21 arch=aarch64 @@ -429,17 +406,18 @@ notes=Fedora 21 Server (ppc64le) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-22] -name=Fedora® 22 Server -osinfo=fedora22 +[fedora-21] +name=Fedora® 21 Server +osinfo=fedora21 arch=x86_64 -file=fedora-22.xz -checksum=59f8b32ba363b64ad37a4bd3d17abd049e80691b84ea9b6c4f0485bcc743b6c8dff5bacd4ed838c555487f750edfd132a22421976a0821d82f16811361d4d98d +file=fedora-21.xz +revision=1 +checksum=4dc92cbf540d3a0745ffe1fa01ffae15f17e7a8aa45c70ad975a1dda82b7f1ebe42f912be74d91a5866a91ee2ca3be3c2be274b5da29db930fe1ec8c2286575b format=raw size=6442450944 -compressed_size=228011712 +compressed_size=209059864 expand=/dev/sda3 -notes=Fedora 22 Server. +notes=Fedora 21 Server. This Fedora image contains only unmodified @Core group packages. @@ -452,28 +430,6 @@ notes=Fedora 22 Server. Source and further information is available from http://fedoraproject.org/ [fedora-22] -name=Fedora® 22 Server (i686) -osinfo=fedora22 -arch=i686 -file=fedora-22-i686.xz -checksum=3547b94d5c418792e722786cfae41decd41f0725d529d65a2c719094c0b815eaa4fae195514a14d42fa19b57b895bcdbfdb305edf918b1b3722f30f338042d31 -format=raw -size=6442450944 -compressed_size=225185592 -expand=/dev/sda3 -notes=Fedora 22 Server (i686) - - This Fedora image contains only unmodified @Core group packages. - - It is thus very minimal. The kickstart and install script can be - found in the libguestfs source tree: - - builder/website/fedora-i686.sh - - Fedora and the Infinity design logo are trademarks of Red Hat, Inc. - Source and further information is available from http://fedoraproject.org/ - -[fedora-22] name=Fedora® 22 Server (aarch64) osinfo=fedora22 arch=aarch64 @@ -520,48 +476,46 @@ notes=Fedora 22 Server (armv7l) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-23] -name=Fedora® 23 Server -osinfo=fedora23 -arch=x86_64 -file=fedora-23.xz -revision=3 -checksum=90cd606923e16e2c01a08eaa360e213cdd49462e259a04cc6efb1d2516215fb4ac3c62811dfd1646d89650f717da030fa6dec693571e027a644eee589accb78d +[fedora-22] +name=Fedora® 22 Server (i686) +osinfo=fedora22 +arch=i686 +file=fedora-22-i686.xz +checksum=3547b94d5c418792e722786cfae41decd41f0725d529d65a2c719094c0b815eaa4fae195514a14d42fa19b57b895bcdbfdb305edf918b1b3722f30f338042d31 format=raw size=6442450944 -compressed_size=317209280 +compressed_size=225185592 expand=/dev/sda3 -notes=Fedora 23 Server. +notes=Fedora 22 Server (i686) This Fedora image contains only unmodified @Core group packages. It is thus very minimal. The kickstart and install script can be found in the libguestfs source tree: - builder/website/fedora.sh + builder/website/fedora-i686.sh Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-23] -name=Fedora® 23 Server (i686) -osinfo=fedora23 -arch=i686 -file=fedora-23-i686.xz -revision=2 -checksum=4b1badbb92f40ca1b3336e70b2564755d643bc00005fd6364c389a1f3078952968a6887c36c4f79fe3873cf42d41cb36dd226521fee32ed6e08c65d6d059af3c +[fedora-22] +name=Fedora® 22 Server +osinfo=fedora22 +arch=x86_64 +file=fedora-22.xz +checksum=59f8b32ba363b64ad37a4bd3d17abd049e80691b84ea9b6c4f0485bcc743b6c8dff5bacd4ed838c555487f750edfd132a22421976a0821d82f16811361d4d98d format=raw size=6442450944 -compressed_size=322831152 +compressed_size=228011712 expand=/dev/sda3 -notes=Fedora 23 Server (i686) +notes=Fedora 22 Server. This Fedora image contains only unmodified @Core group packages. It is thus very minimal. The kickstart and install script can be found in the libguestfs source tree: - builder/website/fedora-i686.sh + builder/website/fedora.sh Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ @@ -614,6 +568,29 @@ notes=Fedora 23 Server (armv7l) Source and further information is available from http://fedoraproject.org/ [fedora-23] +name=Fedora® 23 Server (i686) +osinfo=fedora23 +arch=i686 +file=fedora-23-i686.xz +revision=2 +checksum=4b1badbb92f40ca1b3336e70b2564755d643bc00005fd6364c389a1f3078952968a6887c36c4f79fe3873cf42d41cb36dd226521fee32ed6e08c65d6d059af3c +format=raw +size=6442450944 +compressed_size=322831152 +expand=/dev/sda3 +notes=Fedora 23 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + +[fedora-23] name=Fedora® 23 Server (ppc64) osinfo=fedora23 arch=ppc64 @@ -658,17 +635,18 @@ notes=Fedora 23 Server (ppc64le) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-24] -name=Fedora® 24 Server -osinfo=fedora24 +[fedora-23] +name=Fedora® 23 Server +osinfo=fedora23 arch=x86_64 -file=fedora-24.xz -checksum=907656be1f0bb4ed221a54f4339660d02071bdf79acd1644087e5ca20e315ba8e4b9008d7f0814a840904198a54499556f226db8b32f96a01ecd20370da8d03d +file=fedora-23.xz +revision=3 +checksum=90cd606923e16e2c01a08eaa360e213cdd49462e259a04cc6efb1d2516215fb4ac3c62811dfd1646d89650f717da030fa6dec693571e027a644eee589accb78d format=raw size=6442450944 -compressed_size=321359432 +compressed_size=317209280 expand=/dev/sda3 -notes=Fedora 24 Server. +notes=Fedora 23 Server. This Fedora image contains only unmodified @Core group packages. @@ -681,50 +659,6 @@ notes=Fedora 24 Server. Source and further information is available from http://fedoraproject.org/ [fedora-24] -name=Fedora® 24 Server (i686) -osinfo=fedora24 -arch=i686 -file=fedora-24-i686.xz -checksum=1461da1557327e0641987654919698a6b7c2df1c58f76a4a4d61fb66476dac1b19fe6e3650b82a246df7d241037725c7b8e57e73d3312e370dfb132f54b5cbf4 -format=raw -size=6442450944 -compressed_size=319087504 -expand=/dev/sda3 -notes=Fedora 24 Server (i686) - - This Fedora image contains only unmodified @Core group packages. - - It is thus very minimal. The kickstart and install script can be - found in the libguestfs source tree: - - builder/website/fedora-i686.sh - - Fedora and the Infinity design logo are trademarks of Red Hat, Inc. - Source and further information is available from http://fedoraproject.org/ - -[fedora-24] -name=Fedora® 24 Server (armv7l) -osinfo=fedora24 -arch=armv7l -file=fedora-24-armv7l.xz -checksum=7d9a5ce8e10c13e8d07ace42555183bfee5e561464e9fc439d0fefc3e85048bdc0c14d44d5584029d4015d0f3316c7583af8ae6d4c0ff8bcfcdb9037a37cacc0 -format=raw -size=6442450944 -compressed_size=324231484 -expand=/dev/sda3 -notes=Fedora 24 Server (armv7l) - - This Fedora image contains only unmodified @Core group packages. - - It is thus very minimal. The kickstart and install script can be - found in the libguestfs source tree: - - builder/website/fedora-armv7l.sh - - Fedora and the Infinity design logo are trademarks of Red Hat, Inc. - Source and further information is available from http://fedoraproject.org/ - -[fedora-24] name=Fedora® 24 Server (aarch64) osinfo=fedora24 arch=aarch64 @@ -749,39 +683,39 @@ notes=Fedora 24 Server (aarch64) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-25] -name=Fedora® 25 Server -osinfo=fedora25 -arch=x86_64 -file=fedora-25.xz -checksum=fd7f8c9c7f6093b0c8c154ab12a116952745a00f5634ee8ded8c81d5f3b9b614558b11109de98f814f4f57fb2c0a394fba43d8a9ed127b99b78ff02c39957f7b +[fedora-24] +name=Fedora® 24 Server (armv7l) +osinfo=fedora24 +arch=armv7l +file=fedora-24-armv7l.xz +checksum=7d9a5ce8e10c13e8d07ace42555183bfee5e561464e9fc439d0fefc3e85048bdc0c14d44d5584029d4015d0f3316c7583af8ae6d4c0ff8bcfcdb9037a37cacc0 format=raw size=6442450944 -compressed_size=337395436 +compressed_size=324231484 expand=/dev/sda3 -notes=Fedora 25 Server. +notes=Fedora 24 Server (armv7l) This Fedora image contains only unmodified @Core group packages. It is thus very minimal. The kickstart and install script can be found in the libguestfs source tree: - builder/website/fedora.sh + builder/website/fedora-armv7l.sh Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ -[fedora-25] -name=Fedora® 25 Server (i686) -osinfo=fedora25 +[fedora-24] +name=Fedora® 24 Server (i686) +osinfo=fedora24 arch=i686 -file=fedora-25-i686.xz -checksum=17cdf048a3961a316ac32aa084b4b7d20d0ff4756bd5e942c1aae29c6e8b3cf2a41516e87e301ee1122643aca14ca252554ebbadbe468a582c10591edc56177a +file=fedora-24-i686.xz +checksum=1461da1557327e0641987654919698a6b7c2df1c58f76a4a4d61fb66476dac1b19fe6e3650b82a246df7d241037725c7b8e57e73d3312e370dfb132f54b5cbf4 format=raw size=6442450944 -compressed_size=247412792 +compressed_size=319087504 expand=/dev/sda3 -notes=Fedora 25 Server (i686) +notes=Fedora 24 Server (i686) This Fedora image contains only unmodified @Core group packages. @@ -793,6 +727,28 @@ notes=Fedora 25 Server (i686) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ +[fedora-24] +name=Fedora® 24 Server +osinfo=fedora24 +arch=x86_64 +file=fedora-24.xz +checksum=907656be1f0bb4ed221a54f4339660d02071bdf79acd1644087e5ca20e315ba8e4b9008d7f0814a840904198a54499556f226db8b32f96a01ecd20370da8d03d +format=raw +size=6442450944 +compressed_size=321359432 +expand=/dev/sda3 +notes=Fedora 24 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + [fedora-25] name=Fedora® 25 Server (aarch64) osinfo=fedora25 @@ -841,6 +797,28 @@ notes=Fedora 25 Server (armv7l) Source and further information is available from http://fedoraproject.org/ [fedora-25] +name=Fedora® 25 Server (i686) +osinfo=fedora25 +arch=i686 +file=fedora-25-i686.xz +checksum=17cdf048a3961a316ac32aa084b4b7d20d0ff4756bd5e942c1aae29c6e8b3cf2a41516e87e301ee1122643aca14ca252554ebbadbe468a582c10591edc56177a +format=raw +size=6442450944 +compressed_size=247412792 +expand=/dev/sda3 +notes=Fedora 25 Server (i686) + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora-i686.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + +[fedora-25] name=Fedora® 25 Server (ppc64) osinfo=fedora25 arch=ppc64 @@ -886,6 +864,28 @@ notes=Fedora 25 Server (ppc64le) Fedora and the Infinity design logo are trademarks of Red Hat, Inc. Source and further information is available from http://fedoraproject.org/ +[fedora-25] +name=Fedora® 25 Server +osinfo=fedora25 +arch=x86_64 +file=fedora-25.xz +checksum=fd7f8c9c7f6093b0c8c154ab12a116952745a00f5634ee8ded8c81d5f3b9b614558b11109de98f814f4f57fb2c0a394fba43d8a9ed127b99b78ff02c39957f7b +format=raw +size=6442450944 +compressed_size=337395436 +expand=/dev/sda3 +notes=Fedora 25 Server. + + This Fedora image contains only unmodified @Core group packages. + + It is thus very minimal. The kickstart and install script can be + found in the libguestfs source tree: + + builder/website/fedora.sh + + Fedora and the Infinity design logo are trademarks of Red Hat, Inc. + Source and further information is available from http://fedoraproject.org/ + [scientificlinux-6] name=Scientific Linux 6.5 osinfo=centos6.5 @@ -1027,3 +1027,4 @@ notes=Ubuntu 16.04 (Xenial). image contains a user account 'builder'. I have disabled it, so that people who don't read release notes don't get caught out, but you might still wish to delete it completely. + diff --git a/builder/website/index.asc b/website/download/builder/index.asc similarity index 100% rename from builder/website/index.asc rename to website/download/builder/index.asc -- 2.10.2
Pino Toscano
2016-Nov-30 12:54 UTC
Re: [Libguestfs] [PATCH] builder: Rearrange how template-building scripts work.
On Monday, 28 November 2016 10:40:51 CET Richard W.M. Jones wrote:> Create a new directory (builder/template). Integrate all of the > scripts into a single program, so that templates are generated more > consistently. > > This also changes how the index file is generated. The script now > generates the index file fragment and saves it under version control, > and then generates the final index file by concatenating these. > (Previously the index was written by hand which was tedious and > error-prone.) > > The new script also saves the generated kickstart under version > control so it can be referenced later. > ---Note that the fragments for Ubuntu guests don't seem to match what the new make-template.ml produces -- in particular, the ones in this patch have osinfo=ubuntu$codename instead of osinfo=ubuntu$version as the script should produce. Ah I see, the current index is wrong already... Also, this patch includes changes in the website index but not in the index.asc -- I'd just leave them unchanged in this patch (simple git move), and then regenerate them in a followup commit.> diff --git a/builder/website/Makefile.am b/builder/templates/Makefile.am > similarity index 66% > rename from builder/website/Makefile.am > rename to builder/templates/Makefile.am > index d79b9a0..d1b89f9 100644 > --- a/builder/website/Makefile.am > +++ b/builder/templates/Makefile.am > @@ -1,5 +1,5 @@ > # libguestfs virt-builder tool > -# Copyright (C) 2013 Red Hat Inc. > +# Copyright (C) 2013-2016 Red Hat Inc. > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > @@ -17,33 +17,25 @@ > > include $(top_srcdir)/subdir-rules.mk > > +index_fragments = $(wildcard *.index-fragment) > + > EXTRA_DIST = \ > - .gitignore \ > - compress.sh \ > - test-guest.sh \ > - validate.sh \ > - README \ > - index \ > - index.asc \ > - centos.sh \ > - centos-aarch64.sh \ > + $(index_fragments) \ > + *.ks \Considering $(wildcard) above is already a GNU extension, I'd use it for *.ks as well.> debian.preseed \ > - debian.sh \ > - fedora.sh \ > - fedora-aarch64.sh \ > - fedora-armv7l.sh \ > - fedora-i686.sh \ > - fedora-ppc64.sh \ > - fedora-ppc64le.sh \ > - fedora-s390x.sh \ > - rhel.sh \ > - rhel-aarch64.sh \ > - rhel-ppc64.sh \ > - rhel-ppc64le.sh \ > - scientificlinux.sh \ > + make-template.ml \ > ubuntu.preseed \ > - ubuntu.sh \ > - ubuntu-ppc64le.sh > + validate.sh > + > +# Create the index file under the top level website/ directory. > +noinst_DATA = $(top_builddir)/website/download/builder/index > + > +$(top_builddir)/website/download/builder/index: $(index_fragments) > + rm -f $@ $@-t > + cat *.index-fragment > $@-tShould $^ be used instead of *index-fragment? Also, the order of the files could be made stable with sorting, so the index does not change just because of different results of the wildcard expansion.> diff --git a/builder/templates/make-template.ml b/builder/templates/make-template.ml > new file mode 100755 > index 0000000..71940ff > --- /dev/null > +++ b/builder/templates/make-template.ml > @@ -0,0 +1,1014 @@ > +#!/usr/bin/env ocaml > +(* libguestfs > + * Copyright (C) 2016 Red Hat Inc. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + *) > + > +(* This script is used to create the virt-builder templates hosted > + * http://libguestfs.org/download/builder/ > + * > + * Usage: > + * ./make-template.ml os version [arch] > + * eg: > + * ./make-template.ml fedora 25 > + * ./make-template.ml rhel 7.3 ppc64le > + * > + * The arch defaults to x86_64. Note that i686 is a separate arch. > + * > + * Prior to November 2016, the templates were generated using > + * shell scripts located in libguestfs.git/builder/website. > + *) > + > +open Printf > + > +let prog = "make-template" > + > +(* Check we are being run from the correct directory. We must do this > + * before attempting to load libraries below. > + *) > +let () > + if not (Sys.file_exists "debian.preseed") then ( > + eprintf "%s: run this script from the builder/templates subdirectory\n" > + prog; > + exit 1 > + );; > + > +#load "str.cma";; > +#load "unix.cma";; > +#directory "../../ocaml";; > +#load "mlguestfs.cma";; > + > +type os > + | CentOS of int * int (* major, minor *) > + | RHEL of int * int > + | Debian of int * string (* version, dist name like "wheezy" *) > + | Ubuntu of string * string > + | Fedora of int (* version number *) > +type arch = X86_64 | Aarch64 | Armv7 | I686 | PPC64 | PPC64le | S390X > + > +let quote = Filename.quote > +let (//) = Filename.concat > + > +let virtual_size_gb = 6 > + > +let rec main () > + assert (Sys.word_size = 64); > + Random.self_init (); > + > + (* Get the os, version, arch from the command line. *) > + if Array.length Sys.argv < 3 || Array.length Sys.argv > 4 then ( > + eprintf "%s os version [arch]\n" prog; > + exit 1 > + ); > + > + let os = os_of_string Sys.argv.(1) Sys.argv.(2) > + and arch > + if Array.length Sys.argv <= 3 then X86_64 > + else arch_of_string Sys.argv.(3) in > + > + (* Set the path to use locally built copies of the virt-* tools. *) > + let () > + let orig_path = Unix.getenv "PATH" in > + let paths = ["builder"; "customize"; "sparsify"; "sysprep"] in > + let prefix = Sys.getcwd () // ".." // ".." in > + let paths = List.map ((//) prefix) paths in > + let new_path = String.concat ":" (paths @ [orig_path]) in > + Unix.putenv "PATH" new_path inWouldn't be better just rely on the libguestfs tools in $PATH, i.e. using ./run for uninstalled versions? Just use a check similar to the one below (inspired from virt-builder): (* Check that we have libguestfs tools. *) let cmd = "virt-sparsify --help >/dev/null 2>&1" in if shell_command cmd <> 0 then ( eprintf "%s: libguestfs tools not available (use ./run for uninstalled versions)\n" prog; exit 1 );> +and os_of_string os ver > + match os, ver with > + | "centos", ver -> let maj, min = parse_major_minor ver in CentOS (maj, min) > + | "rhel", ver -> let maj, min = parse_major_minor ver in RHEL (maj, min) > + | "debian", "6" -> Debian (6, "squeeze") > + | "debian", "7" -> Debian (7, "wheezy") > + | "debian", "8" -> Debian (8, "jessie") > + | "ubuntu", "10.04" -> Ubuntu (ver, "lucid") > + | "ubuntu", "12.04" -> Ubuntu (ver, "precise") > + | "ubuntu", "14.04" -> Ubuntu (ver, "trusty") > + | "ubuntu", "16.04" -> Ubuntu (ver, "xenial") > + | "fedora", ver -> Fedora (int_of_string ver) > + | _ -> > + eprintf "%s: unknown or unsupported OS\n" prog; exit 1Can the error message also print the distro name and version?> +and parse_major_minor ver > + let rex = Str.regexp "^\\([0-9]+\\)\\.\\([0-9]+\\)$" in > + if Str.string_match rex ver 0 then ( > + int_of_string (Str.matched_group 1 ver), > + int_of_string (Str.matched_group 2 ver) > + ) > + else ( > + eprintf "%s: cannot parse major.minor\n" prog; > + exit 1 > + )Ditto.> +and arch_of_string = function > + | "x86_64" -> X86_64 > + | "aarch64" -> Aarch64 > + | "armv7l" -> Armv7 > + | "i686" -> I686 > + | "ppc64" -> PPC64 > + | "ppc64le" -> PPC64le > + | "s390x" -> S390X > + | _ -> > + eprintf "%s: unknown or unsupported arch\n" prog; exit 1Ditto.> +and make_kickstart_common ks_filename os arch > + let buf = Buffer.create 4096 in > + let bpf fs = bprintf buf fs in > + > + bpf "\ > +# Kickstart file for %s > +# Generated by libguestfs.git/builder/templates/make-template.ml > + > +install > +text > +reboot > +lang en_US.UTF-8 > +keyboard us > +network --bootproto dhcp > +rootpw builder > +firewall --enabled --ssh > +timezone --utc America/New_York > +" (string_of_os os arch); > + > + (match os with > + | RHEL (3, _) -> > + bpf "\ > +langsupport en_US > +mouse generic > +"; > + | _ -> () > + );rhel.sh has: if [ $major -le 4 ]; then so I think the check should rather be: | RHEL (ver, _) when ver <= 4 ->> + > + (match os with > + | RHEL (3, _) -> () > + | _ -> bpf "selinux --enforcing\n" > + );rhel.sh has: if [ $major -ge 4 ]; then so I think the check should rather be: | RHEL (ver, _) when ver >= 4 -> (OK, the current code does the same considering only RHEL >= 3 is supported, but could be better to convert it straight from the script.)> + > + (match os with > + | RHEL (5, _) -> bpf "key --skip\n" > + | _ -> () > + ); > + bpf "\n"; > + > + bpf "bootloader --location=mbr --append=\"%s\"\n" > + (kernel_cmdline_of_os os arch); > + bpf "\n"; > + > + (match os with > + | CentOS _ -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +part /boot --fstype=ext4 --size=512 --asprimary > +part swap --size=1024 --asprimary > +part / --fstype=ext4 --size=1024 --grow --asprimary > +"; > + | RHEL ((3|4), _) -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +part /boot --fstype=ext2 --size=512 --asprimary > +part swap --size=1024 --asprimary > +part / --fstype=ext3 --size=1024 --grow --asprimary > +"; > + | RHEL (5, _) -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +part /boot --fstype=ext2 --size=512 --asprimary > +part swap --size=1024 --asprimary > +part / --fstype=ext4 --size=1024 --grow --asprimary > +"; > + | RHEL (6, _) -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +part /boot --fstype=ext4 --size=512 --asprimary > +part swap --size=1024 --asprimary > +part / --fstype=ext4 --size=1024 --grow --asprimary > +"; > + | RHEL (7, _) -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +part /boot --fstype=ext4 --size=512 --asprimary > +part swap --size=1024 --asprimary > +part / --fstype=xfs --size=1024 --grow --asprimary > +";IMHO the RHEL cases could be merged together, leaving the bootfs and rootfs selection by version.> + | _ -> > + bpf "\ > +zerombr > +clearpart --all --initlabel > +autopart --type=plain > +"; > + ); > + bpf "\n"; > + > + (match os with > + | RHEL (3, _) -> () > + | _ -> > + bpf "\ > +# Halt the system once configuration has finished. > +poweroff > +"; > + );rhel.sh has: if [ $major -ge 4 ]; then so I think the check should rather be: | RHEL (ver, _) when ver >= 4 -> (Same note above.)> + bpf "\n"; > + > + bpf "\ > +%%packages > +@core > +"; > + > + (match os with > + | RHEL ((3|4|5), _) -> () > + | _ -> > + bpf "%%end\n" > + );rhel.sh has: if [ $major -ge 6 ]; then so I think the check should rather be: | RHEL (ver, _) when ver >= 6 -> (Same note above.)> +and copy_preseed_to_temporary source > + (* d-i only works if the file is literally called "/preseed.cfg" *) > + let d = "/tmp" // random8 () ^ ".tmp" inFilename.temp_dir_name instead of /tmp here.> +and make_location os arch > + match os, arch with > + | CentOS (major, _), Aarch64 -> > + (* XXX This always points to the latest CentOS, so > + * effectively the minor number is always ignored. > + *) > + sprintf "http://mirror.centos.org/altarch/%d/os/aarch64/" major > + > + | CentOS (major, _), X86_64 -> > + (* For 6.x we rebuild this every time there is a new 6.x release, and bump > + * the revision in the index. > + * For 7.x this always points to the latest CentOS, so > + * effectively the minor number is always ignored. > + *) > + sprintf "http://mirror.centos.org/centos-7/%d/os/x86_64/" major > + > + | Debian (_, dist), X86_64 -> > + sprintf "http://ftp.uk.debian.org/debian/dists/%s/main/installer-amd64" > + distWhile we are here, should we use either httpredir.debian.org (but IIRC it's deprecated), or deb.debian.org (works best with current testing, but should still work also with current stable and older).> + | _ -> > + eprintf "%s: don't know how to calculate the --location for this OS and architecture\n" prog; > + exit 1Ditto as above (i.e. print details of unknown distro/version).> +and make_index_fragment os arch index_fragment output nvram revision expandfs > + let chan = open_out (index_fragment ^ ".new") in > + let fpf fs = fprintf chan fs in > + > + fpf "[%s]\n" (string_of_os_noarch os); > + fpf "name=%s\n" (long_name_of_os os arch); > + fpf "osinfo=%s\n" (true_os_variant_of_os os); > + fpf "arch=%s\n" (string_of_arch arch); > + fpf "file=%s\n" output; > + (match revision with > + | None -> () > + | Some i -> fpf "revision=%d\n" i > + ); > + fpf "checksum[sha512]=%s\n" (sha512sum_of_file output); > + fpf "format=raw\n"; > + fpf "size=%d\n" (virtual_size_gb * 1024 * 1024 * 1024);Shouldn't this be Int64?> +and open_guest filename > + let g = new Guestfs.guestfs () in > + g#add_drive_opts ~format:"raw" filename; > + g#launch (); > + > + let roots = g#inspect_os () in > + if Array.length roots = 0 then ( > + eprintf "%s: cannot inspect this guest\n" prog; > + exit 1 > + ); > + let root = roots.(0) in > + > + let mps = g#inspect_get_mountpoints root in > + let cmp (a,_) (b,_) = compare (String.length a) (String.length b) in > + let mps = List.sort cmp mps in > + List.iter ( > + fun (mp, dev) -> > + try g#mount_ro dev mp > + with Guestfs.Error msg -> eprintf "%s (ignored)\n" msgShould mount errors be ignored in this case? Thanks, -- Pino Toscano
Richard W.M. Jones
2016-Nov-30 13:14 UTC
Re: [Libguestfs] [PATCH] builder: Rearrange how template-building scripts work.
On Wed, Nov 30, 2016 at 01:54:43PM +0100, Pino Toscano wrote:> On Monday, 28 November 2016 10:40:51 CET Richard W.M. Jones wrote: > > Create a new directory (builder/template). Integrate all of the > > scripts into a single program, so that templates are generated more > > consistently. > > > > This also changes how the index file is generated. The script now > > generates the index file fragment and saves it under version control, > > and then generates the final index file by concatenating these. > > (Previously the index was written by hand which was tedious and > > error-prone.) > > > > The new script also saves the generated kickstart under version > > control so it can be referenced later. > > --- > > Note that the fragments for Ubuntu guests don't seem to match what the > new make-template.ml produces -- in particular, the ones in this patch > have osinfo=ubuntu$codename instead of osinfo=ubuntu$version as the > script should produce. Ah I see, the current index is wrong already...This is generally true for most of the guests. However I didn't want to change the existing fragments.> Also, this patch includes changes in the website index but not in the > index.asc -- I'd just leave them unchanged in this patch (simple git > move), and then regenerate them in a followup commit.The index.asc has to be signed so you wouldn't want to generate it automatically.> > diff --git a/builder/website/Makefile.am b/builder/templates/Makefile.am > > similarity index 66% > > rename from builder/website/Makefile.am > > rename to builder/templates/Makefile.am > > index d79b9a0..d1b89f9 100644 > > --- a/builder/website/Makefile.am > > +++ b/builder/templates/Makefile.am > > @@ -1,5 +1,5 @@ > > # libguestfs virt-builder tool > > -# Copyright (C) 2013 Red Hat Inc. > > +# Copyright (C) 2013-2016 Red Hat Inc. > > # > > # This program is free software; you can redistribute it and/or modify > > # it under the terms of the GNU General Public License as published by > > @@ -17,33 +17,25 @@ > > > > include $(top_srcdir)/subdir-rules.mk > > > > +index_fragments = $(wildcard *.index-fragment) > > + > > EXTRA_DIST = \ > > - .gitignore \ > > - compress.sh \ > > - test-guest.sh \ > > - validate.sh \ > > - README \ > > - index \ > > - index.asc \ > > - centos.sh \ > > - centos-aarch64.sh \ > > + $(index_fragments) \ > > + *.ks \ > > Considering $(wildcard) above is already a GNU extension, I'd use it > for *.ks as well. > > > debian.preseed \ > > - debian.sh \ > > - fedora.sh \ > > - fedora-aarch64.sh \ > > - fedora-armv7l.sh \ > > - fedora-i686.sh \ > > - fedora-ppc64.sh \ > > - fedora-ppc64le.sh \ > > - fedora-s390x.sh \ > > - rhel.sh \ > > - rhel-aarch64.sh \ > > - rhel-ppc64.sh \ > > - rhel-ppc64le.sh \ > > - scientificlinux.sh \ > > + make-template.ml \ > > ubuntu.preseed \ > > - ubuntu.sh \ > > - ubuntu-ppc64le.sh > > + validate.sh > > + > > +# Create the index file under the top level website/ directory. > > +noinst_DATA = $(top_builddir)/website/download/builder/index > > + > > +$(top_builddir)/website/download/builder/index: $(index_fragments) > > + rm -f $@ $@-t > > + cat *.index-fragment > $@-t > > Should $^ be used instead of *index-fragment? Also, the order of the > files could be made stable with sorting, so the index does not change > just because of different results of the wildcard expansion.I used *.index-fragment so that the order is stable. It turns out that $(wildcard ..) doesn't sort.> > + (* Set the path to use locally built copies of the virt-* tools. *) > > + let () > > + let orig_path = Unix.getenv "PATH" in > > + let paths = ["builder"; "customize"; "sparsify"; "sysprep"] in > > + let prefix = Sys.getcwd () // ".." // ".." in > > + let paths = List.map ((//) prefix) paths in > > + let new_path = String.concat ":" (paths @ [orig_path]) in > > + Unix.putenv "PATH" new_path in > > Wouldn't be better just rely on the libguestfs tools in $PATH, i.e. > using ./run for uninstalled versions? Just use a check similar to the > one below (inspired from virt-builder): > > (* Check that we have libguestfs tools. *) > let cmd = "virt-sparsify --help >/dev/null 2>&1" in > if shell_command cmd <> 0 then ( > eprintf "%s: libguestfs tools not available (use ./run for uninstalled versions)\n" prog; > exit 1 > );Could do this. The problem is that I wanted to unconditionally use the just-built tools, to avoid the case where (eg) I make a fix to virt-sparsify, rebuild a template, but the template isn't sparsified correctly because it used the wrong version of virt-sparsify.> > +and os_of_string os ver > > + match os, ver with > > + | "centos", ver -> let maj, min = parse_major_minor ver in CentOS (maj, min) > > + | "rhel", ver -> let maj, min = parse_major_minor ver in RHEL (maj, min) > > + | "debian", "6" -> Debian (6, "squeeze") > > + | "debian", "7" -> Debian (7, "wheezy") > > + | "debian", "8" -> Debian (8, "jessie") > > + | "ubuntu", "10.04" -> Ubuntu (ver, "lucid") > > + | "ubuntu", "12.04" -> Ubuntu (ver, "precise") > > + | "ubuntu", "14.04" -> Ubuntu (ver, "trusty") > > + | "ubuntu", "16.04" -> Ubuntu (ver, "xenial") > > + | "fedora", ver -> Fedora (int_of_string ver) > > + | _ -> > > + eprintf "%s: unknown or unsupported OS\n" prog; exit 1 > > Can the error message also print the distro name and version?Sure (and others too).> > +and make_kickstart_common ks_filename os arch > > + let buf = Buffer.create 4096 in > > + let bpf fs = bprintf buf fs in > > + > > + bpf "\ > > +# Kickstart file for %s > > +# Generated by libguestfs.git/builder/templates/make-template.ml > > + > > +install > > +text > > +reboot > > +lang en_US.UTF-8 > > +keyboard us > > +network --bootproto dhcp > > +rootpw builder > > +firewall --enabled --ssh > > +timezone --utc America/New_York > > +" (string_of_os os arch); > > + > > + (match os with > > + | RHEL (3, _) -> > > + bpf "\ > > +langsupport en_US > > +mouse generic > > +"; > > + | _ -> () > > + ); > > rhel.sh has: > if [ $major -le 4 ]; then > so I think the check should rather be: > > | RHEL (ver, _) when ver <= 4 ->OK> > + > > + (match os with > > + | RHEL (3, _) -> () > > + | _ -> bpf "selinux --enforcing\n" > > + ); > > rhel.sh has: > if [ $major -ge 4 ]; then > so I think the check should rather be: > > | RHEL (ver, _) when ver >= 4 -> > > (OK, the current code does the same considering only RHEL >= 3 is > supported, but could be better to convert it straight from the script.)OK> > + > > + (match os with > > + | RHEL (5, _) -> bpf "key --skip\n" > > + | _ -> () > > + ); > > + bpf "\n"; > > + > > + bpf "bootloader --location=mbr --append=\"%s\"\n" > > + (kernel_cmdline_of_os os arch); > > + bpf "\n"; > > + > > + (match os with > > + | CentOS _ -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +part /boot --fstype=ext4 --size=512 --asprimary > > +part swap --size=1024 --asprimary > > +part / --fstype=ext4 --size=1024 --grow --asprimary > > +"; > > + | RHEL ((3|4), _) -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +part /boot --fstype=ext2 --size=512 --asprimary > > +part swap --size=1024 --asprimary > > +part / --fstype=ext3 --size=1024 --grow --asprimary > > +"; > > + | RHEL (5, _) -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +part /boot --fstype=ext2 --size=512 --asprimary > > +part swap --size=1024 --asprimary > > +part / --fstype=ext4 --size=1024 --grow --asprimary > > +"; > > + | RHEL (6, _) -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +part /boot --fstype=ext4 --size=512 --asprimary > > +part swap --size=1024 --asprimary > > +part / --fstype=ext4 --size=1024 --grow --asprimary > > +"; > > + | RHEL (7, _) -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +part /boot --fstype=ext4 --size=512 --asprimary > > +part swap --size=1024 --asprimary > > +part / --fstype=xfs --size=1024 --grow --asprimary > > +"; > > IMHO the RHEL cases could be merged together, leaving the bootfs and > rootfs selection by version.I had to change this in a later version because it turns out the above doesn't work properly for RHEL 7.> > + | _ -> > > + bpf "\ > > +zerombr > > +clearpart --all --initlabel > > +autopart --type=plain > > +"; > > + ); > > + bpf "\n"; > > + > > + (match os with > > + | RHEL (3, _) -> () > > + | _ -> > > + bpf "\ > > +# Halt the system once configuration has finished. > > +poweroff > > +"; > > + ); > > rhel.sh has: > if [ $major -ge 4 ]; then > so I think the check should rather be: > > | RHEL (ver, _) when ver >= 4 -> > > (Same note above.)OK> > + bpf "\n"; > > + > > + bpf "\ > > +%%packages > > +@core > > +"; > > + > > + (match os with > > + | RHEL ((3|4|5), _) -> () > > + | _ -> > > + bpf "%%end\n" > > + ); > > rhel.sh has: > if [ $major -ge 6 ]; then > so I think the check should rather be: > > | RHEL (ver, _) when ver >= 6 -> > > (Same note above.)OK> > +and copy_preseed_to_temporary source > > + (* d-i only works if the file is literally called "/preseed.cfg" *) > > + let d = "/tmp" // random8 () ^ ".tmp" in > > Filename.temp_dir_name instead of /tmp here.Yup.> > +and make_location os arch > > + match os, arch with > > + | CentOS (major, _), Aarch64 -> > > + (* XXX This always points to the latest CentOS, so > > + * effectively the minor number is always ignored. > > + *) > > + sprintf "http://mirror.centos.org/altarch/%d/os/aarch64/" major > > + > > + | CentOS (major, _), X86_64 -> > > + (* For 6.x we rebuild this every time there is a new 6.x release, and bump > > + * the revision in the index. > > + * For 7.x this always points to the latest CentOS, so > > + * effectively the minor number is always ignored. > > + *) > > + sprintf "http://mirror.centos.org/centos-7/%d/os/x86_64/" major > > + > > + | Debian (_, dist), X86_64 -> > > + sprintf "http://ftp.uk.debian.org/debian/dists/%s/main/installer-amd64" > > + dist > > While we are here, should we use either httpredir.debian.org (but IIRC > it's deprecated), or deb.debian.org (works best with current testing, > but should still work also with current stable and older). > > > + | _ -> > > + eprintf "%s: don't know how to calculate the --location for this OS and architecture\n" prog; > > + exit 1 > > Ditto as above (i.e. print details of unknown distro/version).OK.> > +and make_index_fragment os arch index_fragment output nvram revision expandfs > > + let chan = open_out (index_fragment ^ ".new") in > > + let fpf fs = fprintf chan fs in > > + > > + fpf "[%s]\n" (string_of_os_noarch os); > > + fpf "name=%s\n" (long_name_of_os os arch); > > + fpf "osinfo=%s\n" (true_os_variant_of_os os); > > + fpf "arch=%s\n" (string_of_arch arch); > > + fpf "file=%s\n" output; > > + (match revision with > > + | None -> () > > + | Some i -> fpf "revision=%d\n" i > > + ); > > + fpf "checksum[sha512]=%s\n" (sha512sum_of_file output); > > + fpf "format=raw\n"; > > + fpf "size=%d\n" (virtual_size_gb * 1024 * 1024 * 1024); > > Shouldn't this be Int64?We actually assert that the word size is 64 bits (in main ()), but using Int64 would be less lazy.> > +and open_guest filename > > + let g = new Guestfs.guestfs () in > > + g#add_drive_opts ~format:"raw" filename; > > + g#launch (); > > + > > + let roots = g#inspect_os () in > > + if Array.length roots = 0 then ( > > + eprintf "%s: cannot inspect this guest\n" prog; > > + exit 1 > > + ); > > + let root = roots.(0) in > > + > > + let mps = g#inspect_get_mountpoints root in > > + let cmp (a,_) (b,_) = compare (String.length a) (String.length b) in > > + let mps = List.sort cmp mps in > > + List.iter ( > > + fun (mp, dev) -> > > + try g#mount_ro dev mp > > + with Guestfs.Error msg -> eprintf "%s (ignored)\n" msg > > Should mount errors be ignored in this case?No they shouldn't be ignored. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Maybe Matching Threads
- Re: [PATCH] builder: Rearrange how template-building scripts work.
- [PATCH 2/2] builder/templates: remove Debian 6 (Squeeze)
- [PATCH 1/2] builder/templates/debian.preseed: enable serial console
- [PATCH 5/5] Add a virt-builder-repository tool
- [PATCH v4 9/9] Add a virt-builder-repository tool