Re: issue with devcoredump.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10-1-2017 12:16, Arend Van Spriel wrote:
> With 4.10-rc1 the devcoredump.patch in patches/backport-adjustment no
> longer applies due to following commit:
> 
> commit f76d25275c314defb684fdd692239507001774bc
> Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Date:   Mon Nov 28 16:41:58 2016 +0100
> 
>     driver core: devcoredump: convert to use class_groups
> 
>     Convert devcoredump to use class_groups instead of class_attrs as that's
>     the correct way to handle lists of class attribute files.
> 
>     Acked-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> So I am reworking the patch file (attached). When I run gentree I get
> following:
> 
> Traceback (most recent call last):
>   File "./gentree.py", line 1091, in <module>
>     ret = _main()
>   File "./gentree.py", line 724, in _main
>     logwrite=logwrite)
>   File "./gentree.py", line 906, in process
>     apply_patches(args, "backport", source_dir, 'patches',
> bpid.target_dir, logwrite)
>   File "./gentree.py", line 514, in apply_patches
>     raise Exception('No patch content found in %s' % print_name)
> Exception: No patch content found in backport-adjustments/devcoredump.patch
> 
> However, go into the target dir and applying patch works fine:
> 
> $ patch -p1 < ~-/patches/backport-adjustments/devcoredump.patch
> patching file compat/drivers-base-devcoredump.c
> Hunk #7 succeeded at 181 with fuzz 1 (offset 2 lines).
> Hunk #8 succeeded at 248 (offset 2 lines).
> Hunk #9 succeeded at 339 (offset 2 lines).
> Hunk #10 succeeded at 386 (offset 2 lines).
> patching file include/linux/backport-devcoredump.h
> 
> So I am a bit puzzled as to what is going on so currently debugging
> lib/patch.py. If anyone has a good hint feel free to let me know.

Turns out that at line 70 of the patch file there is no single space
before the tab, which lib/patch.py marks as an error. With that fixed
the fun really starts as I get following code:

static CLASS_ATTR_RW(disabled);

static struct attribute *devcd_class_attrs[] = {
        &class_attr_disabled.attr,
        NULL,
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
ATTRIBUTE_GROUPS(devcd_class);
#else
#define BP_ATTR_GRP_STRUCT device_attribute
ATTRIBUTE_GROUPS_BACKPORT(devcd_class);
#endif

static struct class devcd_class = {
        .name           = "devcoredump",
        .owner          = THIS_MODULE,
        .dev_release    = devcd_dev_release,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
        .dev_groups     = devcd_dev_groups,
#else
        .dev_attrs = devcd_class_dev_attrs,
#endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
        .class_attrs    = devcd_class_attrs,
#else
        .class_groups   = devcd_class_groups,
#endif
};

This is because the new devcoredump.c in 4.10-rc1 now triggers a
Coccinelle script to kick in, ie.
patches/collateral-evolutions/generic/0001-group-attr/0001-group_attr_class.cocci.
It seems to kick in because of the ATTRIBUTE_GROUPS(devcd_class) macro.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux