* [PATCH] Kernel .patches support
@ 2005-06-23 21:58 Christian Hesse
2005-06-23 22:38 ` Karim Yaghmour
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Christian Hesse @ 2005-06-23 21:58 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 442 bytes --]
Hi everybody,
every time I apply a patch to my kernel tree I (or my scripts) make an
echo $PATCHNAME $PATCHVERSION >> .patches
This patch makes the file accessible via /proc/patches.gz. I think this can be
handy if you want to know what patches you (or your distributor) applied to
your running kernel...
Most of the code is copy & past from CONFIG_IKCONFIG[_PROC].
Let me know what you think.
Regards,
--
Christian
[-- Attachment #1.2: patches.patch --]
[-- Type: text/x-diff, Size: 6543 bytes --]
diff -Nur linux-2.6.12+/include/linux/patches.h linux-2.6.12+-patches/include/linux/patches.h
--- linux-2.6.12+/include/linux/patches.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.12+-patches/include/linux/patches.h 2005-06-23 23:10:15.278685000 +0200
@@ -0,0 +1,6 @@
+#ifndef _LINUX_PATCHES_H
+#define _LINUX_PATCHES_H
+
+#include <linux/autoconf.h>
+
+#endif
diff -Nur linux-2.6.12+/init/Kconfig linux-2.6.12+-patches/init/Kconfig
--- linux-2.6.12+/init/Kconfig 2005-06-23 23:16:40.748685000 +0200
+++ linux-2.6.12+-patches/init/Kconfig 2005-06-23 23:10:16.928685000 +0200
@@ -226,6 +226,25 @@
This option enables access to the kernel configuration file
through /proc/config.gz.
+config IKPATCHES
+ bool "Kernel .patches support"
+ ---help---
+ This option enables the complete Linux kernel ".patches" file
+ contents to be saved in the kernel. It provides documentation
+ of which kernel patches are applied in a running kernel. This
+ information can be extracted from the kernel image file with
+ the script scripts/extract-ikpatches and used as input to
+ rebuild the current kernel or to build another kernel.
+ It can also be extracted from a running kernel by reading
+ /proc/patches.gz if enabled (below).
+
+config IKPATCHES_PROC
+ bool "Enable access to .patches through /proc/patches.gz"
+ depends on IKPATCHES && PROC_FS
+ ---help---
+ This option enables access to the kernel patches file
+ through /proc/patches.gz.
+
config CPUSETS
bool "Cpuset support"
depends on SMP
diff -Nur linux-2.6.12+/kernel/Makefile linux-2.6.12+-patches/kernel/Makefile
--- linux-2.6.12+/kernel/Makefile 2005-06-23 23:17:13.248685000 +0200
+++ linux-2.6.12+-patches/kernel/Makefile 2005-06-23 23:10:17.218685000 +0200
@@ -21,6 +21,8 @@
obj-$(CONFIG_CPUSETS) += cpuset.o
obj-$(CONFIG_IKCONFIG) += configs.o
obj-$(CONFIG_IKCONFIG_PROC) += configs.o
+obj-$(CONFIG_IKPATCHES) += patches.o
+obj-$(CONFIG_IKPATCHES_PROC) += patches.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
obj-$(CONFIG_AUDIT) += audit.o
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
@@ -52,3 +54,17 @@
targets += config_data.h
$(obj)/config_data.h: $(obj)/config_data.gz FORCE
$(call if_changed,ikconfiggz)
+
+$(obj)/patches.o: $(obj)/patches_data.h
+
+# patches_data.h contains the same information as ikpatches.h but gzipped.
+# Info from patches_data can be extracted from /proc/patches*
+targets += patches_data.gz
+$(obj)/patches_data.gz: .patches FORCE
+ $(call if_changed,gzip)
+
+quiet_cmd_ikpatchesgz = IKPTC $@
+ cmd_ikpatchesgz = (echo "static const char kernel_patches_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
+targets += patches_data.h
+$(obj)/patches_data.h: $(obj)/patches_data.gz FORCE
+ $(call if_changed,ikpatchesgz)
diff -Nur linux-2.6.12+/kernel/patches.c linux-2.6.12+-patches/kernel/patches.c
--- linux-2.6.12+/kernel/patches.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.12+-patches/kernel/patches.c 2005-06-23 23:10:17.608685000 +0200
@@ -0,0 +1,115 @@
+/*
+ * kernel/patches.c
+ * Echo the kernel .patches file used to build the kernel
+ *
+ * Copyright (C) 2005 Christian Hesse <Christi@n-Hesse.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/patches.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+
+/**************************************************/
+/* the actual current patchesfile */
+
+/*
+ * Define kernel_patches_data and kernel_patches_data_size, which contains the
+ * wrapped and compressed patches file. The file is first compressed
+ * with gzip and then bounded by two eight byte magic numbers to allow
+ * extraction from a binary kernel image:
+ *
+ * IKPTC_ST
+ * <image>
+ * IKPTC_ED
+ */
+#define MAGIC_START "IKPTC_ST"
+#define MAGIC_END "IKPTC_ED"
+#include "patches_data.h"
+
+
+#define MAGIC_SIZE (sizeof(MAGIC_START) - 1)
+#define kernel_patches_data_size \
+ (sizeof(kernel_patches_data) - 1 - MAGIC_SIZE * 2)
+
+#ifdef CONFIG_IKPATCHES_PROC
+
+/**************************************************/
+/* globals and useful constants */
+
+static ssize_t
+ikpatches_read_current(struct file *file, char __user *buf,
+ size_t len, loff_t * offset)
+{
+ loff_t pos = *offset;
+ ssize_t count;
+
+ if (pos >= kernel_patches_data_size)
+ return 0;
+
+ count = min(len, (size_t)(kernel_patches_data_size - pos));
+ if (copy_to_user(buf, kernel_patches_data + MAGIC_SIZE + pos, count))
+ return -EFAULT;
+
+ *offset += count;
+ return count;
+}
+
+static struct file_operations ikpatches_file_ops = {
+ .owner = THIS_MODULE,
+ .read = ikpatches_read_current,
+};
+
+/***************************************************/
+/* ikpatches_init: start up everything we need to */
+
+static int __init ikpatches_init(void)
+{
+ struct proc_dir_entry *entry;
+
+ /* create the current patches file */
+ entry = create_proc_entry("patches.gz", S_IFREG | S_IRUGO,
+ &proc_root);
+ if (!entry)
+ return -ENOMEM;
+
+ entry->proc_fops = &ikpatches_file_ops;
+ entry->size = kernel_patches_data_size;
+
+ return 0;
+}
+
+/***************************************************/
+/* ikpatches_cleanup: clean up our mess */
+
+static void __exit ikpatches_cleanup(void)
+{
+ remove_proc_entry("patches.gz", &proc_root);
+}
+
+module_init(ikpatches_init);
+module_exit(ikpatches_cleanup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Hesse");
+MODULE_DESCRIPTION("Echo the kernel .patch file that lists applied patches");
+
+#endif /* CONFIG_IKPATCHES_PROC */
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-23 21:58 [PATCH] Kernel .patches support Christian Hesse
@ 2005-06-23 22:38 ` Karim Yaghmour
2005-06-24 6:02 ` Ian Campbell
2005-06-24 7:36 ` Adrian Bunk
2 siblings, 0 replies; 8+ messages in thread
From: Karim Yaghmour @ 2005-06-23 22:38 UTC (permalink / raw)
To: Christian Hesse; +Cc: linux-kernel
Christian Hesse wrote:
> every time I apply a patch to my kernel tree I (or my scripts) make an
>
> echo $PATCHNAME $PATCHVERSION >> .patches
>
> This patch makes the file accessible via /proc/patches.gz. I think this can be
> handy if you want to know what patches you (or your distributor) applied to
> your running kernel...
I haven't looked at the implementation, but I love the functionality.
Karim
--
Author, Speaker, Developer, Consultant
Pushing Embedded and Real-Time Linux Systems Beyond the Limits
http://www.opersys.com || karim@opersys.com || 1-866-677-4546
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-23 21:58 [PATCH] Kernel .patches support Christian Hesse
2005-06-23 22:38 ` Karim Yaghmour
@ 2005-06-24 6:02 ` Ian Campbell
2005-06-24 7:36 ` Adrian Bunk
2 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2005-06-24 6:02 UTC (permalink / raw)
To: Christian Hesse; +Cc: linux-kernel
On Thu, 2005-06-23 at 23:58 +0200, Christian Hesse wrote:
> Most of the code is copy & past from CONFIG_IKCONFIG[_PROC].
I haven't looked, but would it be possible to share this code instead of
copying it ?
--
Ian Campbell
Waking a person unnecessarily should not be considered a capital crime.
For a first offense, that is.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-23 21:58 [PATCH] Kernel .patches support Christian Hesse
2005-06-23 22:38 ` Karim Yaghmour
2005-06-24 6:02 ` Ian Campbell
@ 2005-06-24 7:36 ` Adrian Bunk
2005-06-24 8:57 ` Coywolf Qi Hunt
2005-06-24 21:03 ` Christian Hesse
2 siblings, 2 replies; 8+ messages in thread
From: Adrian Bunk @ 2005-06-24 7:36 UTC (permalink / raw)
To: Christian Hesse; +Cc: linux-kernel
On Thu, Jun 23, 2005 at 11:58:27PM +0200, Christian Hesse wrote:
> Hi everybody,
>
> every time I apply a patch to my kernel tree I (or my scripts) make an
>
> echo $PATCHNAME $PATCHVERSION >> .patches
>
> This patch makes the file accessible via /proc/patches.gz. I think this can be
> handy if you want to know what patches you (or your distributor) applied to
> your running kernel...
>...
> Let me know what you think.
To be honest, I'm not a fan of it.
If e.g. looking at a Debian kernel source that has 289 different patches
with names like tty-locking-fixes7 applied, you'll see that this often
won't give you much valuable information.
You'd need an uniform naming convention for patches across
distributions, and I don't think such things are worth the effort.
> Regards,
> Christian
> --- linux-2.6.12+/include/linux/patches.h 1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.6.12+-patches/include/linux/patches.h 2005-06-23 23:10:15.278685000 +0200
> @@ -0,0 +1,6 @@
> +#ifndef _LINUX_PATCHES_H
> +#define _LINUX_PATCHES_H
> +
> +#include <linux/autoconf.h>
> +
> +#endif
>...
What do you need this file for?
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-24 7:36 ` Adrian Bunk
@ 2005-06-24 8:57 ` Coywolf Qi Hunt
2005-06-24 20:48 ` Christian Hesse
2005-06-24 21:03 ` Christian Hesse
1 sibling, 1 reply; 8+ messages in thread
From: Coywolf Qi Hunt @ 2005-06-24 8:57 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Christian Hesse, linux-kernel
On 6/24/05, Adrian Bunk <bunk@stusta.de> wrote:
> On Thu, Jun 23, 2005 at 11:58:27PM +0200, Christian Hesse wrote:
> > --- linux-2.6.12+/include/linux/patches.h 1970-01-01 01:00:00.000000000 +0100
> > +++ linux-2.6.12+-patches/include/linux/patches.h 2005-06-23 23:10:15.278685000 +0200
> > @@ -0,0 +1,6 @@
> > +#ifndef _LINUX_PATCHES_H
> > +#define _LINUX_PATCHES_H
> > +
> > +#include <linux/autoconf.h>
> > +
> > +#endif
> >...
>
> What do you need this file for?
I think it should be <linux/config.h>.
--
Coywolf Qi Hunt
http://ahbl.org/~coywolf/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-24 8:57 ` Coywolf Qi Hunt
@ 2005-06-24 20:48 ` Christian Hesse
0 siblings, 0 replies; 8+ messages in thread
From: Christian Hesse @ 2005-06-24 20:48 UTC (permalink / raw)
To: coywolf; +Cc: Adrian Bunk, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 773 bytes --]
On Friday 24 June 2005 10:57, Coywolf Qi Hunt wrote:
> On 6/24/05, Adrian Bunk <bunk@stusta.de> wrote:
> > On Thu, Jun 23, 2005 at 11:58:27PM +0200, Christian Hesse wrote:
> > > --- linux-2.6.12+/include/linux/patches.h 1970-01-01
> > > 01:00:00.000000000 +0100 +++
> > > linux-2.6.12+-patches/include/linux/patches.h 2005-06-23
> > > 23:10:15.278685000 +0200 @@ -0,0 +1,6 @@
> > > +#ifndef _LINUX_PATCHES_H
> > > +#define _LINUX_PATCHES_H
> > > +
> > > +#include <linux/autoconf.h>
> > > +
> > > +#endif
> > >...
> >
> > What do you need this file for?
>
> I think it should be <linux/config.h>.
Stupid me. It was too late last night. :)
You're right, I removed the file and included linux/config.h in
kernel/patches.c.
--
Christian
[-- Attachment #1.2: patches.patch --]
[-- Type: text/x-diff, Size: 6165 bytes --]
diff -Nur linux-2.6.12+/init/Kconfig linux-2.6.12+-patches/init/Kconfig
--- linux-2.6.12+/init/Kconfig 2005-06-23 23:16:40.748685000 +0200
+++ linux-2.6.12+-patches/init/Kconfig 2005-06-23 23:10:16.928685000 +0200
@@ -226,6 +226,25 @@
This option enables access to the kernel configuration file
through /proc/config.gz.
+config IKPATCHES
+ bool "Kernel .patches support"
+ ---help---
+ This option enables the complete Linux kernel ".patches" file
+ contents to be saved in the kernel. It provides documentation
+ of which kernel patches are applied in a running kernel. This
+ information can be extracted from the kernel image file with
+ the script scripts/extract-ikpatches and used as input to
+ rebuild the current kernel or to build another kernel.
+ It can also be extracted from a running kernel by reading
+ /proc/patches.gz if enabled (below).
+
+config IKPATCHES_PROC
+ bool "Enable access to .patches through /proc/patches.gz"
+ depends on IKPATCHES && PROC_FS
+ ---help---
+ This option enables access to the kernel patches file
+ through /proc/patches.gz.
+
config CPUSETS
bool "Cpuset support"
depends on SMP
diff -Nur linux-2.6.12+/kernel/Makefile linux-2.6.12+-patches/kernel/Makefile
--- linux-2.6.12+/kernel/Makefile 2005-06-23 23:17:13.248685000 +0200
+++ linux-2.6.12+-patches/kernel/Makefile 2005-06-23 23:10:17.218685000 +0200
@@ -21,6 +21,8 @@
obj-$(CONFIG_CPUSETS) += cpuset.o
obj-$(CONFIG_IKCONFIG) += configs.o
obj-$(CONFIG_IKCONFIG_PROC) += configs.o
+obj-$(CONFIG_IKPATCHES) += patches.o
+obj-$(CONFIG_IKPATCHES_PROC) += patches.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
obj-$(CONFIG_AUDIT) += audit.o
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
@@ -52,3 +54,17 @@
targets += config_data.h
$(obj)/config_data.h: $(obj)/config_data.gz FORCE
$(call if_changed,ikconfiggz)
+
+$(obj)/patches.o: $(obj)/patches_data.h
+
+# patches_data.h contains the same information as ikpatches.h but gzipped.
+# Info from patches_data can be extracted from /proc/patches*
+targets += patches_data.gz
+$(obj)/patches_data.gz: .patches FORCE
+ $(call if_changed,gzip)
+
+quiet_cmd_ikpatchesgz = IKPTC $@
+ cmd_ikpatchesgz = (echo "static const char kernel_patches_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
+targets += patches_data.h
+$(obj)/patches_data.h: $(obj)/patches_data.gz FORCE
+ $(call if_changed,ikpatchesgz)
diff -Nur linux-2.6.12+/kernel/patches.c linux-2.6.12+-patches/kernel/patches.c
--- linux-2.6.12+/kernel/patches.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.12+-patches/kernel/patches.c 2005-06-23 23:10:17.608685000 +0200
@@ -0,0 +1,115 @@
+/*
+ * kernel/patches.c
+ * Echo the kernel .patches file used to build the kernel
+ *
+ * Copyright (C) 2005 Christian Hesse <Christi@n-Hesse.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+
+/**************************************************/
+/* the actual current patchesfile */
+
+/*
+ * Define kernel_patches_data and kernel_patches_data_size, which contains the
+ * wrapped and compressed patches file. The file is first compressed
+ * with gzip and then bounded by two eight byte magic numbers to allow
+ * extraction from a binary kernel image:
+ *
+ * IKPTC_ST
+ * <image>
+ * IKPTC_ED
+ */
+#define MAGIC_START "IKPTC_ST"
+#define MAGIC_END "IKPTC_ED"
+#include "patches_data.h"
+
+
+#define MAGIC_SIZE (sizeof(MAGIC_START) - 1)
+#define kernel_patches_data_size \
+ (sizeof(kernel_patches_data) - 1 - MAGIC_SIZE * 2)
+
+#ifdef CONFIG_IKPATCHES_PROC
+
+/**************************************************/
+/* globals and useful constants */
+
+static ssize_t
+ikpatches_read_current(struct file *file, char __user *buf,
+ size_t len, loff_t * offset)
+{
+ loff_t pos = *offset;
+ ssize_t count;
+
+ if (pos >= kernel_patches_data_size)
+ return 0;
+
+ count = min(len, (size_t)(kernel_patches_data_size - pos));
+ if (copy_to_user(buf, kernel_patches_data + MAGIC_SIZE + pos, count))
+ return -EFAULT;
+
+ *offset += count;
+ return count;
+}
+
+static struct file_operations ikpatches_file_ops = {
+ .owner = THIS_MODULE,
+ .read = ikpatches_read_current,
+};
+
+/***************************************************/
+/* ikpatches_init: start up everything we need to */
+
+static int __init ikpatches_init(void)
+{
+ struct proc_dir_entry *entry;
+
+ /* create the current patches file */
+ entry = create_proc_entry("patches.gz", S_IFREG | S_IRUGO,
+ &proc_root);
+ if (!entry)
+ return -ENOMEM;
+
+ entry->proc_fops = &ikpatches_file_ops;
+ entry->size = kernel_patches_data_size;
+
+ return 0;
+}
+
+/***************************************************/
+/* ikpatches_cleanup: clean up our mess */
+
+static void __exit ikpatches_cleanup(void)
+{
+ remove_proc_entry("patches.gz", &proc_root);
+}
+
+module_init(ikpatches_init);
+module_exit(ikpatches_cleanup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Hesse");
+MODULE_DESCRIPTION("Echo the kernel .patch file that lists applied patches");
+
+#endif /* CONFIG_IKPATCHES_PROC */
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-24 7:36 ` Adrian Bunk
2005-06-24 8:57 ` Coywolf Qi Hunt
@ 2005-06-24 21:03 ` Christian Hesse
2005-06-24 22:31 ` Adrian Bunk
1 sibling, 1 reply; 8+ messages in thread
From: Christian Hesse @ 2005-06-24 21:03 UTC (permalink / raw)
To: Adrian Bunk; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
On Friday 24 June 2005 09:36, Adrian Bunk wrote:
> On Thu, Jun 23, 2005 at 11:58:27PM +0200, Christian Hesse wrote:
> > Hi everybody,
> >
> > every time I apply a patch to my kernel tree I (or my scripts) make an
> >
> > echo $PATCHNAME $PATCHVERSION >> .patches
> >
> > This patch makes the file accessible via /proc/patches.gz. I think this
> > can be handy if you want to know what patches you (or your distributor)
> > applied to your running kernel...
> >...
> > Let me know what you think.
>
> To be honest, I'm not a fan of it.
>
> If e.g. looking at a Debian kernel source that has 289 different patches
> with names like tty-locking-fixes7 applied, you'll see that this often
> won't give you much valuable information.
You can search Debian lists, archives, ... for "tty-locking-fixes7". After
that you probably know what the fix is good for.
On the other hand if there is a security fix in a Debian list you can check if
your kernel is patched by running "zcat /proc/patches.gz | grep
security-fix-foo-bar".
> You'd need an uniform naming convention for patches across
> distributions, and I don't think such things are worth the effort.
If a distribution has a naming convention for itself this patch can already be
useful I think. Even without it can be.
--
Christian
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Kernel .patches support
2005-06-24 21:03 ` Christian Hesse
@ 2005-06-24 22:31 ` Adrian Bunk
0 siblings, 0 replies; 8+ messages in thread
From: Adrian Bunk @ 2005-06-24 22:31 UTC (permalink / raw)
To: Christian Hesse; +Cc: linux-kernel
On Fri, Jun 24, 2005 at 11:03:17PM +0200, Christian Hesse wrote:
> On Friday 24 June 2005 09:36, Adrian Bunk wrote:
> > On Thu, Jun 23, 2005 at 11:58:27PM +0200, Christian Hesse wrote:
> > > Hi everybody,
> > >
> > > every time I apply a patch to my kernel tree I (or my scripts) make an
> > >
> > > echo $PATCHNAME $PATCHVERSION >> .patches
> > >
> > > This patch makes the file accessible via /proc/patches.gz. I think this
> > > can be handy if you want to know what patches you (or your distributor)
> > > applied to your running kernel...
> > >...
> > > Let me know what you think.
> >
> > To be honest, I'm not a fan of it.
> >
> > If e.g. looking at a Debian kernel source that has 289 different patches
> > with names like tty-locking-fixes7 applied, you'll see that this often
> > won't give you much valuable information.
>
> You can search Debian lists, archives, ... for "tty-locking-fixes7". After
> that you probably know what the fix is good for.
The _only_ Google hit for "tty-locking-fixes7" isn't very helpful.
I could simply download the source package for the kernel...
> On the other hand if there is a security fix in a Debian list you can check if
> your kernel is patched by running "zcat /proc/patches.gz | grep
> security-fix-foo-bar".
"zless /usr/share/doc/<pkgname>/Debian.src.changelog.gz" already gives
you the same information plus information about the contents of the
patches including CAN references and bug numbers.
> > You'd need an uniform naming convention for patches across
> > distributions, and I don't think such things are worth the effort.
>
> If a distribution has a naming convention for itself this patch can already be
> useful I think. Even without it can be.
If you are building your own kernel, you have to manually check that you
don't forget to add every patch you apply to .patches .
In a distribution, the information is already present at better places.
> Christian
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-06-24 22:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-23 21:58 [PATCH] Kernel .patches support Christian Hesse
2005-06-23 22:38 ` Karim Yaghmour
2005-06-24 6:02 ` Ian Campbell
2005-06-24 7:36 ` Adrian Bunk
2005-06-24 8:57 ` Coywolf Qi Hunt
2005-06-24 20:48 ` Christian Hesse
2005-06-24 21:03 ` Christian Hesse
2005-06-24 22:31 ` Adrian Bunk
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.