我正在运行Arch,并设置了kdump,以便当当前内核恐慌(或者我通过sysrq+c手动诱导崩溃)时,另一个内核( kexec内核)启动,以便创建崩溃转储,以便以后可以检查它。
问题是,无论这是从控制台还是从Xorg内部触发,在整个kexec版内核的显示过程中,相同的屏幕仍然存在,因此我无法看到它在做什么。
例如,在使用AMD/Radeon的非i 915笔记本电脑上,这并不是一个问题。
我已经尝试了用于kexec内核的以下内核args,它们对此问题没有任何影响:
systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0我目前使用的、没有效果的完整ExecStart=行是:ExecStart=/usr/bin/kexec -p /boot/vmlinuz-linux-git --initrd=/boot/initramfs-linux-git.img --reuse-cmdline --reset-vga --console-vga "--append=root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0"
因此,当内核恐慌时,在恐慌时出现的X或控制台屏幕将留在屏幕上,直到kexec内核完成保存转储文件并重新启动为止。
当主内核的crashkernel= arg太低时,kexec内核可以在makedumpfile期间进行OOM,因此我不知道为什么它在x分钟后没有重新启动,因为我看不到它的屏幕。
我想我需要一些(工作)方式来切换到80x25模式,或者告诉kexec内核重置i915视频卡,这样它就可以正常地重新输入它了吗?
编辑:不使用EFI,使用grub+MBR也有一些主要的内核信息:
[ 0.275493] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux-git root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a rw root_trim=yes rd.luks.allow-discards rd.luks.options=discard ipv6.disable=1 ipv6.disable_ipv6=1 ipv6.autoconf=0 loglevel=15 log_buf_len=16M ignore_loglevel printk.always_kmsg_dump=y printk.time=y printk.devkmsg=on mminit_loglevel=4 memory_corruption_check=1 fbcon=scrollback:4096k fbcon=font:ProFont6x11 net.ifnames=0 nolvm dobtrfs console=tty1 earlyprintk=vga audit=0 systemd.log_target=kmsg systemd.journald.forward_to_console=1 enforcing=0 udev.children-max=1256 rd.udev.children-max=1256 nohz=on oops=panic crashkernel=1024M panic=0 page_poison=1 psi=1 sysrq_always_enabled random.trust_cpu=off logo.nologo lpj=0 mce=bootlog reboot=force,cold noexec=on nohibernate scsi_mod.use_blk_mq=1 consoleblank=120 mitigations=off nospectre_v1 nospectre_v2 spectre_v2=off nospec_store_bypass_disable kvm-intel.vmentry_l1d_flush=never l1tf=off nopti pti=off no_stf_barrier noibrs noibpb ssbd=force-off spectre_v2_user=off noretpoline mds=off rd.log=all noefi cpuidle.governor=menu zram.num_devices=3 zswap.enabled=0 zswap.same_filled_pages_enabled=1 zswap.compressor=zstd zswap.max_pool_percent=40 zswap.zpool=z3fold vsyscall=none i915.enable_fbc=1 i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1
[ 0.845622] device: 'fbcon': device_add
[ 0.845626] PM: Adding info for No Bus:fbcon
...
[ 4.416734] fbcon: i915drmfb (fb0) is primary device
...
[ 4.494499] i915 0000:00:02.0: fb0: i915drmfb frame buffer device下面是主内核和kexec内核之间的cmdline word diff:
diff --git a/home/user/logs/pri_kernel.log b/home/user/logs/kexeckernel.log
index e6d2815..9b90a12 100644
--- a/home/user/logs/pri_kernel.log
+++ b/home/user/logs/kexeckernel.log
@@ -1,2 +1,2 @@
[ 0.000000] Command line:
-BOOT_IMAGE=/boot/vmlinuz-linux-git
root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a rw root_trim=yes rd.luks.allow-discards rd.luks.options=discard ipv6.disable=1 ipv6.disable_ipv6=1 ipv6.autoconf=0 loglevel=15 log_buf_len=16M ignore_loglevel printk.always_kmsg_dump=y printk.time=y printk.devkmsg=on mminit_loglevel=4 memory_corruption_check=1 fbcon=scrollback:4096k fbcon=font:ProFont6x11 net.ifnames=0 nolvm dobtrfs console=tty1 earlyprintk=vga audit=0 systemd.log_target=kmsg systemd.journald.forward_to_console=1 enforcing=0 udev.children-max=1256 rd.udev.children-max=1256 nohz=on oops=panic
-crashkernel=1024M
panic=0 page_poison=1 psi=1 sysrq_always_enabled random.trust_cpu=off logo.nologo lpj=0 mce=bootlog reboot=force,cold noexec=on nohibernate scsi_mod.use_blk_mq=1 consoleblank=120 mitigations=off nospectre_v1 nospectre_v2 spectre_v2=off nospec_store_bypass_disable kvm-intel.vmentry_l1d_flush=never l1tf=off nopti pti=off no_stf_barrier noibrs noibpb ssbd=force-off spectre_v2_user=off noretpoline mds=off rd.log=all noefi cpuidle.governor=menu zram.num_devices=3 zswap.enabled=0 zswap.same_filled_pages_enabled=1 zswap.compressor=zstd zswap.max_pool_percent=40 zswap.zpool=z3fold vsyscall=none i915.enable_fbc=1 i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1
+root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0 acpi_rsdp=0xf05b0 elfcorehdr=2588032K
~
~除了cmdline之外,在kexec内核dmesg中没有提到i915。
发布于 2019-09-10 13:34:25
我刚刚通过在内核中构建i915驱动程序(CONFIG_DRM_I915=y)来解决这个问题,而不是作为一个模块(CONFIG_DRM_I915=m),它需要CONFIG_DRM=y而不是=m。
执行上述两个更改,下面是make nconfig在.config中实际更改的内容:
--- .config.old 2019-09-10 12:38:12.798272432 +0200
+++ .config 2019-09-10 15:17:26.327144324 +0200
@@ -2279,7 +2279,7 @@ CONFIG_I2C_MUX=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=m
-CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOBIT=y
#
# I2C Hardware Bus support
@@ -3124,11 +3124,12 @@ CONFIG_AGP_INTEL=y
CONFIG_INTEL_GTT=y
# CONFIG_VGA_ARB is not set
# CONFIG_VGA_SWITCHEROO is not set
-CONFIG_DRM=m
+CONFIG_DRM=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_DP_AUX_CHARDEV=y
+# CONFIG_DRM_DEBUG_MM is not set
# CONFIG_DRM_DEBUG_SELFTEST is not set
-CONFIG_DRM_KMS_HELPER=m
+CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_KMS_FB_HELPER=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
@@ -3160,7 +3161,7 @@ CONFIG_DRM_I2C_NXP_TDA998X=m
# end of ACP (Audio CoProcessor) Configuration
# CONFIG_DRM_NOUVEAU is not set
-CONFIG_DRM_I915=m
+CONFIG_DRM_I915=y
CONFIG_DRM_I915_ALPHA_SUPPORT=y
CONFIG_DRM_I915_FORCE_PROBE="*"
CONFIG_DRM_I915_CAPTURE_ERROR=y
@@ -3223,7 +3224,7 @@ CONFIG_DRM_PANEL_BRIDGE=y
# CONFIG_DRM_TINYDRM is not set
# CONFIG_DRM_VBOXVIDEO is not set
# CONFIG_DRM_LEGACY is not set
-CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=m
+CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
#
# Frame buffer Devices
@@ -3236,11 +3237,11 @@ CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SYS_FILLRECT=m
-CONFIG_FB_SYS_COPYAREA=m
-CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
-CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
# CONFIG_FB_MODE_HELPERS is not set
CONFIG_FB_TILEBLITTING=y
@@ -3265,7 +3266,6 @@ CONFIG_FB_VESA=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_LE80578 is not set
-# CONFIG_FB_INTEL is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set我将所有的kexec内核args从OP中保存下来,它就能工作了!我还从OP中删除了所有的i915 args,它仍然工作,如下所示:systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9
现在,视频模式被重置了,我可以看到kexec内核中的所有内容,从启动到启动的0.2秒。
这很可能是它(已经)在AMD/Radeon上工作的原因: had DRM_RADEON=y和CONFIG_DRM=y。
更新:我找到了另一种方法:
如果您想将i915和drm保留为内核模块,只需确保/etc/mkintcpio.conf有MODULES=(i915 drm fbcon) (老实说,不确定是否需要)和(可能不需要) /etc/modules-load.d/i915.conf在一行上有i915。
此方法也有效,但最古老的dmesg行在启动时为4.3秒(而内核i 915/drm为0.2秒)。
^换句话说,确保initrd/initramfs映像有那些模块供kexec内核在启动时尽早加载。
https://unix.stackexchange.com/questions/539996
复制相似问题