Compare commits
38 Commits
master
...
mm_189588b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
189588b521 | ||
![]() |
b9d1274783 | ||
![]() |
80cca5b530 | ||
![]() |
95ef045a6c | ||
![]() |
f3efd1dc01 | ||
![]() |
67040fe72a | ||
![]() |
009baa7c9a | ||
![]() |
39ce308324 | ||
![]() |
892ce7b0b9 | ||
![]() |
cba881ecd4 | ||
![]() |
0db8239456 | ||
![]() |
d1a67615c7 | ||
![]() |
734ee7c248 | ||
![]() |
0bdff73c30 | ||
![]() |
8b4d479798 | ||
![]() |
38d24af659 | ||
![]() |
706876a703 | ||
![]() |
f6b5a204a0 | ||
![]() |
606a117b06 | ||
![]() |
670e7678f3 | ||
![]() |
96657adf23 | ||
![]() |
0e4e2cf3c4 | ||
![]() |
fedad2780c | ||
![]() |
02beadc381 | ||
![]() |
c799530211 | ||
![]() |
5e5e03e992 | ||
![]() |
8fd5151195 | ||
![]() |
d642d1decb | ||
![]() |
738ddf8e59 | ||
![]() |
f3902991d1 | ||
![]() |
ad9f3374c7 | ||
![]() |
4111545966 | ||
![]() |
cb452983b5 | ||
![]() |
ac27fed47e | ||
![]() |
6fa02f0622 | ||
![]() |
1a8f484db6 | ||
![]() |
72e769ead6 | ||
![]() |
2df4b71291 |
165
0016-drm-change-func-to-better-detect-wether-swiotlb-is-n.patch
Normal file
165
0016-drm-change-func-to-better-detect-wether-swiotlb-is-n.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From 4fcb87529a644016dc00459681efafc542e7c202 Mon Sep 17 00:00:00 2001
|
||||
From: Michael D Labriola <michael.d.labriola@gmail.com>
|
||||
Date: Tue, 19 Feb 2019 18:08:12 -0500
|
||||
Subject: [PATCH] drm: change func to better detect wether swiotlb is needed
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This commit fixes DRM failures on Xen PV systems that were introduced in
|
||||
v4.17 by the following commits:
|
||||
|
||||
82626363 drm: add func to get max iomem address v2
|
||||
fd5fd480 drm/amdgpu: only enable swiotlb alloc when need v2
|
||||
1bc3d3cc drm/radeon: only enable swiotlb path when need v2
|
||||
|
||||
The introduction of ->need_swiotlb to the ttm_dma_populate() conditionals
|
||||
in the radeon and amdgpu device drivers causes Gnome to immediately crash
|
||||
on Xen PV systems, returning the user to the login screen. The following
|
||||
kernel errors get logged:
|
||||
|
||||
[ 28.554259] radeon_dp_aux_transfer_native: 200 callbacks suppressed
|
||||
[ 31.219821] radeon 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes)
|
||||
[ 31.220030] [drm:radeon_gem_object_create [radeon]] *ERROR* Failed to allocate GEM object (16384000, 2, 4096, -14)
|
||||
[ 31.226109] radeon 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes)
|
||||
[ 31.226300] [drm:radeon_gem_object_create [radeon]] *ERROR* Failed to allocate GEM object (16384000, 2, 4096, -14)
|
||||
[ 31.300734] gnome-shell[1935]: segfault at 88 ip 00007f39151cd904 sp 00007ffc97611ad8 error 4 in libmutter-cogl.so[7f3915178000+aa000]
|
||||
[ 31.300745] Code: 5f c3 0f 1f 40 00 48 8b 47 78 48 8b 40 40 ff e0 66 0f 1f 44 00 00 48 8b 47 78 48 8b 40 48 ff e0 66 0f 1f 44 00 00 48 8b 47 78 <48> 8b 80 88 00 00 00 ff e0 0f 1f 00 48 8b 47 78 48 8b 40 68 ff e0
|
||||
[ 38.193302] radeon_dp_aux_transfer_native: 116 callbacks suppressed
|
||||
[ 40.009317] radeon 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes)
|
||||
[ 40.009488] [drm:radeon_gem_object_create [radeon]] *ERROR* Failed to allocate GEM object (16384000, 2, 4096, -14)
|
||||
[ 40.015114] radeon 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes)
|
||||
[ 40.015297] [drm:radeon_gem_object_create [radeon]] *ERROR* Failed to allocate GEM object (16384000, 2, 4096, -14)
|
||||
[ 40.028302] gnome-shell[2431]: segfault at 2dadf40 ip 0000000002dadf40 sp 00007ffcd24ea5f8 error 15
|
||||
[ 40.028306] Code: 20 6e 31 00 00 00 00 00 00 00 00 37 e3 3d 2d 7f 00 00 80 f4 e6 3d 2d 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 c1 00 00 00 00 00 00 00 80 e1 d2 03 00 00
|
||||
|
||||
This commit renames drm_get_max_iomem() to drm_need_swiotlb(), adds a
|
||||
xen_pv_domain() check to it, and moves the bit shifting comparison that
|
||||
always follows its usage into the function (simplifying the drm driver
|
||||
code).
|
||||
|
||||
Signed-off-by: Michael D Labriola <michael.d.labriola@gmail.com>
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
Link: https://patchwork.freedesktop.org/patch/286987/
|
||||
(cherry picked from commit 913b2cb727b7a47ccf8842d54c89f1b873c6deed)
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +-
|
||||
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +-
|
||||
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +-
|
||||
drivers/gpu/drm/drm_memory.c | 19 ++++++++++++++++---
|
||||
drivers/gpu/drm/radeon/radeon_device.c | 2 +-
|
||||
include/drm/drm_cache.h | 2 +-
|
||||
6 files changed, 21 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
|
||||
index f8d8a3a73e42..cd5bb3e248dc 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
|
||||
@@ -1024,7 +1024,7 @@ static int gmc_v7_0_sw_init(void *handle)
|
||||
pci_set_consistent_dma_mask(adev->pdev, DMA_BIT_MASK(32));
|
||||
pr_warn("amdgpu: No coherent DMA available\n");
|
||||
}
|
||||
- adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
|
||||
+ adev->need_swiotlb = drm_need_swiotlb(dma_bits);
|
||||
|
||||
r = gmc_v7_0_init_microcode(adev);
|
||||
if (r) {
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
index 1a744f964b30..831f72b26d3b 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
@@ -1150,7 +1150,7 @@ static int gmc_v8_0_sw_init(void *handle)
|
||||
pci_set_consistent_dma_mask(adev->pdev, DMA_BIT_MASK(32));
|
||||
pr_warn("amdgpu: No coherent DMA available\n");
|
||||
}
|
||||
- adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
|
||||
+ adev->need_swiotlb = drm_need_swiotlb(dma_bits);
|
||||
|
||||
r = gmc_v8_0_init_microcode(adev);
|
||||
if (r) {
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
|
||||
index 72f8018fa2a8..9ec47e726d78 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
|
||||
@@ -911,7 +911,7 @@ static int gmc_v9_0_sw_init(void *handle)
|
||||
pci_set_consistent_dma_mask(adev->pdev, DMA_BIT_MASK(32));
|
||||
printk(KERN_WARNING "amdgpu: No coherent DMA available.\n");
|
||||
}
|
||||
- adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
|
||||
+ adev->need_swiotlb = drm_need_swiotlb(dma_bits);
|
||||
|
||||
r = gmc_v9_0_mc_init(adev);
|
||||
if (r)
|
||||
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
|
||||
index d69e4fc1ee77..6af59a61f9b0 100644
|
||||
--- a/drivers/gpu/drm/drm_memory.c
|
||||
+++ b/drivers/gpu/drm/drm_memory.c
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/export.h>
|
||||
+#include <xen/xen.h>
|
||||
#include <drm/drmP.h>
|
||||
#include "drm_legacy.h"
|
||||
|
||||
@@ -150,15 +151,27 @@ void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL(drm_legacy_ioremapfree);
|
||||
|
||||
-u64 drm_get_max_iomem(void)
|
||||
+bool drm_need_swiotlb(int dma_bits)
|
||||
{
|
||||
struct resource *tmp;
|
||||
resource_size_t max_iomem = 0;
|
||||
|
||||
+ /*
|
||||
+ * Xen paravirtual hosts require swiotlb regardless of requested dma
|
||||
+ * transfer size.
|
||||
+ *
|
||||
+ * NOTE: Really, what it requires is use of the dma_alloc_coherent
|
||||
+ * allocator used in ttm_dma_populate() instead of
|
||||
+ * ttm_populate_and_map_pages(), which bounce buffers so much in
|
||||
+ * Xen it leads to swiotlb buffer exhaustion.
|
||||
+ */
|
||||
+ if (xen_pv_domain())
|
||||
+ return true;
|
||||
+
|
||||
for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
|
||||
max_iomem = max(max_iomem, tmp->end);
|
||||
}
|
||||
|
||||
- return max_iomem;
|
||||
+ return max_iomem > ((u64)1 << dma_bits);
|
||||
}
|
||||
-EXPORT_SYMBOL(drm_get_max_iomem);
|
||||
+EXPORT_SYMBOL(drm_need_swiotlb);
|
||||
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
|
||||
index 59c8a6647ff2..a1d3c628c352 100644
|
||||
--- a/drivers/gpu/drm/radeon/radeon_device.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_device.c
|
||||
@@ -1387,7 +1387,7 @@ int radeon_device_init(struct radeon_device *rdev,
|
||||
pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(32));
|
||||
pr_warn("radeon: No coherent DMA available\n");
|
||||
}
|
||||
- rdev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
|
||||
+ rdev->need_swiotlb = drm_need_swiotlb(dma_bits);
|
||||
|
||||
/* Registers mapping */
|
||||
/* TODO: block userspace mapping of io register */
|
||||
diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h
|
||||
index 97fc498dc767..987ff16b9420 100644
|
||||
--- a/include/drm/drm_cache.h
|
||||
+++ b/include/drm/drm_cache.h
|
||||
@@ -38,7 +38,7 @@
|
||||
void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
|
||||
void drm_clflush_sg(struct sg_table *st);
|
||||
void drm_clflush_virt_range(void *addr, unsigned long length);
|
||||
-u64 drm_get_max_iomem(void);
|
||||
+bool drm_need_swiotlb(int dma_bits);
|
||||
|
||||
|
||||
static inline bool drm_arch_can_wc_memory(void)
|
||||
--
|
||||
2.17.2
|
||||
|
36
0017-drm-amdgpu-fix-dma-mask-check-in-gmc_v6_0.c.patch
Normal file
36
0017-drm-amdgpu-fix-dma-mask-check-in-gmc_v6_0.c.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 559355f62291c332163dad1627a9f837d0df1dd8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
||||
Date: Wed, 20 Feb 2019 13:46:24 +0100
|
||||
Subject: [PATCH] drm/amdgpu: fix dma mask check in gmc_v6_0.c
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This got messed up by "drm: change func to better detect wether swiotlb
|
||||
is needed".
|
||||
|
||||
Signed-off-by: Christian König <christian.koenig@amd.com>
|
||||
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Reviewed-by: Michael D Labriola <michael.d.labriola@gmail.com>
|
||||
Link: https://patchwork.freedesktop.org/patch/287070/
|
||||
(cherry picked from commit 1fdafbd023793e754aa6ca73c877a375e83b8239)
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
|
||||
index db406a35808f..fb8433958f85 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
|
||||
@@ -880,7 +880,7 @@ static int gmc_v6_0_sw_init(void *handle)
|
||||
pci_set_consistent_dma_mask(adev->pdev, DMA_BIT_MASK(32));
|
||||
dev_warn(adev->dev, "amdgpu: No coherent DMA available.\n");
|
||||
}
|
||||
- adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits);
|
||||
+ adev->need_swiotlb = drm_need_swiotlb(dma_bits);
|
||||
|
||||
r = gmc_v6_0_init_microcode(adev);
|
||||
if (r) {
|
||||
--
|
||||
2.17.2
|
||||
|
@ -53,6 +53,7 @@ BuildRequires: gcc-plugin-devel
|
||||
BuildRequires: elfutils-libelf-devel
|
||||
BuildRequires: bison
|
||||
BuildRequires: flex
|
||||
BuildRequires: e2fsprogs
|
||||
|
||||
# gcc with support for BTI mitigation
|
||||
%if 0%{?fedora} == 23
|
||||
@ -116,6 +117,8 @@ Patch11: 0012-xen-blkfront-make-local-copy-of-response-before-usin.patch
|
||||
Patch12: 0013-xen-blkfront-prepare-request-locally-only-then-put-i.patch
|
||||
Patch13: 0014-xen-pcifront-pciback-Update-pciif.h-with-err-and-res.patch
|
||||
Patch14: 0015-xen-pciback-add-attribute-to-allow-MSI-enable-flag-w.patch
|
||||
Patch15: 0016-drm-change-func-to-better-detect-wether-swiotlb-is-n.patch
|
||||
Patch16: 0017-drm-amdgpu-fix-dma-mask-check-in-gmc_v6_0.c.patch
|
||||
|
||||
%description
|
||||
Qubes Dom0 kernel.
|
||||
@ -161,9 +164,11 @@ make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
u2mfn_ver=`dkms status u2mfn|tail -n 1|cut -f 2 -d ' '|tr -d ':,:'`
|
||||
rm -rf %_builddir/u2mfn
|
||||
cp -r /usr/src/u2mfn-$u2mfn_ver %_builddir/u2mfn
|
||||
u2mfn_ver=`dkms status u2mfn|tail -n 1|cut -f 2 -d ' '|tr -d ':,:'`
|
||||
if [ -n "$u2mfn_ver" ]; then
|
||||
cp -r /usr/src/u2mfn-$u2mfn_ver %_builddir/u2mfn
|
||||
fi
|
||||
|
||||
%build
|
||||
|
||||
@ -182,7 +187,9 @@ export AFTER_LINK=\
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
|
||||
# Build u2mfn module
|
||||
make -C %kernel_build_dir M=%_builddir/u2mfn modules
|
||||
if [ -d "%_builddir/u2mfn" ]; then
|
||||
make -C %kernel_build_dir M=%_builddir/u2mfn modules
|
||||
fi
|
||||
|
||||
%install
|
||||
|
||||
@ -217,7 +224,9 @@ dd if=/dev/zero of=%buildroot/boot/initramfs-%kernelrelease.img \
|
||||
gzip -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/u2mfn
|
||||
if [ -d "%_builddir/u2mfn" ]; then
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/u2mfn
|
||||
fi
|
||||
|
||||
mkdir -p %buildroot/%src_install_dir
|
||||
|
||||
@ -370,14 +379,27 @@ if [ -z "$modules_dep" ]; then
|
||||
depmod -F %buildroot/boot/System.map-%kernelrelease \
|
||||
-b "$tmpdir" -a %kernelrelease || exit 1
|
||||
pushd "$tmpdir"
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
||||
find . -exec touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" {} +
|
||||
fi
|
||||
find . -print0 | sort -z \
|
||||
| cpio --null -R 0:0 -H newc -o --quiet \
|
||||
| gzip > %buildroot/%vm_install_dir/initramfs || exit 1
|
||||
| cpio --null -R 0:0 -H newc -o --reproducible --quiet \
|
||||
| gzip -n > %buildroot/%vm_install_dir/initramfs || exit 1
|
||||
popd
|
||||
fi
|
||||
|
||||
cp -p arch/x86/boot/bzImage %buildroot/%vm_install_dir/vmlinuz
|
||||
|
||||
# default kernel options for this kernel
|
||||
def_kernelopts="root=/dev/mapper/dmroot ro nomodeset console=hvc0"
|
||||
def_kernelopts="$def_kernelopts rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0"
|
||||
if [ -e /usr/lib/dracut/modules.d/90qubes-vm-simple/xen-scrub-pages-supported ]; then
|
||||
# set xen_scrub_pages=0 _only_ when included initramfs does support
|
||||
# re-enabling it
|
||||
def_kernelopts="$def_kernelopts xen_scrub_pages=0"
|
||||
fi
|
||||
echo "$def_kernelopts " > %buildroot/%vm_install_dir/default-kernelopts-common.txt
|
||||
|
||||
# Modules for Qubes VM
|
||||
mkdir -p %buildroot%vm_install_dir/modules
|
||||
cp -a %buildroot/lib/modules/%kernelrelease %buildroot%vm_install_dir/modules/
|
||||
@ -389,6 +411,21 @@ cp -a %buildroot/lib/firmware/%kernelrelease %buildroot%vm_install_dir/modules/f
|
||||
rm -f %buildroot%vm_install_dir/modules/%kernelrelease/build
|
||||
cp -a %buildroot/%src_install_dir %buildroot%vm_install_dir/modules/%kernelrelease/build
|
||||
|
||||
%if 0%{?fedora} >= 25
|
||||
# include kernel+initramfs also inside modules.img, for direct kernel boot with
|
||||
# stubdomain
|
||||
cp %buildroot%vm_install_dir/vmlinuz %buildroot%vm_install_dir/modules/
|
||||
cp %buildroot%vm_install_dir/initramfs %buildroot%vm_install_dir/modules/
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
||||
find %buildroot%vm_install_dir/modules \
|
||||
-exec touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" {} +
|
||||
fi
|
||||
PATH="/sbin:$PATH" mkfs.ext3 -d %buildroot%vm_install_dir/modules \
|
||||
-U dcee2318-92bd-47a5-a15d-e79d1412cdce \
|
||||
%buildroot%vm_install_dir/modules.img 500M
|
||||
rm -rf %buildroot%vm_install_dir/modules
|
||||
%endif
|
||||
|
||||
# remove files that will be auto generated by depmod at rpm -i time
|
||||
for i in alias alias.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap
|
||||
do
|
||||
@ -399,11 +436,25 @@ done
|
||||
/sbin/depmod -a %{kernelrelease}
|
||||
|
||||
%posttrans
|
||||
# with kernel-4.14+ plymouth detects hvc0 serial console and forces text boot
|
||||
# we simply make plymouth ignore it to recover the splash screen
|
||||
if [ -f /etc/default/grub ]; then
|
||||
if ! grep -q plymouth.ignore-serial-consoles /etc/default/grub; then
|
||||
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX plymouth.ignore-serial-consoles"' >> /etc/default/grub
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f /boot/efi/EFI/qubes/xen.cfg ]; then
|
||||
if ! grep -q plymouth.ignore-serial-consoles /boot/efi/EFI/qubes/xen.cfg; then
|
||||
sed -i 's/kernel=.*/& plymouth.ignore-serial-consoles/g' /boot/efi/EFI/qubes/xen.cfg
|
||||
fi
|
||||
fi
|
||||
|
||||
/bin/kernel-install add %{kernelrelease} /boot/vmlinuz-%{kernelrelease} || exit $?
|
||||
|
||||
# grubby (used by new-kernel-pkg) do not understand xen entries in grub2 config
|
||||
if [ -x /sbin/new-kernel-pkg -a -e /boot/grub2/grub.cfg ]; then
|
||||
grub2-mkconfig > /boot/grub2/grub.cfg
|
||||
grub2-mkconfig > /boot/grub2/grub.cfg
|
||||
fi
|
||||
|
||||
%preun
|
||||
@ -425,7 +476,7 @@ License: GPL v2 only
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %kernelrelease
|
||||
%if "%{name_suffix}" != ""
|
||||
%if "%{?name_suffix}" != ""
|
||||
Provides: kernel-devel = %kernelrelease
|
||||
%endif
|
||||
Provides: kernel-devel-uname-r = %kernelrelease
|
||||
@ -484,6 +535,7 @@ Qubes domU kernel.
|
||||
|
||||
%post qubes-vm
|
||||
|
||||
%if 0%{?fedora} < 25
|
||||
mkdir /tmp/qubes-modules-%kernelrelease
|
||||
truncate -s 500M /tmp/qubes-modules-%kernelrelease.img
|
||||
mkfs -t ext3 -F /tmp/qubes-modules-%kernelrelease.img > /dev/null
|
||||
@ -496,14 +548,18 @@ cp %vm_install_dir/initramfs /tmp/qubes-modules-%kernelrelease/
|
||||
umount /tmp/qubes-modules-%kernelrelease
|
||||
rmdir /tmp/qubes-modules-%kernelrelease
|
||||
mv /tmp/qubes-modules-%kernelrelease.img %vm_install_dir/modules.img
|
||||
%endif
|
||||
|
||||
%if "%{name_suffix}" == ""
|
||||
current_default="$(qubes-prefs default-kernel)"
|
||||
current_default_path="/var/lib/qubes/vm-kernels/$current_default"
|
||||
current_default_package="$(rpm --qf '%{NAME}' -qf "$current_default_path")"
|
||||
if [ "$current_default_package" = "%{name}-qubes-vm" ]; then
|
||||
# Set kernel as default VM kernel if we are the default package.
|
||||
|
||||
# If qubes-prefs isn't installed yet, the default kernel will be set by %post
|
||||
# of qubes-core-dom0
|
||||
type qubes-prefs &>/dev/null && qubes-prefs --set default-kernel %version-%plainrel
|
||||
%endif
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@ -523,10 +579,17 @@ exit 0
|
||||
%files qubes-vm
|
||||
%defattr(-, root, root)
|
||||
%dir %vm_install_dir
|
||||
%if 0%{?fedora} < 25
|
||||
%ghost %attr(0644, root, root) %vm_install_dir/modules.img
|
||||
%else
|
||||
%attr(0644, root, root) %vm_install_dir/modules.img
|
||||
%endif
|
||||
%attr(0644, root, root) %vm_install_dir/initramfs
|
||||
%attr(0644, root, root) %vm_install_dir/vmlinuz
|
||||
%if 0%{?fedora} < 25
|
||||
%vm_install_dir/modules
|
||||
%endif
|
||||
%attr(0644, root, root) %vm_install_dir/default-kernelopts-common.txt
|
||||
|
||||
%changelog
|
||||
@CHANGELOG@
|
||||
|
Loading…
Reference in New Issue
Block a user