xen4centos kernel version / debuginfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any problem moving to 4.9.31? This contains upstream commits f2e767bb5d6ee0d9 for mpt3sas and
69861e0a52f87333 for dom0 memory mappings.

I am also trying to build a debuginfo package but it's not correct. Specifically I'm able to get vmlinux but the .debug files for modules are
stripped, which isn't right. Does anyone know how to fix this?

I'm also not sure how you're supposed to build the kernel-firmware package with the current spec file definition.

--Sarah
diff --git a/SOURCES/config-x86_64 b/SOURCES/config-x86_64
index 93bee84..33df253 100644
--- a/SOURCES/config-x86_64
+++ b/SOURCES/config-x86_64
@@ -631,7 +631,7 @@ CONFIG_LEGACY_VSYSCALL_EMULATE=y
 # CONFIG_CMDLINE_BOOL is not set
 CONFIG_MODIFY_LDT_SYSCALL=y
 CONFIG_HAVE_LIVEPATCH=y
-# CONFIG_LIVEPATCH is not set
+CONFIG_LIVEPATCH=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 CONFIG_USE_PERCPU_NUMA_NODE_ID=y
diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec
index 17fe8eb..8f5990f 100644
--- a/SPECS/kernel.spec
+++ b/SPECS/kernel.spec
@@ -8,7 +8,7 @@
 %endif
  
 # Define the version of the Linux Kernel Archive tarball.
-%define LKAver 4.9.25 
+%define LKAver 4.9.31
 
 # Define the buildid, if required.
 #define buildid .1
@@ -33,6 +33,13 @@
 %define with_vdso_install %{?_without_vdso_install: 0} %{?!_without_vdso_install: 1}
 # use dracut instead of mkinitrd
 %define with_dracut       %{?_without_dracut:       0} %{?!_without_dracut:       1}
+# kernel-debuginfo
+%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
+
+%if !%{with_debuginfo}
+%define _enable_debug_packages 0
+%endif
+%define debuginfodir /usr/lib/debug
 
 # Build only the kernel-doc & kernel-firmware packages.
 %ifarch noarch
@@ -42,6 +49,7 @@
 %define with_perf 0
 %define with_vdso_install 0
 %define with_firmware 0
+%define with_debuginfo 0
 %endif
 
 # Build only the 32-bit kernel-headers package.
@@ -91,7 +99,7 @@
 %endif
 
 # Set pkg_release.
-%define pkg_release 27%{?buildid}%{?dist}
+%define pkg_release 28%{?buildid}%{?dist}
 
 #
 # Three sets of minimum package version requirements in the form of Conflicts.
@@ -170,6 +178,7 @@ BuildRequires: xmlto, asciidoc, bc
 %if %{with_perf}
 BuildRequires: elfutils-libelf-devel zlib-devel binutils-devel newt-devel, numactl-devel
 BuildRequires: python-devel perl(ExtUtils::Embed) gtk2-devel bison 
+BuildRequires: elfutils-devel systemtap-sdt-devel audit-libs-devel
 %endif
 BuildRequires: python openssl-devel
 
@@ -186,7 +195,7 @@ Source3: config-x86_64
 Patch10000: blktap2.patch
 Patch10001: export-for-xenfb2.patch
 #Patch10002: xen-apic-id-fix.patch
-Patch10003: xen-nested-dom0-fix.patch
+#Patch10003: xen-nested-dom0-fix.patch
 
 %description
 This package provides the Linux kernel (vmlinuz), the core of any
@@ -300,6 +309,14 @@ Provides: perl(Perf::Trace::Util) = 0.01
 This package provides the perf tool and the supporting documentation.
 %endif
 
+%if %{with_debuginfo}
+%package debuginfo
+Summary: Kernel source files used by %{name}-debuginfo packages
+Group: Development/Debug
+%description debuginfo
+This package provides debug information for kernel-%{version}-%{release}.
+%endif
+
 # Disable the building of the debug package(s).
 %define debug_package %{nil}
 
@@ -335,11 +352,23 @@ pushd linux-%{version}-%{release}.%{_target_cpu} > /dev/null
 %patch10000 -p1
 %patch10001 -p1
 #%patch10002 -p1
-%patch10003 -p1
+#%patch10003 -p1
 
 popd > /dev/null
 
 %build
+
+%if %{with_debuginfo}
+# This override tweaks the kernel makefiles so that we run debugedit on an
+# object before embedding it.  When we later run find-debuginfo.sh, it will
+# run debugedit again.  The edits it does change the build ID bits embedded
+# in the stripped object, but repeating debugedit is a no-op.  We do it
+# beforehand to get the proper final build ID bits into the embedded image.
+# This affects the vDSO images in vmlinux, and the vmlinux image in bzImage.
+export AFTER_LINK=\
+'sh -xc "/usr/lib/rpm/debugedit -b $$RPM_BUILD_DIR -d /usr/src/debug -i $@"'
+%endif
+
 BuildKernel() {
     Flavour=$1
 
@@ -361,6 +390,11 @@ BuildKernel() {
     %{__make} -s CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=%{buildarch} V=1 %{?_smp_mflags} modules
 
     # Install the results into the RPM_BUILD_ROOT directory.
+%if %{with_debuginfo}
+    mkdir -p $RPM_BUILD_ROOT%{debuginfodir}/boot
+    install -m 644 System.map $RPM_BUILD_ROOT/%{debuginfodir}/boot/System.map-%{KVRFA}
+%endif
+
     %{__mkdir_p} $RPM_BUILD_ROOT/boot
     %{__install} -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KVRFA}
     %{__install} -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KVRFA}
@@ -469,6 +503,14 @@ hwcap 1 nosegneg"
     touch -r $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/Makefile $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/include/generated/autoconf.h
     touch -r $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/Makefile $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/include/generated/uapi/linux/version.h
 
+    #
+    # save the vmlinux file for kernel debugging into the kernel-debuginfo rpm
+    #
+%if %{with_debuginfo}
+    mkdir -p $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/%{KVRFA}
+    cp vmlinux $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/%{KVRFA}
+%endif
+
     # Remove any 'left-over' .cmd files.
     /usr/bin/find $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/ -type f -name "*.cmd" | xargs --no-run-if-empty %{__rm} -f
 
@@ -553,6 +595,20 @@ find Documentation -type d | xargs %{__chmod} u+w
 
 popd > /dev/null
 
+%if %{with_debuginfo}
+
+%define __debug_install_post \
+  /usr/lib/rpm/find-debuginfo.sh --strict-build-id %{_builddir}/%{?buildsubdir}\
+%{nil}
+
+%ifnarch noarch
+%global __debug_package 1
+%files -f debugfiles.list debuginfo
+%defattr(-,root,root)
+%endif
+
+%endif
+
 %install
 pushd linux-%{version}-%{release}.%{_target_cpu} > /dev/null
 
@@ -825,6 +881,12 @@ fi
 %endif
 
 %changelog
+* Sun Jun 11 2017 Sarah Newman <srn@xxxxxxxxx> 4.9.31-28
+- Upgraded to LTS 4.9.31, removed patch 10003 as it is now
+  in the upstream kernel.
+- Enable livepatch
+- Add debuginfo
+
 * Wed May  3 2017 Johnny Hughes <johnny@xxxxxxxxxx> 4.9.25-27
 - Upgraded to LTS 4.9.25, removed patch 10002 as it is now 
   in the upstream kernel.

_______________________________________________
CentOS-virt mailing list
CentOS-virt@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos-virt

[Index of Archives]     [CentOS Users]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Linux USB]

  Powered by Linux