* Kernel module package naming
@ 2017-01-03 13:42 ola.redell
2017-01-03 13:42 ` [PATCH] Append KERNEL_VERSION string to kernel module package names ola.redell
0 siblings, 1 reply; 4+ messages in thread
From: ola.redell @ 2017-01-03 13:42 UTC (permalink / raw)
To: openembedded-core
From: Ola Redell <ola.redell@retotech.se>
Hi,
I have been working on a problem with safe kernel and kernel-module upgrade
on a system using .deb packages and apt-get as package manager.
My problem has been that I need to be able to fall back to an earlier kernel
if a newly installed kernel fails to boot for some reason. The basic support
for this is handled in U-boot, but my problem has been with the upgrade of kernel
modules. Today, the same kernel module for different kernel versions has the
same name for both kernels and differ only in its package version. This
makes package managers remove the old kernel module when the newer one is
installed. As a result a safe fall back to the older kernel, whith its (old)
modules is very difficult.
I have a solution that works for me by changing the kernel-module-split.bbclass
to add the KERNEL_VERSION string to the kernel module package name. I assume
this could be useful also in the general case. I am not a package management
expert though, so let me know what you think.
/Ola
Ola Redell (1):
Append KERNEL_VERSION string to kernel module package names
meta/classes/kernel-module-split.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Append KERNEL_VERSION string to kernel module package names
2017-01-03 13:42 Kernel module package naming ola.redell
@ 2017-01-03 13:42 ` ola.redell
2017-01-03 13:56 ` Mats Karrman
0 siblings, 1 reply; 4+ messages in thread
From: ola.redell @ 2017-01-03 13:42 UTC (permalink / raw)
To: openembedded-core
From: Ola Redell <ola.redell@retotech.se>
The KERNEL_VERSION string is added to kernel module package names in order to
make the kernel modules for different kernel versions distinct packages instead
of different versions of the same package. With this change, when a new kernel
is installed together with its kernel modules (e.g. by upgrade of the packages
kernel and kernel-modules) using some package manager such as apt-get or rpm,
the kernel modules for the older kernel will not be removed. This enables a
fall back to the older kernel if the new one fails.
Signed-off-by: Ola Redell <ola.redell@retotech.se>
---
meta/classes/kernel-module-split.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index efe1b42..8365448 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -122,7 +122,7 @@ python split_kernel_module_packages () {
module_regex = '^(.*)\.k?o$'
module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
- module_pattern = module_pattern_prefix + 'kernel-module-%s'
+ module_pattern = 'kernel-module-%s-' + d.getVar("KERNEL_VERSION", True)
postinst = d.getVar('pkg_postinst_modules')
postrm = d.getVar('pkg_postrm_modules')
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Append KERNEL_VERSION string to kernel module package names
2017-01-03 13:42 ` [PATCH] Append KERNEL_VERSION string to kernel module package names ola.redell
@ 2017-01-03 13:56 ` Mats Karrman
2017-01-03 14:00 ` Ola Redell
0 siblings, 1 reply; 4+ messages in thread
From: Mats Karrman @ 2017-01-03 13:56 UTC (permalink / raw)
To: ola.redell, openembedded-core
Hi,
On 01/03/2017 02:42 PM, ola.redell@gmail.com wrote:
> From: Ola Redell <ola.redell@retotech.se>
>
> The KERNEL_VERSION string is added to kernel module package names in order to
> make the kernel modules for different kernel versions distinct packages instead
> of different versions of the same package. With this change, when a new kernel
> is installed together with its kernel modules (e.g. by upgrade of the packages
> kernel and kernel-modules) using some package manager such as apt-get or rpm,
> the kernel modules for the older kernel will not be removed. This enables a
> fall back to the older kernel if the new one fails.
>
> Signed-off-by: Ola Redell <ola.redell@retotech.se>
> ---
> meta/classes/kernel-module-split.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
> index efe1b42..8365448 100644
> --- a/meta/classes/kernel-module-split.bbclass
> +++ b/meta/classes/kernel-module-split.bbclass
> @@ -122,7 +122,7 @@ python split_kernel_module_packages () {
> module_regex = '^(.*)\.k?o$'
>
> module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
> - module_pattern = module_pattern_prefix + 'kernel-module-%s'
> + module_pattern = 'kernel-module-%s-' + d.getVar("KERNEL_VERSION", True)
Why did you drop 'module_pattern_prefix'?
>
> postinst = d.getVar('pkg_postinst_modules')
> postrm = d.getVar('pkg_postrm_modules')
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Append KERNEL_VERSION string to kernel module package names
2017-01-03 13:56 ` Mats Karrman
@ 2017-01-03 14:00 ` Ola Redell
0 siblings, 0 replies; 4+ messages in thread
From: Ola Redell @ 2017-01-03 14:00 UTC (permalink / raw)
To: openembedded-core
Thanks, that was a mistake. I did this change in Jethro originally where
the prefix does not appear. I will prepare a v2.
Ola
On 2017-01-03 14:56, Mats Karrman wrote:
> - module_pattern = module_pattern_prefix + 'kernel-module-%s'
>> + module_pattern = 'kernel-module-%s-' +
>> d.getVar("KERNEL_VERSION", True)
> Why did you drop 'module_pattern_prefix'?
>> postinst = d.getVar('pkg_postinst_modules')
>> postrm = d.getVar('pkg_postrm_modules')
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-03 14:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 13:42 Kernel module package naming ola.redell
2017-01-03 13:42 ` [PATCH] Append KERNEL_VERSION string to kernel module package names ola.redell
2017-01-03 13:56 ` Mats Karrman
2017-01-03 14:00 ` Ola Redell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.