FORUMS
Remove All Ads from XDA

[Guide][Video Tutorial] How to build Custom ROMs and Kernel Modification![P,O,N,M,L]

1,848 posts
Thanks Meter: 3,930
 
Post Reply Email Thread
2nd May 2019, 12:53 PM |#1411  
Senior Member
Thanks Meter: 61
 
More
Hey does anyone know when you make twrp which version your making is nougat like 3.2.1 or what? I've watched all the videos on building it and I've even built a lineage OS twrp for Shamu now but I don't want to flash it until I know which version of twrp it is. Also if I have a device on KitKat and I want to build lineage Oreo and found the kernel source code and stock rom source code how do I change the kernel to work with Oreo or do you not need to?
 
 
2nd May 2019, 01:04 PM |#1412  
vicious98's Avatar
Junior Member
Flag New Delhi
Thanks Meter: 30
 
Donate to Me
More
Quote:
Originally Posted by [email protected]

Search for "wlan.ko" in kernel directory ( may be located in drivers/staging/prima/wlan.ko) and replace the same file from your phone system/lib/modules through twrp or make custom zip of your kernel to flash.

Is there some command by which i can enable making of specific modules (in my case wifi) because there is no wlan.ko in my directory. There are other .ko but not wlan.So perhaps i have to manually enable it in my make file or some other way?
2nd May 2019, 01:11 PM |#1413  
Senior Member
Flag Pennadam Town Tamil Nadu
Thanks Meter: 235
 
Donate to Me
More
Quote:
Originally Posted by vicious98

Is there some command by which i can enable making of specific modules (in my case wifi) because there is no wlan.ko in my directory. There are other .ko but not wlan.So perhaps i have to manually enable it in my make file or some other way?

Look at your stock rom and decide which wifi module it uses. Copy the same module to your ROM if you change the kernel. Watch your kernel during compilation it shows the location of wifi module while it completes.
The Following User Says Thank You to [email protected] For This Useful Post: [ View ] Gift [email protected] Ad-Free
2nd May 2019, 01:29 PM |#1414  
vicious98's Avatar
Junior Member
Flag New Delhi
Thanks Meter: 30
 
Donate to Me
More
Hey can anyone tell me how to add GPU governors in my kernel? I dont even know where they are located in my kernel source?
2nd May 2019, 01:38 PM |#1415  
Senior Member
Flag Pennadam Town Tamil Nadu
Thanks Meter: 235
 
Donate to Me
More
Quote:
Originally Posted by vicious98

Hey can anyone tell me how to add GPU governors in my kernel? I dont even know where they are located in my kernel source?

Look at commits section of your custom kernel from any other developers who already worked on it. Cherry-pick the features from their custom kernel to your kernel.
Or follow the youtube videos on kernel modification by this author. Great work by @AlaskaLinuxUser.
The Following User Says Thank You to [email protected] For This Useful Post: [ View ] Gift [email protected] Ad-Free
2nd May 2019, 01:52 PM |#1416  
vicious98's Avatar
Junior Member
Flag New Delhi
Thanks Meter: 30
 
Donate to Me
More
Quote:
Originally Posted by [email protected]

Look at commits section of your custom kernel from any other developers who already worked on it. Cherry-pick the features from their custom kernel to your kernel.
Or follow the youtube videos on kernel modification by this author. Great work by @AlaskaLinuxUser.

I get it. But i want to add GPU governors not CPU!! So if there is a guide or if anyone knows how to please do tell.Mainly i want to know where the governors for the GPU are located in the kernel source!!
3rd May 2019, 03:57 PM |#1417  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 3,930
 
Donate to Me
More
Quote:
Originally Posted by vicious98

I get it. But i want to add GPU governors not CPU!! So if there is a guide or if anyone knows how to please do tell.Mainly i want to know where the governors for the GPU are located in the kernel source!!

Happened to swing by and saw this. Typically, they are found in <your kernel>/drivers/devfreq/, and the Kconfig file will list them. It can vary widely based on kernel and manufacturer.

Here is a link to arter97's Adreno-Idler GPU gov.
https://forum.xda-developers.com/and...vfreq-t3134872

Good luck!
The Following 2 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
3rd May 2019, 04:45 PM |#1418  
Senior Member
Thanks Meter: 61
 
More
Quote:
Originally Posted by AlaskaLinuxUser

Happened to swing by and saw this. Typically, they are found in <your kernel>/drivers/devfreq/, and the Kconfig file will list them. It can vary widely based on kernel and manufacturer.

Here is a link to arter97's Adreno-Idler GPU gov.
https://forum.xda-developers.com/and...vfreq-t3134872

Good luck!

So how's the new thing going? I seen a video of yours saying something good came along so you'd be retiring on video making. If you don't mind me asking what was it and how's it going? I'm Glade something good came along for you.
The Following User Says Thank You to Techguy777 For This Useful Post: [ View ] Gift Techguy777 Ad-Free
5th May 2019, 09:10 AM |#1419  
matteo0026's Avatar
Senior Member
Flag Treviso
Thanks Meter: 446
 
More
Hi, I'm trying to update from nougat to oreo twrp for bq aquaris u2. I did the build, but I get this error while booting twrp:
Click image for larger version

Name:	photo_2019-05-05_10-09-36.jpg
Views:	286
Size:	141.5 KB
ID:	4753579
https://github.com/matteo0026/android_device_bq_yamcha here is my source, I was wrong when I called the new branch android-9.0, it was android-8.1.

https://github.com/matteo0026/androi...dConfig.mk#L14
Could be this the guilt?
14th May 2019, 04:20 AM |#1420  
DJABHipHop's Avatar
Senior Member
Thanks Meter: 387
 
More
Need help Updating SharedPreferences on the rootless pixel launcher nougat version I don't know what i'm doing wrong.

SharedPrefrencesHelper.java
Code:
package com.android.launcher3;

import android.content.SharedPreferences;
import android.app.Activity;
import android.content.Context;
import android.widget.Toast;

public final class SharedPrefrencesHelper {	
	
	
	/**
	* ------------------------------------------------------------
	* Shared Preferences Put & Get Type for my two cystom function
	* readPrefvalue
	* updatePrefvalue
	* Preferences value Type
	* 1 = Boolean, Boolean value 1 = true & No value / Blank / Any other number then 1 = false
	* 2 = Int
	* 3 = Float
	* 4 = Long
	* No value / Blank = String
	* -------------------------------------------------------------
	*/
	
	// Shared Preferences vaveable
	private SharedPreferences sharedPreferences;
	private static final String PREF_NAME = "com.android.launcher3.device.prefs";
	private static Context context;
	
	private static SharedPreferences getPrefs(Context context) {
        return context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
    }
	
	// Updating Shared Preference value
	// Updating Boolean
	public static final void updateBoolean(String key, boolean value) {
		// Shared Preference Boolean
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.putBoolean(key, value);
		editor.apply();
	}
	// Updating Int
	public static final void updateInt(String key, int value) {
		// Shared Preference Int
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.putInt(key, value);
		editor.apply();
	}
	// Updating Float
	public static final void updateFloat(String key, float value) {
		// Shared Preference Float
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.putFloat(key, value);
		editor.apply();
	}
	// Updating Long
	public static final void updateLong(String key, long value) {
		// Shared Preference Long
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.putLong(key, value);	
		editor.apply();		
	}
	// Updating String
	public static final void updateString(String key, String value) {
		// Shared Preference String 
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.putString(key, value);
		editor.apply();
	}
	
	// Reading Shared Preference value
	// Read Boolean
	public static final boolean readBoolean(String key, boolean value) {
		// Shared Preference Boolean
		return getPrefs(context).getBoolean(key, value);
	}
	// Read Int
	public static final int readInt(String key, int value) {
		// Shared Preference Int
		return getPrefs(context).getInt(key, value);
	}
	// Read Float
	public static final float readFloat(String key, float value) {
		// Shared Preference Float
		return getPrefs(context).getFloat(key, value);
	}
	// Read Long
	public static final long readLong(String key, long value) {
		// Shared Preference Long
		return getPrefs(context).getLong(key, value);			
	}
	// Read String
	public static final String readString(String key, String value) {
		// Shared Preference String 
		return getPrefs(context).getString(key, value);
	}
}
SettingsActivity.java
Code:
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.launcher3;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.preference.PreferenceFragment;
import android.preference.SwitchPreference;
import android.preference.TwoStatePreference;
import android.preference.ListPreference;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.provider.Settings;
import android.provider.Settings.System;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.widget.Toast;  

import com.android.launcher3.Utilities;
import com.android.launcher3.SharedPrefrencesHelper;

/**
 * Settings activity for Launcher. Currently implements the following setting: Allow rotation
 */
public class SettingsActivity extends Activity {
	public static Launcher mLauncher;
			
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Display the fragment as the main content.
        getFragmentManager().beginTransaction()
                .replace(android.R.id.content, new LauncherSettingsFragment())
                .commit();
    }

    /**
     * This fragment shows the launcher preferences.
     */
    public static class LauncherSettingsFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener {

        private SystemDisplayRotationLockObserver mRotationLockObserver;
		
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            getPreferenceManager().setSharedPreferencesName(LauncherFiles.SHARED_PREFERENCES_KEY);
            addPreferencesFromResource(R.xml.launcher_preferences);
			
			// Setup allow rotation preference
            Preference rotationPref = findPreference(Utilities.ALLOW_ROTATION_PREFERENCE_KEY);
            if (getResources().getBoolean(R.bool.allow_rotation)) {
                // Launcher supports rotation by default. No need to show this setting.
                getPreferenceScreen().removePreference(rotationPref);
            } else {
                ContentResolver resolver = getActivity().getContentResolver();
                mRotationLockObserver = new SystemDisplayRotationLockObserver(rotationPref, resolver);

                // Register a content observer to listen for system setting changes while
                // this UI is active.
                resolver.registerContentObserver(
                        Settings.System.getUriFor(System.ACCELEROMETER_ROTATION),
                        false, mRotationLockObserver);

                // Initialize the UI once
                mRotationLockObserver.onChange(true);
                rotationPref.setDefaultValue(Utilities.getAllowRotationDefaultValue(getActivity()));
            }
			
			/**
			* Warning: Dont Remove this is unless you know how to remove app Predictions with out losing home overview setting button,
			* Removing this can cause a bug to appre & frankly I find this options rather annoying.
			* Disable PredictionsBug to avoid a huge bugs
			*/
			Preference predictionsPref = findPreference(Utilities.SHOW_PREDICTIONS_PREF);
			// predictionsPref.setOnPreferenceChangeListener(this);
			predictionsPref.setEnabled(false);
			getPreferenceScreen().removePreference(predictionsPref);
			
			// Custom Mods
			// Todo: Add Ability Hide Google Search like in the LineageOS Default Launcher(Trebuchet)
			Preference minusOnePref = findPreference(Utilities.ENABLE_MINUS_ONE_PREF);
			minusOnePref.setEnabled(false);
			
			// Todo: Add Theme Support
			Preference themeOveridePref = findPreference(Utilities.THEME_OVERRIDE_KEY);
			themeOveridePref.setEnabled(false);
			
			// Todo: Add Ability Hide App Search In App Drawer like in the LineageOS Default Launcher(Trebuchet)
			Preference appSearchPref = (SwitchPreference) findPreference(Utilities.SHOW_APP_SEARCH);
						
			appSearchPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {	
				@Override
				public boolean onPreferenceChange(Preference preference, Object o) {
					/*if (SharedPrefrencesHelper.readBoolean(Utilities.SHOW_APP_SEARCH, true)) {*/
						// Toast.makeText(getContext(), "App Search Enabled", Toast.LENGTH_LONG).show();
						// SharedPrefrencesHelper.updateBoolean(Utilities.SHOW_APP_SEARCH, true);
						// return true;
					//} else {
						Toast.makeText(getContext(), "App Search Disabled", Toast.LENGTH_LONG).show();
						SharedPrefrencesHelper.updateBoolean(Utilities.SHOW_APP_SEARCH, true);
					//}
					return false;
				}
			});
			
        }
		
		@Override
		public void onResume() {
			super.onResume();
			// Set up a listener whenever a key changes
/*  		getPreferenceScreen().getSharedPreferences()
					.registerOnSharedPreferenceChangeListener(this);*/
		}
		
		@Override
		public void onPause() {
			super.onPause();
			// Unregister the listener whenever a key changes
/*			getPreferenceScreen().getSharedPreferences()
					.unregisterOnSharedPreferenceChangeListener(this);
*/		}

		@Override
		public boolean onPreferenceChange(Preference preference, Object o) {
			return false;
		}
		
		@Override
        public void onDestroy() {
            if (mRotationLockObserver != null) {
                getActivity().getContentResolver().unregisterContentObserver(mRotationLockObserver);
                mRotationLockObserver = null;
            }
            super.onDestroy();
        }
    }

    /**
     * Content observer which listens for system auto-rotate setting changes, and enables/disables
     * the launcher rotation setting accordingly.
     */
    private static class SystemDisplayRotationLockObserver extends ContentObserver {

        private final Preference mRotationPref;
        private final ContentResolver mResolver;

        public SystemDisplayRotationLockObserver(
                Preference rotationPref, ContentResolver resolver) {
            super(new Handler());
            mRotationPref = rotationPref;
            mResolver = resolver;
        }

        @Override
        public void onChange(boolean selfChange) {
            boolean enabled = Settings.System.getInt(mResolver,
                    Settings.System.ACCELEROMETER_ROTATION, 1) == 1;
            mRotationPref.setEnabled(enabled);
            mRotationPref.setSummary(enabled
                    ? R.string.allow_rotation_desc : R.string.allow_rotation_blocked_desc);
        }
    }
}
Thanks in Advance
6th June 2019, 11:57 AM |#1421  
Junior Member
Thanks Meter: 0
 
Donate to Me
More
I need help with compiling for my device, I've been following your video series for building device tree from scratch. I'm stuck at one point that I just can't figure out though, can anyone help me please?

Quote:

Made recovery image: /home/raid/android/system/out/target/product/goyave3g/recovery.img
Target build info: /home/raid/android/system/out/target/product/goyave3g/system/build.prop
Construct recovery from boot
mkdir -p /home/raid/android/system/out/target/product/goyave3g/obj/PACKAGING/recovery_patch_intermediates/
PATH=/home/raid/android/system/out/host/linux-x86/bin:$PATH /home/raid/android/system/out/host/linux-x86/bin/imgdiff /home/raid/android/system/out/target/product/goyave3g/boot.img /home/raid/android/system/out/target/product/goyave3g/recovery.img /home/raid/android/system/out/target/product/goyave3g/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
build/tools/generate-notice-files.py /home/raid/android/system/out/target/product/goyave3g/obj/NOTICE.txt /home/raid/android/system/out/target/product/goyave3g/obj/NOTICE.html "Notices for files contained in the filesystem images in this directory:" /home/raid/android/system/out/target/product/goyave3g/obj/NOTICE_FILES/src
failed to reconstruct target deflate chunk 1 [(null)]; treating as normal
chunk 0: type 0 start 0 len 5230602
chunk 1: type 2 start 5230602 len 1732096
chunk 2: type 0 start 6193783 len 269705
Construct patches for 3 chunks...
Combining NOTICE files into HTML
Combining NOTICE files into text
patch 0 is 206 bytes (of 5230602)
patch 1 is 1730987 bytes (of 963181)
patch 2 is 196 bytes (of 269705)
chunk 0: normal ( 0, 5230602) 206
chunk 1: deflate ( 5230602, 3389635) 1730987 (null)
chunk 2: normal ( 8620237, 270131) 196
Installing recovery patch to system partition
Traceback (most recent call last):
File "./build/tools/releasetools/make_recovery_patch", line 55, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/make_recovery_patch", line 37, in main
OPTIONS.info_dict = common.LoadInfoDict(input_dir)
File "/home/raid/android/system/build/tools/releasetools/common.py", line 201, in LoadInfoDict
d["fstab"] = LoadRecoveryFSTab(read_helper, d["fstab_version"], d["device_type"])
File "/home/raid/android/system/build/tools/releasetools/common.py", line 285, in LoadRecoveryFSTab
raise ValueError("malformed recovery.fstab line: "%s"" % (line,))
ValueError: malformed recovery.fstab line: "/boot emmc /dev/block/platform/sprd-sdhci.3/by-name/KERNEL"
build/core/Makefile:1074: recipe for target '/home/raid/android/system/out/target/product/goyave3g/system/bin/install-recovery.sh' failed
make: *** [/home/raid/android/system/out/target/product/goyave3g/system/bin/install-recovery.sh] Error 1
make: Leaving directory '/home/raid/android/system'

#### make failed to build some targets (03:18 (mm:ss)) ####

This is what is in my recovery.fstab

Quote:

/boot emmc /dev/block/platform/sprd-sdhci.3/by-name/KERNEL
/system ext4 /dev/block/platform/sprd-sdhci.3/by-name/system
/data ext4 /dev/block/platform/sprd-sdhci.3/by-name/userdata flags=length=-16384
/cache ext4 /dev/block/platform/sprd-sdhci.3/by-name/CSC
/recovery emmc /dev/block/platform/sprd-sdhci.3/by-name/RECOVERY
/efs emmc /dev/block/platform/sprd-sdhci.3/by-name/efs flags=backup=1;display=EFS

/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;display=USB-OTG



Any help would be greatly appreciated!
Thanks!
Post Reply Subscribe to Thread

Tags
compile, guide, kernel, rom, video

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes