Debian Buster WSL2 Kernel / ROM Builder [replaces VM] - OnePlus 8T Guides, News, & Discussion

Okay I don't have enough time to update this whole description, no one volunteered to host the VM so now I only have a Debian Buster WSL2 (Windows 10 latest) build environment. You can make kernels and ROMs from it. It has a built in XFCE4 and all the features listed below. It will build kernels for you from source and place them in AnyKernel3 zip files ready for flashing in the ~/ directory. Build scripts are provided for Op8T 5G custom and GPUOC RadioActive Kernels from my GitHub (modded for performance + battery). You can use this guide and get full audio and a GUI and all you need to build.
Try out this build for Debian Buster for WSL2:
First you need to ensure you are on a recent build of Windows, go to windows Updates in settings and download the latest.
Next open a Powershell Command Prompt in Admin mode. Type:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Restart your PC, then get back into an Admin Powershell prompt and type:
wsl --set-default-version 2
Next you can download this tar.gz distribution, it's quite big (6GB zipped -> 14GB unzipped). Apparently you can import a tar.gz directly, so I changed it from a .zip file to .gz: https://mega.nz/file/DkARXIjD#hGu8TjxaA__YrRsfqfWJw9-2ViyyntyK5U8JdClor6A
Easily move WSL distributions between Windows 10 machines with import and export!
wsl --import <DistributionName> <InstallLocation> <Full path to .tar/.tar.gz FileName>
After import, you should type: login: user password: user (also the sudo password) change the Global Git settings to your own email and username.
Open the command line.
Set your username: git config --global user.name "FIRST_NAME LAST_NAME"
Set your email address: git config --global user.email "[email protected]"
Then if you want to set up SSH between your WSL2 instance and NoMachine, download NoMachine here for your host PC: https://www.nomachine.com/download/download&id=8 then follow the steps to generate an SSH key, which will be located at ~/.ssh.
ssh-keygen -m PEM -t rsa -b 4096
Use the directory default ~/.ssh/
Then copy this file: ~/.ssh/id_rsa.pub to ~/.nx/config/authorized.crt
In the NoMachine GUI, you should select Configuration, Use a key based authentication key which you provide, then provide the path to the private key \\wsl$\debian\home\user\.ssh\id_rsa and check the box Import the key to the connection file.
To get to the XFCE4 GUI, you should type login: user password: user, then run /.nomachine.sh
It will post the IPV6 address you need to enter into the configuration into NoMachine on Windows 10. It changes every time you open it (WSL2 problem).
Now you should be able to connect to the GUI and use all the dev tools built in. Or you can just use the command line if you're more comfortable there. You'll probably need to do some more Googling to get everything setup the way you like. There are 2 examples in this file for an Op8T RadioActive modded kernel from my GitHub repos with a ./Build-Clang12.sh script you can use to see how to build a kernel. It it fully automatic. It will generate the zip specified in that file in the ~/ directory which can be flashed to a device via EX Kernel Manager or FK Kernel Manager. Best of luck!

Great job mate. I hope this is the kick off and boost up kernel development on the MI9 ??

Now THAT is what XDA is all about.
I'd like to get in to this type of development but simply don't have the personal time right now.
Hope this helps boost community support a bit.
This must've taken some time. Hats off to you sir.

kickassdave said:
Now THAT is what XDA is all about.
I'd like to get in to this type of development but simply don't have the personal time right now.
Hope this helps boost community support a bit.
This must've taken some time. Hats off to you sir.
Click to expand...
Click to collapse
Thanks Dave - this is the absolute easiest way to build a kernel. Yes it took forever to get working, a lot had to do with bad Xiaomi source code and Android 9 package requirements for building kernels. You can simply download, install, click Goto Build, click on QClang8_Build, copy/paste it's text from Geany into the open terminal, sit back and wait for the build to finish. Then once it completes, you click on Built Kernels and you have your image ready. A few more steps obviously outlined in the post to transfer to the host machine (cp Image-dtb /media/sf_VMxfer) and pack via Android Image Kitchen, copy to the device, and flash via TWRP. Most features require Magisk patching as well to enable altering in a kernel manager. The mentioned repo (mrslezak) has Fsync toggle, 830GPU overclock, and F2FS file system support (Mauro TWRP has just enabled it, so I'm using it now). I should note as well that this kernel has only been tested on MIUI and Xiaomi.eu builds thus far (anything based on Xiaomi MIUI should work - MIUI Global Dev, China Dev, Xiaomi.eu, MiGlobe, RevolutionOS, etc. as long as it is Android Pie).
I'm waiting on others to jump on board!!!! Hopefully it happens

Excellent guide, will work for almost all pie devices!
Great work OP :highfive:
Regards,
acervenky

Hi, @mslezak @acervenky Can you help me to build kernel for Stock Miui 10 for K20/Mi9t . I followed your guide setup all requirement i just changed the device code name from cepheus to davinci everything went well kernel complied and also created the boot.img with AIK but after flash it is through back me to recovery.
Can you Please help me with this.

@acervenky fixed that by applying the patch in the Desktop Mi9_Build_Tools/Required_Patches_to_Compile_Xiaomi_Source/cosmin_kernel-module.c copy that to /kernel/module.c, he can chime in here. Or check out his repo he has one on Github that compiles already QUAX kernel I believe with a bunch of stuff added already over stock.

Good job. Compiled a kernel for mi9t pro (raphael) with your detailed guide.
Can you help with "make modules" command?
I need to make xt_HL.ko module, but it not compiling ((
Not needed anymore, made it successfully.

Can you compile q kernels with this?

asgardpark said:
Can you compile q kernels with this?
Click to expand...
Click to collapse
Yes! Just don't replace .dtsi and module.c files for now.
Regards,
acervenky

New Q build VM coming soon. GCC10 x64 and Arter97 GCC9 x32 toolchain.
Just a notice here I have a VM almost ready to upload that can build Mi9 source. It's a ton of patches to stock code but I'll setup a repo with them already applied.

Can i use anykernel to make a flashable zip? Or do i have to use a diffrent approach?

https://mega.nz/#!voJEGIRC!r4FcV6zUlVbFExcidhL9JmgVZlu3IscYH-S5XlnTUJI Android Q VM - expands to 40gb on your hard drive so you don't run out of space. Builds a GCC10 patched version of Xiaomi Cepheus and Raphael kernels from my repo, forked from Xiaomi and commits outlining every step needed to get it to build. https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10

Yes AnyKernel3 is the easiest
asgardpark said:
Can i use anykernel to make a flashable zip? Or do i have to use a diffrent approach?
Click to expand...
Click to collapse
Sure AnyKernel3 is easy, take someone's kernel zip, insert your Image-gz.dtb or Image-dtb into the root of the zip, delete the other kernel, and you should be able to flash it.

got some compile errors today when i tried your wm
/home/user/toolchains/aarch64-linux-elf/bin/aarch64-linux-elf-ar: kernel/resource.o: No such file or directory

I'd first try a: make clean; and: make mrproper;....
But here's more info:
Double click the GoTo Build icon, a terminal will open in the source directory. Then in the terminal: cp /home/user/Desktop/Build GCC10 Cepheus.sh .; chmod +x "Build GCC10 Cepheus.sh"; ./"Build GCC10 Cepheus.sh"; Once done the kernel will be in /home/user/Cepheus-Raphael-Q-GCC10/out/arch/arm64/boot/Image.gz-dtb. /out9TP/ for Raphael, just substitute the build script you need.
If it then still won't build, you'll have to grab the repo again. Type: git pull
Or the safest is a complete re-download: cd ..; rm -rf Cepheus-Raphael-Q-GCC10; git clone --depth=1 https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10.git and repeat the prior copying of the build script to the source directory.
I tested this last night and it worked. If I tried to just drag the script into a terminal window it failed. There could be some dirty files in there not sure how that happened, but deleting and cloning again definitely works. I built both Cepheus and Raphael kernels last night in the VM off a fresh clone of the repo. I'd update I but it literally takes 6hrs + since the files are huge and take forever to compress and upload to Mega. And I have to delete so much off my VM and SSD just to do it. This way you learn something too

I first drag n dropped the file when i got the error, then i remembered when i compiled kernels for my raspberry pi's it also failed if i draged n dropped my build script so i did it the proper way and it worked
Thanks for your WM it's working great

mslezak said:
https://mega.nz/#!voJEGIRC!r4FcV6zUlVbFExcidhL9JmgVZlu3IscYH-S5XlnTUJI Android Q VM - expands to 40gb on your hard drive so you don't run out of space. Builds a GCC10 patched version of Xiaomi Cepheus and Raphael kernels from my repo, forked from Xiaomi and commits outlining every step needed to get it to build. https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10
Click to expand...
Click to collapse
Could you upload the VM to Google Driver? Thank you!

q659503934 said:
Could you upload the VM to Google Driver? Thank you!
Click to expand...
Click to collapse
Yeah if you buy me Google drive space I'd be more than happy to upload to Google Drive. I'm out of space man. If you run Windows 10 Preview WSL2 I have a 3.2GB build that kills everything else out there.

mslezak said:
Yeah if you buy me Google drive space I'd be more than happy to upload to Google Drive. I'm out of space man. If you run Windows 10 Preview WSL2 I have a 3.2GB build that kills everything else out there.
Click to expand...
Click to collapse
Do you have WSL2 tar file that can build Kernel?

Related

[EXPERIMENTAL/TOOLS/GUIDE/ADV.] Toolchain gcc 4.6.3 Cygwin/Linux/OSX; kernel builds

The following contains binaries, and instructions for use of an experimental newer toolchain than those included in the android pre-built package.
This is provided to allow existing linux kernel developers experiment with the updated version of GCC (besides the complicated building instructions the code just has a small patch for a known issue with android and 4.6.* otherwise is directly from GNU (see build information below)
The packages I'm also providing to help developers current on windows (With cygwin but no other virtual environment) to start exploring android Linux kernel development for their devices. (In addition to a OSX toolchain for more advanced mac users)
due to the slight differences between kernels on different devices this How To is intended to be used for advanced users who can adjust for the differences required for the devices specific kernel.
I may add additional guides to this thread if I find a need for them.
[size=+1]Binary Toolchains[/size]
I have two versions of a GCC-4.6.3 toolchain
1) For x86 linux: toolchain-4.6.3.tar.bz2 (Sha1: c8c57aba6ad92e9acddf29ba8620ba880be09a81)
2) For Cygwin (windows): toolchain-4.6.3.cygwin.tar.bz2 (Sha1: 6947e1c1ba95195019f542eb8ba0708667b63eca)
3) For OSX (mac/darwin): toolchain-4.6.3.darwin.tar.bz2 (Sha1: 9a977f0672863fdd9501383a6ad1e30723281f68)
[size=-1]> The linux version was built via this script: http://pastebin.com/b2dZ8YtG (or in the included toolchain_notes.txt)
> The cygwin/darwin version uses the same source however has a slightly modified script (see the included toolchain_notes.txt for the updated script)[/size]
[size=+1]System Requirements[/size]
Note I have a 64bit debian linux box, and a 64bit version of WIndows7 Pro running cygwin, while I believe these binaries ought to be compatible with all x86 linux and cygwin installs these have not been tested by a wide number of people yet.
> Linux users: If you have a working android build environment likely no additional requirements are needed. In addition you must build any kernel/android utilities from a case sensitive filesystem or disk image.
> OSx users: the cygwin packages will give you an idea of what is required, please also see the README in the tar.bz2 about manually installing elf.h
> Cygwin users: as its unlikely you have compiled a kernel with cygwin up to this point you may wish to ensure the following packages are installed (as well as any cygwin recommends to be used with them):
vim
vim-common
make
cmake
lzop
gcc
gcc-core
gcc-g++
wget
git
git-compleation
libncurses-devel
python​
Cygwin users must also set their NTFS file partition to allow case sensitive files:
To do this open regedit and change:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive
to 0
after this reboot and the NTFS kernel will allow cygwin to use case sensitive files (ie 'AbC' and 'aBc' as two different files)​
[size=+1]Advanced Kernel Building Guide[/size]
Since may devices are slightly different this can only be a high level kernel building guide
Please ask for any specific directions from the current kernel maintainer.
To most people who have built kernels before this will look familiar, the most important part is preparing your local environment to use the new toolchain,
1) If you have not already download the tar.bz2 above, (pick the one for the computer you are preparing to build kernels on)
2) extract the file (for the sake of this guide I will assume it is extracted into a ~/android directory)
ie on cygwin you might:
mkdir -p ~/android
cd ~/android
tar -xjvf toolchain-4.6.3.cygwin.tar.bz2
Note: steps one and two are just properly installing the toolchain, you will not need
to repeat them to build a different kernel.
2.b) OSX Only: check elf.h
open ~/android/toolchain-4.6.3/README in a text editor and check if elf.h is installed, otherwise manually install it as per the readme
3) fetch your kernel source into the ~/android directory and change into the
source codes root directory
(this can be via a git repo or tarball)
example if you wanted my ACER a100/a500 source you might run:
git clone git://github.com/ezterry/AcerTabKernel.git
cd AcerTabKernel
change this to match the source you are fetching
4) In the root directory of the kernel source (~/android/AcerTabKernel in the about a100/a500 example) update the environment for the cross compiler
add the toolchain to your path:
export PATH=$HOME/android/toolchain-4.6.3/bin:$PATH​
set the cross compile:
export ARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
export KERNEL_DIR=`pwd`​
(this will need to be done once for each terminal you use to run any of the following make commands)
5) Grab your configuration
From the device:
adb pull /proc/config.gz
gzip -dc config.gz > .config
or from a prepared configuration if it's included in your code base by running
make _defconfig
example for the a100/a500 code base is 'make vangogh_defconfig' for the a100 and 'make picasso_defconfig' for the a500
6) Customize configuration
just run menuconfig and use the UI to update settings
make menuconfig​
7) building the kernel (zImage)
This is normal at this point with 'make -j'
so for a quad core CPU you can run
make -j5​
(note: the wrong number in the -j argument will not harm the build but may slow down the building process by either using too few threads or needing to keep track of too many)
8) If it worked you will now have the kernel in arch/arm/boot/zImage
this can be injected into the boot.img (as the kernel, using an existing ramdisk) as is
If it failed for your kernel your kernel source may need one of the common patches
9) Building modules
the following will prepare the modules in subdirectory mod:
make modules
rm -rf mod
mkdir mod
cp `find ./ | grep .ko$` modules.order mod/​
After these commands [if no errors] you can simply copy the contents of mod/ to /system/lib/modules on your device, note it is recommended usually to remove the existing contents of /system/lib/modules unless there is a closed source module required from the previous build despite the new kernel.
[size=+1]Common Patches Required[/size]
If your kernel has not been built for the new toolchain or on cygwin before you may require some of these common patchs: (I've thus far only tested this on my Acer A100/A500 source)
wireless/bcm4329 for GCC-4.6.3:
https://github.com/ezterry/AcerTabKernel/commit/123f32e27e2c74f1c1789ae5d6d5a1c04e1e264c
linux kernel module patch for cygwin (broken elf.h):
https://github.com/ezterry/AcerTabKernel/commit/220db49593cf6b9f3b556e2f4b75b2f6d3ff556c
Error compiling security/smc/bridge_pub2sec.S (I required the cygwin elf patch and this patch to build the Franco galaxy nexus kernel)
0001-Fix-build-error-with-4.6.3-toolchain-smc-0.patch
(use 'git am 0001-Fix-build-error-with-4.6.3-toolchain-smc-0.patch' to apply)
OSX stat patches (fixes errors between GNU and BSD stat):
https://github.com/ezterry/AcerTabKernel/commit/0c49df3cc1a05a0ccd98201511cdc0534aaeb35a
Errors loading newly built modules (modules appear to build cleanly but wont install):
simply add -fno-pic to CFLAGS_MODULE
https://github.com/ezterry/AcerTabKernel/commit/c5ed0fcb014d36936a86ad253f15af43de2f644a
(I can add others here if highlighted to me, and as I find them)
[size=+1]Other Toolchain uses[/size]
The linux toolchain can be used to build android components, however this requires various manipulation to the android /build git repository as currently various other toolchains have hard coded paths into the prebuilt repo. If you intend to incorporate this into your build it may be best to inject the toolchain into your prebuilt repo rather than expect your users to download the links above, ensure to keep the compile notes as it explains how to get the source code to the toolchains)
On cygwin/osx it may also be possible to build android applications however I've not yet tested this as the scripts to make a proper build are complex when attempted outside the android build tree.
Excellent!!! thanks Man!!! Has been looking for one of these
Added in the OSX version of the toolchain (and some related patches)
Also if you are having problems with your modules built with this toolchain a CFLAG fixes it. (see note in common patches)
FINALLY!!! Great Instructions followed them to the T and BAM got my kernel compiled!!!
wow your toolchain is so small, many thanks, just compiled a kernel for my LG P500 gonna test it, thanks again
Bookmarked for testing when I wake up...
I can almost put: "Building under Windows is not currently supported." (quote from google), unofficially at least, out of my mind...
I have been spoiled by Windows for far too long I fear, my attempt for this last week at getting Linux setup and building CM9 has been nothing but a complete FAILURE, too many single line entrys for different distributions/package combo's, commands I dont know and cant find because of wildcard portions of them and lack of understanding, and not enough scripts like the wonderful Compile CM9 script someone put up (cant run it because all the pre-req's arent setup).
Good god Ill be jumping for joy if this works tomorrow on WinBlows!
EDIT: never mind, problem solved, what I need to know now won't be solved here
I wish i knew how to go about doing this..
Thanks
Thanks For ........... i Really need It .........
Hammerfest said:
Bookmarked for testing when I wake up...
I can almost put: "Building under Windows is not currently supported." (quote from google), unofficially at least, out of my mind...
I have been spoiled by Windows for far too long I fear, my attempt for this last week at getting Linux setup and building CM9 has been nothing but a complete FAILURE, too many single line entrys for different distributions/package combo's, commands I dont know and cant find because of wildcard portions of them and lack of understanding, and not enough scripts like the wonderful Compile CM9 script someone put up (cant run it because all the pre-req's arent setup).
Good god Ill be jumping for joy if this works tomorrow on WinBlows!
Click to expand...
Click to collapse
If you succeed tell me how to do it in a more familiar way
I get errors regading the processor not being supported?
brfield said:
I get errors regading the processor not being supported?
Click to expand...
Click to collapse
Sorry I can't support devs that have not learned cut copy and paste.
You probably forgot to export some of the environment variables or are just trying to run a arm binary on your PC and or a x86 binary on your arm device.
But why am I guessing? Why don't we know what you tried to run and what the actual text of the error was.. what type of kernel you tried to build, what you are running?
These packages are for developers if you feel like using them its time to learn to how to trouble shoot a problem and write a ticket to explain said problem clearly to others with at least some information to give us a chance to understand.
Sent from my Galaxy Nexus using Tapatalk 2
Great guide. Have the bcm4329 wireless module, so followed the tips and everything compiled and works!
Thanks!
one question,how to compiled android kernel with -O3 optimization?
jxxhwy said:
one question,how to compiled android kernel with -O3 optimization?
Click to expand...
Click to collapse
Um, in general its recommended you don't:
-O3 is not recommended for the kernel as many low level parts require the assembly code generated to remain as is and not be optimized as will be by some of the options -O3 enables thus likely reducing the stability of your kernel.
---
That said the menuconfig has an option to optimize for size (-Os) if enabled else -O2
For other optimization (including tuning for your cpu) you can add them to the CFLAGS_KERNEL/CFLAGS_MODULE in the make file.)
For -O3 like functionality you could add the increment to the line:
-finline-functions, -funswitch-loops, -fpredictive-commoning, -fgcse-after-reload, -ftreel-vectorize, -ftree-partial-pre and -fipa-cp-clone
-Ofast is -O3 with -ffast-math as well
If you do build with all the -O3 or-Ofast options ensure you test the kernel for stability and run some benchmarks. (as it may not actually be faster depending on the cache misses)
The first option I'd start pruning was the one mentioned in my reference below -fgcse-after-reload.
If you really insist on -O3 rather than just adding the optimization you want that are not in O2,it can be added also in the Makefile where the configure flag is checked and its added to KBUILD_CFLAGS
Obviously all and any of this is at your own risk, anything that breaks you have to find a way to fix it.
Reference:
Gcc optimize options:
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Talk of O3 and the kernel (not android specific)
http://unix.stackexchange.com/questions/1597/compiling-gnu-linux-with-o3-optimization
ezterry,thank you very much!
I want to build cm9 kernel using toolchain 4.6.3.
How to replace the default GCC 4.4.3 to 4.6.3 version?
BTW,I use the way -- make bootimage
jxxhwy said:
ezterry,thank you very much!
I want to build cm9 kernel using toolchain 4.6.3.
How to replace the default GCC 4.4.3 to 4.6.3 version?
BTW,I use the way -- make bootimage
Click to expand...
Click to collapse
If you are asking in a cm9 build tree.. its a pain, best is to update the cm kernel makefile to point the build chain temporarily.
If you mean just to compile by hand as described in the op
Once the kernel is compiled find an anykernel update.zip or manually use mkbootimg or fastboot to merge it with the ram disk. Cm9 targets mkbootimg and unpackbootimg (if I'm not mistaken) will build the applications to unpack your current (or the default cm9) boot image and re-create them with your custom kernel built from hand.
Now,I runing script file:
#Let's make sure the environment is clean and ready to compile the kernel
echo "Cleaning house!!"
make mrproper
echo "House cleaned, lets build a kernel!!!"
#
# Lets set the kernel defconfig
echo "defconfig = cyanogenmod_iprj_defconfig"
make ARCH=arm cyanogenmod_iprj_defconfig
#
# Let's build a kernel
echo "Now compiling kernel, go get a soda! "
ARCH=arm CROSS_COMPILE=~/Android/sourcecm9/cm9/toolchain-4.6.3/bin/arm-linux-androideabi- make zImage -j4
#
if [ -f arch/arm/boot/zImage ]; then
echo "Plague has been compiled!!! You can find it in arch/arm/boot/zImage"
else
echo "Kernel did not compile, please check for errors!!"
fi
but,I got some error output:
/home/xxx/cm9/toolchain-4.6.3/bin/arm-linux-androideabi-ld: cannot find usr/initramfs_data.o: No such file or directory
thanks again!!!
I think that means there is an issue with your config..
Most android kernels require initramfs, but don't specify a file, as its provided by the bootloader.. However in your case it is trying to embed it into the kernel.
Sent from my A500 using Tapatalk 2
ezterry said:
I think that means there is an issue with your config..
Most android kernels require initramfs, but don't specify a file, as its provided by the bootloader.. However in your case it is trying to embed it into the kernel.
Sent from my A500 using Tapatalk 2
Click to expand...
Click to collapse
issue has been resolved by myslef.Thanks for your time.

How to build AOSP for Nexus 7?

I would like to mess with trying to install my own customized ROM's to my Nexus 7, but the first place to probably start is with being able to build AOSP as-is from source.
As I understand currently, building is only supported on Linux and OS X, but I can easily get Ubuntu 10.04 and re-partition my HDD to give it about 100GB (if that much is even needed).
Looking at:
http://source.android.com/source/initializing.html
I need to choose a branch and setup the Linux environment. I'm a bit confused as to what branch I should choose though. I want the latest source of Android available at the time, so I should pick the master branch? Or since I'm only building for the Nexus 7, should I choose it's device-specific branch instead? Although looking at:
http://source.android.com/source/build-numbers.html
the Nexus 7 is only at android-4.1.1_r1.1, but I could of sworn I heard there was r4 out already.
As for setting up the Linux environment, I hope I can just follow all the commands listed there without any problem.
Proceeding on with:
http://source.android.com/source/downloading.html
It looks like a pretty straightforward process that I'm also hoping can be done successfully if I follow the commands exactly as presented. I don't have a proxy nor the need for a local mirror either.
And then moving onto:
http://source.android.com/source/building-devices.html
Some stuff there I find a little bit confusing. It would seem I have to first get proprietary drivers, which all 4 seem to be placed conveniently at:
https://developers.google.com/android/nexus/drivers#grouper
From there, I imagine I can move the script that's bundled inside to the root of the source folder, run it, and follow the instructions. I don't exactly know what the root of the source folder is, but it would probably be obvious once I did start trying to build this. But once I did find it, I would run (using Nvidia's Graphics driver for the example) sh extract-nvidia-grouper.sh in Terminal, and it would place the right files where they need to be.
I don't understand the make clobber part too well at all; should I run this on the very first build, later builds, or all builds?
And once the source and drivers are all downloaded and available, I should then run lunch full_grouper-userdebug and then finally make -j# (# being some number in accordance with how many cores on my CPU I have). I have a triple-core CPU at 3.5Ghz, and I have the ability to unlock to quad-core at 3.3Ghz (but prefer to stay on triple). Should I just run -j32? Also will this build the Kernel as well, or will I have to get the source for that and compile it separately?
And once the build completes, my plan from there was to just go back to Windows and flash it. And if I managed to get it to flash and boot properly, I assume I would of succeeded with compiling AOSP from source
I noticed that userdebug part on full_grouper-userdebug gives "root access and debuggability". Does this mean it comes with some program like Superuser or SuperSU already installed? Or does this mean I can easily install those?
Perhaps after I get comfortable with the basics of flashing AOSP as-is, I can then try to mess with different types of optimizations, like Linaro and perhaps even messing with many types of optimizations from different kernels like faux123 has done .
I also have a 360kb/s DSL connection, so downloading the entire source the first time will probably take a good while. But once I have the source, I take it I don't have to redownload the entire thing for patches and stuff?
Any and all guidance is welcome
Bump before I go for tonight
Bump
You have a bunch of questions. I will answer some. And while I whole-heartedly support learning to build you don't need to build to flash roms.
The best advice I can give you is to just start building. You have found a bunch of instructions and links, obviously. Go ahead and begin, and tackle problems as they arise.
Environment
Okay...really the hardest part is setting upi the environment, if you don' t know linux. After downloading and installing Java and the SDK, make sure you add them to your path.
Most guides will have adding the path in the directions. But make sure to check that it works! It will be extremely frustrating, and you won't know what is wrong. Go to a random directory, Documents would be good, and enter java -version and then adb devices. If the computer says it cannot find the commands, then your path is the problem.
Make sure to setup udev. It is easy, Google it.
Building
Branch
You want to build from the tags.
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r4
For the proprietary blobs, whatever directory you repo sync from (~/android/system or whatever) is the root directory. run the extraction from there.
when the proprietary blobs are extracted, and the source has been downloaded, these are your commands.
Code:
. build/envsetup.sh
lunch
Lunch will return a list of devices, Grouper is the Nexus 7, it is number 4. eng and user-debug do have root access, but SU and SuperSU are more than just root, they manage the root access for your apps as well. You can download them from Play or install them as a flashable-zip.
Choose 4 and then
Code:
make otapackage
don't worry about the -j# part. Your machine almost definitley cannot handle -j32. It is -j4 by default, that should be fine for your cpu.
If you want to enable faster builds, you can enter
ENABLE_CCACHE=1
before make otapackage, but it will take up a lot of space on your hd. Your subsequent builds will use some thing from your intial build instead of rebuilding them each time (kernel and other things). So even if you repo sync, some changes won't be reflected in your later builds. For instance, if you do not clean your prebuilts and build system, your build date in the build.prop will always stay the same as the first build.
The way you clear the build directory and make new everything is with make clean or make clobber. You can run it before any build, but the build will take much much longer than one that uses prebuilts. Non-clobbered and with ccache enabled are the fastest of all. But subsequent builds are pretty fast even without ccache.
When you want to update your source, you can just go to your root dir and repo sync. It will only update your source, it won't take nearly as long.
Okay, I answered more than I intended. There are a million guides that show you every step in the process.
Don't ask anymore generic worry questions...you're ready. You understand more than most people do before their first build before I even posted. Get started and if you run into problems, search. If you can't find the answer, then come back and ask us.
Good luck. it is easy, and very satisfying.
I finally got around to installing a Virtual Machine, and Ubuntu 10.04 After doing that, I fully updated Ubuntu, installed VMWare Tools, and then proceeded to start trying to acquire the AOSP source.
Getting sun-java-6 was a bit tricky, but not too hard (I ran the commands exactly as listed on the site, but the package didn't exist; had to get it from somewhere else). After that, I proceeded to do everything else, except CCache (I didn't know what .bashrc was, but I'll look further into this with future AOSP builds).
I then made the folder, did repo sync, and I'm now acquiring the source now from android-4.1.1_r4. As a quick question, does it matter whether I choose to build from android-4.1.1_r4, or master? Would master be more up-to-date?
espionage724 said:
I finally got around to installing a Virtual Machine, and Ubuntu 10.04 After doing that, I fully updated Ubuntu, installed VMWare Tools, and then proceeded to start trying to acquire the AOSP source.
Getting sun-java-6 was a bit tricky, but not too hard (I ran the commands exactly as listed on the site, but the package didn't exist; had to get it from somewhere else). After that, I proceeded to do everything else, except CCache (I didn't know what .bashrc was, but I'll look further into this with future AOSP builds).
I then made the folder, did repo sync, and I'm now acquiring the source now from android-4.1.1_r4. As a quick question, does it matter whether I choose to build from android-4.1.1_r4, or master? Would master be more up-to-date?
Click to expand...
Click to collapse
Sorry for late answer, no, use the r4 branch as it is more up to date. Also, make clobber every time isn't needed but you should as it remove then entire out folder (wich is where compiled stuff go) and this make sure you rebuild a clean thing.
Building CyanogenMod 10
Dunno if this is of any interest, but I have a thread started with a complete walkthrough for building CyanogenMod10 for Nexus 7.
Most of the info is the same, and there are some tips in the comments as well.
espionage724 said:
I would like to mess with trying to install my own customized ROM's to my Nexus 7, but the first place to probably start is with being able to build AOSP as-is from source.
Click to expand...
Click to collapse
So, how did you get on? I've been following the same path I think - repo sync the source and follow Google's own tutorial on compiling Android but with the added step of incorporating the binary drivers for the grouper.
I've built the .img files using make -j8, that all works, fastboot flash worked, but I get no video out when booting up using the new OS. I can ADB into the Nexus and it's certainly booted and working okay apart from, I'm guessing, the missing binary drivers.
I've used each of the 5 binary driver scripts to populate the "vendor" directory in the root of the downloaded source before compiling from scratch, but perhaps I've missed a step, so I'm curious as to whether you've got a fully working AOSP+binary driver compile working.
(By the way, my build environment was Ubuntu 12.04 64bit, SDK r20.0.3, Android 4.1.1 (JRO03R) source, Sun Java 1.6, and it all seems to work well using 8 threads on a Core i5 2500K + 4GB RAM).
Edit:
I re-ran the binary extraction, did a make clean; make clobber, and re-compiled - and now video works. Everything works now apart from the compass, camera and rotation sensor. I also tried compiling CyanogenMod from source, too, and had the exact same three problems. Everything works, and works well, apart from camera, compass and rotation sensor. All of which work in the stock Google ROM. Weird.
OK, So I've just compiled an OTA update package from AOSP source... my question is this:
I already have unlocked the bootloader on my wife's Nexus 7, installed Clockworkmod, rooted it, installed busybox, etc, manually on the stock 4.2 update I downloaded from Google on the device when it asked me to upgrade.
Is the otapackage I just compiled going to replace my custom recovery if I flash it as is? I've looked, and it has a "recovery" folder in the .zip, whereas any of the custom ROMs I have downloaded for my phone do not. Do I simply delete this recovery folder, and flash away? Do I need to edit the updater-script? I'm still trying to read and learn about this, but I haven't gotten a good answer from google or searching this site for my specific problem... maybe I'm wording my searches incorrectly.
I would just rather not have to go back and reinstall Clockworkmod... I know that if I want to have busybox, SuperSU, and other apps installed when I flash I'm going to have to add them to the zip and resign... I just don't want to mess my recovery. And being that this is my wife's tab (and not mine to play with, as she pointed out ) I don't want her to get the impression that I'm having to "fix" something I "broke" lol.
hallowed.mh said:
OK, So I've just compiled an OTA update package from AOSP source... my question is this:
I already have unlocked the bootloader on my wife's Nexus 7, installed Clockworkmod, rooted it, installed busybox, etc, manually on the stock 4.2 update I downloaded from Google on the device when it asked me to upgrade.
Is the otapackage I just compiled going to replace my custom recovery if I flash it as is? I've looked, and it has a "recovery" folder in the .zip, whereas any of the custom ROMs I have downloaded for my phone do not. Do I simply delete this recovery folder, and flash away? Do I need to edit the updater-script? I'm still trying to read and learn about this, but I haven't gotten a good answer from google or searching this site for my specific problem... maybe I'm wording my searches incorrectly.
I would just rather not have to go back and reinstall Clockworkmod... I know that if I want to have busybox, SuperSU, and other apps installed when I flash I'm going to have to add them to the zip and resign... I just don't want to mess my recovery. And being that this is my wife's tab (and not mine to play with, as she pointed out ) I don't want her to get the impression that I'm having to "fix" something I "broke" lol.
Click to expand...
Click to collapse
Sorry if a bit late, but here are some answers:
yes, the rom will replace your recovery. but if you delete the recovery folder and delete every line containing the word "recovery" in the updater-script, you should be good to go.
And if you accidentally remove the recovery, you can always flash it back very easily using: "fastboot flash recovery [filename.img]" (your n7 has to be in the bootloader)
And again, yes, you will have to put the extra apps into the zip and update the updater-script to install them too.
Also, you will need the gapps package if you want to use the play store and other google apps.
Hope this helped
Nexus 7 3G does not boot after flashing AOSP
Hi,
I followed the steps provided on source.android.com to build and flash the AOSP for Nexus 7 3G Tilapia. After successful flash, the device does not show anything after Google logo. Please help me out.
Thanks,
Veeren
Compile with ccache makes build time extremely fast.
How to do:
_Open a terminal
_Install ccache:
sudo apt-get install ccache
_Open .bashrc:
sudo gedit ~/.bashrc
_Add these lines:
#ccache
export USE_CCACHE=1
_Save and exit
_Sync source code
_After source synced, run in same terminal (in root directory of your source):
prebuilts/misc/linux-x86/ccache/ccache -M 20G (20G is the size in giga of space allocated for ccache, change it as you want)
_Start building
How to see if ccache works:
_Open another terminal in the root directory of your source and type:
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
First build using ccache may be a little much longer but the others will be faster...
veerndra said:
Hi,
I followed the steps provided on source.android.com to build and flash the AOSP for Nexus 7 3G Tilapia. After successful flash, the device does not show anything after Google logo. Please help me out.
Thanks,
Veeren
Click to expand...
Click to collapse
Did you pull the proprietary files for your nexus and include them in the build? I believe things like your video drivers are included in there, so if those are missing....
I think the prop files are available for download from Google on source.android.com... If not, they tell you how to use an included script to pull them via adb. I can't remember... It's been a while since I built vanilla AOSP.
Sent from my Inspire 4G using xda app-developers app
Modifying stock AOSP
I have built AOSP following the Google tutorial.
I am compiling using the master branch and
Code:
aosp_grouper-userdebug
.
I have downloaded and extracted the appropriate proprietary binaries.
I am modifying two files in the source tree (see attachments; search for "// MODIFICATION ADDED HERE" to find my changes). Will these changes work? I am using Eclipse, set up in the exact way the tutorial explains, and I am not receiving any new errors.
When I compile the source using the following commands
Code:
$ . build/envsetup.sh
$ lunch aosp_grouper-userdebug
$ make fastboot adb
and flash it to my device with
Code:
$ fastboot -w flashall
BEFORE my modifications, it works just fine. The android-info.txt file and all the image files are produced properly.
However, AFTER adding the modifications, the build completes with no errors, but android-info.txt and all image files are no longer produced.
Why am I experiencing these problems? What can I do to make it work the way I want?
P.S. YES, I am aware that my modifications are not secure; these are for my own purposes, not for a public build.

[GUIDE] Build Your Own Android Kernel{Easiest and Fastest Way] [Using The NDK]

This is the quickest and easiest way to build your own Kernel using the Android NDK
Note:I will be reffering to the following
yourusername=the username that you are logged in to
devicecode=The codename for the device you are building a kernel for(Google it on what is the code name
Click to expand...
Click to collapse
Note:I am only showing you how to make it to be flashed via CWM. If you wan't a tuttorial on how to make a boot.img comment and i will make it.
What you will need
Ubuntu 12.04 or newer
A lot of patience
Click to expand...
Click to collapse
Step 1:Installing the required files
Open a terminal and type the following (copy-paste)
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
This will install the packages you need
Download the kernel source code for your device (This is important. We are going to build the kernel from this)
For HTC http://htcdev.com
For Samsung http://opensource.samsung.com/
Click to expand...
Click to collapse
Find your device and click Download
Download The NDK
Move the NDK and your device Kernel source code in your home folder
Extract both the NDK and your kernel source code
Rename the folder were you have the NDK installed to NDK. And rename the folder where you have the kernel installed to Kernel
Now we are ready to build.
Step 2:Tweaking the kernel
Navigate to the kernel folder
Code:
cd /home/[COLOR="red"]yourusername[/COLOR]/Kernel
Next we need to point the NDK tools to the kernel folder
Code:
export CROSS_COMPILE=/home/[COLOR="red"]yourusername[/COLOR]/NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
We've pointed the NDK tolls and now we can use the NDK to tweak the kernel
Next we need to clean the previous work just incase:
Code:
make clean && make mrproper
If everything goes well you are good to go. If you have an Error(s) then something is wrong.
Now we are ready.
Next we need to add the kernel features to the NDK so we can modife them
Firs open your kernel source code folder go to arch/arm/configs
Here you will all the configs.
We need only one. Find that. It is called:Yourdevicecode_somethingbalblabla.defconfig
Rename it to maker.defconfig
Now type this in your terminal
Code:
make maker.defconfig
Now we need to tweak those configs.
Code:
make menuconfig
A user interface will pop out showing you all the tweaks you can do. I am not going to show you whow to use it. Google it(Sorry don't have that enough space)
When you are ready close the UI and click SAVE
Step 3 Building
So we tweaked the Kernel and we are ready to build.
make -j# ARCH=arm
Click to expand...
Click to collapse
Note:The # means the number of CPU cores +1. For example my device has a quad core CPU and I will type
Code:
make -j5 ARCH=arm
This will build the Kernel. It will take about 10 minutes.
Step 4: Finalizing
Now that kernel is ready you will need to find a kernel flashable zip for your device(Just google it)
Download the zip file and leave it in your home folder.
Now got to your kernel source and go to arch/arm/boot and copy zImage
Paste your Zimage to the zip file and replace it.
Now we need the WI-FI modules otherwise your WI-FI will not be working
Go to the Kernel source code folder and go to driver/net/wireless/bcm4329_204 and copy bcm4329.ko
Got the zip file go to the System folder and replace it's bcm4329.ko with your bcm4329.ko
You are ready all you need to do is flash it.
mmm..interesting...i always build without the ndk,but simpy sdk.what's the advantages?
and i usually do the git clone to download all the sources,in my case nexus7 and maguro.
thanks for this!
Well i am just waiting for Samsung to release JB sources for N7000 to start learning on how to create my own kernel
This is a pretty good base! Thanks
Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks
:good: Thanks! I'm use Ubuntu 10.04 64 bit don't know if can?
HTCDreamOn said:
Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks
Click to expand...
Click to collapse
I am not sure. I think you can on 32 bit try it the download takes all together about 500 MB
TheWizardOfROMs said:
I am not sure. I think you can on 32 bit try it the download takes all together about 500 MB
Click to expand...
Click to collapse
Thanks, do you know how large all the files are once installed on the system (you might have guessed I'm slightly short of space atm)
HTCDreamOn said:
Thanks, do you know how large all the files are once installed on the system (you might have guessed I'm slightly short of space atm)
Click to expand...
Click to collapse
About 700 MB
sert00 said:
mmm..interesting...i always build without the ndk,but simpy sdk.what's the advantages?
and i usually do the git clone to download all the sources,in my case nexus7 and maguro.
thanks for this!
Click to expand...
Click to collapse
What are you building? If a whole ROM like AOSP,AOKP,PA or CM then they typically bundle the toolchain/kernel with the source, making this totally unneeded.
---------- Post added at 12:18 PM ---------- Previous post was at 12:17 PM ----------
HTCDreamOn said:
Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks
Click to expand...
Click to collapse
No 32-bit is fine, just install the right libraries. I actually believe that you can compile a ROM on 32-bit as well.
Self-Plug http://forum.xda-developers.com/showthread.php?t=1748297
Also just to warn users, the above defconfig convention is just that, a convention. The author of a kernel can name the defconfig whatever they want, so it is something to keep in mind.
Sent from my SCH-R950 using Tapatalk 2
thewadegeek said:
What are you building? If a whole ROM like AOSP,AOKP,PA or CM then they typically bundle the toolchain/kernel with the source, making this totally unneeded.
---------- Post added at 12:18 PM ---------- Previous post was at 12:17 PM ----------
No 32-bit is fine, just install the right libraries. I actually believe that you can compile a ROM on 32-bit as well.
Self-Plug http://forum.xda-developers.com/showthread.php?t=1748297
Click to expand...
Click to collapse
i builded some kang rom for personal use,but lately only kernels (for my nexus devices and 2 emebedded system board like in my sig.
Thanks for the guide, but unfortunately I am getting errors during compilation:
Code:
make -j3 ARCH=arm
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
arm-eabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
I am trying to compile the Andromadus 3.0 kernel for HTC Vision, I'd really appreciate some help. I'm using Ubuntu 12.10 32 bit and the Android NDK.
TheWizardOfROMs said:
This is the quickest and easiest way to build your own Kernel using the Android NDK
Note:I will be reffering to the following
Note:I am only showing you how to make it to be flashed via CWM. If you wan't a tuttorial on how to make a boot.img comment and i will make it.
What you will need
Step 1:Installing the required files
Open a terminal and type the following (copy-paste)
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
This will install the packages you need
Download the kernel source code for your device (This is important. We are going to build the kernel from this)
Find your device and click Download
Download The NDK
Move the NDK and your device Kernel source code in your home folder
Extract both the NDK and your kernel source code
Rename the folder were you have the NDK installed to NDK. And rename the folder where you have the kernel installed to Kernel
Now we are ready to build.
Step 2:Tweaking the kernel
Navigate to the kernel folder
Code:
cd /home/yourusername/Kernel
Next we need to point the NDK tools to the kernel folder
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
We've pointed the NDK tolls and now we can use the NDK to tweak the kernel
Next we need to clean the previous work just incase:
Code:
make clean && make mrproper
If everything goes well you are good to go. If you have an Error(s) then something is wrong.
Now we are ready.
Next we need to add the kernel features to the NDK so we can modife them
Firs open your kernel source code folder go to arch/arm/configs
Here you will all the configs.
We need only one. Find that. It is called:Yourdevicecode_somethingbalblabla.defconfig
Rename it to maker.defconfig
Now type this in your terminal
Code:
make maker.defconfig
Now we need to tweak those configs.
Code:
make menuconfig
A user interface will pop out showing you all the tweaks you can do. I am not going to show you whow to use it. Google it(Sorry don't have that enough space)
When you are ready close the UI and click SAVE
Step 3 Building
So we tweaked the Kernel and we are ready to build.
Note:The # means the number of CPU cores +1. For example my device has a quad core CPU and I will type
Code:
make -j5 ARCH=arm
This will build the Kernel. It will take about 10 minutes.
Step 4: Finalizing
Now that kernel is ready you will need to find a kernel flashable zip for your device(Just google it)
Download the zip file and leave it in your home folder.
Now got to your kernel source and go to arch/arm/boot and copy zImage
Paste your Zimage to the zip file and replace it.
Now we need the WI-FI modules otherwise your WI-FI will not be working
Go to the Kernel source code folder and go to driver/net/wireless/bcm4329_204 and copy bcm4329.ko
Got the zip file go to the System folder and replace it's bcm4329.ko with your bcm4329.ko
You are ready all you need to do is flash it.
Click to expand...
Click to collapse
will work with an ics device like amazon kindle fire?
Sent from my KFTT using xda app-developers app
HTCDreamOn said:
Thanks for the guide, but unfortunately I am getting errors during compilation:
Code:
make -j3 ARCH=arm
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
arm-eabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
I am trying to compile the Andromadus 3.0 kernel for HTC Vision, I'd really appreciate some help. I'm using Ubuntu 12.10 32 bit and the Android NDK.
Click to expand...
Click to collapse
Check your toolchain definition, looks like your path is wrong.
thewadegeek said:
Check your toolchain definition, looks like your path is wrong.
Click to expand...
Click to collapse
Thanks, you're right my path was wrong, but now I have fixed all the problems and it appears to compile successfully however there is no zImage in arch/arm/bin. Any suggestions? Thanks
HTCDreamOn said:
Thanks, you're right my path was wrong, but now I have fixed all the problems and it appears to compile successfully however there is no zImage in arch/arm/bin. Any suggestions? Thanks
Click to expand...
Click to collapse
Try building it again. Be sure to clean the source folder before you start
TheWizardOfROMs said:
Try building it again. Be sure to clean the source folder before you start
Click to expand...
Click to collapse
Thanks very much, I'd been recommended using Linaro tool chain instead and it works perfectly now, booting and WiFi and all. If I can learn some more advanced modding stuff to do to it then I'll release it in the Vision forums and I'll make sure to link to this guide
I installed Ubuntu on my windows laptop.my computer stars are 3Gigs of memory with 140 Gigs of available free space.Do I have enough space and is my laptop good enough to build kernels on.and I do use Ubuntu 12.04 to build kernels correct.I'm sorry I'm all new to this I just would like to be able to build a kernel for my sensation and HTC one which I will have next week.thanks very much for your time and expertise.
Sent from my HTC Sensation using xda app-developers app
rp56 said:
I installed Ubuntu on my windows laptop.my computer stars are 3Gigs of memory with 140 Gigs of available free space.Do I have enough space and is my laptop good enough to build kernels on.and I do use Ubuntu 12.04 to build kernels correct.I'm sorry I'm all new to this I just would like to be able to build a kernel for my sensation and HTC one which I will have next week.thanks very much for your time and expertise.
Sent from my HTC Sensation using xda app-developers app
Click to expand...
Click to collapse
I compiled with Ubuntu 12.10 and only 2 GB of RAM, and only 30GB free space. The tool chain and kernel really doesn't use up much room at all. As long as you don't go OTT on the -jx bit (I do -j3 as I've got a lowly core 2 duo) you should be fine. By the way if you get errors and you're path is definitely correct, then try with the Linaro tool chain instead.
got an error something like, "make ** [vm.virtual], waiting for unfinished jobs..." then stops, going to try new defconfig and new toolchain

[DEV][WIP][Linux] Easy GNU/Linux on our tablet

Hi all!
Many of us are dreaming of having a real native desktop operating system on Galaxy Note 10.1 as a second system. Of course, the software there is not touch-optimized, but you can attach keyboard and mouse via USB-OTG and Bluetooth and imagine it's a netbook
exception13 showed us that it's possible and shared his work on in a forum and repo. X-Stranger could use it and shared compiled images of ArchLinux. But what if you want to do something more specific for your own needs and you are not such a great developer as both of them are?
My project is for all of you who want to have native GNU/Linux, who want to participate but don't know how yet. It's a guide how to build it from scratch. The problem is - I am not a superdev too and I couldn't do many things. Frankly speaking, all the remaining things seem to be small but I don't know how to overcome them. Maybe it's because I'm studying economics but not programming
Link to the guide.
I need help from anyone who knows how to overcome any of the problems on every step! Everything I managed to do by myself is already written there and currently I have a compiled kernel which is booting a partition on external SD but it freezes there.
If you have any ideas - you can just make a pull request out of Github's webinterface, if you don't know how to edit this html but know something about building Linux - you are welcome to open an issue or write it here and I will include it in the guide.
Let's make our Galaxy Note 10.1 better together!
,I just got my Note 101.1 earlier today. I'll look into the missing information and add to the webpage. Is there anything that you think I should look into first?
I actually had a question.
Looks like you have the section "Harder Way - how to prepare binaries" split into Ubuntu and Arch. Instructions for compiling the kernel are the same.
I guess my question is why the choice to show the arch kernel being compiled under arch?
Might be easier to read the guide with all the kernel compiling done in Ubuntu.
**Edit**
What I didn't originally mention is that i really like it. Hoping to help contribute as well.
darksabre_x said:
I actually had a question.
Looks like you have the section "Harder Way - how to prepare binaries" split into Ubuntu and Arch. Instructions for compiling the kernel are the same.
I guess my question is why the choice to show the arch kernel being compiled under arch?
Might be easier to read the guide with all the kernel compiling done in Ubuntu.
**Edit**
What I didn't originally mention is that i really like it. Hoping to help contribute as well.
Click to expand...
Click to collapse
Good question. The reason for that are that despite how close Arch Linux and Ubuntu are, the environments are different. Ubuntu usually has some sort of bash completion enabled by default whereas Arch Linux doesn't and of course each of them requires diferent packages installed to perform the same functions. I believe thermatk did each distro separately as to make things simpler for the end user. Pick a distro and go as each distro's guide can be tuned independent of the others.
Soul_Est said:
Good question. The reason for that are that despite how close Arch Linux and Ubuntu are, the environments are different. Ubuntu usually has some sort of bash completion enabled by default whereas Arch Linux doesn't and of course each of them requires diferent packages installed to perform the same functions. I believe thermatk did each distro separately as to make things simpler for the end user. Pick a distro and go as each distro's guide can be tuned independent of the others.
Click to expand...
Click to collapse
Doesn't really answer my question considering the end kernel will be the same regardless of the distro being used. I think you took my question as "Why are there 2 options for kernel compilation?", which wasn't what I was asking.
Looks like thermatk actually addressed the question with a page update.
It now gives separate options depending on which distro you want to end up with on your Note 10.1, in addition to separate kernel compilation options.
What I was referring to was when it was Ubuntu only instructions from kernel compilation all the way to deployment on the tablet and Arch only instructions. The kernel and linux image instructions weren't independent of each other, as they currently are.
Update
I'm really happy to hear that someone else wants to use it and contribute! :victory:
darksabre_x, you are right I separated the guide into parts yesterday because the system where you compile kernel doesn't really affect anything on the tablet.
Soul_Est, thank you for helping with questions in the thread :good:
Now I understand that tabs are not the best way to do it, will start this day from trying to rewrite this to a navbar constantly on top which lets you choose options from a dropdown.
Also yesterday got the guide to the point when one path through can get ypu to a bootable distro! You can compile kernel wherever you want, you should be on stock based rom and choose to install Arch on separate partition which probably will be a partition on SD. What you have to add at the end is
Code:
pacman -S lxde
and copy xorg.conf from X-Stranger's post. Once rebooted, you will be able to enter android:changeme and
Code:
sudo lxdm
and the gui will start if you don't have USB-OTG and keyboard you won't be able to enter password but you can poweroff from the interface's right corner :good: Attention: if gui says that it has no permissions to write logs do
Code:
sudo mount -n -o remount, rw /
and retry but do not forget to write here about it!
What are the current problems:
Why exception13 and X-Stranger both hardcoded the whole cmdline for kernel and forced it not to be changeable from bootloaders. It's easy to fix in the config but there should have been some idea or i'm paranoic?
What's wrong with LinuxDeploy, separate partitions and CyanogenMod? hiruna filed a bug but meefik seems to be away for a week. If anyone else with CM has an idea on how to overcome this maybe with some special unmount commands CM is thinking that ext4 partition is th extSdCard and mounts it so that LinuxDeploy can't install anything there (seems that it's the problem) while stock can't mount ext4 as extsdcard and is not touching the partition.
How do we make Debian/Ubuntu to boot? Both ways - for separate partition and img are stuck one the problem that not any mkinitramfs or abootimg or their combinations could get to a better state than initramfs shell. Separate partition should be easier so focus should be on it for the start.
Adapt X-Stranger's guide about booting Arch from *.img. It's there and should be tested, rewritten and easied and some whitespaces should be filled. I know there are some as i have spent many hours in Arch with little dirty hacks like
Code:
ln -s /proc/self/fd /dev/fd
that are needed but no one ever wrote that they are.
What's wrong with basic video? While we get bootable Arch if you add lxdm and xorg.conf it should work with lightdm and boot there without console commands. If you try to install lightdm you will get nothing but a black screen if you start it with
Code:
sudo lightdm
... and it should boot automatically without touching console.
Oh and why is kernel from exception13 not building at all? XD
Redesign #2
Anyone dislikes the new design idea with navbar selectors instead of tabs?
I hope it's better.
Will soon update the guide with last steps to have Arch with LXDE bootable from separate partition.
That's fun as I started this project to get Ubuntu working... :angel:
If anyone can understand what should be done with mkinitramfs to make debian/ubuntu rootfs bootable - please do it.
First success!
If you choose any pc distro, arch on sgn with lxde on a seaprate partition you will now get a fully working guide that will give you a native bootable GNU/Linux =)
That's first success for me but still i hope to get help as i don't know things I asked two posts ago and it's difficult to move forward.
XFCE problems
XFCE is booting (not in the guide yet) but for working with fingers in XFCE one should probably disable multitouch S-pen works fine.
http://lists.x.org/pipermail/xorg/2012-July/054626.html
http://xfce.10915.n7.nabble.com/Xfwm-window-borders-do-not-respond-to-touch-screen-td17348.html
Will find a way to enable onscreen keyboard on LightDM and update the guide with XFCE. Still I was hoping to make it my primary DE and they are not supporting fingers moving windows upstream :crying:
I was hoping to contribute this weekend but unfortunately my only machine is down after mucking up the /lib folder when heimdall. To add insult to injury, I have no backups. Installing Arch Linux or Debian and configuring everything to my liking again will take a few hours.
Sent from my GT-N8010 using Tapatalk 2
How to setup WiFi using wpa_supplicant.conf
How to setup WiFi using wpa_supplicant.conf​
1. Copy the "wifi" folder to "/opt"
- You will need gedit to edit the nameservers.
- You also need two dependencies before installing gedit.
- The two dependencies are : gtksourceview3-3.6.1-1-armv7h.pkg.tar.xz and libpeas-1.6.1-1-armv7h.pkg.tar.xz
2. Download them and copy over to ArchLinux
3. Install the dependencies first then gedit:
Code:
sudo pacman -U gtksourceview3-3.6.1-1-armv7h.pkg.tar.xz
sudo pacman -U libpeas-1.6.1-1-armv7h.pkg.tar.xz
sudo pacman -U gedit-3.6.2-2-armv7h.pkg.tar.xz
4. insmod the drivers:
***NOTE*** " 3.0.31-gedcc915 " is my kernel name. Change it to your
kernel name if it is different.
Code:
sudo insmod /lib/modules/3.0.31-gedcc915/kernel/net/wireless/cfg80211.ko
sudo insmod /lib/modules/3.0.31-gedcc915/kernel/drivers/net/wireless/bcmdhd/dhd.ko op_mode=0 firmware_path=/opt/wifi/bcmdhd_sta.bin nvram_path=/opt/wifi/nvram_net.txt_murata
5. Enable the wlan0:
Code:
sudo ip link set wlan0 up
6. Setup wpa_supplicant and ip address:
Code:
sudo wpa_supplicant -B -i wlan0 -Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf
sudo ip addr add 192.168.1.33/24 dev wlan0
sudo ip route add default via 192.168.1.1
7a. Add nameservers:
Code:
sudo gedit /etc/resolv.conf
7b. Go to the next available line and type:
Code:
nameserver 8.8.8.8
7c. Next line :
Code:
nameserver 8.8.4.4
7d. Save it
8. Go back to the terminal and edit the wpa_supplicant file:
Code:
sudo gedit /etc/wpa_supplicant/wpa_supplicant.conf
- wpa_supplicant.conf file should be like this:
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
network={
ssid="NETWORKNAME"
scan_ssid=1
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
psk="NETWORKPASSWORD"
}
9. And finally, to connect to your network, run
Code:
sudo dhcpcd
Open up a web browser and enjoy!
:good: :good: :good:
WiFi
I am currently including WiFi in the main guide as it's something everyone needs :laugh:
Soul_Est said:
I was hoping to contribute this weekend but unfortunately my only machine is down after mucking up the /lib folder when heimdall. To add insult to injury, I have no backups. Installing Arch Linux or Debian and configuring everything to my liking again will take a few hours.
Sent from my GT-N8010 using Tapatalk 2
Click to expand...
Click to collapse
I will be happy if you join :good:
thermatk said:
I will be happy if you join :good:
Click to expand...
Click to collapse
I'll get right on the Arch Linux instructions once I get an Arch based OS installed. Hopefully that'll be tomorrow.
Written on my Galaxy Note 10.1
is this project dead ?
Equilibrio said:
is this project dead ?
Click to expand...
Click to collapse
Great job! This is awesome.
Anyone else having dependency conflicts with bluez and obexd-client?
cctoro said:
Great job! This is awesome.
Anyone else having dependency conflicts with bluez and obexd-client?
Click to expand...
Click to collapse
I did before but it really depends on what you have install at the time when you do the update.
Having a small issue
Ok, so I followed all the instructions and set the kernel up to boot from mmcblk1p2 (my ext4 partition on my sdcard I made for linux), and used dd to copy the prebuilt arch to the partition, and it boots and eveything seems to work but the wifi.... I repeated the process from the beginning all over and recompiled to make sure i didn't miss anything, but still no wifi... And since I'm using the prebuilt image copied to the sdcard for the distro, and everything works in it if i boot the .img from the internal storage and use the premade recovery, I'm assuming maybe there's something missing from compiling the kernel? In either case, if anyone has any ideas about this, please help, or if someone can make a properly compiled recovery.img that boots from mmcblk1p2, that would be super awesome.... I'm only mediocre in linux skill so any help would be appreciated!
K, so i was an idiot and forgot to copy the compiled kernel modules to /lib........ OOPS!
Arch linux distro booting from mmcblk1p2 with 1p3 as swap... all work awesome! Working on dri2 for the mali now.....
Sent from my GT-N8013 using xda app-developers app
Could you post a prepared .IMG, possibly? Thanks.
Sent from my GT-N8013 using xda app-developers app

[GUIDE]Kali Nethunter 3.0 on Android 6.0.x ROMs - [kenzo]

OUTDATED
Rishabh1x said:
In this guide i will cover how to setup a successful install of kali nethunter 3.0 on Redmi Note 3(mine is 32gb) using the ported nethunter zip and the hammerhead image(nexus 5). This may or may NOT work on any other ROM because I havent tested it. I am running exodus ROM with stock kernel. Please make sure you know what you are doing before you proceed because i dont have time to answer questions like 'what is chroot and root for?'​
Requirements:
1. Unlocked bootloader
2. TWRP
3. ROOT
4. Some free space in /data partition(alot actually if you install ALL the tools)
5. Basic understanding about how linux works
Things you need to grab:
1. kali nethunter zip and modules zip for our device
2. hammerhead image zip
Steps:
1. BACKUP current ROM(system, data, boot->MOST IMP)
2. After you have a backup flash the nethunter.zip(72.8m) and once its done flash modules.zip(2.1mb)
3. Now you have to restore your boot partition from the backup you took earlier. > Goto restore and tick only Boot and restore it.
4. Reboot your phone now. You should see some new apps in your app drawer if all was successful. Also you will see the nethunter bootanim(awesome).
5. Now download kmod manager and enable the modules that can be enabled and ignore the rest.
6. Now extract the hammerhead zip file anywhere. Inside that you will have a /data/local folder. There is a file named kalifs-full.tar.xz. Copy it to /sdcard.
7. Now open Nethunter app from app drawer. From left panel goto - kali chroot manager. Click install chroot > use sdcard > Full chroot.
8. Now you will see a progress bar stating decompressing ~5-10 mins. Wait till it finishes. Then you will see a metapackages thing with options to tick. Ignore by pressing back button.
9. The console(green text) should print somewhere this line - "everything went fine" to tell you no errors were encountered.
10. Now chroot is ready, this means kali is installed and running inside android. To test it, do this - Open es explorer and goto /data/local/nhsystem/kali-armhf, there u should see some directories like bin/boot/ etc.
This means the filesystem is installed. Now you can open the nethunter terminal app and choose 'kali'. If it says [email protected] in red color, it means everything went fine and you are logged in as root.
Post install notes:
1. Hammerhead zip is pretty old. You will have to change the repo to kali-rolling to get the latest stable packages.
2. I have noticed very slow speed while downloading the packages, you can either add mirrors close to your location to avoid this or you can install aria and apt-fast(requires aria) packages.
3. Wifi injection and monitoring is not supported by the internal wifi card of our device, so you will have to refer to the port thread that has a compatible wifi card listed(amazon link) which supports packet injection.
Downloads:
1. nethunter zip and modules for RN3 -> Grab from original port thread
2. Hammerhead image zip -> Hammerhead image zip
Thanks to:
Baka Guy aka Cereal Killer - for port
Offensive Security - for Nethunter
Note- Any sensible questions, feel free to ask. Sorry if I missed something, if any confusion or mistakes found in steps pls inform me.
Click to expand...
Click to collapse
Hello, this is only for 6.0 roms? like which ? RR official?
Did you read the thread?
This is for MM roms however I have not tested on cm based ROM so you can give it a try by doing as per the steps and report back if it works.
Rishabh1x said:
Did you read the thread?
This is for MM roms however I have not tested on cm based ROM so you can give it a try by doing as per the steps and report back if it works.
Click to expand...
Click to collapse
do u have test to install it on cm rom? which cm
He said exodus... I will be testing it today on rr with radon 2.5.1
Sent from my Redmi Note 3 using Tapatalk
I have tried it and it works on Mokee. It boots and many of the functions do seem to work. How ever I'm still testing it and will review later again after some more testing.
Audacity4545 said:
I have tried it and it works on Mokee. It boots and many of the functions do seem to work. How ever I'm still testing it and will review later again after some more testing.
Click to expand...
Click to collapse
Ok thanks for informing...can you check if fruitywifi is working for you or not?
Btw Radon is compatible and should not cause any problem...I will update the guide later.
Rishabh1x said:
Ok thanks for informing...can you check if fruitywifi is working for you or not?
Btw Radon is compatible and should not cause any problem...I will update the guide later.
Click to expand...
Click to collapse
I have tried radon once at Radonv2.1 on mokee but it seemed to mess with the adaptable storage which I really need. So I dont use custom kernal on mokee. I will check fruitywifi possibly tomorrow or day after that when I get the time. Ill report my results when I'm done. Also you should show how to change repos. Many people dont know.
How to change repos- first the current repos are too old. they are for sana i.e. kali 2.0. now latest version is kali 2016 i.e. Kali rolling.
Guide to changing repos and increasing download speed for update.
*OP pls add this in main post if you want.
To change your repos go to (using es explorer) device/data/local/nhsystem/kali-armhf/etc/apt/sources.list
edit it using a text editor. Delete whatever is in it. then add these lines
deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
Then save it.What you just did was delete old sana repos and change them with updated rolling repos. Then go to nethunter terminal using kali shell. then run
apt-get update
then
apt-get upgrade
then
apt-get dist-upgrade
if you are getting slow speed then change http in sources to repo. i.e.
deb http://repo.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://repo.kali.org/kali kali-rolling main contrib non-free
this will most likely get you better download speeda and lot easier than using aria.
This currently only contains nethunter packages, to get all packages
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install kali-linux-full -y
This installs all kali packages shown at http://tools.kali.org/tools-listing. It will require alteast 800 mb data. If you install all packages you will get mysql screen setup. So if you try to installl all check up a guide before doing it. I wont explain it all here. For any noobs this doesnt contain a GUI. Dont expect one. You will need to know atleast basic linux to use it. If you want to try I ask you to try Kali on pc as it contains Gui and easier for beginners.
Audacity4545 said:
I have tried radon once at Radonv2.1 on mokee but it seemed to mess with the adaptable storage which I really need. So I dont use custom kernal on mokee. I will check fruitywifi possibly tomorrow or day after that when I get the time. Ill report my results when I'm done. Also you should show how to change repos. Many people dont know.
How to change repos- first the current repos are too old. they are for sana i.e. kali 2.0. now latest version is kali 2016 i.e. Kali rolling.
Guide to changing repos and increasing download speed for update.
*OP pls add this in main post if you want.
To change your repos go to (using es explorer) device/data/local/nhsystem/kali-armhf/etc/apt/sources.list
edit it using a text editor. Delete whatever is in it. then add these lines
deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
Then save it.What you just did was delete old sana repos and change them with updated rolling repos. Then go to nethunter terminal using kali shell. then run
apt-get update
then
apt-get upgrade
then
apt-get dist-upgrade
if you are getting slow speed then change http in sources to repo. i.e.
deb http://repo.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://repo.kali.org/kali kali-rolling main contrib non-free
this will most likely get you better download speeda and lot easier than using aria.
This currently only contains nethunter packages, to get all packages
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install kali-linux-full -y
This installs all kali packages shown at http://tools.kali.org/tools-listing. It will require alteast 800 mb data. If you install all packages you will get mysql screen setup. So if you try to installl all check up a guide before doing it. I wont explain it all here. For any noobs this doesnt contain a GUI. Dont expect one. You will need to know atleast basic linux to use it. If you want to try I ask you to try Kali on pc as it contains Gui and easier for beginners.
Click to expand...
Click to collapse
I will add the steps in the main thread to change the repos to rolling...although I found that changing from http to repo does not give any difference in speed. You should find a mirror close to your location to get better speed. I find nl mirrors to be far better than repo.
Also the vnc connections work without any tweaks so its not really a cui based installation bcz you can connect through vnc and use the gui too. Btw kali-full package requires 1gb download and more than 2gb space for install.
And you should avoid running dist-upgrade. It can cause problems with install and break the chroot environment.
i am on miui 8 stable global i installed and followed the guide above.. but then i opening the nethunter terminal and chose kali then the app closing auto.. why?how to fix this
feikacab said:
i am on miui 8 stable global i installed and followed the guide above.. but then i opening the nethunter terminal and chose kali then the app closing auto.. why?how to fix this
Click to expand...
Click to collapse
try clearing the app data and cache. if it still does not work do this:
1. Install terminal emulator or try nethunter terminal as root
2. open and type following command
-> su -c bootkali
Then provide feedback if it was successful or not.
Rishabh1x said:
try clearing the app data and cache. if it still does not work do this:
1. Install terminal emulator or try nethunter terminal as root
2. open and type following command
-> su -c bootkali
Then provide feedback if it was successful or not.
Click to expand...
Click to collapse
Missing a requiring folder. Something isn't right. Thatd telling me when I writing the above command and on nethunter emulator, same think on terminal emulator. And try to clear the cache and data both of apps.s sorry if I asking again, on which rom are u using nethunter? Which kernel? CAF KERNEL? On the first topic u dont say clearly which file we supposed to install. I didn't found any files on the link which named nethunter.zip and have 72 mb
feikacab said:
Missing a requiring folder. Something isn't right. Thatd telling me when I writing the above command and on nethunter emulator, same think on terminal emulator. And try to clear the cache and data both of apps.s sorry if I asking again, on which rom are u using nethunter? Which kernel? CAF KERNEL? On the first topic u dont say clearly which file we supposed to install. I didn't found any files on the link which named nethunter.zip and have 72 mb
Click to expand...
Click to collapse
Open the nethunter app and from left menu click Chroot manager and tell me what you see there.
Rishabh1x said:
Open the nethunter app and from left menu click Chroot manager and tell me what you see there.
Click to expand...
Click to collapse
i am now on exodus rom 6.0.1 last version.. i cant understand the intstructions from the first topic.. which file is nethunter.zip 72mb? i couldnt find it..U must update the first post and rename the zip folders because i cant understand which is zip folder named nethunter and have 72mb size... help me someone
feikacab said:
i am now on exodus rom 6.0.1 last version.. i cant understand the intstructions from the first topic.. which file is nethunter.zip 72mb? i couldnt find it..
Click to expand...
Click to collapse
http://en.miui.com/thread-301258-1-1.html
you will find 2 zips here the 72mb and one 2mb
Rishabh1x said:
http://en.miui.com/thread-301258-1-1.html
you will find 2 zips here the 72mb and one 2mb
Click to expand...
Click to collapse
yes but the zip file which have size 74 mb named update-nethunter-kenzo.. anyway i remove and install again the chroot, and now the console is fine, opening again perfect, but the problem is, when i type wifite my card doesnt shows up.. why? i bought it before 2 days ago.. and the otg cable too. my card is tl-wn722n
feikacab said:
yes but the zip file which have size 74 mb named update-nethunter-kenzo.. anyway i remove and install again the chroot, and now the console is fine, opening again perfect, but the problem is, when i type wifite my card doesnt shows up.. why? i bought it before 2 days ago.. and the otg cable too. my card is tl-wn722n
Click to expand...
Click to collapse
is the card itself working with otg? if there is an led light on card check if its blinking....and run lsusb command too
Rishabh1x said:
is the card itself working with otg? if there is an led light on card check if its blinking....and run lsusb command too
Click to expand...
Click to collapse
what do u mean by itself working with otg?
feikacab said:
what do u mean by itself working with otg?
Click to expand...
Click to collapse
I have heard that it requires a y cable to work because card doesn't draws enough power....so I said to check the led light or any other indication to know if card is powered properly
Rishabh1x said:
I have heard that it requires a y cable to work because card doesn't draws enough power....so I said to check the led light or any other indication to know if card is powered properly
Click to expand...
Click to collapse
dude the card working perfect and the cable too. the problem is, how do u know that nethunter isnt fake? upload screenshot from your phone while hacking wifi with wifite.

Categories

Resources