Skip to content

Commit 22e5043

Browse files
authored
Fix warnings (#164)
* Fix warnings and some minor reformulations * try again, maybe travis ci likes this better
1 parent 66d2f5e commit 22e5043

File tree

2 files changed

+50
-33
lines changed

2 files changed

+50
-33
lines changed

porting/common-kernel-build-errors.rst

+38-23
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,63 @@ These are the ``hybris-boot`` build errors most commonly seen in the Halium comm
66
Implicit declaration of 'kvfree'
77
--------------------------------
88

9-
If you receive something similar to the following error::
9+
If you receive something similar to the following error:
1010

11-
../../../../../../kernel/[...]/[...]/security/apparmor/apparmorfs.c: In function 'aa_simple_write_to_buffer':
12-
../../../../../../kernel/[...]/[...]/security/apparmor/apparmorfs.c:110:3: error: implicit declaration of function 'kvfree' [-Werror=implicit-function-declaration]
11+
.. code-block:: text
12+
13+
kernel/[...]/[...]/security/apparmor/apparmorfs.c: In function 'aa_simple_write_to_buffer':
14+
kernel/[...]/[...]/security/apparmor/apparmorfs.c:110:3: error: implicit declaration of function 'kvfree' [-Werror=implicit-function-declaration]
1315
kvfree(data);
1416
1517
Apply the patch `nick kvfree() from apparmor`_.
1618

1719
'kuid_t' (sdcardfs, cgroup) error
1820
---------------------------------
1921

20-
Example of the error::
22+
Example of the error:
23+
24+
.. code-block:: text
2125
22-
../../../../../../kernel/lenovo/msm8916/kernel/cgroup.c:2138:37: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
26+
kernel/lenovo/msm8916/kernel/cgroup.c:2138:37: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
2327
if (current != task && cred->euid != tcred->uid &&
2428
25-
../../../../../../kernel/lenovo/msm8916/kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
29+
kernel/lenovo/msm8916/kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
2630
cred->euid != tcred->suid)
2731
2832
Set ``CONFIG_USER_NS`` to ``n`` in your defconfig.
2933

3034
Firmware class error
3135
--------------------
3236

33-
Example of the error::
37+
Example of the error:
3438

35-
../../../../../../kernel/lenovo/msm8916/drivers/base/firmware_class.c: In function '_request_firmware':
36-
../../../../../../kernel/lenovo/msm8916/drivers/base/firmware_class.c:1226:38: warning: passing argument 2 of 'fw_load_from_user_helper' from incompatible pointer type
39+
.. code-block:: text
40+
41+
kernel/lenovo/msm8916/drivers/base/firmware_class.c: In function '_request_firmware':
42+
kernel/lenovo/msm8916/drivers/base/firmware_class.c:1226:38: warning: passing argument 2 of 'fw_load_from_user_helper' from incompatible pointer type
3743
error, forbidden warning: firmware_class.c:1226
3844
3945
Set ``CONFIG_FW_LOADER_USER_HELPER`` to ``y`` in your defconfig.
4046

4147
ECRYPTFS error
4248
--------------
4349

44-
Example of the error::
50+
Example of the error:
51+
52+
.. code-block:: text
4553
46-
../../../../../../kernel/lenovo/msm8916/fs/ecryptfs/file.c: In function 'ecryptfs_readdir':
47-
../../../../../../kernel/lenovo/msm8916/fs/ecryptfs/file.c:130:16: error: assignment of read-only member 'actor'
48-
buf.ctx.actor = ecryptfs_filldir;
54+
kernel/lenovo/msm8916/fs/ecryptfs/file.c: In function 'ecryptfs_readdir':
55+
kernel/lenovo/msm8916/fs/ecryptfs/file.c:130:16: error: assignment of read-only member 'actor'
56+
buf.ctx.actor = ecryptfs_filldir;
4957
5058
Apply `'patch ecryptfs to fix a build error' from bullhead`_.
5159

5260
'Undefined reference to pidns_operations' on Linux 3.4
5361
------------------------------------------------------
5462

55-
The implementation of PID Namespacing was incomplete in the Android kernel 3.4, causing the following error::
63+
The implementation of PID Namespacing was incomplete in the Android kernel 3.4, causing the following error:
64+
65+
.. code-block:: text
5666
5767
fs/built-in.o:namespaces.c:ns_entries: error: undefined reference to 'pidns_operations'
5868
@@ -61,20 +71,24 @@ To fix this issue, apply the patch `Finish implementation of PID namespace`_
6171
'struct perf_cpu_context' has no member named 'unique_pmu'
6272
----------------------------------------------------------
6373

64-
This is caused by an incomplete merge of a few changes in some 3.4 kernels::
74+
This is caused by an incomplete merge of a few changes in some 3.4 kernels:
75+
76+
.. code-block:: text
6577
66-
/../../../../kernel/fairphone/msm8974/kernel/events/core.c: In function 'perf_cgroup_switch':
67-
/../../../../kernel/fairphone/msm8974/kernel/events/core.c:379:13: error: 'struct perf_cpu_context' has no member named 'unique_pmu'
78+
kernel/fairphone/msm8974/kernel/events/core.c: In function 'perf_cgroup_switch':
79+
kernel/fairphone/msm8974/kernel/events/core.c:379:13: error: 'struct perf_cpu_context' has no member named 'unique_pmu'
6880
if (cpuctx->unique_pmu != pmu)
6981
7082
To fix this issue, apply `perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu`_
7183

7284
'PROC_PID_INIT_INO' undeclared here (not in a function)
7385
-------------------------------------------------------
7486

75-
Somehow, the implementation of the ``/proc`` filesystem is incomplete in some 3.4 kernels::
87+
Somehow, the implementation of the ``/proc`` filesystem is incomplete in some 3.4 kernels:
7688

77-
/../../../../kernel/fairphone/msm8974/kernel/pid.c:81:15: error: 'PROC_PID_INIT_INO' undeclared here (not in a function)
89+
.. code-block:: text
90+
91+
kernel/fairphone/msm8974/kernel/pid.c:81:15: error: 'PROC_PID_INIT_INO' undeclared here (not in a function)
7892
.proc_inum = PROC_PID_INIT_INO,
7993
8094
Add the following line after all of the other ``#include`` lines in the file kernel/user_namespace.c similar to https://github.com/Halium/android_kernel_lge_hammerhead/commit/5754614eb43dea44a99e54898e3b83d4d96d8b83 ::
@@ -84,11 +98,12 @@ Add the following line after all of the other ``#include`` lines in the file ker
8498
POSIX_ACL not supported in 3.18 backport
8599
----------------------------------------
86100

87-
Example of the error::
101+
Example of the error:
102+
103+
.. code-block:: text
88104
89-
/home/florian/halium-7.1/kernel/huawei/angler/fs/ext4/inode.c: In function 'ext4_setattr':
90-
/home/florian/halium-7.1/kernel/huawei/angler/fs/ext4/inode.c:4717:2: error: #error POSIX_ACL not supported in 3.18 backport
91-
#error POSIX_ACL not supported in 3.18 backport
105+
kernel/huawei/angler/fs/ext4/inode.c: In function 'ext4_setattr':
106+
kernel/huawei/angler/fs/ext4/inode.c:4717:2: error: #error POSIX_ACL not supported in 3.18 backport
92107
93108
Set ``CONFIG_EXT4_FS_POSIX_ACL`` to ``n`` in your defconfig.
94109

porting/common-system-build-errors.rst

+12-10
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ Also check the vendor folders of your dependencies.
1717
Undefined or missing bluetooth headers
1818
--------------------------------------
1919

20-
.. code-block:: guess
20+
.. todo::
2121

22-
*TODO: example*
22+
add example of error message
2323

24-
Some devices requires bluetooth when compiling, which aren't synced for default by Halium. This can be fixed adding LineageOS's repo to the device manifest:
24+
Some devices require bluetooth headers which aren't synced by default. This can be fixed by adding the following repository to the device manifest:
2525

26-
... to the device manifest::
26+
.. code-block:: xml
2727
2828
<project path="system/bt" name="android_system_bt" remote="los" revision="cm-14.1" />
2929
3030
HYBRIS_BOOT_PART and HYBRIS_DATA_PART
3131
-------------------------------------
3232

33-
.. code-block:: guess
33+
.. code-block:: text
3434
3535
find: ‘device/*/generic’: No such file or directory
3636
find: ‘device/unknown’: No such file or directory
@@ -39,30 +39,32 @@ HYBRIS_BOOT_PART and HYBRIS_DATA_PART
3939
halium/hybris-boot/Android.mk:68: ********************* /data appears to live on ERROR: *fstab* not found
4040
halium/hybris-boot/Android.mk:71: *** There should be a one and only one device entry for HYBRIS_BOOT_PART and HYBRIS_DATA_PART.
4141
42-
Make sure you run the commands :ref:`here <breakfast-and-lunch>` before trying to build. The Makefile depends on the environment set up immediately before by envsetup.sh; so if running in a build environment such as Emacs, be sure to set your compile command to something like "source build/envsetup.sh && breakfast [codename] && make [target]"
42+
Make sure you rerun the :ref:`initialization commands <breakfast-and-lunch>` before trying to build. The Makefile depends on the environment set up immediately before by ``envsetup.sh``. So if running in a build environment such as Emacs, be sure to set your compile command to something like ``source build/envsetup.sh && breakfast [codename] && make [target]``.
4343

4444

4545
.. _remove apks on lyudmila17/android_device_motorola_athene: https://github.com/Lyudmila17/android_device_motorola_athene/commit/a752422012165d937c058c1b671497bad44a4962
4646

4747
Flex locale error
4848
-----------------
4949

50-
.. code-block:: guess
50+
.. code-block:: text
5151
5252
[ 19% 2365/12156] Lex: checkpolicy <= external/selinux/libsepol/cil/src/cil_lexer.l
5353
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/home/peter/docs/devel/halium.amami/out/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/cil/src/cil_lexer.c external/selinux/libsepol/cil/src/cil_lexer.l"
5454
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
5555
Aborted (core dumped)
5656
57-
This seems to be a problem with locales and the prebuilt ``flex``. You can avoid this by using the flex installed on your host::
57+
This seems to be a problem with locales and the prebuilt ``flex``. You can avoid this by using the flex installed on your host:
58+
59+
.. code-block:: bash
5860
5961
export USE_HOST_LEX=yes
6062
make systemimage
6163
6264
Missing bison error
6365
-------------------
6466

65-
.. code-block:: guess
67+
.. code-block:: text
6668
6769
[ 1% 322/20069] Yacc: checkpolicy <= external/selinux/checkpolicy/policy_parse.y
6870
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d -v --defines=/home/builder/workdir/out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.h -o /home/builder/workdir/out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c external/selinux/checkpolicy/policy_parse.y"
@@ -72,7 +74,7 @@ The error message is very misleading here. The issue stems from the bison shippe
7274

7375
The fix is to install 32-bit support for Ubuntu via:
7476

75-
.. code-block:: guess
77+
.. code-block:: bash
7678
7779
sudo dpkg --add-architecture i386
7880
sudo apt-get update

0 commit comments

Comments
 (0)