Skip to content

Instantly share code, notes, and snippets.

@Oliv4945
Last active April 16, 2021 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oliv4945/ce794ac39239f057100cbed66f6c33c9 to your computer and use it in GitHub Desktop.
Save Oliv4945/ce794ac39239f057100cbed66f6c33c9 to your computer and use it in GitHub Desktop.
UBPorts - BT backport notes

Feedback on the text

Required tools

spatch can be installed under Debian/Ubuntu with apt install coccinelle.

Download 4.2 kernel sources

What is the aim of creating kernel-backports folder?

Run backports script and fix errors

Add note that paths must be absolute and to relatives (Learnt from the video) Rename [MODEL_NAME] by [KERNEL_NAME], for example for the herolte device kernel name is universal8890

Give a hint that the Makefile.rej is probably in ~/halium/kernel/[VENDOR]/[MODEL_NAME/. Add a link to https://www.youtube.com/watch?v=RC5e87-8LpU&t=35:27 so people can understand the step to resolve the errors.

Apply new settings

I would find this part easier to understand if written:

At the same time, for each one, add a corresponding one beginning with CONFIG_BACKPORT_BT_, e.g.:

CONFIG_BT=y

becomes

#CONFIG_BT=y
CONFIG_BACKPORT_BT=y

Why the Additionnal BT configs needed for UT from https://www.youtube.com/watch?v=RC5e87-8LpU?t=59:15 are not in the doc? Why commenting CONFIG_CRC16=y and CONFIG_TTY=y in the files to add? Should be removed if not needed

Step The corresponding source file(s) will have to be migrated from their original location to the corresponding location under [...] If would help to write this command in order to quickly show the files to move: diff -qr drivers/bluetooth/ backports/drivers/bluetooth/ | grep "Only in drivers"

Step The files Makefile and Kconfig need to be edited to include this missing setting or else they will not be built. => What should be done to Kconfig file?

Errors

Failed to process SmPL patch collateral-evolutions/network/0027-genl-const/genl-const.cocci

The error is

Get original source files from git ...
Applying patches from patches to ~/<PATH_TO_HALIUM>/halium/kernel/samsung/universal8890/backports/ ...
Failed to process SmPL patch collateral-evolutions/network/0027-genl-const/genl-const.cocci
Traceback (most recent call last):
  File "./gentree.py", line 1099, in <module>
    ret = _main()
  File "./gentree.py", line 724, in _main
    logwrite=logwrite)
  File "./gentree.py", line 905, in process
    apply_patches(args, "backport", source_dir, 'patches', bpid.target_dir, logwrite)
  File "./gentree.py", line 605, in apply_patches
    raise Exception('SmPL patch failed')
Exception: SmPL patch failed

This is caused by a format change in coccinelle/spatch , starting with spatch version >= 1.0.6 (see here). Fix:

  1. Edit the file ~/backport-scripts/patches/collateral-evolutions/network/0027-genl-const/genl-const.cocci
  2. Add name to attribute __genl_const; in order to have attribute name __genl_const;

Or apply this patch, in ~backport-scripts folder:

diff --git a/patches/collateral-evolutions/network/0027-genl-const/genl-const.cocci b/patches/collateral-evolutions/network/0027-genl-const/genl-const.cocci
index 36c71d62..58824c72 100644
--- a/patches/collateral-evolutions/network/0027-genl-const/genl-const.cocci
+++ b/patches/collateral-evolutions/network/0027-genl-const/genl-const.cocci
@@ -1,5 +1,5 @@
 @@
-attribute __genl_const;
+attribute name __genl_const;
 @@
 (
 -const struct genl_multicast_group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment