xen-tools commit 83c37b476a75 ("Start all Debian releases since
Stretch (9) with pygrub by default") started to use pygrub by default.
Revert this.

With "pygrub" setting, xen-create-guest fails on armhf, the
80-install-kernel hook fails because it doesn't know about "armhf".

https://github.com/xen-tools/xen-tools/commit/83c37b476a7534c432ecc9941817aeb989677da6

There's "--nopygrub" but that doesn't work due to several issues, so
removing "pygrub" from "distributions.conf" is the only way.

Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
---
 ts-debian-install | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ts-debian-install b/ts-debian-install
index c42e8a37..a737bec9 100755
--- a/ts-debian-install
+++ b/ts-debian-install
@@ -78,6 +78,21 @@ sub ginstall () {
             fi
 END
     }
+
+    if ($ho->{Suite} =~ m/bookworm/) {
+        # remove "pygrub" from /etc/xen-tools/distributions.conf
+        # The "--nopygrub" option doesn't work.
+        # https://github.com/xen-tools/xen-tools/issues/67
+        # https://github.com/xen-tools/xen-tools/issues/68
+        target_editfile_root($ho, "/etc/xen-tools/distributions.conf", sub {
+            while (<::EI>) {
+                unless (m/^#/) {
+                    s/ pygrub\b//;
+                }
+                print ::EO or die $!;
+            }
+        });
+    }
     my $cmd = '';
     my $useproxy = $c{DebianMirrorProxy} // $c{HttpProxy};
     $cmd .= <<END if defined $useproxy;
-- 
Anthony PERARD


Reply via email to