[Libguestfs] [p2v PATCH 2/3] kickstart: disable recommends on RHEL 8

Pino Toscano ptoscano at redhat.com
Mon Mar 16 13:55:10 UTC 2020


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




More information about the Libguestfs mailing list