Linux cmd line - OnePlus 2 Q&A, Help & Troubleshooting

Can you share your linux cmdline?
I thinks that the rf mode is set based on the command line, and I want to compare the command line for all the regional versions of the OPT.
Bellow is the command line I have in my device (A0005 - US version):
sched_enable_hmp=1 sched_enable_power_aware=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 androidboot.selinux=permissive androidboot.bootdevice=f9824900.sdhci androidboot.serialno=c50dec84 androidboot.baseband=msm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_jd35695_1080p_cmd:1:none maxcpus=8 androidboot.startupmode=reboot androidboot.mode=reboot lk_version=V1.0 lcd_gamma_select=0 androidboot.project_name=14049 androidboot.hw_version=14 androidboot.rf_v1=34 androidboot.rf_v2=0 androidboot.rf_v3=0 androidboot.ddr_manufacture_name=Samsung androidboot.ddr_row=15 androidboot.ddr_column=10​To get command line (need root access):
adb shell
su
cat /proc/cmdline​

OSM said:
Can you share your linux cmdline?
I thinks that the rf mode is set based on the command line, and I want to compare the command line for all the regional versions of the OPT.
Bellow is the command line I have in my device (A0005 - US version):
sched_enable_hmp=1 sched_enable_power_aware=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 androidboot.selinux=permissive androidboot.bootdevice=f9824900.sdhci androidboot.serialno=c50dec84 androidboot.baseband=msm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_jd35695_1080p_cmd:1:none maxcpus=8 androidboot.startupmode=reboot androidboot.mode=reboot lk_version=V1.0 lcd_gamma_select=0 androidboot.project_name=14049 androidboot.hw_version=14 androidboot.rf_v1=34 androidboot.rf_v2=0 androidboot.rf_v3=0 androidboot.ddr_manufacture_name=Samsung androidboot.ddr_row=15 androidboot.ddr_column=10​To get command line (need root access):
adb shell
su
cat /proc/cmdline​
Click to expand...
Click to collapse
A2001 (Chinese version)
[email protected]:/ # cat /proc/cmdline
sched_enable_hmp=1 sched_enable_power_aware=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 androidboot.selinux=permissive androidboot.bootdevice=f9824900.sdhci androidboot.serialno=****** androidboot.baseband=msm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_jd35695_1080p_cmd:1:none maxcpus=8 androidboot.startupmode=reboot androidboot.mode=reboot lk_version=V1.0 lcd_gamma_select=0 androidboot.project_name=14049 androidboot.hw_version=14 androidboot.rf_v1=14 androidboot.rf_v2=0 androidboot.rf_v3=0 androidboot.ddr_manufacture_name=Samsung androidboot.ddr_row=15 androidboot.ddr_column=10

voron00 said:
A2001 (Chinese version)
[email protected]:/ # cat /proc/cmdline
sched_enable_hmp=1 sched_enable_power_aware=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 androidboot.selinux=permissive androidboot.bootdevice=f9824900.sdhci androidboot.serialno=****** androidboot.baseband=msm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_jd35695_1080p_cmd:1:none maxcpus=8 androidboot.startupmode=reboot androidboot.mode=reboot lk_version=V1.0 lcd_gamma_select=0 androidboot.project_name=14049 androidboot.hw_version=14 androidboot.rf_v1=14 androidboot.rf_v2=0 androidboot.rf_v3=0 androidboot.ddr_manufacture_name=Samsung androidboot.ddr_row=15 androidboot.ddr_column=10
Click to expand...
Click to collapse
Thanks for sharing.
It seems that the modem mode (CH/EU/US) is set in androidboot.rf_v1 (34 for US/14 for CH, and my guess 24 for EU).
Next step for me if to find out how is this value set, and if it is possible to change the device mode from US to EU.

OSM said:
Thanks for sharing.
It seems that the modem mode (CH/EU/US) is set in androidboot.rf_v1 (34 for US/14 for CH, and my guess 24 for EU).
Next step for me if to find out how is this value set, and if it is possible to change the device mode from US to EU.
Click to expand...
Click to collapse
You are right. I boot my A2005 from fastboot with androidboot.rf_v1=24 and now it is A2003, have all EU bands (checked by CdmaTool). But LTE do not work anyway. All important work did aboot, but it is unable to change it because of digital sign. I`ve tried to hack it, got brick. Only way to restore - MSM8994DownloadTool or similar.

Implex said:
You are right. I boot my A2005 from fastboot with androidboot.rf_v1=24 and now it is A2003, have all EU bands (checked by CdmaTool). But LTE do not work anyway. All important work did aboot, but it is unable to change it because of digital sign. I`ve tried to hack it, got brick. Only way to restore - MSM8994DownloadTool or similar.
Click to expand...
Click to collapse
Hi
Two questions, How did you change the androidboot.rf_v1 from fastboot? and is the value hard coded in the aboot? or is it reading from the some partition in the device NAND?
Thanks

OSM said:
Hi
Two questions, How did you change the androidboot.rf_v1 from fastboot? and is the value hard coded in the aboot? or is it reading from the some partition in the device NAND?
Thanks
Click to expand...
Click to collapse
Just exec: fastboot -c "here is modifyed cmdline" boot boot.img. boot.img should be the same as on device.
Second. I've look at aboot.img in IDA (disassembler), but my knowledge of asm is not enough. All I could understand, value calculated, I guess based on some other value readed same way as device serial. Original boot.img contain less parameters than /proc/cmdline shows, so most of parameters set by aboot.img. However, aboot digitally signed, and any changes brick device.

Related

Kernel & Ramdisk

Hey i extracted boot.img and ramdisk
damn i life in germany i cant order one
Bootloader is locked? loki patch should work
from their update script lol
Code:
# Extract tools required to change the certificate
#
package_extract_file("sed", "/tmp/sed");
package_extract_file("prod_cert_swap.sed", "/tmp/cert_swap.sed");
set_perm(0, 0, 0777, "/tmp/sed");
set_perm(0, 0, 0777, "/tmp/cert_swap.sed");
#
# Update packages.xml
#
run_program("/tmp/sed", "-i", "-f", "/tmp/cert_swap.sed", "/data/system/packages.xml");
Sounds interesting.
Too bad i live in Germany too.
I am actually Considering to order via ebay (all taxes, shipping and stuff included).
Would cost me 220$USD (160€). But i would rather wait until root is confirmed.
Code:
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 5971248
Kernel address 0x80208000
Ramdisk size 368957
Ramdisk address 0x82200000
Secondary size 0
Secondary address 0x81100000
Kernel tags address 0x80200100
Flash page size 2048
Board name is ""
Command line "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_RAMDISK_ADDR is 0x02000000
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x80200000 --cmdline 'androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2' -o new_boot.img
---------------
evilracer123 said:
Code:
Command line "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2"
Click to expand...
Click to collapse
maxcpus=2? really? they are disabling two cores?
robclark said:
maxcpus=2? really? they are disabling two cores?
Click to expand...
Click to collapse
no this fix boot problems @ every qcom device
jumoog said:
no this fix boot problems @ every qcom device
Click to expand...
Click to collapse
hmm, power issue (drawing too much current at boot?).. I don't use maxcpus=2 on any of my snapdragon boards (but they are all running off of wall power, like the firetv)

[KERNEL INFO] Solving Kernel boot problems / Blackscreen and Red blinking LED issue

This should go to especially the kernel devs here who does do kernels for our Z5 Premium
It seems Sony messed up something on their kernel so compilation of kernel is kinda more difficult for Z5P than for Z5
With this thread I want to explain what you need to know if you compile a kernel and packing it for the Z5 Premium
At first: The Kernel compilation
For the Z5P you need to use Google's stock Toolchain, I tried with UBERTC4.9 and didn't worked, Linaro isn't tested yet
Link to the Google Toolchain: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
Second: The packing of the kernel
On Z5P you need a special type of mkbootimg or it don't work, this tool is called mkqcdtbootimg
Here you have the already compiled one:
https://github.com/BlackSoulxxx/XerXes/mkqcdtbootimg
Credits to for the tool @BlackSoulxxx
If you want the source of this tool:
https://github.com/sonyxperiadev/mkqcdtbootimg
Then you have to keep attention: Kernel compression doesn't work properly so Image.gz and Image.gz-dtb doesn't work so you have to pack the kernel with the Image file only (Kernel file without any compression)
Then the command to pack the kernel:
Code:
mkqcdtbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 dwc3_msm.prop_chg_detect=Y coherent_pool=2M dwc3_msm.hvdcp_max_current=1500 androidboot.selinux=permissive enforcing=0" --base 0x00000000 --kernel arch/arm64/boot/Image --ramdisk <Path to your Ramdisk> --ramdisk_offset 0x02000000 --pagesize 4096 --dt_dir arch/arm64/boot/dts/qcom/ -o <Output destination path> --tags_offset 0x01E00000
(for making SELinux on enforcing remove androidboot.selinux=permissive enforcing=0 from cmdline)
This is tested on SunKernel made by @zacharias.maladroit (could be helpful for you)
Tested on my Z5P Dual E6833
I hope this can help someone
Your PDesire
PDesire said:
Then the command to pack the kernel:
Code:
mkqcdtbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 dwc3_msm.prop_chg_detect=Y coherent_pool=2M dwc3_msm.hvdcp_max_current=1500 androidboot.selinux=permissive enforcing=0" --base 0x00000000 --kernel arch/arm64/boot/Image --ramdisk <Path to your Ramdisk> --ramdisk_offset 0x02000000 --pagesize 4096 --dt_dir arch/arm64/boot/dts/qcom/ -o <Output destination path> --tags_offset 0x01E00000
Click to expand...
Click to collapse
I'm hoping this will help me because I have been having a non-booting kernel since r24 of 7.0 and r8 of 7.1.1! I also have a question about the Ramdisk since it wasn't exactly explained in the kernel guide Sony gives us. Is this the ramdisk.img from the out folder in the AOSP build?
Also would adding mkqcdtbootimg to the Boardconfig.mk file like it says on the sony github work so I can compile the whole thing in using the:
Code:
make -j#
command in the AOSP build guide? Or should I build the kernel separately?

[Tutorial]Kernel Post Compilation Guide; how to turn kernel into img

There are many great guides online on how to compile a kernel, but they often skimp on the last and most important part, how to get it into a working img. Therefore, without further ado, these are the steps
Prerequisites:
-Linux
-Good-ish command line experience
-Mkbootimg https://github.com/Team-DevElite/mkbootimg-python3
-you will need this https://forum.xda-developers.com/showthread.php?t=2073775
-Python 3
Step 1:
-Extract image kitchen
-Download a working kernel and extract boot image
-Place it into image kitchen's folder
-Type this into the terminal(of course, set permissions first)
Code:
./unpackimg.sh <boot image>
You will now get something similar to this.
Code:
BOARD_KERNEL_CMDLINE androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] coherent_pool=2M enforcing=0
BOARD_KERNEL_BASE 80000000
BOARD_NAME
BOARD_PAGE_SIZE 4096
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02200000
BOARD_SECOND_OFFSET 00f00000
BOARD_TAGS_OFFSET 02000000
SAVE THE OUTPUT INTO A TEXT FILE
Step 2: Getting the Ramdisk
-Go to the folder, split_img
-Copy ramdisk.cpio.gz into a conveinient folder
Step 3:
Now, get the values from Step 1
-Seperate them like this and get rid of whitespace between the \s
Code:
--ramdisk <ramdisk location> \
--cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] coherent_pool=2M enforcing=0" \
--base 0x80000000 \
--pagesize 4096 \
--ramdisk_offset 0x02200000 \
--tags_offset 0x02000000 \
Now Figure out the directory of your compiled kernel
64bit
Code:
arch/arm64/boot/
32bit
Code:
arch/arm/boot
Depending on your kernel, the kernel file will either be image-gz.dtb or zImage.
Either way its the same step.
Next, add this argument to the one we made above
Code:
--kernel <path to kernel output file>
Step 4 FINAL:
-Set the permissons for mkbootimg
-add this argument to the one above
Code:
--output boot.img
Now your arguments list should look something like this
Code:
--kernel <kernel file> \
--ramdisk <ramdisk file> \
--cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected]
coherent_pool=2M enforcing=0" \
--base 0x80000000 \
--pagesize 4096 \
--ramdisk_offset 0x02200000 \
--tags_offset 0x02000000 \
--output boot.img \
-cd into the directory containing mkbootimg
-Now add ./mkbootimg to the front of it and execute!
-Check that it looks something like this
Code:
./mkbootimg \
--kernel <kernel file> \
--ramdisk <ramdisk file> \
--cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] coherent_pool=2M enforcing=0" \
--base 0x80000000 \
--pagesize 4096 \
--ramdisk_offset 0x02200000 \
--tags_offset 0x02000000 \
--output boot.img \
you should now see a boot.img generated
HIT Thanks if I helped
thanks to @osm0sis for his awesome tools!
Thanks for nice and easy guide
Manjot xda said:
There are many great guides online on how to compile a kernel, but they often skimp on the last and most
Thanks for nice and easy guide
Click to expand...
Click to collapse
Thank you, and please don't quote the op, please edit and shorten your post.
Regards
-LLJY
Sry mostly i use other forums there is no rule like don't quote whole op so ignore that post edited. Again nice tutorial
Missed the ramdisk flag while building the new image and my device failed to boot multiple times. Thanks for the detailed guide (pressed the button )!
Can you make a guide video ? And this can not work on Windows ?
shinigami_tsin said:
Can you make a guide video ? And this can not work on Windows ?
Click to expand...
Click to collapse
No to both
I know this is a rather old thread, but I just wanted to say thank you for this. I do a lot of modding and other tricks and hacks on Amazon Fire HD 10 (we were just recently able to unlock them) and it was nice to read a small and straight forward guide without anything being deleted or commented out. As such, I was able to use this method to make a fresh boot.img and it booted the very first time. It's an awesome feeling when that happens, given we often do more unintentional (or intentional) destruction to them.

Packing Boot.img Zenfone 3 ZE520KL

I've success compiling with gcc aarch64 4.9 for my zen3 and after it i'm packing with mkbootimg with command
mkbootimg --kernel Image --ramdisk boot-img.ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000" --base 0x80000000 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --second_offset 0x00f00000 -o new.img , but i've problem when flashing, boot.img not work , device is booting, but bootlop . Whether i'm wrong something ? i'm customing kernel for adding mode monitor . Anyone know how to fix it ? Thanks

How to repack boot.img

Hi.
I have successfully rooted SM-T725 device and installed twrp. After booting in twrp I get boot.img.
Code:
dd if=/dev/block/by-name/boot of=/data/media/0/Download/boot.img
I unpack boot.img with tool from github /osm0sis/pxa-mkbootimg.git with command
Code:
./pxa-unpackbootimg -i boot.img -o out
When I try to pack it again with command
Code:
./pxa-mkbootimg --kernel out/boot.img-zImage --dt out/boot.img-dt --base 0 --pagesize 4096 --board SRPRL03A001 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --second_offset 0x00f00000 --tags_offset 0x00000001 --cmdline "console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=1" --output boot-new.img
it makes file with different size then original boot.img
and after flashing to boot partition, the device boots in download mode with the following error:
"partition vbmeta
Reason vbmeta: Error verifying vbmeta image: O_O_INDIVLDVMT_EDRHS_IMTHSGAUEMSAC"
How can I fix this?
I solved it. I used wrong pxamkbootimg. You need to use mkbootimg, not pxamkbootimg.
I used all parameters that unpackbootimg shows when unpacking boot.img, so the correct command is
Code:
./mkbootimg --kernel out.boot/boot.img-zImage --ramdisk out.boot/boot.img-ramdisk.gz --output boot-new.img \
--board SRPRL03A001 --base 0 --pagesize 4096 --hash sha1 \
--os_version 9.0.0 --os_patch_level 2019-03 --header_version 1 \
--kernel_offset 00008000 --ramdisk_offset 02000000 --second_offset 00f00000 --tags_offset 01e00000 \
--cmdline "console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=1"
Now my boot-new.img is working and tablet boots to android well.
Hi,
I just bought same model and like to know wich method you used.
i don't ask for a comlete guide as i know the amount of time and answer it comes with, but just know i you find a sm-t725 specific way or used a wifi version designed for.
Thx.
LtGarcia said:
Hi,
I just bought same model and like to know wich method you used.
i don't ask for a comlete guide as i know the amount of time and answer it comes with, but just know i you find a sm-t725 specific way or used a wifi version designed for.
Thx.
Click to expand...
Click to collapse
At first I got root, instruction is here https://forum.xda-developers.com/tab-s5e/how-to/galaxy-tab-s5e-sm-t720-root-t3947806
After that I found that twrp is ready and flashed it, but lost root. I think because twrp and magisk lives in recovery now. https://twrp.me/samsung/samsunggalaxytabs5ewifi.html
Then I rooted twrp and flashed it again and now I have my device with twrp and root.
I used twrp for wifi version and it works.
Thanks i rooted yesterday with this post thinking i can use sm-t720 method and you just confirmed me i can use sm-t720 twrp (for sm-t725) too. I will try to do same as you did. My final challenge will be to find a way to change my TVV csc into XEF as this tablet seems to be regionnaly locked.
Thanks again for your help.

Categories

Resources