diff --git a/kernel-collabora-tfg.spec b/kernel-collabora-tfg.spec index 5714fdc..c75c4de 100644 --- a/kernel-collabora-tfg.spec +++ b/kernel-collabora-tfg.spec @@ -1,6 +1,6 @@ # change version here %global fake_ver 1 -%global rel_ver 2 +%global rel_ver 3 %global commit_id b034abfca55f329be85c37a84768775c60f52885 %global short_commit_id b034abfc diff --git a/kernel-lts-tfg.spec b/kernel-lts-tfg.spec index 458f93b..706c338 100644 --- a/kernel-lts-tfg.spec +++ b/kernel-lts-tfg.spec @@ -1,5 +1,5 @@ # change version here -%global rel_ver 2 +%global rel_ver 3 %global major_ver 6 %global minor_ver 1 %global patch_ver 52 diff --git a/kernel-next-tfg.spec b/kernel-next-tfg.spec index d46a5d3..33c9c28 100644 --- a/kernel-next-tfg.spec +++ b/kernel-next-tfg.spec @@ -1,5 +1,5 @@ # change version here -%global rel_ver 2 +%global rel_ver 3 %global next_snapshot_date 20230911 Name: kernel-next-tfg diff --git a/kernel-rc-tfg.spec b/kernel-rc-tfg.spec index 95630ca..f56ab17 100644 --- a/kernel-rc-tfg.spec +++ b/kernel-rc-tfg.spec @@ -1,5 +1,5 @@ # change version here -%global rel_ver 2 +%global rel_ver 3 %global major_ver 6 %global minor_ver 6 %global rc_ver 1 diff --git a/kernel-stable-tfg.spec b/kernel-stable-tfg.spec index 442516d..87e5d8c 100644 --- a/kernel-stable-tfg.spec +++ b/kernel-stable-tfg.spec @@ -1,5 +1,5 @@ # change version here -%global rel_ver 2 +%global rel_ver 3 %global major_ver 6 %global minor_ver 5 %global patch_ver 2 diff --git a/master.inc b/master.inc index 111152f..e3d8d74 100644 --- a/master.inc +++ b/master.inc @@ -29,7 +29,6 @@ Requires: linux-firmware %global make_targets Image.gz modules dtbs %endif -%global kernel_image $(make -s image_name) %global make make KERNELRELEASE=%{KVERREL} Source2: https://git.thefossguy.com/enterprise-linux/kernel-tfg/archive/master.tar.gz @@ -106,13 +105,16 @@ verify_config %install rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/boot -mkdir -p $RPM_BUILD_ROOT%{_libexecdir} mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KVERREL} mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/systemtap +# install the kernel +cp $(%{make} -s image_name) $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} +chmod 755 $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} +cp $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/vmlinuz + # install DTBs %ifarch aarch64 || riscv64 %{make} %{?_smp_mflags} dtbs_install INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/boot/dtb-%{KVERREL} @@ -130,28 +132,25 @@ find arch/%{build_arch}/boot/dts -name '*.dtb' -type f -delete %{make} %{?_smp_mflags} headers_install INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr # install other key files too -cp System.map $RPM_BUILD_ROOT/boot/System.map-%{KVERREL} -cp .config $RPM_BUILD_ROOT/boot/config-%{KVERREL} +install -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KVERREL} +install -m 644 .config $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/config +install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KVERREL} +install -m 644 System.map $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/System.map -# install the kernel -cp %{kernel_image} $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} -chmod 755 $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} -cp $RPM_BUILD_ROOT/boot/vmlinuz-%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/vmlinuz +# fix links +rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build +rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source +ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build +ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source -# cleanup of sorts +# install actual Linux src to /usr/src/kernels/%{KVERREL} EXCLUDES="--exclude=SCCS --exclude=BitKeeper --exclude=.svn \ --exclude=CVS --exclude=.pc --exclude=.hg --exclude=.git \ --exclude=*vmlinux* --exclude=*.mod \ --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" -rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build -rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source mkdir -p $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL} tar cf - $EXCLUDES . | tar xf - -C $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL} -pushd $RPM_BUILD_ROOT/lib/modules/%{KVERREL} -ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build -ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source -popd %{make} run-command KBUILD_RUN_COMMAND='${RPM_BUILD_DIR}/%{src_dir}/scripts/package/install-extmod-build $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL}' %clean @@ -190,5 +189,7 @@ fi %files %defattr (-, root, root) +%exclude /lib/modules/%{KVERREL}/build +%exclude /lib/modules/%{KVERREL}/source /lib/modules/%{KVERREL} /boot/*