Move grub config into xen-hypervisor-common
authorHans van Kranenburg <hans@knorrie.org>
Fri, 23 Feb 2018 16:52:02 +0000 (17:52 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Fri, 23 Mar 2018 15:16:08 +0000 (16:16 +0100)
The grub config snippet is not arch dependent, neither version
dependent, so it has to move into a 'common' package.

The packages with a version number in their name only have contents that
do not conflict with a previous or next version. Having this file in the
version dependent xen-hypervisor package currently prevents us from
being able to co-install the current and next version of Xen.

Since users who install the whole set of hypervisor and utils via the
meta package undoubtedly also want to get the example grub config,
always install the xen-hypervisor-common package in that case, even if
the user ignores Recommends (like I always do).

Also see #852545

Signed-off-by: Hans van Kranenburg <hans@knorrie.org>
debian/.gitignore
debian/changelog
debian/rules.real
debian/templates/control.hypervisor.in
debian/templates/control.main.in
debian/templates/control.system.latest.in
debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg [new file with mode: 0644]
debian/xen-hypervisor-4.8.xen.cfg [deleted file]
debian/xen-hypervisor-common.install [new file with mode: 0644]

index 166b19dffc8c5a37df590db60801446cfbee9925..7d60fbd00ad7869b47d1b91909cf179493b12033 100644 (file)
@@ -16,5 +16,7 @@ __pycache__
 /xen-utils-*.*.*
 !/xen-utils-common.*
 /xen-utils-common/
+!/xen-hypervisor-common.*
+/xen-hypervisor-common/
 *.debhelper*
 *.substvars
index a1a68b9da0c06ab2fca2cfad6df90693077ba5a6..98bcd5ea2526cc06b51c1555242c424477c0b50e 100644 (file)
@@ -35,6 +35,7 @@ xen (4.10.1~pre+2.3921128fcb-1~) UNRELEASED; urgency=medium
   * Rebase patches against 4.10 upstream source.
   * Add README.source.md to document how the packaging works.
   * This package builds correctly with gcc 7. (Closes: #853710)
+  * Fix grub config file conflict when upgrading from Stretch. (Closes: #852545)
 
   [ Mark Pryor ]
   * Fix shared library build dependencies for the new xentoolcore library.
index 175ac33042d6f0e9ab872fbb3b25c516a3039a35..95ecff6cbeb271077cd6bd9bcb08f56b431b9e64 100644 (file)
@@ -18,7 +18,7 @@ binary-arch-arch: install-utils_$(ARCH)
 binary-arch-arch: install-xenstore-utils_$(ARCH)
 binary-arch-flavour: install-hypervisor_$(ARCH)_$(FLAVOUR)
 
-binary-indep: install-utils-common
+binary-indep: install-utils-common install-hypervisor-common
 
 build-arch-arch: $(STAMPS_DIR)/build-utils_$(ARCH)
 build-arch-flavour: $(STAMPS_DIR)/build-hypervisor_$(ARCH)_$(FLAVOUR)
@@ -137,6 +137,12 @@ $(STAMPS_DIR)/install-utils-common: $(STAMPS_DIR)/build-docs
        +$(MAKE_CLEAN) -C debian/scripts install
        touch $@
 
+$(STAMPS_DIR)/install-hypervisor-common: INSTALL_DIR = $(BUILD_DIR)/install-hypervisor-common
+$(STAMPS_DIR)/install-hypervisor-common: $(STAMPS_DIR)/build-docs
+       @rm -rf $(INSTALL_DIR)
+       mkdir -p $(INSTALL_DIR)
+
+
 install-base:
        dh_installchangelogs -XChangelog
        dh_installdirs
@@ -163,10 +169,6 @@ install-hypervisor_$(ARCH)_$(FLAVOUR): $(STAMPS_DIR)/build-hypervisor_$(ARCH)_$(
        dh_testroot
        dh_prep
        dh_installdirs boot
-       # FIXME: Think of better solution (grub used for other arches?)
-       dh_installdirs etc/default/grub.d
-       install -D -m644 debian/xen-hypervisor-$(VERSION).xen.cfg \
-               debian/$(PACKAGE_NAME)/etc/default/grub.d/xen.cfg
        dh_install debian/templates/xen-hypervisor.bug/* usr/share/bug/$(PACKAGE_NAME)
        cp $(DIR)/xen/xen$(IMAGE_SUFFIX) debian/$(PACKAGE_NAME)/boot/xen-$(VERSION)-$(FLAVOUR)$(IMAGE_SUFFIX)
 ifeq ($(ARCH),amd64)
@@ -258,6 +260,17 @@ install-utils-common: $(STAMPS_DIR)/install-utils-common
        dh_ucf
        +$(MAKE_SELF) install-base
 
+install-hypervisor-common: DIR = $(BUILD_DIR)/install-hypervisor-common
+install-hypervisor-common: PACKAGE_NAME = xen-hypervisor-common
+install-hypervisor-common: DH_OPTIONS = -p$(PACKAGE_NAME)
+install-hypervisor-common: $(STAMPS_DIR)/install-hypervisor-common
+       dh_testdir
+       dh_testroot
+       dh_prep
+       dh_install --sourcedir=$(DIR)
+       dh_ucf
+       +$(MAKE_SELF) install-base
+
 install-xenstore-utils_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
 install-xenstore-utils_$(ARCH): PACKAGE_NAME = xenstore-utils
 install-xenstore-utils_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
index 51a47f100d2e544be0db8d04a9677352192a81d8..b27f748fe083626722ed6f8aa630c063f8fd9697 100644 (file)
@@ -1,7 +1,7 @@
 Package: xen-hypervisor-@version@@localversion@
 Depends: ${misc:Depends}
 Provides: xen-hypervisor, xen-hypervisor-@version@, xen-hypervisor@localversion@
-Recommends: xen-utils-@version@
+Recommends: xen-utils-@version@, xen-hypervisor-common
 Description: Xen Hypervisor on @class@
  The hypervisor is the "core" for XEN itself. It gets booted by the boot loader
  and controls cpu and memory, sharing them between your administrative domain
index 932a39e854d52f83b5836db9de478375f5601e6f..bb16fef2509d9c869eb465288c44a0edd63ead4c 100644 (file)
@@ -58,3 +58,15 @@ Description: Xen administrative tools - common files
  .
  This package is only required on the host system (Domain 0) and not on
  the virtual guest systems (Domain U).
+
+Package: xen-hypervisor-common
+Architecture: all
+Depends: ${misc:Depends}
+Replaces: xen-hypervisor-4.8-amd64, xen-hypervisor-4.8-arm64, xen-hypervisor-4.8-armhf
+Description: Xen Hypervisor - common files
+ The configuration which arranges for an installed hypervisor to
+ be booted as default, with the right command line arguments passed
+ to both hypervisor and host (Domain 0) kernel.
+ .
+ This package is only required on the host system (Domain 0) and not on
+ the virtual guest systems (Domain U).
index 730002cc48ad2f70b8fb7ad7877007f2ad0858cd..4130c80d23c8abd941ab1a7f0124e7d19be1e2b1 100644 (file)
@@ -1,5 +1,5 @@
 Package: xen-system@localversion@
-Depends: xen-hypervisor-@version@@localversion@, xen-utils-@version@, ${misc:Depends}
+Depends: xen-hypervisor-@version@@localversion@, xen-hypervisor-common, xen-utils-@version@, ${misc:Depends}
 Provides: xen-system
 Description: Xen System on @class@ (meta-package)
  This package depends on the latest Xen hypervisor for use on @class@ and the Xen utils.
diff --git a/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg b/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg
new file mode 100644 (file)
index 0000000..b2d2f6e
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Uncomment the following variable and set to 0 or 1 to avoid warning.
+#
+#XEN_OVERRIDE_GRUB_DEFAULT=0
+
+echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
+
+#
+# When running update-grub with the Xen hypervisor installed, there are
+# some additional variables that can be used to pass options to the
+# hypervisor or the dom0 kernel.
+
+# The following two are used to generate arguments for the hypervisor:
+#
+#GRUB_CMDLINE_XEN_DEFAULT=""
+#GRUB_CMDLINE_XEN=""
+#
+# For example:
+#
+# dom0_mem=<size>[M]:max=<size>[M]
+#   Sets the amount of memory dom0 uses (max prevents balloning for more)
+# com[12]=<speed>,<data bits><parity><stopbits>
+#   Initialize a serial console from in the hypervisor (eg. 115200,8n1)
+#   Note that com1 would be ttyS0 in Linux.
+# console=<dev>[,<dev> ...]
+#   Redirects Xen hypervisor console (eg. com1,vga)
+
+#
+# The next two lines are used for creating kernel arguments for the dom0
+# kernel. This allows to have different options for the same kernel used
+# natively or as dom0 kernel.
+#
+#GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT"
+#GRUB_CMDLINE_LINUX_XEN_REPLACE="$GRUB_CMDLINE_LINUX"
+#
+# For example:
+#
+# earlyprintk=xenboot
+#   Allows to send early printk messages to the Xen hypervisor console
+# console=hvc0
+#   Redirects the Linux console to the hypervisor console
+
+#
+# Make booting into Xen the default if not changed above. Finding the
+# current string for it always has been a problem.
+#
+if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "" ]; then
+       echo "WARNING: GRUB_DEFAULT changed to boot into Xen by default!"
+       echo "         Edit /etc/default/grub.d/xen.cfg to avoid this warning."
+       XEN_OVERRIDE_GRUB_DEFAULT=1
+fi
+if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "1" ]; then
+       GRUB_DEFAULT="Debian GNU/Linux, with Xen hypervisor"
+fi
diff --git a/debian/xen-hypervisor-4.8.xen.cfg b/debian/xen-hypervisor-4.8.xen.cfg
deleted file mode 100644 (file)
index b2d2f6e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Uncomment the following variable and set to 0 or 1 to avoid warning.
-#
-#XEN_OVERRIDE_GRUB_DEFAULT=0
-
-echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
-
-#
-# When running update-grub with the Xen hypervisor installed, there are
-# some additional variables that can be used to pass options to the
-# hypervisor or the dom0 kernel.
-
-# The following two are used to generate arguments for the hypervisor:
-#
-#GRUB_CMDLINE_XEN_DEFAULT=""
-#GRUB_CMDLINE_XEN=""
-#
-# For example:
-#
-# dom0_mem=<size>[M]:max=<size>[M]
-#   Sets the amount of memory dom0 uses (max prevents balloning for more)
-# com[12]=<speed>,<data bits><parity><stopbits>
-#   Initialize a serial console from in the hypervisor (eg. 115200,8n1)
-#   Note that com1 would be ttyS0 in Linux.
-# console=<dev>[,<dev> ...]
-#   Redirects Xen hypervisor console (eg. com1,vga)
-
-#
-# The next two lines are used for creating kernel arguments for the dom0
-# kernel. This allows to have different options for the same kernel used
-# natively or as dom0 kernel.
-#
-#GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT"
-#GRUB_CMDLINE_LINUX_XEN_REPLACE="$GRUB_CMDLINE_LINUX"
-#
-# For example:
-#
-# earlyprintk=xenboot
-#   Allows to send early printk messages to the Xen hypervisor console
-# console=hvc0
-#   Redirects the Linux console to the hypervisor console
-
-#
-# Make booting into Xen the default if not changed above. Finding the
-# current string for it always has been a problem.
-#
-if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "" ]; then
-       echo "WARNING: GRUB_DEFAULT changed to boot into Xen by default!"
-       echo "         Edit /etc/default/grub.d/xen.cfg to avoid this warning."
-       XEN_OVERRIDE_GRUB_DEFAULT=1
-fi
-if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "1" ]; then
-       GRUB_DEFAULT="Debian GNU/Linux, with Xen hypervisor"
-fi
diff --git a/debian/xen-hypervisor-common.install b/debian/xen-hypervisor-common.install
new file mode 100644 (file)
index 0000000..f8cfab9
--- /dev/null
@@ -0,0 +1 @@
+../../tree/xen-hypervisor-common/* /