kexec -p --command-line="crashkernel=xx hugepages=xx hugepagesz=xx abm=xx irqpoll nr_cpus=1 nousb systemd.unit=kdump-tools.service ata_piix.prefer_ms_hyperv=0" --initrd=/boot/initrd.img-$KVER /var/lib/kdump/vmlinuz
一、kexec -l流程:以 x86_64 bzImage为例
kexec-tools程序解析参数后执行my_load:
1、slurp_decompress_file:读取新内核镜像vmlinuz到kernel_buf;
2、get_memory_ranges:获取kexec使用的内存地址访问;
3、根据命令-t参数指定的镜像文件类型,若未指定,编译执行文件类型对象的probe ops进行文件类型的校验。
4、根据uname信息获取当前设备的cpu类型
5、执行file的load方法bzImage64_load
5.1、读取根文件系统initrd.img存放到ramdisk_buf;
5.2、do_bzImage6