Related
Why would you want to build a kernel yourself?
Click to expand...
Click to collapse
Have you read this: http://forum.xda-developers.com/showpost.php?p=21006133&postcount=1144
In that spirit, I'm going to attempt to write a plain-English tutorial on what to do to build this kernel. In fact, change one or two URLs, and you could build practically any kernel!
Note: I'm assuming you're on a PC here. I'm also assuming this isn't your first trip to linux-land, and you've at least used the terminal a few times before now. I'm also going to assume that even if you are a noob, you're not mentally sub-normal.
Note2: If this is your first time building a kernel, you may want to print this out, and go slowly, and if you get stuck, post about it in the thread! It will help me improve the guide.
What makes this different to other tutorials?
Click to expand...
Click to collapse
I'm a noob at building, but a professional at teaching. It's literally my job! In my noobishness, I made good records of pretty much every step, and I've got lots of time for explaining what each step actually does.
THE STEPS
Got a computer?
Click to expand...
Click to collapse
You'll need one to compile stuff. "For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required." (source)
OK. You're probably thinking of compiling a kernel for ICS or higher right? Is your computer only 32 bit? Pull the processor off the motherboard and count the pins. Just kidding. It won't matter if it is AMD or Intel, but it needs to be a 64 bit processor. I can compile a kernel with just 2GB of RAM and my processor is approaching its 9 year. Even with this lousy set-up, compiling a whole kernel from scratch takes only five minutes.
Install Ubuntu 10.04 64-bit. (Click on this link to download the install CD.)
If you've got a spare hard drive, use the whole thing. If you're good at partitioning, you might consider putting the linux swap partition on a separate disk. You'll want it to be at least 8GB. Putting it on a separate disk will speed things up.
If you don't have a spare disk, you're going to have to resize a partition of an existing OS, to make some new space for Ubuntu. Lets say a minimum of 12GB for the OS plus 8GB for the swap. The more space you can give to the OS, the easier your life will be if you're serious about building stuff.
At the end of the installation it will ask to install a boot-loader. This should be on sda (not sda1!) but you may need to adjust your BIOS to point at the right hard-drive if you later find it doesn't boot into Ubuntu when you restart. Don't worry about Windows, Ubuntu provides a boot menu, so you have the option of booting to Windows instead.
Once Ubuntu is installed, reboot then open a terminal and sort out your credentials:
Code:
sudo passwd root
Type in the password you set during the install, then decide on a password for the root user, and enter it once, then again for confirmation. It can be the same as your user password if you like.
Do some updates (this could take a while):
Code:
sudo apt-get update && sudo apt-get dist-upgrade
When it's finally finished, you'll have to reboot, then repeat until there's no updates left.
You're ready to set up a build environment!
Click to expand...
Click to collapse
First, you need a whole bunch of packages. You could copy and paste this into your terminal:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" && sudo apt-get update && sudo apt-get install sun-java6-jdk
That's java sorted.
Next up is the dependencies for compiling stuff:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libsdl-dev libesd0-dev libwxgtk2.6-dev libncurses5-dev lib32z1-dev gcc-multilib git-core && sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
I think I remember getting an error for one of these. Possibly lib32readline5-dev. If you get that error, make sure you install everything else. Please let me know, and I'll update this step with a fix.
Make sure ADB is initialised:
Code:
gedit /etc/udev/rules.d/51-android.rules
and copy the below into a blank text file, then edit both instances of <username> to your Ubuntu username (lower-case!) and no chevrons: ="<bedalus>" is wrong. You want ="bedalus"
Code:
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
Now save the file!
Get hold of a Cross-Compiler
Click to expand...
Click to collapse
Follow this link to Mentor Graphics Sourcery CodeBench LITE and do a free signup to get the download link. You can get hold of other ones, like Linaro or Google's own, but I'm using this as an example, because it's the one I use, and Ezekeel published some R&D here that showed there was no measurable benefit to one toolchain over another.
When you've downloaded it, you need to copy it to /opt:
Code:
cd /home/<username>/Downloads
cp arm-some-date-some-version-some-arch.tar.bz2 /opt
Note- Obviously that's not the actual name of the file! But you can see what it's really called when you download it.
Now go to /opt and unpack it:
Code:
cd /opt
tar xjf arm-some-date-some-version-some-arch.tar.bz2
So I've got all the tools. Now what?
Click to expand...
Click to collapse
So now you need to get some source code. You can use 'git clone' if you don't plan on publishing your kernel. But if you've made some modifications and want to share your end result, you need to obey the GPL terms for the linux kernel, which is Open Source, meaning that you are required to make your source available publicly.
Go to github: https://github.com/
...and sign up. It's just a free registration provided you are non-commercial. Github has some useful getting started tutorials, which I suggest you follow:
https://help.github.com/articles/set-up-git
(just follow that first page for now. I will walk you through git in a bit...)
Next, fork a repo:
Go to whichever kernel you like: https://github.com/bedalus/bedalusKERNEL
I'm using mine as an example. Look for the big 'Fork' button.
You've now got your own copy on github, and you can do whatever you like with it, without affecting the original.
However, it's no use if it exists only in the cloud. You need to get a local copy. You'll also want something called a 'remote tracking branch', which will enable you to keep up-to-date with the changes going on in the original repository that you have forked-off from.
Critical Step:
Click to expand...
Click to collapse
Shout 'fork-off!' at the top of your voice.
Uh... okay. Now, to get a local copy, and set up your remote-tracking branches, execute:
Code:
cd /home/<username>/
mkdir mykernel
...you can name your new directory whatever you want. It doesn't have to be 'mykernel', then:
Code:
git clone https://github.com/<your github username>/bedalusKERNEL.git
In the above, put your git username, and substitute bedalusKERNEL.git for whatever your fork is called. You can actually copy and paste the URL from the top of your new github repo's page if you want.
It's going to download about 800MB if I remember correctly. This will take a while, so go have some marmite on toast.
When that's done, you're ready for the remote-tracking branch:
Code:
cd bedalusKERNEL (or whatever your fork is called)
git remote add upstream https://github.com/bedalus/bedalusKERNEL.git
git fetch upstream
The 'git remote add upstream' creates a new branch called upstream, and any changes that the original developer uploads to github can be fetched to your machine with the 'git fetch upstream' command. Notice how this time, the download time is much shorter? That's because of 'delta downloads' which only downloads the differences between what you have, and what they have. (There's some technical detail here.)
Git Tip No. 1: What branches do I have?
Click to expand...
Click to collapse
You can now enter:
Code:
git branch
...to see all your branches. At this point there should be 'origin' and 'upstream'.
Git Tip No. 2: How do I change branches?
Click to expand...
Click to collapse
Changing branches (you might as well do this now just to have a little go):
Code:
git checkout upstream
That will move you onto the upstream branch, as long as you haven't made any 'uncommited' changes in origin. (More on that later.) Change back to origin with:
Code:
git checkout origin
Git Tip No. 3: How do I rename a branch?
Click to expand...
Click to collapse
You might want to rename your branches to help personalise them, just to make remembering which is which a little bit easier. To change origin to 'my_version' do this:
Code:
git branch -m origin my_version
You can change upstream to 'their_version' or something else if you want to. It won't stop anything from working.
More Git Tips later. Let's sort out a build script. If you tinker with any code, you'll inevitably break stuff, and need to fix it, and then need to try building again... So, having a build script is going to save you a lot of time, because there are several steps that can be automated.
Here's how the start of my script looks:
Code:
#!/bin/sh
cd /home/dave/mykernel
git branch
read -p "Correct branch? [Y/N]: " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo -e "\n"
exit 1
fi
This is just a little precaution that I put in to give myself the chance to abort the build before it starts if I'm on the wrong branch. If I don't hit y then the script aborts, and I can checkout the right branch, then restart the script.
Code:
echo -e "\nSTARTING...\n"
The \n prints a new line, then on that new line the message 'STARTING...' and then begins another new line. If you put \n\n you can print a blank line. The echo command is a good way of putting notices in a script so you know what stage it is at.
Code:
export PATH=$PATH:/opt/toolchain/bin/
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-none-eabi-
If you put these lines in your script, it sets 'environment variables' that tells the make program where to find the compiler, and what processor it's compiling for (ARM).
If you now save your script in the /mykernel directory you created earlier, git can keep track of it as well as the files integral to the kernel. Save it as whatever you like, e.g. "myscript.sh"
...It's important to have the .sh extension so the system knows it is a script.
To make your script executable, run:
Code:
chmod a+x myscript.sh
Before you execute the script, you need a .config file in the mykernel directory. If you've cloned my repo, you can get a working one by executing:
Code:
cp arch/arm/configs/crespo_release_defconfig ./.config
...this command will only work properly if you are in the mykernel directory when you execute it.
You can mess with this config file if you like! But it's very easy to break the kernel. However, you can always just copy the crespo_release_defconfig again.
Now, to execute the build script run:
Code:
./myscript
If you execute your script, your compiler will now build the kernel. It will take time, but even on my ten-years-old PC it takes less than ten minutes from scratch.
The compiler will spit out a lot of messages. Most of the time it's telling you that it has compiled an object (i.e. a .o file, which will all be linked up later to form the kernel) and sometimes you'll see warnings, which is the compiler telling you it thinks something might be wrong. Don't worry, most of the time the compiler is just being over-cautious.
If the compiler hits a real problem with the code, it will print an error, and tell you what file, and what line, and how far along that line it managed to get to before it didn't know what to do. I'll get back to this later. For now, let's assume everything compiled.
You'll see a message about the zImage being created. That's the kernel. You can't use it as it is, you need to put it into a boot.img so you can flash it.
I find it useful to add this command in my build-script:
Code:
ls -l /home/dave/mykernel/arch/arm/boot/zImage
ls -l means list with long format. It'll print out the entire contents of a directory with size, time, permissions, etc. if you execute it in a directory, or point it to a directory. However, in the command above, I've pointed it specifically at the zImage file, so it only prints out the details for that. This is so I can check the time. If the time is from yesterday, I can see quickly that there has been an error in the build, and the zImage is still the same one I built yesterday, or an hour ago... etc. depending on the time-stamp printed out.
If you get a 'No such file' error, it's because there is no old zImage, because you haven't ever successfully built one yet.
If you sat and watched the entire thing build, then the timestamp should show the current time, minus a few seconds.
How do I make this zImage into a CWM flashable .zip file?
Click to expand...
Click to collapse
Yay! You've built a kernel. Now you need to make everybody else flash it to their phones too
To do this you need to put it into a boot.img, and then into a .zip file.
Making the boot.img
Click to expand...
Click to collapse
Download this: http://d-h.st/wVZ (make-boot necessary files)
It's a small download. It's some very simple tools that can split an existing boot image into a ramdisk and zImage, and can also stitch them back up.
Move mkboot.zip into your mykernel folder, right click on it, and select 'Extract Here'. You can now delete mkboot.zip. There is a tool called unbootimg, that can take apart existing boot.img files, I've made things simple by including my own ramdisk, which is compatible with AOSP and CM ROMs. That file is called cyan2disk_new.cpio.gz
We now need to add some new stuff to the script to stitch our zImage and ramdisk together.
If you've not already added the ls -l command I mentioned above, also add this now. Then:
Code:
cp /home/dave/mykernel/arch/arm/boot/zImage /home/dave/mykernel/mkboot/
cd /home/dave/mykernel/mkboot
./mkbootimg --kernel zImage --ramdisk cyan2disk_new.cpio.gz --cmdline 'no_console_suspend=1 console=bull's --base 0x30000000 --pagesize 4096 -o boot.img
Remember, your username is not dave! Unless it is. Make the appropriate changes to the path.
How do I make the CWM flashable .zip file?
We're nearly there! This bit is relatively painless. At this point you could save and run the script to check that mkboot is working. If it has worked you can use the same ls -l trick from before, but this time target the boot.img file you just created. If the time-stamp is fresh, it means your boot.img is correct.
TIP: If you haven't switched branches, or run 'make clean', all your .o files are unchanged. The make program keeps track of changes, and only recompiles .o files when the corresponding .c file has been altered. If nothing has changed, your build script will execute very quickly!
To make a flashable .zip file, the easiest thing to do is modify an existing .zip file. You can download my kernel for simplicity, since it already has the necessary script for flashing the entire boot partition. (Most kernels here use koush's any-kernel script, which updates only the zImage and keeps the boot partition's existing ramdisk, so if you try to use another kernel .zip as a template, make sure you correct their updater-script. Using my ramdisk and kernel script will also ensure you keep MTP!)
Once you've downloaded my kernel you should extract it in your home folder, then rename the directory to something like 'myzip'
Now add these lines to your build-script:
Code:
cp /home/dave/mykernel/mkboot/boot.img /home/dave/myzip/boot.img
cp /home/dave/mykernel/drivers/scsi/scsi_wait_scan.ko /home/dave/myzip/system/modules/
"What's that second line? With the .ko file?" I hear you say. Depending on what modules you build, you'll need to copy all of them to the folder specified above. Fortunately, when the kernel finishes building, it tells you what modules have also been built. If you don't want modules in your kernel, you can remove the second line above. However, you must edit your .config file: Open it in gedit, use CTRL+F to open the find dialogue, then type "=m" Now, change every one you find into a "=y" ...so now instead of building modules, the kernel will now incorporate all that code into the zImage instead.
Finally, add this line to your build-script:
Code:
7z a -r -tzip /home/dave/mykernel.zip /home/dave/myzip/*
Run the script again. if everything has gone smoothly, then you now have a flashable .zip in your home directory!
Congratulations!
* * * * * * * * *
More git tips!
Click to expand...
Click to collapse
I've compiled a list of commands you may find handy when getting to know git.
Add a remote branch and track it
git remote add ezekeel git://github.com/Ezekeel/GLaDOS-nexus-s-ics.git
git fetch ezekeel
git checkout --track -b bln ezekeel/bln
Merge in the changes
git merge bln
Resolve conflicts
git mergetool
List local branches
git branch
List remote branches
git branch -r
Switch branch
git checkout branch_name
Rename a branch
git branch -m old_branch_name new_branch_name
View log with short sha1 hash
git log -10 --pretty=format:"%h - %ar: %s"
Restore to a particular point
(IMPORTANT! Don't do this if you've already pushed your commits to github!)
git reset --hard <sha1 hash>
Restore to your last commit
git reset --hard HEAD
Restore to one commit before your last commit:
git reset --hard HEAD^
Restore to two commits before your last commit:
git reset --hard HEAD^^ (etc.)
As long as you haven't pushed to github,
squash all your recent commits into one:
git rebase -i <sha1> ...then change push to squash (or fixup) for all except the first one
git rebase -i --abort (to abort!)
Add .file (i.e. hidden file)
git add .file (simple!)
Add all new and modified files
git add .
Deleting files
(i.e. after doing rm <files>)
git add -u (git will note which files have been deleted)
Bring files from a directory in another branch
git checkout cyanogenmod drivers/cpufreq/
Tells you what changes you've made so far
git status
Commit your changes
git commit (type in your notes about what you did, then CTRL+X then Y to save)
Sync your commits to your github repo
git push <repo_name> <branch_name>
Delete a remote branch
(WARNING: This will delete the entire branch from github
Note: You cannot do this to the default github branch, but you can change the default branch in the admin tab on the website)
git push <repo_name> :<branch to be deleted>
General tips! File management, searching... etc.
Click to expand...
Click to collapse
Find a file (useful for troubleshooting in some situations)
find /home/dave/ -name 'buildlean.sh'
(searches the home folder and subdirectories for 'buildlean.sh')
Find within any *.c file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f -name *.c | xargs grep s5pv210_driver
Find within any file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f | xargs grep s5pv210_driver
Special Mention : bedalus [Original maker of this Post]. Thank Him Not Me!!
I will not help in this thread as I am not a kernel Dev. I just kanged it here so there Can Be New Developers
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I m getting an error which you've mentioned after applying this code
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libsdl-dev libesd0-dev libwxgtk2.6-dev libncurses5-dev lib32z1-dev gcc-multilib git-core && sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
Click to expand...
Click to collapse
EDIT: page not found https://github.com/bedalus/bedalusKERNEL
l0lh4rd said:
I m getting an error which you've mentioned after applying this code
EDIT: page not found https://github.com/bedalus/bedalusKERNEL
Click to expand...
Click to collapse
Ubuntu??
Which Device??
mithun46 said:
Ubuntu??
Which Device??
Click to expand...
Click to collapse
Ubuntu 12.04 LTS (x64)
l0lh4rd said:
Ubuntu 12.04 LTS (x64)
Click to expand...
Click to collapse
Device???????
@l0lh4rd
Your device probably has different sources. And the page was not found because bedalus doesn't have any public repo by that name anymore.
Below
Sent from my GT-S5360 using xda app-developers app
thanks i'll find a time and try.
I am going to say WOW. Is everyone as lost and confused about what this is or does? I know I am. First off. I think you started off with a very good Tut. The problem is, you never said what you are compiling or what its for. The more advance users can figure it out and actually understand what you said. But what about the n00bs here? If I understand the jibberish you are compiling a Arm kernel off of linux. It would have been more useful if you had mentioned that this is the Arm kernal for the android platform. It would have also been better if you had said what chip your where using. Is this for the Arm5, Arm6, Arm7? You should also give warning about compiling the kernal and how they can screw things up if they don't follow the steps properly and not to skip or try something that is not listed. You also say that you are using Ubuntu, which alot do, but not all. Some use other distro's and that this may not work on all flavors of linux. Some use different commands and some repo's don't work on all distro's either.
Other then that, pretty nice Tut.
mithun46 said:
Have you read this: http://forum.xda-developers.com/showpost.php?p=21006133&postcount=1144
In that spirit, I'm going to attempt to write a plain-English tutorial on what to do to build this kernel. In fact, change one or two URLs, and you could build practically any kernel!
Note: I'm assuming you're on a PC here. I'm also assuming this isn't your first trip to linux-land, and you've at least used the terminal a few times before now. I'm also going to assume that even if you are a noob, you're not mentally sub-normal.
Note2: If this is your first time building a kernel, you may want to print this out, and go slowly, and if you get stuck, post about it in the thread! It will help me improve the guide.
I'm a noob at building, but a professional at teaching. It's literally my job! In my noobishness, I made good records of pretty much every step, and I've got lots of time for explaining what each step actually does.
THE STEPS
You'll need one to compile stuff. "For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required." (source)
OK. You're probably thinking of compiling a kernel for ICS or higher right? Is your computer only 32 bit? Pull the processor off the motherboard and count the pins. Just kidding. It won't matter if it is AMD or Intel, but it needs to be a 64 bit processor. I can compile a kernel with just 2GB of RAM and my processor is approaching its 9 year. Even with this lousy set-up, compiling a whole kernel from scratch takes only five minutes.
Install Ubuntu 10.04 64-bit. (Click on this link to download the install CD.)
If you've got a spare hard drive, use the whole thing. If you're good at partitioning, you might consider putting the linux swap partition on a separate disk. You'll want it to be at least 8GB. Putting it on a separate disk will speed things up.
If you don't have a spare disk, you're going to have to resize a partition of an existing OS, to make some new space for Ubuntu. Lets say a minimum of 12GB for the OS plus 8GB for the swap. The more space you can give to the OS, the easier your life will be if you're serious about building stuff.
At the end of the installation it will ask to install a boot-loader. This should be on sda (not sda1!) but you may need to adjust your BIOS to point at the right hard-drive if you later find it doesn't boot into Ubuntu when you restart. Don't worry about Windows, Ubuntu provides a boot menu, so you have the option of booting to Windows instead.
Once Ubuntu is installed, reboot then open a terminal and sort out your credentials:
Code:
sudo passwd root
Type in the password you set during the install, then decide on a password for the root user, and enter it once, then again for confirmation. It can be the same as your user password if you like.
Do some updates (this could take a while):
Code:
sudo apt-get update && sudo apt-get dist-upgrade
When it's finally finished, you'll have to reboot, then repeat until there's no updates left.
First, you need a whole bunch of packages. You could copy and paste this into your terminal:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" && sudo apt-get update && sudo apt-get install sun-java6-jdk
That's java sorted.
Next up is the dependencies for compiling stuff:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libsdl-dev libesd0-dev libwxgtk2.6-dev libncurses5-dev lib32z1-dev gcc-multilib git-core && sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
I think I remember getting an error for one of these. Possibly lib32readline5-dev. If you get that error, make sure you install everything else. Please let me know, and I'll update this step with a fix.
Make sure ADB is initialised:
Code:
gedit /etc/udev/rules.d/51-android.rules
and copy the below into a blank text file, then edit both instances of <username> to your Ubuntu username (lower-case!) and no chevrons: ="<bedalus>" is wrong. You want ="bedalus"
Code:
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
Now save the file!
Follow this link to Mentor Graphics Sourcery CodeBench LITE and do a free signup to get the download link. You can get hold of other ones, like Linaro or Google's own, but I'm using this as an example, because it's the one I use, and Ezekeel published some R&D here that showed there was no measurable benefit to one toolchain over another.
When you've downloaded it, you need to copy it to /opt:
Code:
cd /home/<username>/Downloads
cp arm-some-date-some-version-some-arch.tar.bz2 /opt
Note- Obviously that's not the actual name of the file! But you can see what it's really called when you download it.
Now go to /opt and unpack it:
Code:
cd /opt
tar xjf arm-some-date-some-version-some-arch.tar.bz2
So now you need to get some source code. You can use 'git clone' if you don't plan on publishing your kernel. But if you've made some modifications and want to share your end result, you need to obey the GPL terms for the linux kernel, which is Open Source, meaning that you are required to make your source available publicly.
Go to github: https://github.com/
...and sign up. It's just a free registration provided you are non-commercial. Github has some useful getting started tutorials, which I suggest you follow:
https://help.github.com/articles/set-up-git
(just follow that first page for now. I will walk you through git in a bit...)
Next, fork a repo:
Go to whichever kernel you like: https://github.com/bedalus/bedalusKERNEL
I'm using mine as an example. Look for the big 'Fork' button.
You've now got your own copy on github, and you can do whatever you like with it, without affecting the original.
However, it's no use if it exists only in the cloud. You need to get a local copy. You'll also want something called a 'remote tracking branch', which will enable you to keep up-to-date with the changes going on in the original repository that you have forked-off from.
Shout 'fork-off!' at the top of your voice.
Uh... okay. Now, to get a local copy, and set up your remote-tracking branches, execute:
Code:
cd /home/<username>/
mkdir mykernel
...you can name your new directory whatever you want. It doesn't have to be 'mykernel', then:
Code:
git clone https://github.com/<your github username>/bedalusKERNEL.git
In the above, put your git username, and substitute bedalusKERNEL.git for whatever your fork is called. You can actually copy and paste the URL from the top of your new github repo's page if you want.
It's going to download about 800MB if I remember correctly. This will take a while, so go have some marmite on toast.
When that's done, you're ready for the remote-tracking branch:
Code:
cd bedalusKERNEL (or whatever your fork is called)
git remote add upstream https://github.com/bedalus/bedalusKERNEL.git
git fetch upstream
The 'git remote add upstream' creates a new branch called upstream, and any changes that the original developer uploads to github can be fetched to your machine with the 'git fetch upstream' command. Notice how this time, the download time is much shorter? That's because of 'delta downloads' which only downloads the differences between what you have, and what they have. (There's some technical detail here.)
You can now enter:
Code:
git branch
...to see all your branches. At this point there should be 'origin' and 'upstream'.
Changing branches (you might as well do this now just to have a little go):
Code:
git checkout upstream
That will move you onto the upstream branch, as long as you haven't made any 'uncommited' changes in origin. (More on that later.) Change back to origin with:
Code:
git checkout origin
You might want to rename your branches to help personalise them, just to make remembering which is which a little bit easier. To change origin to 'my_version' do this:
Code:
git branch -m origin my_version
You can change upstream to 'their_version' or something else if you want to. It won't stop anything from working.
More Git Tips later. Let's sort out a build script. If you tinker with any code, you'll inevitably break stuff, and need to fix it, and then need to try building again... So, having a build script is going to save you a lot of time, because there are several steps that can be automated.
Here's how the start of my script looks:
Code:
#!/bin/sh
cd /home/dave/mykernel
git branch
read -p "Correct branch? [Y/N]: " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo -e "\n"
exit 1
fi
This is just a little precaution that I put in to give myself the chance to abort the build before it starts if I'm on the wrong branch. If I don't hit y then the script aborts, and I can checkout the right branch, then restart the script.
Code:
echo -e "\nSTARTING...\n"
The \n prints a new line, then on that new line the message 'STARTING...' and then begins another new line. If you put \n\n you can print a blank line. The echo command is a good way of putting notices in a script so you know what stage it is at.
Code:
export PATH=$PATH:/opt/toolchain/bin/
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-none-eabi-
If you put these lines in your script, it sets 'environment variables' that tells the make program where to find the compiler, and what processor it's compiling for (ARM).
If you now save your script in the /mykernel directory you created earlier, git can keep track of it as well as the files integral to the kernel. Save it as whatever you like, e.g. "myscript.sh"
...It's important to have the .sh extension so the system knows it is a script.
To make your script executable, run:
Code:
chmod a+x myscript.sh
Before you execute the script, you need a .config file in the mykernel directory. If you've cloned my repo, you can get a working one by executing:
Code:
cp arch/arm/configs/crespo_release_defconfig ./.config
...this command will only work properly if you are in the mykernel directory when you execute it.
You can mess with this config file if you like! But it's very easy to break the kernel. However, you can always just copy the crespo_release_defconfig again.
Now, to execute the build script run:
Code:
./myscript
If you execute your script, your compiler will now build the kernel. It will take time, but even on my ten-years-old PC it takes less than ten minutes from scratch.
The compiler will spit out a lot of messages. Most of the time it's telling you that it has compiled an object (i.e. a .o file, which will all be linked up later to form the kernel) and sometimes you'll see warnings, which is the compiler telling you it thinks something might be wrong. Don't worry, most of the time the compiler is just being over-cautious.
If the compiler hits a real problem with the code, it will print an error, and tell you what file, and what line, and how far along that line it managed to get to before it didn't know what to do. I'll get back to this later. For now, let's assume everything compiled.
You'll see a message about the zImage being created. That's the kernel. You can't use it as it is, you need to put it into a boot.img so you can flash it.
I find it useful to add this command in my build-script:
Code:
ls -l /home/dave/mykernel/arch/arm/boot/zImage
ls -l means list with long format. It'll print out the entire contents of a directory with size, time, permissions, etc. if you execute it in a directory, or point it to a directory. However, in the command above, I've pointed it specifically at the zImage file, so it only prints out the details for that. This is so I can check the time. If the time is from yesterday, I can see quickly that there has been an error in the build, and the zImage is still the same one I built yesterday, or an hour ago... etc. depending on the time-stamp printed out.
If you get a 'No such file' error, it's because there is no old zImage, because you haven't ever successfully built one yet.
If you sat and watched the entire thing build, then the timestamp should show the current time, minus a few seconds.
Yay! You've built a kernel. Now you need to make everybody else flash it to their phones too
To do this you need to put it into a boot.img, and then into a .zip file.
Download this: http://d-h.st/wVZ (make-boot necessary files)
It's a small download. It's some very simple tools that can split an existing boot image into a ramdisk and zImage, and can also stitch them back up.
Move mkboot.zip into your mykernel folder, right click on it, and select 'Extract Here'. You can now delete mkboot.zip. There is a tool called unbootimg, that can take apart existing boot.img files, I've made things simple by including my own ramdisk, which is compatible with AOSP and CM ROMs. That file is called cyan2disk_new.cpio.gz
We now need to add some new stuff to the script to stitch our zImage and ramdisk together.
If you've not already added the ls -l command I mentioned above, also add this now. Then:
Code:
cp /home/dave/mykernel/arch/arm/boot/zImage /home/dave/mykernel/mkboot/
cd /home/dave/mykernel/mkboot
./mkbootimg --kernel zImage --ramdisk cyan2disk_new.cpio.gz --cmdline 'no_console_suspend=1 console=bull's --base 0x30000000 --pagesize 4096 -o boot.img
Remember, your username is not dave! Unless it is. Make the appropriate changes to the path.
How do I make the CWM flashable .zip file?
We're nearly there! This bit is relatively painless. At this point you could save and run the script to check that mkboot is working. If it has worked you can use the same ls -l trick from before, but this time target the boot.img file you just created. If the time-stamp is fresh, it means your boot.img is correct.
TIP: If you haven't switched branches, or run 'make clean', all your .o files are unchanged. The make program keeps track of changes, and only recompiles .o files when the corresponding .c file has been altered. If nothing has changed, your build script will execute very quickly!
To make a flashable .zip file, the easiest thing to do is modify an existing .zip file. You can download my kernel for simplicity, since it already has the necessary script for flashing the entire boot partition. (Most kernels here use koush's any-kernel script, which updates only the zImage and keeps the boot partition's existing ramdisk, so if you try to use another kernel .zip as a template, make sure you correct their updater-script. Using my ramdisk and kernel script will also ensure you keep MTP!)
Once you've downloaded my kernel you should extract it in your home folder, then rename the directory to something like 'myzip'
Now add these lines to your build-script:
Code:
cp /home/dave/mykernel/mkboot/boot.img /home/dave/myzip/boot.img
cp /home/dave/mykernel/drivers/scsi/scsi_wait_scan.ko /home/dave/myzip/system/modules/
"What's that second line? With the .ko file?" I hear you say. Depending on what modules you build, you'll need to copy all of them to the folder specified above. Fortunately, when the kernel finishes building, it tells you what modules have also been built. If you don't want modules in your kernel, you can remove the second line above. However, you must edit your .config file: Open it in gedit, use CTRL+F to open the find dialogue, then type "=m" Now, change every one you find into a "=y" ...so now instead of building modules, the kernel will now incorporate all that code into the zImage instead.
Finally, add this line to your build-script:
Code:
7z a -r -tzip /home/dave/mykernel.zip /home/dave/myzip/*
Run the script again. if everything has gone smoothly, then you now have a flashable .zip in your home directory!
Congratulations!
* * * * * * * * *
I've compiled a list of commands you may find handy when getting to know git.
Add a remote branch and track it
git remote add ezekeel git://github.com/Ezekeel/GLaDOS-nexus-s-ics.git
git fetch ezekeel
git checkout --track -b bln ezekeel/bln
Merge in the changes
git merge bln
Resolve conflicts
git mergetool
List local branches
git branch
List remote branches
git branch -r
Switch branch
git checkout branch_name
Rename a branch
git branch -m old_branch_name new_branch_name
View log with short sha1 hash
git log -10 --pretty=format:"%h - %ar: %s"
Restore to a particular point
(IMPORTANT! Don't do this if you've already pushed your commits to github!)
git reset --hard <sha1 hash>
Restore to your last commit
git reset --hard HEAD
Restore to one commit before your last commit:
git reset --hard HEAD^
Restore to two commits before your last commit:
git reset --hard HEAD^^ (etc.)
As long as you haven't pushed to github,
squash all your recent commits into one:
git rebase -i <sha1> ...then change push to squash (or fixup) for all except the first one
git rebase -i --abort (to abort!)
Add .file (i.e. hidden file)
git add .file (simple!)
Add all new and modified files
git add .
Deleting files
(i.e. after doing rm <files>)
git add -u (git will note which files have been deleted)
Bring files from a directory in another branch
git checkout cyanogenmod drivers/cpufreq/
Tells you what changes you've made so far
git status
Commit your changes
git commit (type in your notes about what you did, then CTRL+X then Y to save)
Sync your commits to your github repo
git push <repo_name> <branch_name>
Delete a remote branch
(WARNING: This will delete the entire branch from github
Note: You cannot do this to the default github branch, but you can change the default branch in the admin tab on the website)
git push <repo_name> :<branch to be deleted>
Find a file (useful for troubleshooting in some situations)
find /home/dave/ -name 'buildlean.sh'
(searches the home folder and subdirectories for 'buildlean.sh')
Find within any *.c file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f -name *.c | xargs grep s5pv210_driver
Find within any file, the text "s5pv210_driver" (good for finding bits of code)
find ./ -type f | xargs grep s5pv210_driver
Special Mention : bedalus [Original maker of this Post]. Thank Him Not Me!!
I will not help in this thread as I am not a kernel Dev. I just kanged it here so there Can Be New Developers
Click to expand...
Click to collapse
excellent but! you will not have a custom kernel. why?
where did "make menuconfig" go?
you selected yes as default, what if i wanted a custom kernel w/o a "Y" for each?
i want to keep my kernel bare minimal. this is not for minimalistic kernel.?
how you pass other kernel params?
you can pass gcc optimizations in -Os but what if i wish to pass it in the kernel build process?
how on earth using this script? can i include firmwares? aka blobwares which are at times ultimate necessity.....?
what if i want to include my patch and the kernel w/o boot w/o special params or switch....?
how do i set the compression params?
well i am still the old school "make menuconfig" and that
cp arch/arm/configs/crespo_release_defconfig ./.config is not my cup of tea. i still like to roll my own kernel the orthodox method, than this automation.
this is okay if you are building your first kernel and you dont know the process. but this is not the right way if you want a complete fine grained inside out control of the device and the kernel.
NOPE NOPE NOPE!
but the git crash course is excellent. i wanted as usual a git flash cards. thanks
+5 to mithun for the git. everything else i found tasty but was a fruit salad, except git tut. which i found very very well documented.
+5 for git. and +1 for the effort for the kernel info.
hope this helps.
thanks
-paul
p.s. very good effort even tho its cut copy paste but the original post didnt address many kernel issues. hope its updated. hope you take it as a positive feedback.
---------- Post added at 03:08 AM ---------- Previous post was at 03:00 AM ----------
TheStrokerace said:
I am going to say WOW. Is everyone as lost and confused about what this is or does? I know I am. First off. I think you started off with a very good Tut. The problem is, you never said what you are compiling or what its for. The more advance users can figure it out and actually understand what you said. But what about the n00bs here? If I understand the jibberish you are compiling a Arm kernel off of linux. It would have been more useful if you had mentioned that this is the Arm kernal for the android platform. It would have also been better if you had said what chip your where using. Is this for the Arm5, Arm6, Arm7? You should also give warning about compiling the kernal and how they can screw things up if they don't follow the steps properly and not to skip or try something that is not listed. You also say that you are using Ubuntu, which alot do, but not all. Some use other distro's and that this may not work on all flavors of linux. Some use different commands and some repo's don't work on all distro's either.
Other then that, pretty nice Tut.
Click to expand...
Click to collapse
thats what i said, how you select the parms and fine controls like choosing the arm arch type. this doesnt do it. it copies the old config. which is excellent for new comers who wants to start to get their feet wet. but if you are building your custom kernel for arm or amd or i386 or mips? this is not at all helpful. if i were a new comer? i could have clicked on the thanks button. for an advanced user? this is a good read/timepass and nothing else. honestly because i got no control. :-s *Unacceptable*
and mithun you should also tell users how to include patches. if you write patches. how will you patch your kernel before you hit make and make bzimage? nope i am sorry this is good for a stock kernel. which has no info about patch and customization this is not complete. edit it and add more info. if you need help. feel free to ask. there are many kernel chaps here.
good luck mithun.
hope this helps.
thanks
-paul
p.s. i am pedantic at times and people hate me for that, but i am sorry i love being a pedantic moron.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
this thread wanst clealry required man as xda-u already has a post regarding this .. so do something useful.most of the steps here are ready made kang stuff .
if my phone doesn't boot up what can be the cause? is there a specific file that i have to look at or not?
matt95 said:
if my phone doesn't boot up what can be the cause? is there a specific file that i have to look at or not?
Click to expand...
Click to collapse
We can never help without logs. But in this case logcat starts after the kernel has been loaded so you need to figure out what's wrong yourself
speed_bot said:
We can never help without logs. But in this case logcat starts after the kernel has been loaded so you need to figure out what's wrong yourself
Click to expand...
Click to collapse
Cause i'm trying to port the Ubuntu touch preview on my HTC One X but id remains on the bootanimation and i think that the problem is with the kernel itself
matt95 said:
Cause i'm trying to port the Ubuntu touch preview on my HTC One X but id remains on the bootanimation and i think that the problem is with the kernel itself
Click to expand...
Click to collapse
Boot anime can't work without a kernel
speed_bot said:
Boot anime can't work without a kernel
Click to expand...
Click to collapse
The problem is that it is stuck at the bootanimation, what can cause this? do you think it could be kernel related?
matt95 said:
The problem is that it is stuck at the bootanimation, what can cause this? do you think it could be kernel related?
Click to expand...
Click to collapse
First up. Does logcat work?
this is what i get
Code:
$ adb logcat
Unable to open log device '/dev/alog/main': No such file or directory
matt95 said:
this is what i get
Code:
$ adb logcat
Unable to open log device '/dev/alog/main': No such file or directory
Click to expand...
Click to collapse
Thanks for Education
DEPRECATED because I don't have the watch anymore. Might still work, might also not. Feel free to just try and iterate on my work.
To port over TWRP, I needed a prebuilt kernel. With a little reading around the web, I managed to compile the kernel source for the Zenwatch3 from the Asus website.
Now, to make things easier for others, I created a script which handles the setup and compilation.
You can clone the script from GitHub: https://github.com/Maxr1998/asus_swift_tools
To continue, follow the instructions from the README.
Huge thanks to @joeykrim and @T10NAZ for their work in their Zenwatch2 thread, from which I got the ASUS_SW_VER fix for the Makefile and general directions.
Maxr1998 said:
To port over TWRP, I needed a prebuilt kernel. With a little reading around the web, I managed to compile the kernel source for the Zenwatch3 from the Asus website.
Now, to make things easier for others, I created a script which handles the setup and compilation.
You can clone the script from GitHub: https://github.com/Maxr1998/asus_swift_tools
To continue, follow the instructions from the README.
Huge thanks to @joeykrim and @T10NAZ for their work in their Zenwatch2 thread, from which I got the ASUS_SW_VER fix for the Makefile and general directions.
Click to expand...
Click to collapse
Thanks for the recovery and instructions.
I faces the following issue when trying to compile. Any tips to avoid this issue. thanks in advance.
drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c: In function 'hdd_RoamIbssIndicationHandler':
drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c:2170:13: warning: passing argument 3 of 'cfg80211_ibss_joined' makes pointer from integer without a cast [enabled by default]
error, forbidden warning: wlan_hdd_assoc.c:2170
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:257: recipe for target 'drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o' failed
make[3]: *** [drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o] Error 1
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:402: recipe for target 'drivers/staging/prima' failed
make[2]: *** [drivers/staging/prima] Error 2
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:402: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:820: recipe for target 'drivers' failed
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
CC net/key/af_key.o
CC net/ipv6/ip6_input.o
LD net/wireless/built-in.o
LD net/built-in.o
[email protected]:~/android/Test/kernel$
janjan said:
Thanks for the recovery and instructions.
I faces the following issue when trying to compile. Any tips to avoid this issue. thanks in advance.
drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c: In function 'hdd_RoamIbssIndicationHandler':
drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c:2170:13: warning: passing argument 3 of 'cfg80211_ibss_joined' makes pointer from integer without a cast [enabled by default]
error, forbidden warning: wlan_hdd_assoc.c:2170
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:257: recipe for target 'drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o' failed
make[3]: *** [drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o] Error 1
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:402: recipe for target 'drivers/staging/prima' failed
make[2]: *** [drivers/staging/prima] Error 2
/home/toffyjan/android/Test/kernel/scripts/Makefile.build:402: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:820: recipe for target 'drivers' failed
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
CC net/key/af_key.o
CC net/ipv6/ip6_input.o
LD net/wireless/built-in.o
LD net/built-in.o
[email protected]:~/android/Test/kernel$
Click to expand...
Click to collapse
Weird. Are you using the same toolchain I use?
Maxr1998 said:
Weird. Are you using the same toolchain I use?
Click to expand...
Click to collapse
Yes I did. I using arm-eabi-4.8. I replaced the Makefile with one you linked. Then followed by.
export PATH=~/android/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
make swift_defconfig
make -j `getconf _NPROCESSORS_ONLN`
Error due to 'drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o' failed anf stopped.
janjan said:
Yes I did. I using arm-eabi-4.8. I replaced the Makefile with one you linked. Then followed by.
export PATH=~/android/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
make swift_defconfig
make -j `getconf _NPROCESSORS_ONLN`
Error due to 'drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.o' failed anf stopped.
Click to expand...
Click to collapse
That explains it. You shouldn't replace the Makefile, but keep the default one, it gets patched with the fix automatically
Maxr1998 said:
That explains it. You shouldn't replace the Makefile, but keep the default one, it gets patched with the fix automatically
Click to expand...
Click to collapse
I can't get the patch to work. It seems it does not patched the makefile. It trying to patch but nothing happen.
~/android/Test/test111$ sudo ./build.sh
[sudo] password for toffyjan:
Welcome!
Extracting files..
Archive: WI503Q_kernel_5_8_0_54.zip
inflating: ASUS_Swift-5.8.0.54-kernel-src.tar
Press any key to continue, Ctrl + C to cancel.
Compiling kernel
Trying to patch Makefile..
--------------------------------------
I edit your script like following.
#!/bin/bash
ARCH=arm CROSS_COMPILE=/home/toffyjan/android/arm-eabi-4.8/bin/arm-eabi-
echo "Welcome!"
##################
# Setup
##################
if [ ! -d kernel ]; then
echo "Extracting files.."
unzip "WI503Q_kernel_*.zip"
tar -xf ASUS_Swift-*-kernel-src.tar
fi
echo "Press any key to continue, Ctrl + C to cancel."
read
##################
# Compile kernel
##################
echo "Compiling kernel"
cd kernel
# Patch Makefile
echo "Trying to patch Makefile.."
patch -N -r /home/toffyjan/android/Test/test111/Patch-Makefile.patch
# Exports
export ARCH=arm
export CROSS_COMPILE=/home/toffyjan/android/arm-eabi-4.8/bin/arm-eabi-
# Make
echo "Starting compilation.."
make clean
make swift_defconfig
make -j3
# Copy kernel
cp "arch/arm/boot/zImage-dtb" ../zImage-dtb
---
I can't get your point here..
OMNI_TREE="/home/max/Development/Android/TWRP" # Enter path of your Omni tree with the toolchain here ? Do I need OMNI_TREE? Is it necessary?
janjan said:
I can't get the patch to work. It seems it does not patched the makefile. It trying to patch but nothing happen.
~/android/Test/test111$ sudo ./build.sh
[sudo] password for toffyjan:
Welcome!
Extracting files..
Archive: WI503Q_kernel_5_8_0_54.zip
inflating: ASUS_Swift-5.8.0.54-kernel-src.tar
Press any key to continue, Ctrl + C to cancel.
Compiling kernel
Trying to patch Makefile..
--------------------------------------
I edit your script like following.
...
I can't get your point here..
OMNI_TREE="/home/max/Development/Android/TWRP" # Enter path of your Omni tree with the toolchain here ? Do I need OMNI_TREE? Is it necessary?
Click to expand...
Click to collapse
Does applying the patch manually from Terminal work?
You don't really need the whole omni tree for compiling the kernel, I only use it for the CROSS_COMPILE/toolchain. Maybe I'll update the script.
Btw, you normally don't need to run this with sudo.
Maxr1998 said:
Does applying the patch manually from Terminal work?
You don't really need the whole omni tree for compiling the kernel, I only use it for the CROSS_COMPILE/toolchain. Maybe I'll update the script.
Btw, you normally don't need to run this with sudo.
Click to expand...
Click to collapse
It seems it is working now at least the patch. Let me see if it finish compiling without error. I will report when it finish. Thanks. I edited like
#!/bin/bash
CROSS_COMPILE=/home/xxxxx/android/arm-eabi-4.8/bin/arm-eabi- # PLACE YOUR CROSS_COMPILE HERE
echo "Welcome!"
##################
# Setup
##################
if [ ! -d kernel ]; then
echo "Extracting files.."
unzip "WI503Q_kernel_*.zip"
tar -xf ASUS_Swift-*-kernel-src.tar
fi
echo "Press any key to continue, Ctrl + C to cancel."
read
##################
# Compile kernel
##################
echo "Compiling kernel"
cd kernel
# Patch Makefile
echo "Trying to patch Makefile.."
patch -N -r /home/xxxxx/android/asus_swift_tools-master/null Makefile ../Patch-Makefile.patch
# Exports
export PATH=~/android/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
export CROSS_COMPILE=/home/xxxxx/android/arm-eabi-4.8/bin/arm-eabi-
# Make
echo "Starting compilation.."
make clean
make swift_defconfig
make -j `getconf _NPROCESSORS_ONLN`
# Copy kernel
cp "arch/arm/boot/zImage-dtb" ../zImage-dtb
Edit: YES It complete the compiling without any issue. Seems good. Thanks a lot. Now we need to compile a boot.img to try it out. OR maybe use AnyKernel2 Ramdisk Mod Script. The best and the safe way to try by making a boot.img and then try by fastboot boot boot.img It should not hurt the device.
Do you mind to share the stock boot.img? Thanks
janjan said:
Do you mind to share the stock boot.img? Thanks
Click to expand...
Click to collapse
I currently don't have my watch with me, but I will extract it for you tomorrow.
Don't know why my script doesn't work for you :/
Maxr1998 said:
I currently don't have my watch with me, but I will extract it for you tomorrow.
Don't know why my script doesn't work for you :/
Click to expand...
Click to collapse
Sounds good. Thank you very much. It works with a bit edit. Happy new
janjan said:
Sounds good. Thank you very much. It works with a bit edit. Happy new
Click to expand...
Click to collapse
I think that my current paths setup still needs some tweaking
Happy new year!
Maxr1998 said:
I think that my current paths setup still needs some tweaking
Happy new year!
Click to expand...
Click to collapse
We can always add tweaking afterward as long we are able to build. Really appreciate your work for script and custom recovery :good:
janjan said:
Sounds good. Thank you very much. It works with a bit edit. Happy new
Click to expand...
Click to collapse
Here you are. A little later than I wanted, but I hope it's ok
Maxr1998 said:
Here you are. A little later than I wanted, but I hope it's ok
EDIT: mirrored to Dropbox, since attachments are broken right now in XDA.
Click to expand...
Click to collapse
Thank you so much. I will play with the kernel in coming days. :good:
Hello Maxr1998.
Edit.
I tried your custom kernel. It seems everything is working fine. Backup, Restore, flash boot.img and flash zips. Great work there. Really appreciate your work. :good:
Can anyone post a quick list of what commands I would need to enter to get all the required packages/toolchain stuff? I'm fine with plugging commands in to the shell, but I don't really know what I need to get started. Was gonna give this a try to see if it fixes my problem with rebooting when I try to charge.
jobarr said:
Can anyone post a quick list of what commands I would need to enter to get all the required packages/toolchain stuff? I'm fine with plugging commands in to the shell, but I don't really know what I need to get started. Was gonna give this a try to see if it fixes my problem with rebooting when I try to charge.
Click to expand...
Click to collapse
I will upload my kernel soon. Need to upload the source first. You can try my build if you want.
janjan said:
I will upload my kernel soon. Need to upload the source first. You can try my build if you want.
Click to expand...
Click to collapse
Really looking forward to it!
I am quite interested in what the tweaks/changes are
Maxr1998 said:
Really looking forward to it!
I am quite interested in what the tweaks/changes are
Click to expand...
Click to collapse
Nothing so much now. I will add tweaks later. I disabled dm-verity and forced encryption. Possibility to modify system partition and ability to add BusyBox and SuperSu. I will play with other tweaks later. I am a bit busy with exams etc. Did you also build a kernel ?
This is the thread where people trying to build LineageOS themselves communicate. Communication up until now happend inside the "[ROM+Kernel][Unofficial][Unified]LineageOS 15.0[8.0.0]" thread. Picking the important parts in all the user-talk was hard.
So here we go, lets get this **** build.
Short summary - I try to build from LineageOS sources, taking roomservice from LineageOS and - except for blobs from muppets - not using any external repos. If you try to build from akhilnarang's sources, please note that in your post.
Anyways, I wrote this:
mad-murdock said:
If you build from vanilla laos sources, with roomservice, you must "repopick -t kryo-libc" after repo sync to get rid of those soong "arch.arm64.kryo" errors. see https://review.lineageos.org/#/q/branch:lineage-15.0+topic:kryo-libc
credits go to dianlujitao who was so kind to answer my question.
also, in device/oneplus/oneplus3/lineage.mk there is a reference to vendor/cm which you must change to vendor/lineage
then another error happen
Click to expand...
Click to collapse
And got a reply here:
joshndroid said:
Are you referring to the cmsdk/api/7.txt needed by blah/blah/checkpublicapi-cm-last-timestamp is missing and no know rule to make it.
repopicking the lineagesdk-oreo-briungup topic (although it was slated as working) doesn't seem to fix that issue. i must be missing something.
Click to expand...
Click to collapse
No josh, I don't repo-pick that. The error happening for me - which I look into once this is done - is
Code:
[ 99% 1105/1108] glob vendor/qcom/opensource/interfaces/*/Android.bp
[ 99% 1106/1108] glob vendor/qcom/opensource/interfaces/camera/device/1.0/Android.bp
[ 99% 1107/1108] glob vendor/qcom/opensource/interfaces/display/config/1.0/Android.bp
ninja: error: '/opt/develop/lineage-15.0/out/target/common/obj/JAVA_LIBRARIES/org.cyanogenmod.platform.internal_intermediates/link_type', needed by '/opt/develop/lineage-15.0/out/target/common/obj/APPS/OneplusDoze_intermediates/link_type', missing and no known rule to make it
19:31:54 ninja failed with: exit status 1
make: *** [build/core/main.mk:21: run_soong_ui] Error 1
make: Leaving directory '/opt/develop/lineage-15.0'
#### make failed to build some targets (35 seconds) ####
I built a non-booting image of LOS15 a while back, I think it was when they started tagging repositories with LOS15 branch - I still can't seem to boot it myself, so I'll ignore that for a moment.
I do have several word to say about this, for one, I had followed what Google have done to the the CPU arch of Sailfish and Marlin. Making them a generic ARMv8 (for the main arch) and ARMv7 Neon for the secondary arch. Of course, I could've merged the libc changes, but they didn't exist when I started doing the early bringup hence the reason why I stuck myself with Google's way of doing things.
As for the OneplusDoze, I simply commented it out due to the fact that Lineage themselves has yet to bring up the necessary CMHW-related changes. However, this is an experience speaking from about a month ago, I have yet to see whether they have started merging new things connected to CMHW.
I still wonder why my build doesn't boot though. I have done practically everything needed for the bringup, but I'm stuck in this loop where the device would hang on the OnePlus logo before jumping to Fastboot Mode; I suppose someone can help me with this?
F4uzan said:
I still wonder why my build doesn't boot though. I have done practically everything needed for the bringup, but I'm stuck in this loop where the device would hang on the OnePlus logo before jumping to Fastboot Mode; I suppose someone can help me with this?
Click to expand...
Click to collapse
Thanks for your input. Well, it was a month ago. I would try again. Unfortunately, my time is limited, so I have little time to spend on this. Very curious though, if the ROM boots once finished. If not, we still can try the repo's akhilnarang builds from:
akhilnarang said:
Sources
Device tree - https://github.com/akhilnarang/device_oneplus_oneplus3
Vendor - https://github.com/akhilnarang/proprietary_vendor_oneplus
Common tree - https://github.com/akhilnarang/device_oppo_common
Has my Derp kernel builtin
Click to expand...
Click to collapse
My issue is, that ROM is a week behind current development, and somehow I don't want to go back to 7.1.2 - so getting this stuff compiled myself is the best way. Guess thats motivation for most who raised their voice on the 8.0 thread
So I'm getting something like this, will experiment further.
Code:
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/host/darwin-x86/cts/android-cts/testcases/libcrash-jni.so'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/host/darwin-x86/cts/android-cts/testcases/libcrash-jni.so'
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/libcrash-jni/libcrash-jni.so'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/libcrash-jni/libcrash-jni.so'
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/hello_world_test/hello_world_test'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/hello_world_test/hello_world_test'
./test/vts/utils/python/archive/Android.mk:28: warning: overriding commands for target `default'
./test/vts/runners/host/tcp_server/Android.mk:19: warning: ignoring old commands for target `default'
./test/vts/utils/python/coverage/Android.mk:28: warning: overriding commands for target `default'
./test/vts/utils/python/archive/Android.mk:28: warning: ignoring old commands for target `default'
build/core/Makefile:34: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-brcm.conf'
build/core/base_rules.mk:375: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-brcm.conf'
build/core/Makefile:34: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-nxp.conf'
build/core/base_rules.mk:375: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-nxp.conf'
[ 96% 29/30] glob frameworks/wilhelm/include/SLES/**/*.h
ninja: error: 'cm-api-stubs-docs', needed by '/Volumes/android/los/out/target/common/obj/PACKAGING/cm_public_api.txt', missing and no known rule to make it
20:00:43 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
#### make failed to build some targets (59 seconds) ####
iMac-Micha:los magnum828$
Magnum828 said:
So I'm getting something like this, will experiment further.
Click to expand...
Click to collapse
I've tried Akhil's repos and a cherry pick from ElixiumOS which brings in a blob called libgpustats.so in vendor/oneplus
I get stuck @17% with ninja giving an error with relation to something in audio-caf.
Something to do with audio_hw.c
I ain't no coder so I can't fix it unfortunately. ?
inflames91 said:
I've tried Akhil's repos and a cherry pick from ElixiumOS which brings in a blob called libgpustats.so in vendor/oneplus
I get stuck @17% with ninja giving an error with relation to something in audio-caf.
Something to do with audio_hw.c
I ain't no coder so I can't fix it unfortunately. ?
Click to expand...
Click to collapse
How did you go past the cm-api-stubs ???
Oh man, thanks for seperating this out.
1) I repo sync'd lineage-15.0
2) breakfast oneplus3
3) cloned/checked-out akhil's 3 repo's for device/kernel/vendor replacing what I already had
3a) Dont need repo pick for kryo-libc unless you wanna change main arch in device/boardconfig back to kryo (which is really what it should be)
3b) If you use stock device tree, you may need to edit some files to point to lineage files instead of cm (look at this commit: http://tinyurl.com/y6u844ah)
~4) I might have needed to pull libgpustats from my phone or op3t or something, don't remember on that.
Pretty sure at this point it builds up to ~3-10k files before you run into failures in hardware/qcom/audio, hardware/qcom/display, and hardware/qcom/media.
5) Delete the following folders in hardware/qcom:
audio/audio-caf/display/display-caf/media/media-caf
and clone dianlujitao 3 repo's(specify branch lineage-15.0): hardware/qcom/audio, hardware/qcom/display, and hardware/qcom/media
From here I can compile up to ~35k files before i get failure generating cache.img.
I haven't had time to go back through the error but it might just be a simple "not enough space" error at which point we just need to edit boardconfig to make it think it can have a larger cache img, but im not positive thats the issue/fix. And I havent had time to do anything else from here yet either. Will update when I know more.
After reading all these self test stories I myself tried to build again.
I got this for the first time today, never saw this last time I tried to build [The line in RED]:
Code:
[email protected]:~/Android/AOSP/LineageOS15$ source build/envsetup.sh
including device/generic/car/car-arm64/vendorsetup.sh
including device/generic/car/car-armv7-a-neon/vendorsetup.sh
including device/generic/car/car-x86_64/vendorsetup.sh
including device/generic/car/car-x86/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/lineage/vendorsetup.sh
including sdk/bash_completion/adb.bash
[email protected]:~/Android/AOSP/LineageOS15$ brunch oneplus3
including vendor/lineage/vendorsetup.sh
[COLOR=Red][B]Trying dependencies-only mode on a non-existing device tree?[/B][/COLOR]
Any idea if this will cause any issue or not.
Magnum828 said:
How did you go past the cm-api-stubs ???
Click to expand...
Click to collapse
I was getting errors for libgpustats.
Solved that bit. ?
arnabJ said:
After reading all these self test stories I myself tried to build again.
I got this for the first time today, never saw this last time I tried to build [The line in RED]:
Code:
[email protected]:~/Android/AOSP/LineageOS15$ source build/envsetup.sh
including device/generic/car/car-arm64/vendorsetup.sh
including device/generic/car/car-armv7-a-neon/vendorsetup.sh
including device/generic/car/car-x86_64/vendorsetup.sh
including device/generic/car/car-x86/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/lineage/vendorsetup.sh
including sdk/bash_completion/adb.bash
[email protected]:~/Android/AOSP/LineageOS15$ brunch oneplus3
including vendor/lineage/vendorsetup.sh
[COLOR=Red][B]Trying dependencies-only mode on a non-existing device tree?[/B][/COLOR]
Any idea if this will cause any issue or not.
Click to expand...
Click to collapse
no that 'dependencies-only' notification has no real bearing on the issues that are being seen with building.
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Code:
14 warnings generated.
[ 55% 46381/83932] Target cache fs image: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
FAILED: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
/bin/bash -c "(mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache ) && (mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates && rm -rf /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg.sh\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"fs_type=ext4\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"system_size=3154116608\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"userdata_size=57436708864\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_fs_type=f2fs\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_size=268435456\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"selinux_fc=/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"skip_fsck=true\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/system ) && (size=\$(for i in /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img\" | tr \" \" +); img_blocksize=270336; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((276824064 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((276824064 - reserve)); echo \"\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve\"; if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > [276824064 - \$reserve])\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
error: failed to build /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img from /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache
Running: mkf2fsuserimg.sh /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img 268435456
in mkf2fsuserimg.sh PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:/usr/lib/jvm/java-8-openjdk-amd64/bin:/home/arnabj/Android/AOSP/LineageOS15/out/soong/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/development/scripts:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/devtools/tools:/home/arnabj/Android/AOSP/LineageOS15/external/selinux/prebuilts/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/android-emulator/linux-x86_64:/home/arnabj/bin:/home/arnabj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
make_f2fs -l 268435456 /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
[ 55% 46386/83932] ld /home/arnabj/Android/AOSP/LineageOS15/out/soong/.intermediates/external/protobuf/aprotoc/linux_x86_64/aprotoc
ninja: build stopped: subcommand failed.
15:58:23 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/arnabj/Android/AOSP/LineageOS15'
#### make failed to build some targets (04:37:46 (hh:mm:ss)) ####
Original:
Just an update.
Hoping for the best.
I am using Akhilnarang's device sources (kernel & vendor included).
I have replaced hardware_qcom_xyz / hardware_qcom_xyz-caf with hardware_qcom_xyz from Official LineageOS repo instead of that from dianlujitao as posted by HolyAngel.
Also I have cherry picked the required commit in vendor/oneplus3 as stated by inflames91.
The build is under process.
I am already at 52% with 44333 files out of 83932.
As per HolyAngel he/she got stuck at ~35k lines.
I am currently at ~45k lines.
Which is surely better.
I am completely noob on all these things.
I am just reading through different guides and posts here to try to build.
Wish me luck and give suggestions if you think it will be useful for me.
Sent from my OnePlus3 using XDA Labs
arnabJ said:
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Code:
14 warnings generated.
[ 55% 46381/83932] Target cache fs image: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
FAILED: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
/bin/bash -c "(mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache ) && (mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates && rm -rf /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg.sh\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"fs_type=ext4\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"system_size=3154116608\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"userdata_size=57436708864\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_fs_type=f2fs\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_size=268435456\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"selinux_fc=/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"skip_fsck=true\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/system ) && (size=\$(for i in /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img\" | tr \" \" +); img_blocksize=270336; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((276824064 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((276824064 - reserve)); echo \"\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve\"; if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > [276824064 - \$reserve])\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
error: failed to build /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img from /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache
Running: mkf2fsuserimg.sh /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img 268435456
in mkf2fsuserimg.sh PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:/usr/lib/jvm/java-8-openjdk-amd64/bin:/home/arnabj/Android/AOSP/LineageOS15/out/soong/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/development/scripts:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/devtools/tools:/home/arnabj/Android/AOSP/LineageOS15/external/selinux/prebuilts/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/android-emulator/linux-x86_64:/home/arnabj/bin:/home/arnabj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
make_f2fs -l 268435456 /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
[ 55% 46386/83932] ld /home/arnabj/Android/AOSP/LineageOS15/out/soong/.intermediates/external/protobuf/aprotoc/linux_x86_64/aprotoc
ninja: build stopped: subcommand failed.
15:58:23 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/arnabj/Android/AOSP/LineageOS15'
#### make failed to build some targets (04:37:46 (hh:mm:ss)) ####
Original:
Just an update.
Hoping for the best.
I am using Akhilnarang's device sources (kernel & vendor included).
I have replaced hardware_qcom_xyz / hardware_qcom_xyz-caf with hardware_qcom_xyz from Official LineageOS repo instead of that from dianlujitao as posted by HolyAngel.
Also I have cherry picked the required commit in vendor/oneplus3 as stated by inflames91.
The build is under process.
I am already at 52% with 44333 files out of 83932.
As per HolyAngel he/she got stuck at ~35k lines.
I am currently at ~45k lines.
Which is surely better.
I am completely noob on all these things.
I am just reading through different guides and posts here to try to build.
Wish me luck and give suggestions if you think it will be useful for me.
Sent from my OnePlus3 using XDA Labs
Click to expand...
Click to collapse
Have you tried commenting out "BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs" from device/oneplus/oneplus3/BoardConfig.mk?
This might be out of the question and implausible, and possibly would break something, but seeing that you're failing at F2FS cacheimage generation, it might be worth trying. I have never encountered such error, but then again, I hacked around the device tree a bit too much and may have accidentally "fixed" the error myself.
F4uzan said:
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Have you tried commenting out "BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs" from device/oneplus/oneplus3/BoardConfig.mk?
This might be out of the question and implausible, and possibly would break something, but seeing that you're failing at F2FS cacheimage generation, it might be worth trying. I have never encountered such error, but then again, I hacked around the device tree a bit too much and may have accidentally "fixed" the error myself.
Click to expand...
Click to collapse
Ok I will try that later tonight.
Also commenting it will be better or changing it to ext4?
Also should I start rebuild from where it got stuck or should I first delete the out directory and start fresh?
___________________________________________
Were you able to complete a working build?
If yes why not share your working device tree?
Sent from my OnePlus3 using XDA Labs
arnabJ said:
Ok I will try that later tonight.
Also commenting it will be better or changing it to ext4?
Also should I start rebuild from where it got stuck or should I first delete the out directory and start fresh?
___________________________________________
Were you able to complete a working build?
If yes why not share your working device tree?
Sent from my OnePlus3 using XDA Labs
Click to expand...
Click to collapse
I haven't tried changing it to EXT4 as I just pieced two and two together and came up with an amateurish solution. Commenting it out would be better, seeing that plenty of device tree doesn't seem to have that specific line anyway.
As for the out directory, I think building dirty is fine but should you encounter an issue, it'd be better if you do a make clean or something to that effect.
Device tree? My device tree has not been updated for about weeks now and most of the solutions there are either hacks or dirty workarounds. And as I have said before, my build compiles but it doesn't boot; I have tried building AOSP and Lineage (which does compiles) but sadly none of them boot. I suspect this is the cause of the device tree which I have hacked around.
F4uzan said:
I haven't tried changing it to EXT4 as I just pieced two and two together and came up with an amateurish solution. Commenting it out would be better, seeing that plenty of device tree doesn't seem to have that specific line anyway.
As for the out directory, I think building dirty is fine but should you encounter an issue, it'd be better if you do a make clean or something to that effect.
Device tree? My device tree has not been updated for about weeks now and most of the solutions there are either hacks or dirty workarounds. And as I have said before, my build compiles but it doesn't boot; I have tried building AOSP and Lineage (which does compiles) but sadly none of them boot. I suspect this is the cause of the device tree which I have hacked around.
Click to expand...
Click to collapse
Ok. I will update with new info when I have any.
Sent from my OnePlus3 using XDA Labs
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
HolyAngel said:
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := EXT4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
Click to expand...
Click to collapse
I did exactly what you did and it compiled successfully.
However, it did not boot into system.
Booted to bootloader.
I used Sultan's kernel as source though.
Maybe that's why?
inflames91 said:
I did exactly what you did and it compiled successfully.
However, it did not boot into system.
Booted to bootloader.
I used Sultan's kernel as source though.
Maybe that's why?
Click to expand...
Click to collapse
could possibly be kernel, i'm using akhilnarangs but haven't tried to boot it yet
HolyAngel said:
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := EXT4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
Click to expand...
Click to collapse
Does this boot?
I was following the official guide to building Lineage OS 15.1 for Oneplus 3T but when I executed "extract-files.sh" I got error with some files being missing.Ignoring that, when I ran brunch oneplus3 I got:
Code:
[1060/1060] including ./vendor/qcom/opensource/rcs-service/Android.mk ...
ninja: error: 'vendor/oneplus/oneplus3/proprietary/vendor/firmware/a530_zap-pro.b00', needed by '/home/user/Desktop/lineage/out/target/product/oneplus3/system/vendor/firmware/a530_zap-pro.b00', missing and no known rule to make it
20:25:42 ninja failed with: exit status 1
but I have checked with Root Browser and can say for sure that "a530_zap-pro.b00" file does not exist Anyone who has compiled Lineage OS before can you please tell how did you get it to work as the files don't exist. I'm currently on Oxygen OS Open Beta 24 with Magisk 16.3.
DelicatePanda said:
I was following the official guide to building Lineage OS 15.1 for Oneplus 3T but when I executed "extract-files.sh" I got error with some files being missing.Ignoring that, when I ran brunch oneplus3 I got:
Code:
[1060/1060] including ./vendor/qcom/opensource/rcs-service/Android.mk ...
ninja: error: 'vendor/oneplus/oneplus3/proprietary/vendor/firmware/a530_zap-pro.b00', needed by '/home/user/Desktop/lineage/out/target/product/oneplus3/system/vendor/firmware/a530_zap-pro.b00', missing and no known rule to make it
20:25:42 ninja failed with: exit status 1
but I have checked with Root Browser and can say for sure that "a530_zap-pro.b00" file does not exist Anyone who has compiled Lineage OS before can you please tell how did you get it to work as the files don't exist. I'm currently on Oxygen OS Open Beta 24 with Magisk 16.3.
Click to expand...
Click to collapse
Put this in your local_manifest/roomservice.xml file :
<project path="vendor/oneplus" name="TheMuppet/proprietary_vendor_oneplus" revision="lineage=15.1" />
Click to expand...
Click to collapse
and then do a `repo sync`. This repo wll add all mandatory files (files which are extracted by the `extract-files.sh' tool) to your build tree.
casual_kikoo said:
Put this in your local_manifest/roomservice.xml file :
and then do a `repo sync`. This repo wll add all mandatory files (files which are extracted by the `extract-files.sh' tool) to your build tree.
Click to expand...
Click to collapse
Thank you for that but I was curious about how those files were obtained. And now I'm having another error:
Code:
make[1]: Leaving directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
make: Leaving directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
Building DTBs
make: Entering directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
make[1]: Entering directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
Using /home/user/Desktop/lineage/kernel/oneplus/msm8996 as source for kernel
CHK include/generated/utsrelease.h
CALL /home/user/Desktop/lineage/kernel/oneplus/msm8996/scripts/checksyscalls.sh
make[2]: 'include/generated/vdso-offsets.h' is up to date.
make[1]: Leaving directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
make: Leaving directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
ninja: build stopped: subcommand failed.
20:21:02 ninja failed with: exit status 1
DelicatePanda said:
Thank you for that but I was curious about how those files were obtained. And now I'm having another error:
Code:
make[1]: Leaving directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
make: Leaving directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
Building DTBs
make: Entering directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
make[1]: Entering directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
Using /home/user/Desktop/lineage/kernel/oneplus/msm8996 as source for kernel
CHK include/generated/utsrelease.h
CALL /home/user/Desktop/lineage/kernel/oneplus/msm8996/scripts/checksyscalls.sh
make[2]: 'include/generated/vdso-offsets.h' is up to date.
make[1]: Leaving directory '/home/user/Desktop/lineage/out/target/product/oneplus3/obj/KERNEL_OBJ'
make: Leaving directory '/home/user/Desktop/lineage/kernel/oneplus/msm8996'
ninja: build stopped: subcommand failed.
20:21:02 ninja failed with: exit status 1
Click to expand...
Click to collapse
Your output is missing some information, there is no error in this, except
Code:
ninja: build stopped : subcommand failed
casual_kikoo said:
Your output is missing some information, there is no error in this, except
Code:
ninja: build stopped : subcommand failed
Click to expand...
Click to collapse
Sorry for the delay I am attaching the output of entire "brunch oneplus3" command to this and could you please tell me from where the files in the repo were obtained. Thanks for the help:highfive:
DelicatePanda said:
Sorry for the delay I am attaching the output of entire "brunch oneplus3" command to this and could you please tell me from where the files in the repo were obtained. Thanks for the help:highfive:
Click to expand...
Click to collapse
You have some problem with jack-server :
FAILED: setup-jack-server
/bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.11.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.11.ALPHA.jar 4.11.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.32.CANDIDATE.jar 4.32.CANDIDATE || exit 47 )"
Jack server already installed in "/home/user/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G -cp /home/user/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
No Jack server running. Try 'jack-admin start-server'
No Jack server running. Try 'jack-admin start-server'
Click to expand...
Click to collapse
In the root of your Android build directory
Code:
prebuilts/sdk/tools/jack-admin start-server
and then, straight after starting jack-server, relaunch your build process.
Also, judging from the log, jack-server is launching with 2G of RAM, which is very low IMO. If you have a low end PC, check this XDA thread, which explains you how to use Google Cloud for free to build ROM.
If you still have issues with jack-server, check this build guide by @nathanchance : there is a part about jack-server memory's problem (Ctrl + F -> "Jack issues").
Also, check a look at this Google Groups thread, this might help you.
Concerning TheMuppets : to be honest with you, I don't know exactly where files come from, BUT looking at commit messages on their Github, you can see, among others, that fourkbomb is pushing to this organization; a quick Google Search, you find his Github profile, he's a member of LineageOS. Also, you'll find a lot of ROMs builders TheMuppet' repo, so nothing to worry about (their repos are on Github, so you can check by yourself ).
I tried the following:
Download toolchain from https://android.googlesource.com/pl....9/+/e54105c9f893a376232e0fc539c0e7c01c829b1e
Download clang-4639204
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install flex bison
sudo apt-get install libelf-dev
export CROSS_COMPILE=/home/gilius/Desktop/tool/bin/aarch64-linux-android-
export ARCH=arm64
enter the 9820 directory
sudo -i
make xynos9820-beyond2lte_defconfig
make -j10
Am getting the following errors:
Code:
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:57: Detected assembler with broken .inst; disassembly will be unreliable
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
CHK include/config/kernel.release
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make: *** [Makefile:1244: prepare-compiler-check] Error 1
make: *** Waiting for unfinished jobs....
Hi,
for me : sudo ln -s /usr/lib/libtinfo.so /usr/lib/libtinfo.so.5 did the trick but I am now stuck with some assembly instructions "not existing" errors when compiling arch/arm64/kernel/vdso/gettimeofday.S
did you made any progress?
Update : linking libtinfo.so.6 to libtinfo.so.5 solved it but also failed with :
scripts/selinux/genheaders/genheaders.c:19:
./security/selinux/include/classmap.h:251:2: erreur: #error New address family defined, please update secclass_map.
251 | #error New address family defined, please update secclass_map.
| ^~~~~
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:673: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:673: scripts/selinux] Error 2
make: *** [Makefile:607: scripts] Error 2
I am currently trying it on archlinux and the ncurses5-compat-libs package didn't put a new library in my path I will try later on another distro see if it's just a library error.
Update 2 :
Compiled fine using rhel 8, I had to install ncurses compat libs and create a symbolic link from python2 to python in my $PATH.
Does it boot?
Does your kernel boot?
Mine, keep stuck at Samsung logo
Akugila said:
Does your kernel boot?
Mine, keep stuck at Samsung logo
Click to expand...
Click to collapse
Non, I can't even go further the unlocked warning screen, but my repacking of the image is wrong, my new image is always lighter than the original, I am using magiskboot to do it. How are you doing it ?
try AIK
shmsh9 said:
Non, I can't even go further the unlocked warning screen, but my repacking of the image is wrong, my new image is always lighter than the original, I am using magiskboot to do it. How are you doing it ?
Click to expand...
Click to collapse
Ahh, fool me. it's stuck at warning screen too (forgot there are another samsung logo during boot)
I use AIK [https://forum.xda-developers.com/showthread.php?t=2073775] for packing, the size is the same with original (I use "Image" file)
kernel build error: expected parameter declarator
Did you get these compilation errors?
In file included from kernel/bounds.c:10:
In file included from ./include/linux/page-flags.h:10:
In file included from ./include/linux/bug.h:5:
In file included from ./arch/arm64/include/asm/bug.h:37:
In file included from ./include/asm-generic/bug.h:16:
In file included from ./include/linux/kernel.h:14:
./include/linux/printk.h:149:24: error: expected parameter declarator
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:24: error: expected ')'
./include/linux/printk.h:149:23: note: to match this '('
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
static inline __printf(1, 2) __cold
^
void
./include/linux/printk.h:149:29: error: expected ';' after top level declarator
static inline __printf(1, 2) __cold
^
Linaro 4.9.4 aarch64-linux-gnu compiler tools for S10 5G kernel build
floor51 said:
Did you get these compilation errors?
In file included from kernel/bounds.c:10:
In file included from ./include/linux/page-flags.h:10:
In file included from ./include/linux/bug.h:5:
In file included from ./arch/arm64/include/asm/bug.h:37:
In file included from ./include/asm-generic/bug.h:16:
In file included from ./include/linux/kernel.h:14:
./include/linux/printk.h:149:24: error: expected parameter declarator
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:24: error: expected ')'
./include/linux/printk.h:149:23: note: to match this '('
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
static inline __printf(1, 2) __cold
^
void
./include/linux/printk.h:149:29: error: expected ';' after top level declarator
static inline __printf(1, 2) __cold
^
Click to expand...
Click to collapse
I found that using the Linaro 4.9.4 aarch64-linux-gnu compiler tools solved this:
https://releases.linaro.org/compone...4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz
I was previously using the toolchain that is in ianmacd's github repo here:
https://github.com/ianmacd/beyond2l...p/gcc-cfp-jopp-only/aarch64-linux-android-4.9
I changed this:
#CROSS_COMPILE ?= $(srctree)/toolchain/gcc-cfp/gcc-cfp-jopp-only/aarch64-linux-android-4.9/bin/aarch64-linux-android-
...to:
CROSS_COMPILE ?= ~/dev/projects/android/kernel/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
I also used Linaro for CLANG_TRIPLE.
And I used clang for CC:
CC = ~/dev/projects/android/kernel/clang-4639204/bin/clang
...from here:
https://android.googlesource.com/pl...archive/android-9.0.0_r1/clang-4639204.tar.gz
All that info would have helped me a lot anyway. Hope it helps someone. Not that I've tried the image on device yet.
Hey,
I have managed to build the kernel by following the instructions in the samsung readme.
Code:
$ export ANDROID_MAJOR_VERSION=p
$ make ARCH=arm64 exynos9820-d2s_defconfig
$ make ARCH=arm64
I end up with an Image file and Image.gz with the same Image file inside. I'm not sure if this has built correctly as people talk about being able to use Android kitchen or similar unpacker to unpack and repack the img file. With the Image file I receive it is incompatible with Android Kitchen and another Perl unpacker I have tried.
When you compile your kernel do you get an Image.img file? Or the same as me, just Image, and if so, how do you make it usable?
JPNZ4 said:
Hey,
I have managed to build the kernel by following the instructions in the samsung readme.
Code:
$ export ANDROID_MAJOR_VERSION=p
$ make ARCH=arm64 exynos9820-d2s_defconfig
$ make ARCH=arm64
I end up with an Image file and Image.gz with the same Image file inside. I'm not sure if this has built correctly as people talk about being able to use Android kitchen or similar unpacker to unpack and repack the img file. With the Image file I receive it is incompatible with Android Kitchen and another Perl unpacker I have tried.
When you compile your kernel do you get an Image.img file? Or the same as me, just Image, and if so, how do you make it usable?
Click to expand...
Click to collapse
glad to hear that you could build the kernel.
could you please elaborate which build env you used and which version?
make clean destroys my build env and i needed some patches to make it even compile in the first place.
could you run the kernel successfully on the device?