Building my own Kernel for Android 4.4.4 on my note 3 (The journey) - Galaxy Note 3 Q&A, Help & Troubleshooting

Hello XDA community,
After months of struggling im in desperate need of your help.
What is my goal?
To compile our own kernel so we can mess around with Qualcomm's trustzone.
Where did it all start?
It all started a few months ago back in November 2021 when me and a friend read a blog about a Trustzone exploit in Qualcomm's MSM8974 processor. (link to the blog)
Big noobs as we where, we where getting hyped an bought ourselves a Samsung Galaxy Note 3 with a MSM8974 processor. After messing around with the device we learned more and more about android and the workings of the software. We first started to root the phone and play around with ADB. After that we found that we can use Frida aswell. But all of it didn't lead to the result we wanted. So we started to dig deeper in to the write-up of the blog. We soon came to the conclusion that we where not even close to doing the right thing.
What happend next?
After we came to the conclusion that ADB and Frida is not enough we understood we need to build our own kernel for this exploit to work. So we do what we always do and that was start googling and watch YouTube. By doing that we found 2 different kernels:
Lineage 18.1
SM-N9005_EUR_LL_Opensource
We where over the moon because inside the folders we found the the files that need to be replaced for the exploit to work. So we replaced the files and try to compile the kernel by using this YouTube tutorial. Everything seemed to go well, we made the
Code:
make msm8974_sec_defconfig
and we run
Code:
make menuconfig
so far so good. the last and final step should be to run
Code:
make
to compile the kernel. And that is where it went wrong an ran in to a error.
Then what?
Then we started to compare the original files with the modified files and we found out that it wasn't just a few modifications in the code but the code was different. So we did what we always do, go back to the source. So back at the blog we thought maybe its because they modified a Nexus 5 at android 4.4.4.
Now what?
Now im trying to find the source of a android 4.4.4 kernel of msm8974 so we can compare those files to the modified files. So if anyone has useful info or knows where to find a kernel for android 4.4.4 for a Samsung Galaxy Note 3 (SM-N9005).
TLDR;
Im looking for a source of android 4.4.4. for a Samsung Galaxy Note 3 (SM-N9005) (hlte)

Well, unfortunately today almost no one uses android 4.4.4. even that have the exact same device, I am using Android 11 on my phone.
I recommend not wasting your time on a kernel for Android 4.4.4. And if you really want to make a kernel for this device I need one for Android 10 and above.
Also I think making a kernel for AOSPs like LineageOS or HavocOS or crDroid ETC is much easier.

A.M.2.K.M said:
Well, unfortunately today almost no one uses android 4.4.4. even that have the exact same device, I am using Android 11 on my phone.
I recommend not wasting your time on a kernel for Android 4.4.4. And if you really want to make a kernel for this device I need one for Android 10 and above.
Also I think making a kernel for AOSPs like LineageOS or HavocOS or crDroid ETC is much easier.
Click to expand...
Click to collapse
Thanks for your response I will look in to it. not sure if it will be easier because the files that needed to be changed are:
arch/arm/mach-msm/scm.c
arch/arm/mach-msm/include/mach/scm.h
drivers/misc/qseecom.c

SwAgLaNdeR said:
Thanks for your response I will look in to it. not sure if it will be easier because the files that needed to be changed are:
arch/arm/mach-msm/scm.c
arch/arm/mach-msm/include/mach/scm.h
drivers/misc/qseecom.c
Click to expand...
Click to collapse
Well, I don't know much about kernels.
I said it's easier because I thought it's a pure and raw operating system. But now according to your post it turns out it's not easier.

Plus almost no developers left for this now very old model .

Related

[09-06]SailfishOS & Multirom. How to set up guide

Hi sailors out there
When I'm going to read through the available sailfish threads the question about how to set up multirom & sailfish have been asked many times. So I thought I'm writing this little guide. I describe the procedure along the nexus 4 mako. But it have to be very similar on other devices like nexus 5 for example. The important parts that differs from mako are the kernel and modem image you've to use. I will describe the easiest way in my opinion. Experienced users have more capabilities to reach the goal. I will not describe how to install twrp recovery and unlock bootloader. Both are prequesites. Please use xda search or google to get this. But this little guide want's to be simple as possible. So let's begin .
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Beginning:
First we have to detect you're actual setup and where you want to go. Because nexus 4 is up to date I think the most common goal is to run android 4.4 as primary and sailfish os as secondary. Atm I have only paranoidandroid 4.4 on my device and will show you how to get everything working.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Requirements / Download following parts:
kernel aosp: http://d-h.st/A99
kernel cm: http://d-h.st/CCn
aosp = android open source rom. Ask in you're rom thread what version you're on with the rom
cm = cyanogen mod rom. Ask in you're rom thread what version you're on with the rom
Modem for nexus4 in version 0.84: http://d-h.st/cIJ
or
through an app in play store: https://play.google.com/store/apps/details?id=com.bpear.makomodem&hl=de
sailfishOS ea4: http://releases.sailfishos.org/sfa-ea/sailfishos-mako-release-1.0.8.19-EA4.zip
cm 10.1.3: http://get.cm/get/aWH
Multirom manager in play store: https://play.google.com/store/apps/details?id=com.tassadar.multirommgr&hl=de
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Before we're going on check up the following
1. All zip's you've downloaded have to be transferred on the device
2. Apps from play store are installed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Installation process
Reboot in twrp recovery
Flash the new kernel
Flash the modem 0.84 in twrp. Or via the modem flasher from playstore. It's you're decision.
Boot back into android
Proof the functionality in android withe the new modem and kernel. Wlan working? Bluetooth? NFC?
Open mutlirom manager. Follow the installation steps.
After some time you'll be back in android. You have now the right modem, kernel and and a twrp multirom version on you're device
After this. Please reboot back into twrp recovery
There select the advanced button.
Then the multirom button
Select add rom and mark up the entry sailfish os
Press next.
Now you can choose two zip files to flash
zip1: Select the cm10.1.3 zip file
zip2: Select the sailfish EA4 zip file
Installation process is beginning.
After this select reboot
You automatically went into multirom where you can cancel the automatic boot process for the primary rom. Then you can select which rom you want to start.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And the most important thing is to read: http://forum.xda-developers.com/jolla-sailfish/general/qa-sailfish-n4-thread-devices-t2727330 for further question before you ask. I have described there many things to start with sailfish. If you find this useful think about to press the thanks button.
I'm a bit confused why do you insist on updating the modem? I checked my modem version and it is newer so I imagine there is no need to update. Also why use such an old version ov CM?
Just asking because I did all according to your instructions except I used newer CM build and didn't update my modem firmware as it was already newer. But for some reason Sailfish wont boot. It just hangs showing Google at start.
anttimonty said:
I'm a bit confused why do you insist on updating the modem? I checked my modem version and it is newer so I imagine there is no need to update. Also why use such an old version ov CM?
Just asking because I did all according to your instructions except I used newer CM build and didn't update my modem firmware as it was already newer. But for some reason Sailfish wont boot. It just hangs showing Google at start.
Click to expand...
Click to collapse
lol. and you ask why it won't work? It gave reasons for the instructions. Also look in the linked q&a thread at the bottom of first post. And here for you the relaese notes. Hope things becomes clear now. enjoy
Release Notes:
This release is based on SailfishOS 1.0.8.19 (Tahkalampi).
The Nexus 4 port is considered to be of alpha quality.
Though depending on your usage it might be stable enough for daily use.
Download & installation instructions:
* Install adb and fastboot
a. Debian/Ubuntu: apt-get install android-tools-adb android-tools-fastboot
b. Fedora: yum install android-tools
c. Mac OS X: Install Homebrew from http://brew.sh/, then: brew install android-platform-tools
d. Windows: See http://wiki.cyanogenmod.org/w/Doc:_fastboot_intro for instructions
MultiROM ≥v28 ability is in the image. See options of how to layout your MultiROM in #2 post below.
Alternatively, just have it as your primary ROM:
* Install Android 4.2.2 (JDQ39) to your Nexus 4
a. Instructions here: https://developers.google.com/androi...s#instructions
b. Download links can be found here: https://developers.google.com/androi...ges#occamjdq39
* Download CyanogenMod 10.1.3 for your Nexus 4
a. Perform Factory Reset and wipe contents of the /data/ partition in case of leftovers from previous ROMs
b. The file you want to download is cm-10.1.3-mako.zip
c. Download links can be found here: http://wiki.cyanogenmod.org/w/Install_CM_for_mako
* Download the Sailfish OS for Android image for "mako"
a. The file you want to download is http://releases.sailfishos.org/sfa-e...0.8.19-EA4.zip
b. Another flavour filled with demo content: http://releases.sailfishos.org/sfa-e...mo-content.zip
* Install CyanogenMod 10.1.3 on your Nexus 4
a. Follow the instructions at: http://wiki.cyanogenmod.org/w/Install_CM_for_mako
* After flashing the "cm-10.1.3-mako.zip" file, flash the Sailfish OS .zip file in the same way ("on top of it")
* Reboot bootloader, Sailfish OS should boot and be visible
We recommend reading through http://jolla.com/guide/ -- some parts may not apply to Nexus 4
HW Support status:
(Look for Nexus 4 row): https://wiki.merproject.org/wiki/Adaptations/libhybris
Click to expand...
Click to collapse
Also I stated in first post why I only described the way I've did
Ahh ok nevermind got it working once I used the older CM image. Wifi seems not to be working but I guess that is because I didn't downgrade my modem firmware. I guess I'll wait for a more stable builde or better yet buy a Jolla phone. Just like having the nexus 4 as I can test bunch of operating systems on it.
anttimonty said:
Ahh ok nevermind got it working once I used the older CM image. Wifi seems not to be working but I guess that is because I didn't downgrade my modem firmware. I guess I'll wait for a more stable builde or better yet buy a Jolla phone. Just like having the nexus 4 as I can test bunch of operating systems on it.
Click to expand...
Click to collapse
yes. that's a great benefit of this device Do you like sailfish?
With modem version 0.84 you have all parts working in sailfish and android
Ok thanks for the hint. I used to be one of the early adopters of Jolla, but couldn't use it as my daily phone so I sold it, but now that the OS has matured I think I maybe swithing back. Even though I still think Nokia N9 had far better UI experience. If only some would port N9 UI to Sailfish
anttimonty said:
Ok thanks for the hint. I used to be one of the early adopters of Jolla, but couldn't use it as my daily phone so I sold it, but now that the OS has matured I think I maybe swithing back. Even though I still think Nokia N9 had far better UI experience. If only some would port N9 UI to Sailfish
Click to expand...
Click to collapse
I feel the same, don't know why, but i just loved the N9 and the way the OS worked. I am not saying that sailfish is bad or something, but there Are somethings missing ...
v3ng3anc32002 said:
I feel the same, don't know why, but i just loved the N9 and the way the OS worked. I am not saying that sailfish is bad or something, but there Are somethings missing ...
Click to expand...
Click to collapse
They've practically done nothing since pre-release to improve and refine the UI, and so many incredibly basic features are missing (voicemail notifications, global copy and paste etc). The pulley menus are ropey and the active covers feature hasn't really been made use of much. They seem to be mainly concentrating on the Jolla Launcher for Android, which will definitely make them higher profile ... but if all their software engineers and UX guys are working on that instead of Sailfish itself, then it seems like cutting off their nose to spite their face.
I'm not a fan of Android and I can't see myself ever using WP or iOS, but the lack of progress and their production priorities are a bit dispiriting. I'm hoping that they're holding a lot of big and waited for improvements for update 1.1 (October).
Anyway, I'll keep it as my main phone for a bit longer, despite the fact that I have a Z3C coming early next week. Hope to see a decent Sailfish port for it soon.
mudnightoil said:
They've practically done nothing since pre-release to improve and refine the UI, and so many incredibly basic features are missing (voicemail notifications, global copy and paste etc). The pulley menus are ropey and the active covers feature hasn't really been made use of much. They seem to be mainly concentrating on the Jolla Launcher for Android, which will definitely make them higher profile ... but if all their software engineers and UX guys are working on that instead of Sailfish itself, then it seems like cutting off their nose to spite their face.
I'm not a fan of Android and I can't see myself ever using WP or iOS, but the lack of progress and their production priorities are a bit dispiriting. I'm hoping that they're holding a lot of big and waited for improvements for update 1.1 (October).
Anyway, I'll keep it as my main phone for a bit longer, despite the fact that I have a Z3C coming early next week. Hope to see a decent Sailfish port for it soon.
Click to expand...
Click to collapse
hope the same for the z1c, but don't how is the chance to see this port (soon or later).
Works nicely on my n4. Looking for getting gapps to run....
mudnightoil said:
They seem to be mainly concentrating on the Jolla Launcher for Android, which will definitely make them higher profile ... but if all their software engineers and UX guys are working on that instead of Sailfish itself, then it seems like cutting off their nose to spite their face.
Click to expand...
Click to collapse
This is just wrong
mudnightoil said:
I have a Z3C coming early next week. Hope to see a decent Sailfish port for it soon.
Click to expand...
Click to collapse
I bought a z1c after my N9 broke and I totally regret it. But I'll go on and try using it with Sailfish one day
paulle said:
hope the same for the z1c, but don't how is the chance to see this port (soon or later).
Click to expand...
Click to collapse
I tried using the hadk but like some other devices, there are gpu-problems with the z1c (see https://wiki.merproject.org/wiki/Adaptations/libhybris/gpu).
Keep an eye on IRC logs and on the status matrix in mer wiki
sorry for off-topic
iuno said:
This is just wrong
I bought a z1c after my N9 broke and I totally regret it. But I'll go on and try using it with Sailfish one day
I tried using the hadk but like some other devices, there are gpu-problems with the z1c (see https://wiki.merproject.org/wiki/Adaptations/libhybris/gpu).
Keep an eye on IRC logs and on the status matrix in mer wiki
sorry for off-topic
Click to expand...
Click to collapse
thank you for information, followed your links to look at. It seems there for the z1c is a lot of remaining, we will need patience.
iuno said:
I bought a z1c after my N9 broke and I totally regret it. But I'll go on and try using it with Sailfish one day
I tried using the hadk but like some other devices, there are gpu-problems with the z1c (see https://wiki.merproject.org/wiki/Adaptations/libhybris/gpu).
Keep an eye on IRC logs and on the status matrix in mer wiki
sorry for off-topic
Click to expand...
Click to collapse
Don't think I'll regret getting the Z3C, from a hardware perspective ... held one the other day, as a friend had been gifted one by Sony. It's absolutely superb. Granted, I despise Android .. but for when the Jolla ****s itself / runs out of battery / when GPS or a camera is needed / roaming / skype /outdoor use, I can suffer it until there's a Sailfish port.
Hopefully as work is already under way for the One Plus One, the identical SoC used in the Z3 & Z3C won't be too much additional work.
For all the moaning and groaning about Mediatek, I'm guessing the simplest and best port of Sailfish will probably be for the Meizu MX4, as there'll be an Ubuntu ROM for it, and libhybris is used by Ubuntu Phone ...
Also, hopefully future iterations of the HADK will smooth out some of the problems porters are facing.
mudnightoil said:
Don't think I'll regret getting the Z3C, from a hardware perspective
Click to expand...
Click to collapse
it's the same for me...
The SoC in your z3c and 1+1 is actually the same as in z1c, I guess – 8974 vs 8974ac – only higher clocked.
You should not suppose that mediatek SoCs will be easier in general just because of is one working device. Jolla runs a Snapdragon and it works perfectly, most of the devices sailfish is currently ported to run snapdragons – with very different results.
iuno said:
it's the same for me...
The SoC in your z3c and 1+1 is actually the same as in z1c, I guess – 8974 vs 8974ac – only higher clocked.
You should not suppose that mediatek SoCs will be easier in general just because of is one working device. Jolla runs a Snapdragon and it works perfectly, most of the devices sailfish is currently ported to run snapdragons – with very different results.
Click to expand...
Click to collapse
I wasn't saying Mediatek in general will be easier (though it's possible), but any device with an official Ubuntu ROM certainly will (should) be - Meizu MX4 (Mediatek) is the first of those.
P.S. The Z3C is fantastic ... though unfortunately in black as opposed to the red I ordered (it's being swapped tomorrow).
Thank you very much for these instructions. i have one question though. In order to download CM 10.1.3, it says to click that link which takes you to download CM installer app. Ive used that app before and as far as I kmow, it doesnt let you choose which version of CM you want to install, instead it just sets you up to install the newest CM 11. I downloaded 10.1.3 from their site. Either way, no big deal.
Also, which kernel do I download to install? Aosp or CM?
Thank you
Still up to date
Hi,
are these steps still up to date or should we follow a different set up guide to install the latest sailfish OS on the Nexus 4? Because most, if not all, the links on the first page end up 404...
Bluetooth sync from Jolla to Nexus 4
Flashed my Nexus 4 with the factory 4.2.2 from google with radio .48 and then flashed cm-10.1-20131003-SNAPSHOT-TREATFORCOOPER-mako-signed.zip because that seemed to be the 10.1.3 mentioned in the guides to end up flashing the latest sfos from this guide http://forum.xda-developers.com/nexus-4/development/rom-sailfish-os-community-port-t2969823.
I didn't try calling, it has 3G network working and wifi is working but I can't seem to get the contacts from my Jolla phone using the Bluetooth sync from the settings.
Anybody has some advice on this?
Just had a good look at the wiki of devices on the mer website and found out the bluetooth is not yet working on the Nexus 4...
Works perfectly on my oneplus one

[Q] Is it possible to "upgrade" kernel version?

I still use my Nexus 4 happily and recently started modding the kernel a bit.
This led me to the question in the first hand, because it is possible to upgrade minor versions (3.4.0 -> 3.4.105)
The thing is, N4 uses google_msm 3.4 sources
shamu is pretty new, uses google_msm too but 3.10
I've tried by bluntly downloading shamu's kernel source, placing mako_defconfig in arch/arm/configs and updating the defconfig with make menuconfig.
As expected didn't work out, but i'm just a little modder cherry-picking stuff i'd like to have, so in reality i have no clue how to archieve that, or if it is even possible with some modifications.
I've also tried with the standard 3.18 Linux kernel too before, but got the same expected result.
Did someone actually tried this and got a bit further, is this something simply not posiible or too much work to get it going?

Building Lineage OS for the Samsung Galaxy Note 4 (N9100, trlteduos)

Hello xda community,
I would like to try my hands at building Lineage OS for the Galaxy Note 4 Duos. I was a little surprised that there seems to be not even an unofficial build for it (or cyanogenmod for that matter). Is there some technical reason why it hasn't been attempted yet that is specific to the Duos?
Otherwise, I'd be happy if someone could point me in the right direction. Maybe someone who already did it for a different model could post a basic guide since I have no experience yet in this area.
Speaking of it, my current level of experience is that I have rooted and flashed roms on android phones a few dozen times, and developed a handful of apps for android. So hopefully it's not too far outside of my skill-level.
Thank you in advance.
You can take a look at Note 4 General section, a new thread was made on how to build LinageOS for the Note 4 N910F/N910G. N9100 will not support 2nd sim if im not wrong, you need a dev who want to work on this project
Try this:
https://drive.google.com/open?id=0By...llGSnVyVDVfRlE
I downloaded this from the Chinese website. The latest build is 29 April. Donno why. Give it a try.
Thank you very much, I'll give it a try when I get to it.
Btw. the url is incomplete, I'm trying the original thread.
Did it work for you? (the April 29 build )
akshayarajdayal said:
Did it work for you? (the April 29 build )
Click to expand...
Click to collapse
Kind of. Fingerprint and HDR camera don't work, which was expected, but for some reason phone calls don't work for me, I can call and receive, but there is no sound on either end. Otherwise everything seemed fine and the phone performed relatively well.
twrp-3.2.0-0-trlteduos official build release candidate!
twrp-3.2.0-0-trlteduos.img
twrp-3.2.0-0-trlteduos.tar
I've finally managed to build it from a pure omni device tree borrowed heavily from _mone's trlte twrp device tree. Chinese variant users: please test it as thoroughly as you can, including backing up and restoring with and without encryption. If it works, _mone will push it for official support.
ripee said:
twrp-3.2.0-0-trlteduos official build release candidate!
twrp-3.2.0-0-trlteduos.img
twrp-3.2.0-0-trlteduos.tar
I've finally managed to build it from a pure omni device tree borrowed heavily from _mone's trlte twrp device tree. Chinese variant users: please test it as thoroughly as you can, including backing up and restoring with and without encryption. If it works, _mone will push it for official support.
Click to expand...
Click to collapse
The links are broken

[Discussion] SM T819 - Lineage OS - A possible starting point!

I have been waiting quite some time for a custom rom for SM T819 but I haven't see much progress in this. I looked for a device with similar specs for our device and came across this device which already has a Lineage OS build available. Its practically the same device but with a different screen size.
LeEco Le 2 Specs: http://www.gsmarena.com/leeco_le_2-8053.php
LeEco Le 2 Lineage OS Github Repo: https://github.com/LineageOS/android_device_leeco_s2
It will be a good starting point as I think for getting a custom rom for this device with a great potential. I have read that having spec devices is a great start to porting a ROM from one device to another without specifically building it from the source. However it includes a few build prop tweaks and changing few lines on kernel which I have no technical expertise.
Looking forward for your thoughts.
It's true, personally I don't have this tab but I had experience with a Tab I used which was similar in specs with S4 Mini ..
You'll get bugs though and you can base device tree from the Leeco Phone to build ROMs
Anything new here?
Seems like @tuxing built a modified T813 LOS build for himself, but of course no LTE in there. https://forum.xda-developers.com/showpost.php?p=73992901&postcount=552
i really hate the lack of support for LTE Tablets :/
Hi guys, I don't know if i am on topic but 'cause of this lack of ROMs for the T819, can I install the one for the T813? I know there is no LTE, but if I wanna try the ROM can I install it or it is incompatible with the T819?
kinglolloman said:
Hi guys, I don't know if i am on topic but 'cause of this lack of ROMs for the T819, can I install the one for the T813? I know there is no LTE, but if I wanna try the ROM can I install it or it is incompatible with the T819?
Click to expand...
Click to collapse
Not that easy, but I had a nice chat session with @LuK1337 and he explained me how to get things built and boot on T819: https://forum.xda-developers.com/tab-s2/general/guide-build-lineageos-15-1-t819-t3721477
It's not that difficult as I thought. @LuK1337 told me it's simple and even I managed to get it working.

Mainline N8000 Progress

Dear fellow developers and users of this great device,
I'm working on mainline support for the p4note device family, I started with the N8010 but this is usable on all the other N80XX devices as well as they are technically all the same aside from the modem.
The current status is that an initial device tree will land in 5.11 with some components still missing but its a good start. I'm working on the rest and also I'm working on Android 11 on top of that.
This post will not be updated any longer, you can find my mainline progress here.
There is also a blog which I'll probably woefully neglect as I'm way too busy with everything in life.
Cheers
An update for my mainline progress, there is kernel logs on the display now! I'm currently working on the touch screen config.
Oh Nice to see.
But i think not many people read the General forum anymore ^^
You might want to mention this in the Dev thread.
Do you have a git repository anywhere? I found a Note 10 8000 hidden in a box and wanted to get a working small working terminal up on the wall at my 3D-Printer/Soldering-workstation, I would be happy to be tinkering around som with the code.
Nevermind, found it.
fldc said:
Do you have a git repository anywhere? I found a Note 10 8000 hidden in a box and wanted to get a working small working terminal up on the wall at my 3D-Printer/Soldering-workstation, I would be happy to be tinkering around som with the code.
Nevermind, found it.
Click to expand...
Click to collapse
Hey, great to hear that you want to tinker with it. Remember that I currently work on rev 6 of the hardware, the version info can be found in the atags of the kernel log. You may run into issues with other revisions but it should be fine.
For the wifi settings, you need the correct nvram file. I'm not yet sure whether you can determine it by the version of the hardware, the current way is a macloader in the current hardware repo.
I extracted the touchscreen firmware from the sources and put them in my buildroot repo. The driver will look for a file called maxtouch.fw on boot.
I hope this helps.
Thank you very much for the pointers, I haven't t really been into kernel development since Samsung Galaxy S2 (9100), but getting a proper Linux installation on this device would fit me perfectly so I would happily try things on my side, keep us posted.

Categories

Resources