SoulInfernoDE commented on Feb 27, 2021
Hello, here are the log:ASHMEM DKMS make.log for anbox-ashmem-1 for kernel 5.11.0-051100-generic (x86_64) Sa 27. Feb 08:00:47 CET 2021 make -C /lib/modules/5.11.0-051100-generic/build V=0 M=$PWD make[1]: Verzeichnis „/usr/src/linux-headers-5.11.0-051100-generic“ wird betreten CC [M] /var/lib/dkms/anbox-ashmem/1/build/deps.o CC [M] /var/lib/dkms/anbox-ashmem/1/build/ashmem.o LD [M] /var/lib/dkms/anbox-ashmem/1/build/ashmem_linux.o MODPOST /var/lib/dkms/anbox-ashmem/1/build/Module.symvers ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/anbox-ashmem/1/build/ashmem_linux.ko] undefined! make[2]: *** [scripts/Makefile.modpost:111: /var/lib/dkms/anbox-ashmem/1/build/Module.symvers] Fehler 1 make[2]: *** Datei „/var/lib/dkms/anbox-ashmem/1/build/Module.symvers“ wird gelöscht make[1]: *** [Makefile:1710: modules] Fehler 2 make[1]: Verzeichnis „/usr/src/linux-headers-5.11.0-051100-generic“ wird verlassen make: *** [Makefile:12: all] Fehler 2 BINDERDKMS make.log for anbox-binder-1 for kernel 5.11.0-051100-generic (x86_64) Sa 27. Feb 08:00:50 CET 2021 make -C /lib/modules/5.11.0-051100-generic/build V=0 M=$PWD make[1]: Verzeichnis „/usr/src/linux-headers-5.11.0-051100-generic“ wird betreten CC [M] /var/lib/dkms/anbox-binder/1/build/deps.o CC [M] /var/lib/dkms/anbox-binder/1/build/binder.o /var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘task_get_unused_fd_flags’: /var/lib/dkms/anbox-binder/1/build/binder.c:444:9: error: implicit declaration of function ‘__alloc_fd’ [-Werror=implicit-function-declaration] 444 | return __alloc_fd(files, 0, rlim_cur, flags); | ^~~~~~~~~~ /var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘task_fd_install’: /var/lib/dkms/anbox-binder/1/build/binder.c:454:3: error: implicit declaration of function ‘__fd_install’; did you mean ‘fd_install’? [-Werror=implicit-function-declaration] 454 | __fd_install(proc->files, fd, file); | ^~~~~~~~~~~~ | fd_install /var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘task_close_fd’: /var/lib/dkms/anbox-binder/1/build/binder.c:467:11: error: implicit declaration of function ‘__close_fd’; did you mean ‘close_fd’? [-Werror=implicit-function-declaration] 467 | retval = __close_fd(proc->files, fd); | ^~~~~~~~~~ | close_fd /var/lib/dkms/anbox-binder/1/build/binder.c: In function ‘binder_mmap’: /var/lib/dkms/anbox-binder/1/build/binder.c:3498:16: error: implicit declaration of function ‘get_files_struct’; did you mean ‘put_files_struct’? [-Werror=implicit-function-declaration] 3498 | proc->files = get_files_struct(current); | ^~~~~~~~~~~~~~~~ | put_files_struct cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/anbox-binder/1/build/binder.o] Fehler 1 make[1]: *** [Makefile:1806: /var/lib/dkms/anbox-binder/1/build] Fehler 2 make[1]: Verzeichnis „/usr/src/linux-headers-5.11.0-051100-generic“ wird verlassen make: *** [Makefile:8: all] Fehler 2 |
2rizzini and polygonnedpotato reacted with thumbs up emoji
rizzini commented on Mar 2, 2021
Same here. |
choff commented on Mar 7, 2021 • edited
Hello all,I just came across the same problem. After some research on this topic, I found out that the build fails because “kallsyms_lookup_name()” is now no longer exported by the kernel for reasons described here: https://lwn.net/Articles/813350 . However, Anbox kernel modules are using kallsyms_lookup_name() to access some internal kernel functions that they otherwise wouldn’t be able to call (such as “zap_page_range”). The Anbox kernel modules should never have used these functions in the first place as they are not supposed to be used by kernel modules (they are lacking an “EXPORT_SYMBOL()” annotation).There is probably nothing that we can do to get these kernel modules to compile for kernels 5.10 and 5.11 anymore. To solve the problems, changes to the upstream kernel would be required to export the (up to now) internal functions like “zap_page_range()” and add an EXPORT_SYMBOL annotation to them.You are probably best off by asking the kernel maintainers of your Linux distribution to include binder and ashmem in their kernels per default. The way it looks right now, building ashmen and binder as kernel modules is no longer a way to go. To make it work again, the Linux kernel devs would need to expose a whole lot of up-to-now internal functions – I am not sure if even they’s be willing to do that.Best regards,Christian |
3FliegendeWurst, stepwise-alan, and knightofmorning reacted with thumbs up emoji
choff commented on Mar 9, 2021
Essentially, this is a duplicate of issue #49 , though the error message you see is slightly different. Please check my last commit in that issue if you really need a solution that makes binder and ashmem work again as modules with the latest kernels. I am using it with kernel 5.10 and it works fine. |
Author
SoulInfernoDE commented on Mar 9, 2021 • edited
So okay im writing down how i am trying to fix the issue for me. (12.03.21 – i reviewed the procedure after some testing.)New edit: successfully compiled and tested! – [13.03.21] Compile kernel with android options enabled:–>> Scripts for automate the following steps can be obtained and improved here: https://github.com/SoulInfernoDE/compile-kernel-from-source.[28.03.23] ### For the lazy ones a modern one liner for copy and paste to your terminal for the first use: rm cfs_noguimerge.sh*; wget https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/v6.x/nogui/cfs_noguimerge.sh && chmod +x cfs_noguimerge.sh && ./cfs_noguimerge.sh .### For the second use you need to delete all files generated by the script / tool to work correctly again: rm cfs_noguimerge.sh*; sudo rm -f ~/Downloads/linux-*.deb ~/Downloads/linux-*.buildinfo ~/Downloads/linux-*.changes ~/Downloads/ashmemk6.tar.xz*; sudo rm -R -f ~/Downloads/kernel/ ~/Downloads/anboxashmem/; wget https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/v6.x/nogui/cfs_noguimerge.sh && chmod +x cfs_noguimerge.sh && ./cfs_noguimerge.sh .i am using Linux Mint 21.1 with Kernel 6.1.12 from UKUU utility which downloads and installs the kernels from official source. (you can always manually download and install them on http://kernel.ubuntu.com/~kernel-ppa/mainline/ but ukuu automates that with a nice gui – its not for free so manually installing them is the recommend way for most ppl.) Steps to manually compile your kernel with ANDROID options:Show your current installed kernel: uname -a Linux 5.11.6-051106-generic #202103111435 SMP Thu Mar 11 14:42:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Installing propably needed dependencies: sudo apt install git dwarves build-essential fakeroot bc kmod cpio libncurses5-dev libgtk2.0-dev libglib2.0-dev libglade2-dev libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev dpkg-dev autoconf libdw-dev cmake zstd **download and install dependency dwarves: (deprecated since newer linux versions already include this) ** http://archive.ubuntu.com/ubuntu/pool/universe/d/dwarves-dfsg/dwarves_1.21-0ubuntu1~20.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/d/dwarves-dfsg/dwarves_1.20-1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/libb/libbpf/libbpf0_0.3-2ubuntu1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc6_2.33-0ubuntu5_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc6_2.33-0ubuntu5_i386.deb http://mirrors.kernel.org/ubuntu/pool/main/f/fakeroot/libfakeroot_1.25.3-1.1ubuntu2_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/f/fakeroot/fakeroot_1.25.3-1.1ubuntu2_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/locales_2.33-0ubuntu5_all.deb http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc-bin_2.33-0ubuntu5_amd64.debEdit new [12.07.2021]: The newest stable kernel 5.13.1 doesn’t compile with the pahole/dwarves version 1.17 anymore. To fix this i downloaded the source of pahole v1.21, compiled and installed it: git clone https://github.com/acmel/dwarves.git cd dwarves mkdir build cd build sudo cmake -D__LIB=lib -DBUILD_SHARED_LIBS=OFF .. sudo make install I downloaded official kernel source from here: https://www.kernel.org Create a folder where we download the source code, create the compile-configuration parameter file and finally compile the kernel with it: mkdir kernel wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.18.tar.xz tar xvf linux-* -C kernel/ --strip-components=1 cd kernel cd cod/mainline/v5.11.4Information::: You need to have the latest kernel running to copy the correct config file of your current running kernel! I copied the original .config file for building the kernel from my installed one: cp /boot/config-$(uname -r) ./.config KERNEL 5.18.X and above ASHMEM has been dropped completely as to this kernel source patch from torvalds: torvalds/linux@721412eAslong as anbox is using ASHMEM instead of MEMFD we need to revert the deletion of the ASHMEM module patch to be able to use anbox for now. Download the patch in the same directory you downloaded and extracted the kernel sources: wget -O remove_ashmem.patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=721412ed3d819e767cac2b06646bf03aa158aaec Revert the patch with: interdiff -q remove_ashmem.patch /dev/null > enable_ashmem.patch Patch the source code with the reverted patch code: patch -p1 -i enable_ashmem.patch Proceed with the next steps described here – the ASHMEM is now back in the make xconfig afterwards executing: make xconfig or make gconfig or if you build from an already enabled android options enabled kernel make an oldconfig with make olddefconfig scroll through the menu and look for ashmem and binder. (One is inside stageing driver if i remember correct.) Scroll further down to the next Android section: Double click to activate the marked points and save as you are ready. https://lists.ubuntu.com/archives/kernel-team/2020-October/113929.htmlCopy from CONFIG_SYSTEM_TRUSTED_KEYS="" and CONFIG_SYSTEM_REVOCATION_KEYS="" Start compile with a simple:time nice make bindeb-pkg LOCALVERSION=-android If you want to compile with more cores run the command nproc and then you see your availabe cores. Run with number of cores you want to use -jX:time nice make -j4 bindeb-pkg LOCALVERSION=-android Note: The time command counts how long the build process have taken after it finished.Then install the deb packages which should be in your parent directorycd .. sudo dpkg -i linux-*.deb Restart and enter:uname -a it should print something like *android-1 then you know it booted the newly generated kernel.Warning:Doing so needs some space and much time to build. I am still building… …i will get back and report if it worked for me.Edit 13.03.21: Successfully compiled the kernel with older 4 core-laptop in about 3 hours. After compiling try to follow the instructions to activate binderfs and activate /dev/binder permanent on boot. uname -a says:Linux 5.11.6android1 #1 SMP Fri Mar 12 11:32:19 CET 2021 x86_64 x86_64 x86_64 GNU/LinuxEdit: Link to GDrive where i layed down my compiled deb-files for own history. (Using it in your own environment at your own risk!)Pre-compiled *.debs:6.x Branch Added updated kernel version builded within Linux Mint 21 Vanessa (based on Ubuntu 22.04) 6.0 stable/main branch from kernel.org (08.10.22) Added updated kernel version builded within Linux Mint 21.1 (based on Ubuntu 22.04) 6.1.12 stable/main branch from kernel.org (15.02.23) Added updated kernel version builded within Linux Mint 21.1 (based on Ubuntu 22.04) 6.2.8 stable/main branch from kernel.org (26.03.23)NOTE: DUE TO LIMITED TIME FOR THESE THINGS I AM NOT GOING TO UPDATE THE LIST FREQUENTLY. I WILL UPDATE THE GDRIVE FOLDER FROM TIME TO TIME WITHOUT NOTICE HERE´´WARNING! In 5.18.x ASHMEM has been completely removed from the kernel according to this commit from torvalds: torvalds/linux@721412e we need to revert that patch until anbox uses MEMFD instead of ASHMEM to be able to use anbox again.– Future plan is to compile some kernel branches with the latest / last EOL kernel for other use cases and clean/remove old/deprecated ones.Note as of now: (09.07.21)To be able to successfully build and run the latest kernel versions with linux mint 20.x you need newer glibc and gcc versions which are included in ubuntu 21.10 already. Unfortunately i didn’t figure out yet how i could update them without “heart touching” the whole linux mint 20.x system. It is until now very complicated as you need to compile gcc and glibc from source and maybe many other dependencys that relay on other updated dependencys and updated gcc and glibc. So for me until now i workaround this with a virtual machine (i use a synology virtual machine which works independend of my laptop. You may could use QEMU for example if you really want to build from scratch) and the latest ubuntu 21.04 installation where i use this handbook i wrote together to build the newer kernels there until linux mint switches to the new ubuntu base image where many apps and dependencys will get updates and higher versions included. I know this is very uncomfortable actually but in my opinion more stressless. Maybe i’ll try docker anytime in the future to build it in the future where we could create a preconfigured ubuntu image with dependencys already installed but thats on another star yet. If you need any option enabled in the kernel i can do that for my own pre-compiled kernels also, just leave a note here what you need. I dont care about some more drivers or options included even if i don’t use them.So if you want to compile newer kernels i’ll suggest to stick to older ones actually or maybe to the 5.12.x branch where compiling could be done with the included files and apps from linux mint 20.x system.Secure Boot / UEFI: (05.04.22) Using newer hardware with UEFI / Secure Boot active will need an extra step to make the changed android kernel builds boot. I recommend to take a look at this Information: (Thanks to jakeday to write down the steps for the average user like me) https://github.com/jakeday/linux-surface/blob/3267e4ea1f318bb9716d6742d79162de8277dea2/SIGNING.md.28.03.23: You can also have a look at this script / tool which automates the secure boot / uefi signing process ( a standard mok file is generated with dummy informations used in the certificate and signed with your newly generated kernel)/v6.x/signkernel/cfs_signkernel.sh.### And for the lazy ones that want to copy and paste into a terminal: rm cfs_signkernel.sh*; wget https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/v6.x/signkernel/cfs_signkernel.sh && chmod +x cfs_signkernel.sh && ./cfs_signkernel.sh . |
11polygonnedpotato, ZhongYic00, Stitch-Zhang, totedati, Reticove, RankoR, bardiarajabi, tamckenna, Toni500github, kinlish, and stepwise-alan reacted with thumbs up emoji4adil192, fabiosammy, RankoR, and Toni500github reacted with hooray emoji4ZhongYic00, GeorgeV220, RankoR, and hakan-demirli reacted with heart emoji
Author
SoulInfernoDE commented on Mar 10, 2021
Hello all, i tried to compile the kernel like mentioned before but its more trial and error and guessing. I try to learn and understood linux and all the compiling things but im quietly new to this.It did compile and install but it did not install the modules and therefore i couldn’t boot into the system. Also it said it compiled 5.10 instead 5.11. Anyone wants to provide help to this topic as the best way seems to be to enable the in built modules as for now.And the new ubuntu kernels seems to not have them enabled by default (v.5.11;v5.10 etc.) |
choff commented on Mar 10, 2021
Hello @SoulInfernoDE ,first of all, as soon as you build something into the kernel, it’s not a module anymore. Modules are just dynamically loadable “plugins” for the kernel. So, if you have compiled ashmem and binder support into your kernel, ashmem and binder are not modules. They are just part of the main kernel.What is the error message you see from Anbox? Is it complaining that either ashmem or binder kernel module is not loaded? Maybe in that case, it will help to upgrade Anbox… Maybe Anbox some time ago only supported the external kernel modules and not yet the built-in ashmem and binder functionality that is now available with recent kernels.You should try to check the kernel config of your hand-compiled kernel with one of the methods described here: https://superuser.com/questions/287371/obtain-kernel-config-from-currently-running-linux-system and verify that ashmem and binder are indeed enabled.Do at least my “hacked” kernel modules for ashmem and binder work for you? Best regards,Christian |
Author
SoulInfernoDE commented on Mar 11, 2021 • edited
Hello Christian, thanks for assisting. I am actually not at home to test your method. What I can say is that if I try to mount binder it says unknown file system. So I am sure my kernel don’t know binder yet and if I look at the configuration file .config it is not active yet. Therefore the inbuilt ashmem and binder hasn’t been compiled into the kernel yet.Also the copied config from actual kernel says: ANDROID not configuredWhich make menuconfig confirms this |
choff commented on Mar 11, 2021
Hello @SoulInfernoDE ,all right, then you know the root cause at the very least :-)I think you are using some Ubuntu-based distributon. Ubuntu applies its own patches to the kernel and building a kernel for Ubuntu is described here: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel . This description also tells you how you can modify the kernel configuration.If you use a standard kernel without Ubuntu modifications, a simple “make menuconfig” will do the trick. But Ubuntu kernels are built in a different way and different commands need to be used there, so a “make menuconfig” will likely not work and you need to follow the instructions from the Ubuntu page that I have linked above.Best regards,Christian |
Author
SoulInfernoDE commented on Mar 11, 2021 • edited
Hello Christian, thanks for trying to support. It’s the same article I mentioned under installing dependencies :-)I have found this guide and will check that when I’m back home:https://tutorialforlinux.com/2021/01/15/how-to-install-kernel-5-11-from-source-on-linux-mint-20/WARNING: unfortunately this guide site has many ads. Still noted because it could help us.Edit:Also found this video guide: https://youtu.be/E4yRcmQqvWM13.03.21 – I collected informations and successfully tested and compiled the kernel with the android options enabled.You can read the solution here if you want to try it yourself and dont know how yet: #75 (comment)Edit: 18.03.21Successfully build 5.11.7 real 163m8,412s user 553m7,071s sys 54m21,928s |
SoulInfernoDE mentioned this issue on Mar 16, 2021
Linux Mint 20 ashmem/binder anbox/anbox#1721
Closed
This was referenced on Mar 26, 2021
Open
Binder not building on pop os #77
Closed
binder_linux: binder_alloc_buf failed to map page at 0000000087962a40 in kernel #73
Open
Open
memnoth commented on May 24, 2021 • edited
@SoulInfernoDE aren’t the configs, ASHMEM/BINDER depended on ANDROID as platform dependency? so that you enable the dependency in force?here is menuconfig help for ashmemDepends on: STAGING [=n] && ANDROID [=n] && SHMEM [=n] EditedJust figured out that I can manually pick the dependency 🙂 |
1SoulInfernoDE reacted with heart emoji
SoulInfernoDE mentioned this issue on Aug 8, 2021
Error when installing from source: binary package for anbox-ashmem: 1 not found #82
Open
adil192 commented on Aug 22, 2021 • edited
Small update for anyone who comes across this thread…sudo apt install git dwarves build-essential fakeroot bc kmod kernel-package cpio libncurses5-dev libgtk2.0-dev libglib2.0-dev libglade2-dev libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev dpkg-dev autoconf libdw-dev cmakeFor me there was no kernel-package , and I was missing zstd. So the updated command can besudo apt install git dwarves build-essential fakeroot bc kmod cpio libncurses5-dev libgtk2.0-dev libglib2.0-dev libglade2-dev libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev dpkg-dev autoconf libdw-dev cmake zstd To fix the certificate error while compiling you need to remove path data in ” ” the line:CONFIG_SYSTEM_TRUSTED_KEYS="" I needed to remove the path from both trusted keys and revocation keys in my .config file:CONFIG_SYSTEM_TRUSTED_KEYS="" ... CONFIG_SYSTEM_REVOCATION_KEYS="" |
2SoulInfernoDE and NonstickAtom785 reacted with heart emoji
Author
SoulInfernoDE commented on Sep 11, 2021
I added that info and updated my notes. Thanks @adil192 |
1adil192 reacted with thumbs up emoji
This was referenced on Dec 7, 2021
ubuntu 20.04 内核5.11.0-42-generic 编译失败(bad exit status: 2) #87
Open
Open
Open
SoulInfernoDE mentioned this issue on Dec 17, 2021
Failed to build anbox-modules on Fedora 35 linux kernel 5.15.7 #88
Open
This was referenced on Apr 6, 2022
ERROR (dkms apport): binary package for anbox-binder: 1 not found #92
Open
Error! Bad return status for module build on kernel: 5.16.0-kali2-amd64 (x86_64) #91
Open
ls: cannot access ‘/dev/binder’: No such file or directory #90
Open
Failed to load on kernel 5.15 #89
Open
SeremTitus commented on May 5, 2022 • edited
I been having hard time trying to build and install this kernel modules, this issues’ comment seem to have a solution however not being an expert in the Linux kernel am lost in the technicalities. Can some one help me out by linking a script that just works…I am on Ubuntu |
Author
SoulInfernoDE commented on May 5, 2022 • edited
i can try to make a script for you. You can also use my precompiled .deb files if you like:https://drive.google.com/drive/folders/1X4ojO2KYExc94yc5XFlPx7M_tKu-5gBy?usp=sharingKernel 5.17.5 direct link: https://drive.google.com/drive/folders/1TakXT93Q16s_Sz7zOcmAZ7L4xvMy8WECInstructions for the deb files:Download at least the Linux-Image, Linux Headers and Linux-libc deb-files. (To your downloads folder)open terminal and enter: cd Downloads sudo dpkg -i linux-*.deb Reboot and open terminal:uname -a If you see something like this:Then you have the modules built in and loaded..What you need to do now is to activate the binder to make anbox work:#49 (comment) and #50 (comment).For the one shot script i will try to write it now.Edit:Creating the scripts is ongoing – the goal is a one shot nogui version and a gui version where you can manually add/change options. As i am doing all this in my spare time i will update and improve it from time to time.You can find the scripts here: https://github.com/SoulInfernoDE/compile-kernel-from-source |
SeremTitus commented on May 5, 2022
#75 (comment), took care of this issue for me.Thanks to @SoulInfernoDE for help . And can you consider creating pull request |
1SoulInfernoDE reacted with thumbs up emoji
Author
SoulInfernoDE commented on Jun 2, 2022
#75 (comment), took care of this issue for me.Thanks to @SoulInfernoDE for help . And can you consider creating pull requestSure, pull request is opened to your fork. If you have any ideas or suggestions feel free to contribute and pull request them back to my main branch. |
6 hidden itemsLoad more…
Author
SoulInfernoDE commented on Jun 25, 2022
I made this script for automation as I compile my kernels often from source and made the steps easier for me:https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/main/nogui/cfs_noguimerge.shYou will be asked to enter the version number you want to compile from source. In your case you can enter: 5.15.0 If it throws any errors, then feel free to report here. You cannot do much wrong as in linux you can install many and multiple kernels at the same time. You can select the one you want to boot after a restart of your computer. If one fails to boot for any reason you just restart and select your generic kernel to boot. |
1DeafMan1983 reacted with thumbs up emoji
DeafMan1983 commented on Jun 25, 2022
Oh … I have much errors 🙁$ ./cfs_noguimerge.sh Kernel Pull Merge Script v0.1a Installing dependencies Reading package lists... Done Building dependency tree... Done Reading state information... Done autoconf is already the newest version (2.71-2). bc is already the newest version (1.07.1-3build1). bison is already the newest version (2:3.8.2+dfsg-1build1). build-essential is already the newest version (12.9ubuntu3). cmake is already the newest version (3.22.1-1ubuntu1). cpio is already the newest version (2.13+dfsg-7). dkms is already the newest version (2.8.7-2ubuntu2). fakeroot is already the newest version (1.28-1ubuntu1). flex is already the newest version (2.6.4-8build2). gawk is already the newest version (1:5.1.0-1build3). kmod is already the newest version (29-1ubuntu1). libdw-dev is already the newest version (0.186-1build1). libelf-dev is already the newest version (0.186-1build1). libglib2.0-dev is already the newest version (2.72.1-1). libiberty-dev is already the newest version (20211102-1build1). libncurses-dev is already the newest version (6.3-2). libncurses5-dev is already the newest version (6.3-2). libpci-dev is already the newest version (1:3.7.0-6). libxi-dev is already the newest version (2:1.8-1build1). nano is already the newest version (6.2-1). packagekit is already the newest version (1.2.5-2ubuntu2). zstd is already the newest version (1.4.8+dfsg-3build1). dwarves is already the newest version (1.22-8). libglade2-dev is already the newest version (1:2.6.4-2.4). libgtk2.0-dev is already the newest version (2.24.33-2ubuntu2). libpackagekitqt5-dev is already the newest version (1.0.2-1). qt5ct is already the newest version (1.5-1build1). dpkg-dev is already the newest version (1.21.1ubuntu2.1). git is already the newest version (1:2.34.1-1ubuntu1.2). libssl-dev is already the newest version (3.0.2-0ubuntu1.5). openssl is already the newest version (3.0.2-0ubuntu1.5). libudev-dev is already the newest version (249.11-0ubuntu3.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. mkdir: cannot create directory ‘kernel’: File exists Which kernel version do you want to compile? (example: 5.18.1) 5.15.0-40 kernel version you entered: 5.15.0-40_android --2022-06-25 14:48:03-- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.0-40.tar.xz Resolving cdn.kernel.org (cdn.kernel.org)... 2a04:4e42:6f::432, 199.232.189.176 Connecting to cdn.kernel.org (cdn.kernel.org)|2a04:4e42:6f::432|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2022-06-25 14:48:03 ERROR 404: Not Found. tar: linux-*: Cannot open: No such file or directory tar: Error is not recoverable: exiting now Downloading the ASHMEM source code removal patch from upstream --2022-06-25 14:48:03-- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=721412ed3d819e767cac2b06646bf03aa158aaec Resolving git.kernel.org (git.kernel.org)... 2604:1380:4601:e00::1, 145.40.68.75 Connecting to git.kernel.org (git.kernel.org)|2604:1380:4601:e00::1|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/plain] Saving to: ‘remove_ashmem.patch’ remove_ashmem.p [ <=> ] 32,04K --.-KB/s in 0,02s 2022-06-25 14:48:03 (1,33 MB/s) - ‘remove_ashmem.patch’ saved [32814] Reverting the removal patch code.. ./cfs_noguimerge.sh: line 24: interdiff: command not found Patching the kernel sources to bring back ASHMEM.. DONE! ASHMEM is now selectable again in your kernel .config file! NOTE: THIS MAY BREAK ANYTIME AS ASHMEM IS REPLACED WITH MEMFD which is not supported by Anbox yet.. make: *** No rule to make target 'olddefconfig'. Stop. Configuration file with standard defaults options: 5.15.0-40_android has been created.. --2022-06-25 14:48:03-- https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/main/nogui/.config-fragment Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8003::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 302 [text/plain] Saving to: ‘.config-fragment.2’ .config-fragmen 100%[=====>] 302 --.-KB/s in 0s 2022-06-25 14:48:03 (13,0 MB/s) - ‘.config-fragment.2’ saved [302/302] ./cfs_noguimerge.sh: line 37: ./scripts/kconfig/merge_config.sh: No such file or directory merging new android options into the .config file: make: *** No rule to make target 'olddefconfig'. Stop. You have 8 cpu cores Ready to start compiling! Enter 'time nice make bindeb-pkg' -j'YOUR NUMBER OF CORES HERE' to start compiling with multi-core mode.. ############################################################### # deb-file creation will start. Do you want to continue? # # # # - Make sure configuration changes are correct! # ############################################################### (y|Y)es (n|N)o # It looks like they won’t compile or failed of tar |
Author
SoulInfernoDE commented on Jun 25, 2022 • edited
Just enter the kernel version number without the build addition -40. For example: correct: 5.15.0wrong: 5.15.0-40report back if it works or if you get further errors.Edit: You can also try to build the newest 5.15.49 for example ;-)Edit: I updated the script to include patchutils as requirement as it seems that interdiff is not installed as default on some systems which is needed to reverse a patch |
DeafMan1983 commented on Jun 25, 2022
Hey I have already tried but my current kernel version is see in my first post.I have typed 5.15.0 then it seems not found anything../cfs_noguimerge.sh Kernel Pull Merge Script v0.1a Installing dependencies [sudo] password for deafman1983: Reading package lists... Done Building dependency tree... Done Reading state information... Done autoconf is already the newest version (2.71-2). bc is already the newest version (1.07.1-3build1). bison is already the newest version (2:3.8.2+dfsg-1build1). build-essential is already the newest version (12.9ubuntu3). cmake is already the newest version (3.22.1-1ubuntu1). cpio is already the newest version (2.13+dfsg-7). dkms is already the newest version (2.8.7-2ubuntu2). fakeroot is already the newest version (1.28-1ubuntu1). flex is already the newest version (2.6.4-8build2). gawk is already the newest version (1:5.1.0-1build3). kmod is already the newest version (29-1ubuntu1). libdw-dev is already the newest version (0.186-1build1). libelf-dev is already the newest version (0.186-1build1). libglib2.0-dev is already the newest version (2.72.1-1). libiberty-dev is already the newest version (20211102-1build1). libncurses-dev is already the newest version (6.3-2). libncurses5-dev is already the newest version (6.3-2). libpci-dev is already the newest version (1:3.7.0-6). libxi-dev is already the newest version (2:1.8-1build1). nano is already the newest version (6.2-1). packagekit is already the newest version (1.2.5-2ubuntu2). zstd is already the newest version (1.4.8+dfsg-3build1). dwarves is already the newest version (1.22-8). libglade2-dev is already the newest version (1:2.6.4-2.4). libgtk2.0-dev is already the newest version (2.24.33-2ubuntu2). libpackagekitqt5-dev is already the newest version (1.0.2-1). qt5ct is already the newest version (1.5-1build1). dpkg-dev is already the newest version (1.21.1ubuntu2.1). git is already the newest version (1:2.34.1-1ubuntu1.2). libssl-dev is already the newest version (3.0.2-0ubuntu1.5). openssl is already the newest version (3.0.2-0ubuntu1.5). libudev-dev is already the newest version (249.11-0ubuntu3.1). The following packages were automatically installed and are no longer required: libapparmor1:i386 libasound2:i386 libasyncns0:i386 libdbus-1-3:i386 libflac8:i386 libogg0:i386 libopus0:i386 libpulse0:i386 libsamplerate0:i386 libsndfile1:i386 libsystemd0:i386 libvorbis0a:i386 libvorbisenc2:i386 Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. mkdir: cannot create directory ‘kernel’: File exists Which kernel version do you want to compile? (example: 5.18.1) 5.15.0 kernel version you entered: 5.15.0_android --2022-06-25 15:54:48-- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.0.tar.xz Resolving cdn.kernel.org (cdn.kernel.org)... 2a04:4e42:6f::432, 199.232.189.176 Connecting to cdn.kernel.org (cdn.kernel.org)|2a04:4e42:6f::432|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2022-06-25 15:54:48 ERROR 404: Not Found. tar: linux-*: Cannot open: No such file or directory tar: Error is not recoverable: exiting now Downloading the ASHMEM source code removal patch from upstream --2022-06-25 15:54:48-- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=721412ed3d819e767cac2b06646bf03aa158aaec Resolving git.kernel.org (git.kernel.org)... 2604:1380:4601:e00::1, 145.40.68.75 Connecting to git.kernel.org (git.kernel.org)|2604:1380:4601:e00::1|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/plain] Saving to: ‘remove_ashmem.patch’ remove_ashmem.p [ <=> ] 32,04K --.-KB/s in 0,02s 2022-06-25 15:54:48 (1,36 MB/s) - ‘remove_ashmem.patch’ saved [32814] Reverting the removal patch code.. ./cfs_noguimerge.sh: line 24: interdiff: command not found Patching the kernel sources to bring back ASHMEM.. DONE! ASHMEM is now selectable again in your kernel .config file! NOTE: THIS MAY BREAK ANYTIME AS ASHMEM IS REPLACED WITH MEMFD which is not supported by Anbox yet.. make: *** No rule to make target 'olddefconfig'. Stop. Configuration file with standard defaults options: 5.15.0_android has been created.. --2022-06-25 15:54:48-- https://raw.githubusercontent.com/SoulInfernoDE/compile-kernel-from-source/main/nogui/.config-fragment Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8000::154, 2606:50c0:8002::154, 2606:50c0:8003::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8000::154|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 302 [text/plain] Saving to: ‘.config-fragment.3’ .config-fragmen 100%[=====>] 302 --.-KB/s in 0s 2022-06-25 15:54:49 (38,4 MB/s) - ‘.config-fragment.3’ saved [302/302] ./cfs_noguimerge.sh: line 37: ./scripts/kconfig/merge_config.sh: No such file or directory merging new android options into the .config file: make: *** No rule to make target 'olddefconfig'. Stop. You have 8 cpu cores Ready to start compiling! Enter 'time nice make bindeb-pkg' -j'YOUR NUMBER OF CORES HERE' to start compiling with multi-core mode.. ############################################################### # deb-file creation will start. Do you want to continue? # # # # - Make sure configuration changes are correct! # ############################################################### (y|Y)es (n|N)o # And it can’t create but my current version of Ubuntu 22.04: is Kernel-version 5.15.0-40 What does it mean for current version like 5.15.0 or 5.15.1….Thanks! |
Author
SoulInfernoDE commented on Jun 25, 2022 • edited
Aaah sorry i guess kernel.org removed the last digit for a main version number. So you need to enter 5.15 instead of 5.15.0So the last number of your main kernel version is simple a update for your kernel branch (which also contains security fixes and so on..). Ubuntu for example does test their updates a longer time before adding them to ubuntu. So as you can already get the updated kernel versions and use it for ubuntu itself it takes some more days to get them.Edit: If the patch script line detects that some files already exists just say [n]o.You can view the changes between 5.15 and 5.15.50 here for example: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/?id=v5.15&id2=v5.15.50&dt=2 |
DeafMan1983 commented on Jun 26, 2022 • edited
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
DeafMan1983 commented on Jun 26, 2022 • edited
Welcome my best @SoulInfernoDE ! But it seems I takes longer with dbg.,how do I skip debug version? I see your picture how does it take minutes longer? If you get successful with debug version? |
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
Sure the debug-symbols is not always needed and is very big i know. Im not sure if you can exclude the generation of the debug symbols deb-file but you can just delete or move the linux-dbg.deb file next time you compiled from source before installing it with sudo dpkg -i linux-*.deb so it won’t get installed.If you successfully installed your fresh compiled kernel files then you can reboot and try to start with your new kernel. But first check if your boot menu is correctly configured to be able to select all your installed kernels you want to boot under the advanced menu at boot start: cat /etc/default/grub | grep GRUB_TIMEOUT should show you something like this: which means that after restarting your computer you see a menu and auto start will be done in 3 seconds when nothing is pressed on the keyboard.You can edit the file with a text editor: sudo gedit /etc/default/grub after you changed something in that file and have saved it you need to update the system with the new file: sudo update-grub If your computer blocks it while you want to start, then you need to sign your compiled kernel with your own uefi/secure boot key. I also have a script made for that in case you need it just let me know. |
DeafMan1983 commented on Jun 26, 2022
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
DeafMan1983 commented on Jun 26, 2022
Yeah you are correct but I don’t have modules It is really impossible because I don’t have modules yet sudo dkms remove -m anbox-ashmem -v 1 Error! There is no instance of anbox-ashmem 1 for kernel 5.15.0-40-generic (x86_64) located in the DKMS tree. deafman1983@deafman1983-desktop:~$ sudo dkms remove -m anbox-binder -v 1 Error! There is no instance of anbox-binder 1 for kernel 5.15.0-40-generic (x86_64) located in the DKMS tree. Cause It got error. I think It doesn’t find if I see before sudo dkms status:$ sudo dkms status anbox-ashmem/1: added anbox-binder/1: added v4l2loopback/0.12.5, 5.15.0-39-generic, x86_64: installed v4l2loopback/0.12.5, 5.15.0-40-generic, x86_64: installed v4l2loopback/0.12.5, 5.15.0-android, x86_64: installed I can’t remove both modules.. but I already use “sudo” |
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
hmh the removal needs a correct command line sometimes i forget how it was formed.. ..does this work?sudo dkms remove -m anbox-ashmem -v1 or sudo dkms remove -m anbox-ashmem/1 or sudo dkms remove -m anbox-ashmem/1 --all |
DeafMan1983 commented on Jun 26, 2022
Wow thanks my friend 😀sudo dkms remove -m anbox-ashmem/1 --all It works fine. Thanks It can remove … :DThen I will resolve again… |
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
Very cool – glad it worked Could you boot your newly installed kernel and did you check the output of uname -a && ls -1 /dev/{ashmem,binder} yet? I think checking of installed module and removing it with the script is a good update. Will add that now |
DeafMan1983 commented on Jun 26, 2022
I am very disappointed why is binder not successful for me 🙁 ?I am broken on floor. :/ I can’t fix that. I don’t understand why does it happen with Ubuntu 22.04 I don’t believe that if it doesn’t support for me. |
Author
SoulInfernoDE commented on Jun 26, 2022 • edited
SoulInfernoDE changed the title Kernel 5.11 binder and ashmem not building with dkms Solution for building binder and ashmem modules on kernel version above 5.7 on Sep 12, 2022
SoulInfernoDE mentioned this issue on Sep 26, 2022
issue while installing anbox in kali linux #101
Open
Author
SoulInfernoDE commented on Sep 26, 2022
I am very disappointed why is binder not successful for me 🙁 ?I am broken on floor. :/ I can’t fix that. I don’t understand why does it happen with Ubuntu 22.04 I don’t believe that if it doesn’t support for me.Do you still need help for this? 🙂 |
This was referenced on Sep 26, 2022
Both modules fail to build in DKMS #98
Open
Failed to install using DKMS on Kali Linux #97
Open
gleitoncampos mentioned this issue on Feb 1
In fedora 37, when install kernel module by dkms there’s some issue reported #104
Open
SoulInfernoDE mentioned this issue on Mar 29
orangepi5 can not install #105
Open
acheong08 mentioned this issue on Mar 31
ERROR: Can’t open /dev/anbox-binder: No such file or directory waydroid/waydroid#839
Closed
Sudococommunity commented 3 days ago
i need help i have binder module running but ashmem module is not there and i dont have android.img too my os 6.1.0-1parrot1-amd64 based on debian |
Sudococommunity commented 3 days ago
Sudococommunity commented 3 days ago
Sudococommunity commented 3 days ago
Author
SoulInfernoDE commented 2 days ago
For Ashmem you could try the fix from @choffFirst remove the ashmem dkms module you already have installed and delete the copied files from the original source.Then download the ashmem folder with the ashmem.c fix from here: https://github.com/choff/anbox-modules/tree/masterFinally follow the readme for the part with Ashmem. |
source : https://github.com/anbox/anbox-modules/issues/75