How Do I Save My Kernel Configuration As The Default Settings? - General Questions and Answers

Hi,
How do I save my kernel configuration as the default settings when building a kernel ? I use this:
$ make menuconfig
I save the settings when asked, but how do I make them the default settings so I don't have to keep going back and setting it all up again? When I build a kernel the settings are saved, but when I build a boot.img or do a:
$ make distclean
the settings revert back to what they were originally. What am I missing? Please help.
Thanks,

Problem solved!!!!!
I went through the process of setting up to build a kernel. I then entered the following commands:
$ make distclean
$ make <NAME>_defconfig
$ make menuconfig
After getting all my settings the way I wanted them, instead of exiting all the way to the "save settings yes or no", I exited to the main or home screen and hit the "Save an Alternate Configuration File". Then I named the file. This was saved in the "kernel" directory (by default). I went into the kernel/arch/arm/configs folder and renamed the (in my case) "imx6_defconfig" and "imx6_android_defconfig" files to "original_ imx6_defconfig" and "original_imx6_android_defconfig" (to keep the originals). I then took the Alternate Configuration file in the kernel directory and copied the contents and created my own "imx6_defconfig" and "imx6_android_defconfig" files in the kernel/arch/arm/configs folder. Now my settings are saved as the default settings (unless I go through this process again). I now can build a "rom" or a "boot.img". I can do a:
$ make distclean
and then:
$ make imx6_android_defconfig
I do not have to use the:
$ make menuconfig
to reset my settings.

Related

superuser command list

hi i want to make a superuser command list
anyone how know commands can post it here.
chmod - give especific permissions to an specific file
cat - look at, modify, or combine a file. You can also copy files with this command by "reading" it to another file instead of to the screen.
cd - change from one directory to another
cp - Copy a file from one location to another
dd - copies exact locations to other locations. Can be an entire drive, a folder, etc. dd if= of=. uses an input file and an output file.
df - how much free disk space.
du - show disk usage of files. Add "-h" to get human readable. Especially useful when you add "-d1" to limit the directory depth to 1. If you run "du -h -d1", it will tell you how much space each directory occupies, including their contents summed.
exit - exits the shell you are in.
grep - search within a file for a text string. Also useful for parsing command output. 'ls | grep something' is a quick way to list files that contain the string "something" (although "ls *something*" would do it, too, but grep can do a lot more)
ifconfig- get network interface configuration. Good for getting your own IP address.
kill - kill a process by PID
ls - lists all files in a directory .
mv - Move a file from one location to another.
ping - see if an internet host is alive
pm - android package manager. LOTS of useful things in here, type pm by itself for the help screen
ps - list processes. Useful to see what is running
reboot - reboots your device
reboot recovery - reboots you into recovery
reboot-bootloader -reboots the device in bootloader- fastboot
rm - remove a specified file
rmdir - remove a directory. rm can't do it unless you remove recursively with -R
su - Substitute User. We type this to switch to the root user. You need to type this command first to do a lot of the other commands.
sync - synchronizes any data on disk with data in memory. We type this before rebooting to ensure we've got all data written
tar - creates taped archives. Compresses files like winzip, 7zip, winrar and others tar
top - like task manager, it displays running processes. in Linux the q key quits. On Android I don't know how to make it quit other than closing the app.
uptime - displays how long it has been since you last rebooted the system. Interestingly enough the "Menu Key > System > About Phone > Status > Up time" on my phone does not match "uptime" typed in the terminal emulator.
Download a root explorer app. Go to system/bin (or xbin). You will see many files, but actually every file is a command for the kernel and (theoretically) all of them can be used in the terminal. Not all of them are stand-alone functions and must be used along with other commands. Just type the title of a file in terminal and see what happens. You might find some other functions that are not already in your list .
Sent from my GT-I9001 using xda app-developers app
I use this as a cheatsheet as I normally deal with rooted devices with busybox installed anyway. Most "commands" found in /system/bin are symlinks to busybox. Sometimes a device has a non-standard busybox version with not all applets available. The reason why Titanium backup ships their own version of busybox with the app.

Simple "Send/Install to Phone" Context menu [For ADB wireless]

Attn Moderator. This is a reply to:
http://forum.xda-developers.com/showthread.php?t=712433
I was able to use Tasker with the "Secure Settings" plugin [to turn on ADB Over Network and Wireless ABD Enabled/Wifi+]
[But you could also do this on your phone if you don't want to install anything additional http://forum.xda-developers.com/showthread.php?t=1685736]
To send APKs to my phone via wifi I did the following:
First I put adb.exe in C:\adb\
Then I ran the follow reg file:
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.apk\shell\Install to Phone]
[HKEY_CLASSES_ROOT\.apk\shell\Install to Phone\command]
@="C:\\adb\\connect-to-phone.bat & C:\\adb\\adb.exe install %1"
[HKEY_CLASSES_ROOT\*\shell\Send to Phone]
[HKEY_CLASSES_ROOT\*\shell\Send to Phone\command]
@="C:\\adb\\connect-to-phone.bat & C:\\adb\\adb.exe push %1 /sdcard/"
If copying this setup exactly, you will also need to create the following file: C:\abd\connect-to-phone.bat
Code:
C:\adb\adb.exe disconnect&&C:\adb\adb.exe connect 192.168.1.101
[This is the static IP address of my phone, yours will probably be different] ^^
Does anyone know if there is a way to get this into the right click Send To > menu?
\\EDIT This script does not like file names with spaces, please make sure there are no special characters or spaces in the names of the files you are sending to the phone
Additionally, sometimes I've had to run it twice to get it to connect
Can someone please move this to the correct forum?
I was looking for this and I have modified above script to work properly for directories with spaces in its name. Simply change %1 in above script to \"%1\"
Thanks for the original version.
Make sure that whatever directory you point to one your phone already exists. It wont create a new folder for you.
In my case the above code became like this.
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\ADB Push to Phone]
[HKEY_CLASSES_ROOT\*\shell\ADB Push to Phone\command]
@="C:\\Program Files (x86)\\Minimal ADB and Fastboot\\adb.exe push \"%1\" /sdcard/ADBPush/"
[HKEY_CLASSES_ROOT\Folder\shell\ADB Push to Phone]
[HKEY_CLASSES_ROOT\Folder\shell\ADB Push to Phone\command]
@="C:\\Program Files (x86)\\Minimal ADB and Fastboot\\adb.exe push \"%1\" /sdcard/ADBPush/"
Install minimal adb and fastboot from xda if you dont have it. Change directories as suited to your system to point to adb.exe file. Location on phone must already exist. Edit in notepad, save as .reg file and install it.

Importing WiFi profiles from an old device / backup

Hi guys!
As I'm not a developer, but did not find a proper section to post this, feel free to edit / move / remove this topic if you feel it necessary / that does not comply.
Short story: updated my HTC One M8 Verizon phone with Viper OneM8 ROM, had some issues during various setups, and at final install I disalowed Google to restore my infos (contacts, apps, wifi settings etc) automatically at initial setup. Did almost all of the restore manually at a later time. But without my saved wifi profiles (arround 200 saved).
As I did not find a proper way to get them from Google, I had to do it old way. Had an older HTC One S, sync'd with Google backup, having full list of all my wifi profiles.
Disclaimer: I cannot take credits for this, as I just double checked and adapted the code found here for my needs (I am a lazy guy, and - as the original code was written to be used "as is" on a linux machine - I did not wanted to reboot to Mint, do the job and revert to Windows afterthat ).
So please make backups and don't do it if you don't understand what you are doing! As I take no credit, I also take no responsibility!
The goal: copy relevant info from wpa_supplicant.conf on old phone and put it in wpa_supplicant.conf in the new phone and make it load the new info correctly.
What you need:
- rooted device (rw access to /data/misc/wifi/),
- a backup of wpa_supplicant.conf from the above folder (a previous version) - might be from another device (like in my case).
- working adb tools on a windows computer (for linux see the above disclaimer).
- some basic skills in adb
The job:
1. Get the wpa_supplicant.conf from BOTH devices on your desktop.
This can be done in various ways, I will not get too deep into it. The easiest way is to just copy the wpa_supplicant.conf from /data/misc/wifi/ somewhere on sdcard on devices (using root explorer or similar app - remember, you need root on your device!), and after that just get it with windows explorer or whatever tool you are using to copy files from device to computer.
the adb should look like (I assumed you did copy the file(s) from /data/misc/wifi to the root of your sdcard(s) ):
(from old device)
Code:
adb pull /mnt/sdcard/wpa_supplicant.conf wpa_supplicant.FULL
(from new device)
Code:
adb pull /mnt/sdcard/wpa_supplicant.conf wpa_supplicant.EMPTY
2. Make a backup of BOTH files you just got! Especially of the EMPTY file, in case you run troubles.
3. Open the wpa_supplicant.FULL with a text editor on your computer and clear the headers. Save afterthat:
Don't use notepad, it's not handling well *nix new lines. You can use notepadd++, wordpad etc.
You need to delete everything in the begining of the .FULL file down to first
Code:
network={
ssid="hro-M"
(DON'T delete the network={ part or anything bellow it!)
Save the file. Open it again to check headers are gone.
4. Get the content from just saved wpa_supplicant.FULL into wpa_supplicant.EMPTY
Can be done in various ways. Easiest:
Code:
more wpa_supplicant.FULL >> wpa_supplicant.EMPTY
Check that now wpa_supplicant.EMPTY is full (filled with original new file headers and your networks info from the FULL file).
5. Put the new file back to new device sdcard and rename it with correct filename:
Again multiple options here (explorer, cloud etc).
Adb should look like:
Code:
adb push wpa_supplicant.EMPTY /mnt/sdcard/wpa_supplicant.conf
Check on your device that file is indeed there (also check it's contents with a text editor).
6. Turn off device WiFi
7. Make a backup of /data/misc/wifi/wpa_supplicant.conf:
Adb stuff:
Code:
adb shell
su
cd /data/misc/wifi
cp wpa_supplicant.conf wpa_supplicant.conf.backup
Check on device that both wpa_supplicant.conf AND wpa_supplicant.conf.backup are in place, and they have the same size.
8. Overwrite wpa_supplicant.conf in /data/misc/wifi/ with wpa_supplicant.conf from sdcard:
I prefered to delete the file and copy my version instead of overwriting it:
Code:
rm wpa_supplicant.conf
cp /mnt/sdcard/wpa_supplicant.conf .
9. Change permissions for wpa_supplicant.conf:
Code:
chown system.wifi wpa_supplicant.conf
10. Turn on wifi on device (restart device recommended):
In my case it worked after device reboot, but I did it with wifi turned-on.
Check your saved wifi networks in Settings - WiFi!
Most probably this will not apply to all devices (I remember I saw a wpa_supplicant.conf with encrypted passwords at some point on my device (different ROM, probably original Verizon One M8 ROM), but in some cases might help, as there are few references of how to recover previously saved network details (except Google backup and some apps, that sometimes do not work).
Hope this helps someone!
Thanks!

[Hack] Skip WiFi setup/ Setup wizard while booting Android for first time.

Hey guys,
We had plenty of sweet surprises for Mi 4i recently, especially considering the Nougat ROMs. This also implies that you'll be busy in flashing a plenty of times.
You should also have noticed by now that when you flash a new ROM, you can't entirely Skip the network connection requirement after the first boot. This annoyed me so much because I have a slow, conservative bandwidth.
Fortunately, I have found a solution; but make no mistake, I'm NOT the author of this solution. This method was originally for Nexus 7 by organophosphate. I'm just extending this amazing trick to Mi 4i.
If you want, you can read the original post.
What do you need?
PC
Your phone
TWRP recovery
ADB on PC
Have them all before proceeding.
Procedure :
1. After installing your ROM through TWRP, mount system partition(Advanced>Mount>check system).
2. Connect your phone to PC via USB. Let the phone be in recovery. All the work is to be done in the same.
3. Launch ADB. Just ensure proper connection by first using adb usb and then adb devices commands. It should then show your phone connected in recovery mode.
4. Now, the important part.
If you want to skip only the WiFi setup part but not the rest of initial setup, execute adb shell sed -i 's/ro.setupwizard.wifi_required=true/ro.setupwizard.wifi_required=false/g' /system/build.prop
If you want to skip entire setup and directly goto home screen, launch Shell by executing adb shell and then execute the command echo "ro.setupwizard.mode=DISABLED" >> /system/build.prop.
5. Reboot your phone, either by using adb reboot (or just reboot in Shell) or using Reboot option in recovery.
6. Now, you should see a Skip button in WiFi setup page or Home screen depending on your choice in step 4.
7. Enjoy/explore your new OS
Few personal notes:
1. Entire procedure should happen while your phone is in recovery mode.
2. Skipping the setup wizard entirely has more working chance(almost every time) than skipping just WiFi setup. Skipping WiFi setup rarely worked for me. So, I'd recommend the former option.
3. Skipping initial setup entirely won't cause any trouble as it just for collecting the very basic information. Those details can be set manually later.
5. This method won't cause any trouble usually. That said, I'm not responsible for bootloops(although I haven't encountered it yet). This is not to discourage you but to let you know of worst case scenario. Should this happen, please refer to original article mentioned earlier.
Credits :
organophosphate for this amazing hack.
I(yourSAS) may/may not deserve credit for extending the method and sharing, depending on your result
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
faizauthar12 said:
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
Click to expand...
Click to collapse
I guess that would work. But it'll be lengthy and tedious.
If devs test and do that before releasing the ROM, this problem will be no more.
faizauthar12 said:
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
Click to expand...
Click to collapse
In that case what lines should I delete/edit ?
elonmusk said:
In that case what lines should I delete/edit ?
Click to expand...
Click to collapse
oopss, we don't need to do this trick anymore
lineage already fix ( patch ) the setup wizard, it will ask a Wi-Fi connection..
so make sure you're an up-to date build
faizauthar12 said:
oopss, we don't need to do this trick anymore
lineage already fix ( patch ) the setup wizard, it will ask a Wi-Fi connection..
so make sure you're an up-to date build
Click to expand...
Click to collapse
Yes! I'm on the latest version.. was just curious..
elonmusk said:
Yes! I'm on the latest version.. was just curious..
Click to expand...
Click to collapse
It is already explained in first post. Those two are basic Linux commands:
- echo - is a simple command line text files editor/creator
Code:
echo "ro.setupwizard.mode=DISABLED" >> /system/build.prop
It mean: append text string "ro.setupwizard.mode=DISABLED" to the end of text file "/system/build.prop" , so if you want to do manually these unpack/repack acrobation, just paste "ro.setupwizard.mode=DISABLED" in build .prop
- sed - is advanced command line text editor, you can change already existing text in text file with your desired, using exact match or regex, etc.
Code:
sed -i 's/ro.setupwizard.wifi_required=true/ro.setupwizard.wifi_required=false/g' /system/build.prop
It mean: Get text file "/system/build.prop" , find in file following text string "ro.setupwizard.wifi_required=true" and change it to "ro.setupwizard.wifi_required=false", so if you want to do manually unpack/repack acrobations, just change true to false in mentioned text string, in build.prop.
Anyway, thanks to @yourSAS for sharing idea
Skip WiFi Setup / Setup Wizard On Fresh Boot
Figured I would leave my notes here as this where google dropped me off...
Yes ro.setupwizard.wifi_required doesn't work as expected most of the time as it was replaced with ro.setupwizard.require_network.
That being said one should be using it to skip WiFi setup:
adb shell sed -i 's/ro.setupwizard.require_network=any/ro.setupwizard.require_network=no/g' /system/build.prop
Click to expand...
Click to collapse
None the less here is a little breakdown of the process with a few suggestions:
1. Boot to TWRP.
2. Mount System partition.
3. Pull current build.prop to see what is currently set.
--- There may be other possible values for these properties.
--- There are many other things one can change from here, google them.
--- Also you may find that once mounted the build.prop resides in /system/system rather.
4. Run commands.
5. Reboot, Profit!
# Pull current build.prop from phone to local folder; see what you currently have.
adb pull /system/build.prop
# Push build.prop back to device.
# You can use this method, just be sure you save your the text file with correct line endings for Linux (no CR only LF).
# Using commands to edit the file rather than a pull/push will ensure things stay the same.
adb push /system.build.prop
# Replace elements in text files (build.prop).
adb shell sed -i 's/FIND.THIS/REPLACE.WITH.THIS/g' /system/build.prop
# Append (add a new line) to text file.
echo "NEW LINE TO ADD" >> /system/build.prop
# Relevant properties
# Set which, or if any network is required
ro.setupwizard.require_network=
any, no, wifi
# Same as above but older property
ro.setupwizard.network_required=
true, false
# Again replaced by above
ro.setupwizard.wifi_required=
true, false
# Control the complete setup process
ro.setupwizard.mode=
OPTIONAL, ENABLED, DISABLED
Click to expand...
Click to collapse

'Restore' your display

I bring to you another script, courtesy of Amazon. This one might not suit a lot of you, so be prepared. Like most of the tricks we've tried this past week or so, even resetting the reset, may not be to your liking and can only be reverted via factory reset.
Titled 'Display,' it toggles at least three modes. i didn't quite understand them so I went ahead and ran the script in Terminal Emulator. This was also in /system/bin.
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.
It changes size, density and values. The last one sets it back to "original value." I don't have a before shot, because I wasn't expecting anything. Cleaner, brighter, crisper and in my opinion, more HD.
Edit: the picture does no justice unfortunately.
1. Go to /system/bin
2. Locate file: display
3. Rename to display.sh
4. Copy to internal storage
5. I used Terminal Emulator
Code:
$ sh /sdcard/display.sh
Enter the command that will "reset to original" and you get sharper screen, brighter and more vibrant. Your text may look a bit smaller and folders on home also. I think this is the HD the tablet was missing.
Display Configuration:
Code:
/system/etc/display_conf
Code:
# Please add new device using the same format.
# The comments begin with "#".
device=apollo, size=1600x2560, density=320
device=thor, size=1200x1920, density=320
device=soho, size=800x1280, density=240
Followed by...
Code:
/system/bin/display
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.
Hi
Is the actual command something like ./display.sh hostname
I ran the script with the above but said permission denied.
DragonFire1024 said:
I bring to you another script, courtesy of Amazon. This one might not suit a lot of you, so be prepared. Like most of the tricks we've tried this past week or so, even resetting the reset, may not be to your liking and can only be reverted via factory reset.
Titled 'Display,' it toggles at least three modes. i didn't quite understand them so I went ahead and ran the script in Terminal Emulator. This was also in /system/bin.
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.
It changes size, density and values. The last one sets it back to "original value." I don't have a before shot, because I wasn't expecting anything. Cleaner, brighter, crisper and in my opinion, more HD.
Edit: the picture does no justice unfortunately.
Click to expand...
Click to collapse
smileyint said:
Hi
Is the actual command something like ./display.sh hostname
I ran the script with the above but said permission denied.
Click to expand...
Click to collapse
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.
Thanks DragonFire1024. i cannot tell the different after resetting the display though.
DragonFire1024 said:
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.
Click to expand...
Click to collapse
---------- Post added at 08:39 AM ---------- Previous post was at 08:31 AM ----------
Thanks DragonFire1024. i cannot tell the different after resetting the display though.
DragonFire1024 said:
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.
Click to expand...
Click to collapse

Categories

Resources