#12 a few fixups for s390x and ostree based systems
Closed 2 years ago by dustymabe. Opened 2 years ago by dustymabe.
rpms/ dustymabe/kexec-tools dusty-fix-kdump-on-s390x  into  rawhide

file modified
+8 -3
@@ -248,9 +248,9 @@ 

  	echo $(get_persistent_dev "$dev")

  }

  

- is_atomic()

+ is_ostree()

  {

- 	grep -q "ostree" /proc/cmdline

+ 	test -f /run/ostree-booted

  }

  

  # get ip address or hostname from nfs/ssh config value
@@ -644,8 +644,13 @@ 

  	boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"}

  	boot_imglist="$KDUMP_IMG-$kdump_kernelver$KDUMP_IMG_EXT $machine_id/$kdump_kernelver/$KDUMP_IMG"

  

+ 	# The kernel of OSTree based systems is not in the standard locations.

+ 	if is_ostree; then

+ 		boot_dirlist="$(echo /boot/ostree/*) $boot_dirlist"

+ 	fi

+ 

  	# Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format

- 	boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"

+ 	boot_img="$(grep -P -o '^BOOT_IMAGE=(\S+)' /proc/cmdline | sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\)/\2/")"

  	if [[ "$boot_img" == *"$kdump_kernelver" ]]; then

  		boot_imglist="$boot_img $boot_imglist"

  	fi

file modified
+5 -5
@@ -1342,7 +1342,7 @@ 

  {

  	local _kernel_path=$1 _crashkernel=$2 _dump_mode=$3 _fadump_val=$4

  

- 	if is_atomic; then

+ 	if is_ostree; then

  		if rpm-ostree kargs | grep -q "crashkernel="; then

  			rpm-ostree kargs --replace="crashkernel=$_crashkernel"

  		else
@@ -1472,13 +1472,13 @@ 

  		esac

  	done

  

- 	# 1. CoreOS uses "rpm-ostree kargs" instead of grubby to manage kernel command

- 	#    line. --kernel=ALL doesn't make sense for CoreOS.

- 	# 2. CoreOS doesn't support POWER so the dump mode is always kdump.

+ 	# 1. OSTree systems use "rpm-ostree kargs" instead of grubby to manage kernel command

+ 	#    line. --kernel=ALL doesn't make sense for OStree.

+ 	# 2. We don't have any OSTree POWER systems so the dump mode is always kdump.

Note that this statement is no longer true. We do have POWER RHCOS and will have power Fedora CoreOS in the near future.

  	# 3. "rpm-ostree kargs" would prompt the user to reboot the system after

  	#    modifying the kernel command line so there is no need for kexec-tools

  	#    to repeat it.

- 	if is_atomic; then

+ 	if is_ostree; then

  		_old_crashkernel=$(rpm-ostree kargs | sed -n -E 's/.*(^|\s)crashkernel=(\S*).*/\2/p')

  		_new_dump_mode=kdump

  		_new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode")

Build succeeded.

rebased onto e6eea66

2 years ago

Note that this statement is no longer true. We do have POWER RHCOS and will have power Fedora CoreOS in the near future.

Build succeeded.

Pull-Request has been closed by dustymabe

2 years ago
Metadata