"cleanup"

This commit is contained in:
Pratham Patel 2023-10-17 09:01:33 +05:30
parent 7e5a0793da
commit 5e82d2632a
No known key found for this signature in database

View File

@ -95,17 +95,13 @@ export LLVM=1 AR=llvm-ar CC=clang HOSTAR=llvm-ar HOSTCC=clang HOSTCXX=clang++ HO
[ -f .config ] && rm -vf .config* [ -f .config ] && rm -vf .config*
%{make} distclean %{make} distclean
cp %{SOURCE3} .config %{make} defconfig
tar -xf %{SOURCE2} -C . tar -xf %{SOURCE2} -C .
cp -vr kernel-tfg/{configure-linux.sh,extra-configs} . cp -vr kernel-tfg/{configure-linux.sh,extra-configs} .
rm -rf kernel-tfg/ rm -rf kernel-tfg/
./configure-linux.sh ./configure-linux.sh
%{make} savedefconfig
cp defconfig arch/%{build_arch}/configs/defconfig
%{make} defconfig
%build %build
%{make} PYTHON=%{__python3} %{make_targets} %{make} PYTHON=%{__python3} %{make_targets}
@ -150,15 +146,13 @@ mkdir -p %{buildroot}/usr/src/kernels/%{KVERREL}
if [ -f scripts/package/install-extmod-build ]; then if [ -f scripts/package/install-extmod-build ]; then
%{make} run-command KBUILD_RUN_COMMAND='%{_builddir}/%{src_dir}/scripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KVERREL}' %{make} run-command KBUILD_RUN_COMMAND='%{_builddir}/%{src_dir}/scripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KVERREL}'
else else
touch %{buildroot}/usr/src/kernels/%{KVERREL}/MAYBE_THIS_WORKS touch %{buildroot}/usr/src/kernels/%{KVERREL}/EMPTY
fi fi
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
%post %post
set -xeuf -o pipefail
if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KVERREL} -a -r /boot/System.map-%{KVERREL} ]; then if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KVERREL} -a -r /boot/System.map-%{KVERREL} ]; then
cp /boot/vmlinuz-%{KVERREL} /boot/.vmlinuz-%{KVERREL}-rpm cp /boot/vmlinuz-%{KVERREL} /boot/.vmlinuz-%{KVERREL}-rpm
cp /boot/System.map-%{KVERREL} /boot/.System.map-%{KVERREL}-rpm cp /boot/System.map-%{KVERREL} /boot/.System.map-%{KVERREL}-rpm
@ -167,24 +161,7 @@ if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KVERREL} -a -r /boot/System.ma
rm -f /boot/.vmlinuz-%{KVERREL}-rpm /boot/.System.map-%{KVERREL}-rpm rm -f /boot/.vmlinuz-%{KVERREL}-rpm /boot/.System.map-%{KVERREL}-rpm
fi fi
# we pushd into /boot because we want our symlinks to be
# vmlinuz -> vmlinuz-6.6.0-20231004.6.el9.aarch64
# and not
# vmlinuz -> /boot/vmlinuz-6.6.0-20231004.6.el9.aarch64
pushd /boot
rm -rvf dtb initramfs.img System.map vmlinuz
ln -s dtb-%{KVERREL} dtb
ln -s initramfs-%{KVERREL}.img initramfs.img
ln -s System.map-%{KVERREL} System.map
ln -s vmlinuz-%{KVERREL} vmlinuz
popd
%preun %preun
# remove symlinks
rm -vf /boot/initramfs.img
rm -vf /boot/System.map
rm -vf /boot/vmlinuz
if [ -x /sbin/new-kernel-pkg ]; then if [ -x /sbin/new-kernel-pkg ]; then
new-kernel-pkg --remove %{KVERREL} --rminitrd --initrdfile=/boot/initramfs-%{KVERREL}.img new-kernel-pkg --remove %{KVERREL} --rminitrd --initrdfile=/boot/initramfs-%{KVERREL}.img
elif [ -x /usr/bin/kernel-install ]; then elif [ -x /usr/bin/kernel-install ]; then