Pino Toscano
2020-Mar-16 13:55 UTC
[Libguestfs] [p2v PATCH 1/3] Add kickstart URLs for RHEL 8
Both BaseOS and AppStream are needed. --- virt-p2v-make-kickstart.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in index 779ba62..cbbfb8a 100644 --- a/virt-p2v-make-kickstart.in +++ b/virt-p2v-make-kickstart.in @@ -176,6 +176,16 @@ repo --name=rhel6_${minor}_server_optional --baseurl=$baseurl/Server/optional/$a repos="$repos repo --name=rhel7_${minor}_server --baseurl=$baseurl/Server/$arch/os $proxy repo --name=rhel7_${minor}_server_optional --baseurl=$baseurl/Server-optional/$arch/os $proxy +" + ;; + rhel-8.*) + minor=$( echo "$repo" | sed 's/rhel-[0-9]*\.\([0-9]*\)/\1/' ) + baseurl=http://download.devel.redhat.com/released/RHEL-8/8.$minor.0 + # '$basearch' cannot be used in kickstart, so: + arch=`uname -m` + repos="$repos +repo --name=rhel8_${minor}_0_baseos --baseurl=$baseurl/BaseOS/$arch/os $proxy +repo --name=rhel8_${minor}_0_appstream --baseurl=$baseurl/AppStream/$arch/os $proxy " ;; *) -- 2.24.1
Pino Toscano
2020-Mar-16 13:55 UTC
[Libguestfs] [p2v PATCH 2/3] kickstart: disable recommends on RHEL 8
There is no need to install the weak dependencies (i.e. recommends) by default, since they are not needed. In case a package/tool is required, it will be explicitly installed. --- p2v.ks.in | 2 +- virt-p2v-make-kickstart.in | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/p2v.ks.in b/p2v.ks.in index 9bb31ab..15a449c 100644 --- a/p2v.ks.in +++ b/p2v.ks.in @@ -43,7 +43,7 @@ __REPOS__ # Packages to install in the ISO. For dependencies, see # p2v/Makefile.am. Note that libguestfs is NOT required by virt-p2v. -%packages +%packages __PACKAGES_OPTIONS__ @core diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in index cbbfb8a..d139c9b 100644 --- a/virt-p2v-make-kickstart.in +++ b/virt-p2v-make-kickstart.in @@ -48,6 +48,7 @@ output=p2v.ks proxy ssh_identity verbose+packages_options while true; do case "$1" in @@ -187,6 +188,8 @@ repo --name=rhel7_${minor}_server_optional --baseurl=$baseurl/Server-optional/$a repo --name=rhel8_${minor}_0_baseos --baseurl=$baseurl/BaseOS/$arch/os $proxy repo --name=rhel8_${minor}_0_appstream --baseurl=$baseurl/AppStream/$arch/os $proxy " + # Avoid recommends by default. + packages_options="--excludeWeakdeps" ;; *) # A custom repo is just a URL. @@ -229,6 +232,7 @@ done < $depsfile -v "extra_packages=$extra_packages" \ -v "md5sum_virt_p2v=$md5sum_virt_p2v" \ -v "repos=$repos" \ + -v "packages_options=$packages_options" \ '{ gsub (/__PACKAGE_NAME__/, "@PACKAGE_NAME@"); gsub (/__PACKAGE_VERSION__/, "@PACKAGE_VERSION@"); @@ -242,6 +246,7 @@ done < $depsfile gsub (/__EXTRA_PACKAGES__/, gensub (/,/, "\n", "g", extra_packages)); gsub (/__MD5SUM_VIRT_P2V__/, md5sum_virt_p2v); gsub (/__REPOS__/, repos); + gsub (/__PACKAGES_OPTIONS__/, packages_options); print; }' \ $datadir/p2v.ks.in > $output-t -- 2.24.1
The 'openstack' output mode requires few options, and virt-p2v does not have the GUI bits for specifying them. Similar to commit 9b009aa4a3898648fe68301d1c5ed774a0bf2e38 (for rhv-upload). --- ssh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssh.c b/ssh.c index 9dd2d8a..ce0caaa 100644 --- a/ssh.c +++ b/ssh.c @@ -1018,10 +1018,11 @@ static void add_output_driver (const char *name, size_t len) { /* Ignore the 'vdsm' driver, since that should only be used by VDSM. - * Ignore the 'rhv-upload' driver, since we do not support passing all the - * options for it. + * Ignore the 'openstack' and 'rhv-upload' drivers, since we do not + * support passing all the options for them. */ if ((len != 4 || memcmp (name, "vdsm", 4) != 0) && + (len != 9 || memcmp (name, "openstack", 9) != 0) && (len != 10 || memcmp (name, "rhv-upload", 10) != 0)) add_option ("output", &output_drivers, name, len); } -- 2.24.1
Richard W.M. Jones
2020-Mar-16 17:03 UTC
Re: [Libguestfs] [p2v PATCH 3/3] Ignore 'openstack' driver
On Mon, Mar 16, 2020 at 02:55:11PM +0100, Pino Toscano wrote:> The 'openstack' output mode requires few options, and virt-p2v does not > have the GUI bits for specifying them. > > Similar to commit 9b009aa4a3898648fe68301d1c5ed774a0bf2e38 (for > rhv-upload). > --- > ssh.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/ssh.c b/ssh.c > index 9dd2d8a..ce0caaa 100644 > --- a/ssh.c > +++ b/ssh.c > @@ -1018,10 +1018,11 @@ static void > add_output_driver (const char *name, size_t len) > { > /* Ignore the 'vdsm' driver, since that should only be used by VDSM. > - * Ignore the 'rhv-upload' driver, since we do not support passing all the > - * options for it. > + * Ignore the 'openstack' and 'rhv-upload' drivers, since we do not > + * support passing all the options for them. > */ > if ((len != 4 || memcmp (name, "vdsm", 4) != 0) && > + (len != 9 || memcmp (name, "openstack", 9) != 0) && > (len != 10 || memcmp (name, "rhv-upload", 10) != 0)) > add_option ("output", &output_drivers, name, len); > } > --Series looks fine, ACK. Somewhere I had a patch (for "old" p2v/) which got half way through fixing the openstack options. I'll have to dig it up some time, but IIRC it depended rather crucially on having the generator generate p2v files, but since the "new" virt-p2v doesn't use the generator it probably wouldn't work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW