android-rpi / kernel_manifest

Android-RPi Kernel Manifest
9 stars 19 forks source link

Kernel build is failing for arpi-5.10 #7

Open mse6cob opened 2 years ago

mse6cob commented 2 years ago

@peyo-hd :

I got the below error while building the kernel with arpi-5.10.

$ build/build.sh build/build.sh: line 424: nproc: command not found build/build.sh: line 425: readlink: command not found build/build.sh: line 426: readlink: command not found build/build.sh: line 427: readlink: command not found build/build.sh: line 472: rm: command not found

Because of that, I followed the below commands for building the kernel arpi-5.10.

$ cd common $ ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/bcm2711_defconfig kernel/configs/android-base.config kernel/configs/android-recommended.config kernel/configs/android-recommended-arm64.config kernel/configs/android-base-conditional.config $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make Image.gz $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS="-@" make broadcom/bcm2711-rpi-4-b.dtb $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS="-@" make overlays/vc4-kms-v3d-pi4.dtbo $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS="-@" make broadcom/bcm2711-rpi-400.dtb

Build was successful.

Could you please let me know whether it is correct.

Thanks

moonjuice commented 2 years ago

Hi @mse6cob ,

You can try this: under the build folder and use git command: git reset --hard f8ae8a9be8b018ba90a0f576488833fabb3fda74

also make sure you don't have these files or directories:

  1. $(srctree)/.config
  2. $(srctree)/include/config
  3. $(srctree)/arch/$(SRCARCH)/include/generated
zchokri commented 2 years ago

To avoid this issue, put the kernel source under aosp tree : source build/envsetup.sh lunch 66 .cd android-kernel/ ./build/build.sh

icedieler commented 2 years ago

Hi @mse6cob, I experienced the same issue and was able to work around it by using the following command: HERMETIC_TOOLCHAIN=0 build/build.sh That way you can build in a separate directory outside the AOSP tree. Also see my pull request that fixes an issue with the prebuilt toolchain.

peyo-hd commented 2 years ago

After checking PR of @icedieler , Rebased arpi-5.10 to common-android12-5.10-lts. You can check if build works with this change.

mse6cob commented 2 years ago

Hi @peyo-hd ,

Thanks for the input. I have re based again with latest arpi-5.10. But still i facing the below error.

merged configuration written to android_kernel/common/arch/arm64/configs/arpi_defconfig (needs make)

set +x
cd common
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=android_kernel/out/arpi-5.10/common arpi_defconfig
make[1]: Entering directory 'android_kernel/out/arpi-5.10/common'

The source tree is not clean, please run 'make mrproper' in android_kernel/common

make[1]: [/android_kernel/common/Makefile:562: outputmakefile] Error 1 make[1]: Leaving directory android_kernel/out/arpi-5.10/common' make: [Makefile:185: __sub-make] Error 2

So I have tried with (https://github.com/MaJiu/kernel_manifest) . Build is successful.

https://github.com/android-rpi/device_arpi_rpi4/issues/96#issuecomment-1048349487

Thanks.

mse6cob commented 2 years ago

Hi @peyo-hd @icedieler ,

I am able to run android 12 on Raspberry Pi4.

But NOT able to connect adb over USB..

Could you please let me know the steps for connect adb over USB.

Thanks.

icedieler commented 2 years ago

Hi, unfortunately that is not possible because the USB ports on the Raspberry Pi 4 do not support device mode. You can use ADB via network though.

mse6cob commented 2 years ago

Hi @icedieler,

We are not able to navigate through Developer options while selecting is redirected to Home screen. Could you share the steps to enable ADB via network without using USB.

Thanks.

icedieler commented 2 years ago

Hi @mse6cob , what kind of Android build do you have? If it is an engineering build then adbd is started by default. You don't need to do anything on the device. Just plugin an ethernet cable and from your host you can connect via adb connect <ip addr> && adb shell

mse6cob commented 2 years ago

Hi @icedieler ,

I am building the android source using the below repository. I think it is an engineering build.

https://github.com/android-rpi/local_manifests

Android12 build is successful and it is up and running . But I am not able to get the ip address of the Pi4.

Please find the ifconfig output of Pi4.

console:/ $ ifconfig lo [ 158.089727] type=1400 audit(1649139958.303:532): avc: denied { ioctl } for comm="ifconfig" path="socket:[36746]" dev="sockfs" ino=36746 ioctlcmd=0x8927 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=udp_socket permissive=1 Link e[ 158.110701] type=1400 audit(1649139958.303:533): avc: denied { ioctl } for comm="ifconfig" path="socket:[36746]" dev="sockfs" ino=36746 ioctlcmd=0x891d scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=udp_socket permissive=1 ncap:Local Loopback inet addr:127.0.0.1 Ma[ 158.136071] type=1400 audit(1649139958.347:534): avc: denied { ioctl } for comm="ifconfig" path="socket:[36746]" dev="sockfs" ino=36746 ioctlcmd=0x8970 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=udp_socket permissive=1 sk:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:52 errors:0 dropped:0 overruns:0 frame:0 TX packets:52 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:8199 TX bytes:8199

dummy0 Link encap:Ethernet HWaddr f6:44:18:2e:78:f6 inet6 addr: fe80::f444:18ff:fe2e:78f6/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:62 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:12228

eth0 Link encap:Ethernet HWaddr e4:5f:01:72:b9:12 Driver bcmgenet inet6 addr: fe80::e4e1:4dce:e298:68ba/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:35 errors:0 dropped:0 overruns:0 frame:0 TX packets:28 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3706 TX bytes:4595

If I set the IPAddress, "Operation not permitted" message is seen in console.

console:/ $ ifconfig eth0 192.168.1.2 ifconfig: ioctl [ 226.138011] type=1400 audit(1649140026.351:799): avc: denied { ioctl } for comm="ifconfig" path="socket:[51233]" dev="sockfs" ino=51233 ioctlcmd=0x8916 scontext=u:r:shell:s0 tcontext=u:r:shell:s0 tclass=udp_socket permissive=1 8916: Operation not permitted

Could you please let me know how to set the IPAddress.

Note: Also I have tried another variant of android 12(omnirom) using the below repository. In this I am able to connect adb over USB.

https://github.com/omnirom/android_device_brcm_rpi4

Thanks.

icedieler commented 2 years ago

Yes, you cannot manually configure an IP address as a non-privileged user. The easiest thing would be to have a DHCP server on your network that just assigns an IP address to your Pi. Alternatively you can achieve that with manual ip commands setting the IP address, gateway etc. in a custom init.rc.

mse6cob commented 2 years ago

Hi @icedieler @peyo-hd,

I have checked the services which are running in Pi board.

DHCP service is NOT running

Could you share the steps of manual ip setting in init.rc file.

Thanks.

icedieler commented 2 years ago

You can use the ip command for that e.g.

ip address add $ADDR dev eth0