Browse Source

change back to new installkernel script

* add bpftool
* use new install kernel and add install files

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 2 years ago
parent
commit
f8dfe055dc
  1. 34
      SPECS/kernel-6.1.spec

34
SPECS/kernel-6.1.spec

@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
# These architectures install vdso/ directories.
%define vdso_arches i686 x86_64 ppc64 ppc64le


# Per-architecture tweaks.

# Architecture defaults.
@ -44,6 +43,7 @@ @@ -44,6 +43,7 @@
%define with_perf 0
%define with_tools 0
%define with_bootwrapper 0
%define with_bpftool 0
%endif

%ifarch i686
@ -61,6 +61,7 @@ @@ -61,6 +61,7 @@
%define hdrarch x86_64
%define configarch x86_64
%define with_doc 0
%define with_bpftool 1
%define with_bootwrapper 0
%define make_target bzImage
%endif
@ -72,6 +73,7 @@ @@ -72,6 +73,7 @@
%define hdrarch powerpc
%define configarch ppc64
%define with_doc 0
%define with_bpftool 1
%define with_bootwrapper 1
%define make_target vmlinux
%endif
@ -83,6 +85,7 @@ @@ -83,6 +85,7 @@
%define hdrarch powerpc
%define configarch ppc64le
%define with_doc 0
%define with_bpftool 1
%define with_bootwrapper 1
%define make_target vmlinux
%endif
@ -93,6 +96,7 @@ @@ -93,6 +96,7 @@
%define hdrarch arm64
%define configarch rpi3b64
%define with_doc 0
%define with_bpftool 1
%define with_bootwrapper 0
%define make_target vmlinux
%endif
@ -373,6 +377,9 @@ BuildKernel() { @@ -373,6 +377,9 @@ BuildKernel() {

%define KVRFA %{version}-%{release}${Flavour}.%{_target_cpu}

%{__mkdir_p} $RPM_BUILD_ROOT/lib/modules/%{KVRFA}
%{__mkdir_p} $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/kernel

# Set the EXTRAVERSION string in the main Makefile.
%{__perl} -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}${Flavour}.%{_target_cpu}/" Makefile

@ -382,7 +389,9 @@ BuildKernel() { @@ -382,7 +389,9 @@ BuildKernel() {
# Install the results into the RPM_BUILD_ROOT directory.
%{__mkdir_p} $RPM_BUILD_ROOT/boot
%{__install} -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KVRFA}
%{__install} -m 644 .config $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/config
%{__install} -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KVRFA}
%{__install} -m 644 System.map $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/System.map

# We estimate the size of the initramfs because rpm needs to take this size
# into consideration when performing disk space calculations. (See bz #530778)
@ -392,13 +401,12 @@ BuildKernel() { @@ -392,13 +401,12 @@ BuildKernel() {
#%{__cp} %make_target $RPM_BUILD_ROOT/boot/vmlinuz-%{KVRFA}
if [ %make_target == 'bzImage' ]; then
%{__cp} arch/%{buildarch}/boot/%make_target $RPM_BUILD_ROOT/boot/vmlinuz-%{KVRFA}
%{__cp} $RPM_BUILD_ROOT/boot/vmlinuz-%{KVRFA} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/vmlinuz
else
eu-strip --remove-comment -o $RPM_BUILD_ROOT/boot/vmlinuz-%{KVRFA} %make_target
fi
%{__chmod} 755 $RPM_BUILD_ROOT/boot/vmlinuz-%{KVRFA}

%{__mkdir_p} $RPM_BUILD_ROOT/lib/modules/%{KVRFA}
%{__mkdir_p} $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/kernel
# Override $(mod-fw) because we don't want it to install any firmware.
# We'll get it from the linux-firmware package and we don't want conflicts.
%{__make} -s ARCH=%{buildarch} INSTALL_MOD_PATH=$RPM_BUILD_ROOT KERNELRELEASE=%{KVRFA} INSTALL_MOD_STRIP=1 modules_install mod-fw=
@ -441,11 +449,11 @@ hwcap 1 nosegneg" @@ -441,11 +449,11 @@ hwcap 1 nosegneg"
%{__mkdir_p} $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/weak-updates

# First copy everything . . .
%{__cp} --parents `/usr/bin/find -type f -name 'Makefile*' -o -name 'Kconfig*'` $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build
%{__cp} Module.symvers $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build
%{__cp} System.map $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build
%{__cp} --parents `/usr/bin/find -type f -name 'Makefile*' -o -name 'Kconfig*'` $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/
%{__cp} Module.symvers $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/
%{__cp} System.map $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/
if [ -s Module.markers ]; then
%{__cp} Module.markers $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build
%{__cp} Module.markers $RPM_BUILD_ROOT/lib/modules/%{KVRFA}/build/
fi

%{__gzip} -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KVRFA}.gz
@ -752,8 +760,8 @@ popd > /dev/null @@ -752,8 +760,8 @@ popd > /dev/null
# Scripts section.
%posttrans
%if %{with_default}
%{_sbindir}/new-kernel-pkg --package %{name} --mkinitrd --dracut --depmod --update %{version}-%{release}.%{_target_cpu} || exit $?
#%{_bindir}/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?
#%{_sbindir}/new-kernel-pkg --package %{name} --mkinitrd --dracut --depmod --update %{version}-%{release}.%{_target_cpu} || exit $?
%{_sbindir}/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?
if [ -x %{_sbindir}/weak-modules ]
then
%{_sbindir}/weak-modules --add-kernel %{KVERREL}%{?1:+%{1}} || exit $?
@ -761,8 +769,8 @@ fi\ @@ -761,8 +769,8 @@ fi\


%post
%{_sbindir}/new-kernel-pkg --package %{name} --mkinitrd --dracut --depmod --install %{version}-%{release}.%{_target_cpu} || exit $?
#%{_bindir}/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?
#%{_sbindir}/new-kernel-pkg --package %{name} --mkinitrd --dracut --depmod --install %{version}-%{release}.%{_target_cpu} || exit $?
%{_sbindir}/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz /lib/modules/%{KVERREL}%{?1:+%{1}}/System.map || exit $?
if [ -x %{_sbindir}/weak-modules ]
then
%{_sbindir}/weak-modules --add-kernel %{KVERREL}%{?1:+%{1}} || exit $?
@ -771,8 +779,8 @@ fi @@ -771,8 +779,8 @@ fi


%preun
%{_sbindir}/new-kernel-pkg --rminitrd --rmmoddep --remove %{version}-%{release}.%{_target_cpu} || exit $?
#%{_bindir}/kernel-install remove %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?
#%{_sbindir}/new-kernel-pkg --rminitrd --rmmoddep --remove %{version}-%{release}.%{_target_cpu} || exit $?
%{_bindir}/kernel-install remove %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?
if [ -x %{_sbindir}/weak-modules ]
then
%{_sbindir}/weak-modules --remove-kernel %{KVERREL}%{?1:+%{1}} || exit $?

Loading…
Cancel
Save