From 2a773305ecb3d7f5686f933284bc82f2806357bf Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 21:29:01 +0000 Subject: Apply patch 0001-sensors-detect-Fix-printing-CPU-info-on-ppc-and-arm.patch patch_name: 0001-sensors-detect-Fix-printing-CPU-info-on-ppc-and-arm.patch present_in_specfile: true --- diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 4fa4c03..6b03d3b 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -3103,7 +3103,7 @@ sub initialize_cpu_list }; next; } - if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) { + if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level|cpu|revision)\s*:\s*(.+)$/) { my $k = $1; my $v = $2; $v =~ s/\s+/ /g; # Merge multiple spaces @@ -3119,7 +3119,16 @@ sub initialize_cpu_list sub print_cpu_info { my $cpu = $cpu[0]; - print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n"; + if ($kernel_arch =~ m/^ppc(64(le)?)?$/) { + print "# Processor: $cpu->{cpu} ($cpu->{revision})\n"; + } elsif ($kernel_arch =~ m/^arm/) { + print "# Processor: $cpu->{'model name'}\n"; + } elsif (exists $cpu->{'model name'} && exists $cpu->{'cpu family'} + && exists $cpu->{'model'} && exists $cpu->{'stepping'}) { + print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n"; + } else { + print "# Cannot show processor info on $kernel_arch architecture.\n"; + } } # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus