From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: masahiroy@kernel.org
Cc: dcavalca@meta.com, jtornosm@redhat.com,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
nathan@kernel.org, ndesaulniers@google.com, nicolas@fjasle.eu,
stable@vger.kernel.org
Subject: Re: [PATCH V5 1/2] rpm-pkg: simplify installkernel %post
Date: Mon, 22 Jan 2024 19:22:24 +0100 [thread overview]
Message-ID: <20240122182225.17944-1-jtornosm@redhat.com> (raw)
In-Reply-To: <CAK7LNAQCiBtQ3kQznPDKtkD83wpCzodPVDs8eFnfnx5=Y8E5Cw@mail.gmail.com>
> Those installed files should be removed by %ghost markers.
> I already have a local patch to do this.
> (see the attachment)
I like the idea of your new patch, a lot of things can be fixed in that way.
Ok, I will remove the extra code to remove (%preun) in the patch.
Just a comment about your patch: for openSUSE /boot/initramfs-* files are
called /boot/initrd-* and maybe someone would not require it (i.e. embedded
systems). If it is created it is normally removed and it might not be
necessary (although I like your idea to control it).
> I just asked you to fix up the code as I suggested in v4.
Now I understand why no code was added in %preun.
Ok, your suggestion was very good, but let me try and explain better with
commands what I would like to fix after next point. When I said 'update'
wasn't clear, I think.
If it doesn't fit with your idea or global usage, I will include your
suggestion like it is.
> For me (on Fedora 39 and openSUSE Tumbleweed), rpm fails due to file conflict.
>
> vagrant@opensuse-tumbleweed20231218:~> sudo rpm -i
> kernel-6.7.0_12924_g660a5f4a53e7-4.x86_64.rpm
> file /lib/modules/6.7.0-12924-g660a5f4a53e7/vmlinuz from install of
> kernel-6.7.0_12924_g660a5f4a53e7-4.x86_64 conflicts with file from
> package kernel-6.7.0_12924_g660a5f4a53e7-3.x86_64
>
> So, this does not happen.
I was refering to the cases when zypper is used to install a new kernel with
the same release and different build number or when 'rpm -i --replacefiles'
is used (in this case it would be necessary to remove the old kernel with
'rpm -e --justdb' too).
In this cases we only need the possibility of copying the files from the new
package and not only if they don't exist.
I have thought about an easy way (no extra or problematic command) and I think
I have it.
In addition to your suggestion (if the file does not exit in /boot), I will
just compare the file in /boot with the file in /lib/modules/%{KERNELRELEASE}
and if it is not the same, we allow copying:
%post
if [ -x /usr/bin/kernel-install ]; then
/usr/bin/kernel-install add %{KERNELRELEASE} /lib/modules/%{KERNELRELEASE}/vmlinuz
fi
for file in vmlinuz System.map config; do
if [ ! -e "/boot/${file}-%{KERNELRELEASE}" ] || ! cmp --silent "/lib/modules/%{KERNELRELEASE}/${file}" "/boot/${file}-%{KERNELRELEASE}"; then
cp "/lib/modules/%{KERNELRELEASE}/${file}" "/boot/${file}-%{KERNELRELEASE}"
fi
done
Let me try with a new patch to know your opinion.
Thanks
Best regards
José Ignacio
next prev parent reply other threads:[~2024-01-22 18:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 23:33 [PATCH] rpm-pkg: simplify installkernel %post Davide Cavalca via B4 Relay
2023-11-08 0:07 ` Nathan Chancellor
2023-12-12 17:10 ` [PATCH v2] " Jose Ignacio Tornos Martinez
2023-12-12 19:19 ` Nathan Chancellor
2023-12-18 18:26 ` Masahiro Yamada
2023-12-19 8:43 ` Jose Ignacio Tornos Martinez
2023-12-19 15:56 ` [PATCH v3] " Jose Ignacio Tornos Martinez
2023-12-19 16:49 ` Masahiro Yamada
2023-12-19 20:17 ` [PATCH v4] " Jose Ignacio Tornos Martinez
2023-12-20 17:18 ` Nathan Chancellor
2023-12-26 4:02 ` Masahiro Yamada
2024-01-07 15:25 ` Jose Ignacio Tornos Martinez
2024-01-14 8:06 ` [PATCH V5 1/2] " Jose Ignacio Tornos Martinez
2024-01-17 1:29 ` Masahiro Yamada
2024-01-18 14:12 ` Jose Ignacio Tornos Martinez
2024-01-21 17:32 ` Masahiro Yamada
2024-01-22 18:22 ` Jose Ignacio Tornos Martinez [this message]
2024-01-22 18:22 ` [PATCH] " Jose Ignacio Tornos Martinez
2024-01-28 7:32 ` Masahiro Yamada
2024-01-29 9:27 ` Jose Ignacio Tornos Martinez
2024-01-29 9:28 ` [PATCH v7] " Jose Ignacio Tornos Martinez
2024-01-31 1:48 ` Masahiro Yamada
2024-01-14 8:07 ` [PATCH V5 2/2] rpm-pkg: avoid install/remove the running kernel Jose Ignacio Tornos Martinez
2024-01-17 1:32 ` Masahiro Yamada
2024-01-18 14:12 ` Jose Ignacio Tornos Martinez
2024-01-21 17:33 ` Masahiro Yamada
2024-01-22 15:53 ` Jose Ignacio Tornos Martinez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240122182225.17944-1-jtornosm@redhat.com \
--to=jtornosm@redhat.com \
--cc=dcavalca@meta.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox