[HOW TO] Extract DTS from running OS - Android

Build dtc (Device Tree Compiler) from AOSP (external/dtc/)
- Get Android sources (AOSP., LineageOS, OmniRom or whatever you want)
- Modify external/dtc/Android.mk
- Replace
Code:
include $(BUILD_HOST_EXECUTABLE)
with
Code:
include $(BUILD_EXECUTABLE)
- . build/envsetup.sh && lunch aosp_yourdevice-userdebug
- mka dtc
Run dtc on your device
- Root your device
- Remount system
- push dtc binary to /system/bin/
Code:
adb root
adb shell
Code:
setenforce 0
dtc -I fs -O dts -o /sdcard/extracted.dts /proc/device-tree
exit
Code:
adb pull /sdcard/extracted.dts
Open extracted.dts with your favourite text editor.
Attached dtc binaries:
dtc.zip - Android P
dtc-n.zip - Android N

Related

CM10 maguro build fails on kernel?

If you get the error: selected processor does not support ARM mode `smc #0' when trying to compile kernel on OS X, please go to the scripts folder in the kernel source tree and change in Kbuild.include from:
Code:
/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
to:
Code:
printf "%s\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))

[Tutorial]Buliding Firefox os form sources

I NEED TO COREST SOME LINES SO PLZ DO USE IT STILL
For buliding Firefox os you need UNLOCKER BOOTlODER,andorid-sdk,linux ubuntu 12.04 64bit,for now only Arc and Ray are suported
Code:
$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g+ + g+ +-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make
also you need java jdk 6
Preparing source
To download as shown below source (depending on the environment, but it takes about 30 minutes to 1 hour).
Code:
$ Mkdir ~ / b2g_work
$ cd ~ / b2g_work
$ export B2G_WORK = `pwd`
(When you build the arc for you)
$ export DEVICE = anzu
(When you build for the ray)
$ export DEVICE = urushi
$ git clone https://github.com/neuralassembly/B2JC.git B2G
$ cd B2G
The following if you want to build a Firefox OS normal,
Code:
./config.sh
Chose your phone
Code:
./config.sh (device name)
(Arc is sc02, Ray is sc03)
When the download is finished, it is placed in the source tree dump-ray or Xperia arc of / system directory, but will sometimes use the file of pre-built CyanogenMod9 here.
Code:
$ mkdir $ B2G_WORK/B2G/backup- $ DEVICE
$ cd $ B2G_WORK/B2G/backup- $ DEVICE
If (arc, and place here to download the cm-9.1.0-anzu.zip from http://download.cyanogenmod.com/?device=anzu,
If the ray, and place here to download the cm-9.1.0-urushi.zip from http://download.cyanogenmod.com/?device=urushi)
$ unzip cm-9.1.0-$ DEVICE.zip
$ cd $ B2G_WORK/B2G/device/semc / $ DEVICE /
$. / Extract-files.sh
By the operation of the above, the following will be created.
(In the case of arc) $ B2G_WORK/B2G/vendor/semc/anzu /
(In the case of ray) $ B2G_WORK/B2G/vendor/semc/urushi /
[Optional]if you using japanise xperia ray you can use this to slove sensor problems.
Code:
cd $ B2G_WORK/B2G/vendor/semc/urushi/proprietary/etc /
$ wget https://dl.dropboxusercontent.com/u/69652790/patch/b2g-urushi-sensors-conf.patch
$ patch <b2g-urushi-sensors-conf.patch
[Optional]if you want japanise lang
Code:
$ cd $ B2G_WORK
(Arranged by downloading from the http://sourceforge.jp/projects/naist-jdic/releases/ naist-jdic-0.4.3.tar.gz)
$ tar zxvf naist-jdic-0.4.3.tar.gz
$ cd $ B2G_WORK/B2G/gaia/apps/keyboard/js/imes/jskanji/dict
$ mkdir ipadic
$ cp $ B2G_WORK/naist-jdic-0.4.3/naist-jdic.dic ipadic /
(This fails by the value of the environment variable LANG. It is sufficient to set ja_JP.utf8 This instruction) $ make json
some addons for fixing some bugs
Code:
$ cd $ B2G_WORK/B2G/gaia/build
$ wget https://dl.dropboxusercontent.com/u/69652790/patch/b2g-webapp-zip.patch
$ patch <b2g-webapp-zip.patch
[CODE$ Cd $ B2G_WORK/B2G/gecko/hal/gonk /
$ Wget https://dl.dropboxusercontent.com/u/69652790/patch/b2g-GonkHal.patch
$ Patch <b2g-GonkHal.patch][/CODE]
Make the environment variable settings
Code:
$ Export LOCALE_BASEDIR = $ B2G_WORK/B2G/multilocale/gaia-l10n
$ Export LOCALES_FILE = $ B2G_WORK/B2G/multilocale/languages-japan.json
$ Export PATH = "$ PATH: $ B2G_WORK/B2G/multilocale/compare-locales/scripts"
$ Export PYTHONPATH = "$ B2G_WORK/B2G/multilocale/compare-locales/lib"
$ Export MOZILLA_OFFICIAL = 1
$ Export GAIA_DEV_PIXELS_PER_PX = 2
Building the kernel
Code:
$ cd $ B2G_WORK
$ git clone https://github.com/CyanogenMod/semc-kernel-msm7x30-b ics
$ cd semc-kernel-msm7x30
$ export ARCH = arm
$ export CROSS_COMPILE = $ B2G_WORK/B2G/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
$ make cyanogen_ $ DEVICE_defconfig
$ make-j16
$ cp `find drivers net-name" *. Ko "` $ B2G_WORK/B2G/device/semc / $ DEVICE /
$ cp arch / arm / boot / zImage $ B2G_WORK/B2G/device/semc / $ DEVICE / kernel
Compile source
Code:
cd B2G_WORK/B2G
./build.sh otapackage
Build is complete,
If out / target / product / anzu / full_anzu-ota-eng.username.zip of arc
If out / target / product / urushi / full_urushi-ota-eng.username.zip-ray
Because we can, and burn it.
In advance, so that you can connect with adb and fastboot to the terminal, please be sure that you install the driver.
First, you may want to place the SD card the zip file that you can try build.
In addition, it should remove the boot.img from the zip file in advance, and place it on the PC.
Then turn off the terminal, hold down the menu in the case of arc,
You will need to connect it to a USB port on the PC while holding down the volume up key in the case of ray.
Enter the fastboot mode, arc is the LED next to the USB port, around the home button should glow in blue ray. There
Code:
Fastboot flash boot boot.img
Run and burn the boot.img. Then, I will restart with the following command.
Code:
Fastboot reboot
In a state where the visible logo of Free Xperia Project, arc is battered the menu button,
ray will roll the volume down key. Both, LED home key surrounding lights and success,
I enter the CWM recovery.
In CWM recovery, after running the wipe data / factory reset,
from install zip from sdcard, please burn the zip file you created.
will add soon Work/not list
Tnanks to:
Code:
[URL="https://github.com/neuralassembly?tab=repositories"]neuralassembly GitHub[/URL]
[URL="https://github.com/sola-dolphin1"]Sola GitHub[/URL]
[user=359497]@FXP[/user]
original guide
link
Video how it work on Arc(Anzu )and Ray(urushi)
http://youtu.be/Ghv4wsj8Q4U
n1kolaa said:
If (arc, and place here to download the cm-9.1.0-anzu.zip from http://download.cyanogenmod.com/?device=anzu,
If the ray, and place here to download the cm-9.1.0-urushi.zip from http://download.cyanogenmod.com/?device=urushi)
$ unzip cm-9.1.0-$ DEVICE.zip
$ cd $ B2G_WORK/B2G/device/semc / $ DEVICE /
$. / Extract-files.sh[/CODE]
By the operation of the above, the following will be created.
(In the case of arc) $ B2G_WORK/B2G/vendor/semc/anzu /
(In the case of ray) $ B2G_WORK/B2G/vendor/semc/urushi /
Code:
[/QUOTE]
better to use fxp nightly build rather than cm stable branch
Click to expand...
Click to collapse
can you do this for anzu ? i've tried a few days ago from neuralassembly guide , but i didn't manage to compile it
TakisBeskos said:
can you do this for anzu ? i've tried a few days ago from neuralassembly guide , but i didn't manage to compile it
Click to expand...
Click to collapse
i allready done it for anzu will done it for all phones soon as soon fix it fully for anzu look at android development
GOOD JOB !
Good job, hope you fly high with it. When you done, you wiil make history
And what about coconut?
Idea for Dual-boot option [Android and B2G]
I am not an expert kernel developer but :
We know that B2G requires only to modify ramdisk in Kernel right? [init.b2g.rc and init.rc]
an0nym0us_' MESA Hybrid kernel can change ramdisk based on some criterias:
Code:
# android ramdisk, decision to load which ramdisk is based on relevant string in build.prop and availability of semc framework
ICS="ro.build.version.sdk=15"
JB="ro.build.version.sdk=16"
JB2="ro.build.version.sdk=17"
if busybox [ -e /system/build.prop ];
then
if busybox grep -qs $ICS /system/build.prop
then
if busybox [ -e /system/framework/semcrilextension.jar ];
then
load_image=/sbin/ramdisk-stock.cpio.lzma
else
load_image=/sbin/ramdisk-cm9.cpio.lzma
fi;
fi;
if busybox grep -qs $JB /system/build.prop
then
load_image=/sbin/ramdisk-cm10.cpio.lzma
fi;
if busybox grep -qs $JB2 /system/build.prop
then
load_image=/sbin/ramdisk-cm10.1.cpio.lzma
fi;
fi;
In system.img for Firefox OS we only have B2G folder and some specific files right?:silly:
Then comes the Idea :
If we leave the entire Android system files and we make a CWM Flashable zip with all B2G specific files and another one with android files that are replaced(like usr, fonts folders etc.) we can change the OS without losing any data .(theoretically :laugh: )
And every Zip will include the right Build.prop to help kernel decide what OS to boot
Also i think that data files from B2G will not fight with files from Android :silly: They will ignore each other right? :fingers-crossed:
Steps will be like that :
==Flash Hybrid Kernel==
==Flash Full Android==
Boot Android,installing apps,games doing whatever you want then when you get bored :
-Boot into recovery flash the B2G Flashable zip
Boot into Firefox OS,play some HTML5 games,make pictures,anything you can then when you get bored :
-Get back in CWM flash the Android Flashable zip and start over again .
I know that my idea may be stupid but i really like to find a "viking method" to problems )
danutzgtx480 said:
I am not an expert kernel developer but :
We know that B2G requires only to modify ramdisk in Kernel right? [init.b2g.rc and init.rc]
an0nym0us_' MESA Hybrid kernel can change ramdisk based on some criterias:
Code:
# android ramdisk, decision to load which ramdisk is based on relevant string in build.prop and availability of semc framework
ICS="ro.build.version.sdk=15"
JB="ro.build.version.sdk=16"
JB2="ro.build.version.sdk=17"
if busybox [ -e /system/build.prop ];
then
if busybox grep -qs $ICS /system/build.prop
then
if busybox [ -e /system/framework/semcrilextension.jar ];
then
load_image=/sbin/ramdisk-stock.cpio.lzma
else
load_image=/sbin/ramdisk-cm9.cpio.lzma
fi;
fi;
if busybox grep -qs $JB /system/build.prop
then
load_image=/sbin/ramdisk-cm10.cpio.lzma
fi;
if busybox grep -qs $JB2 /system/build.prop
then
load_image=/sbin/ramdisk-cm10.1.cpio.lzma
fi;
fi;
In system.img for Firefox OS we only have B2G folder and some specific files right?:silly:
Then comes the Idea :
If we leave the entire Android system files and we make a CWM Flashable zip with all B2G specific files and another one with android files that are replaced(like usr, fonts folders etc.) we can change the OS without losing any data .(theoretically :laugh: )
And every Zip will include the right Build.prop to help kernel decide what OS to boot
Also i think that data files from B2G will not fight with files from Android :silly: They will ignore each other right? :fingers-crossed:
Steps will be like that :
==Flash Hybrid Kernel==
==Flash Full Android==
Boot Android,installing apps,games doing whatever you want then when you get bored :
-Boot into recovery flash the B2G Flashable zip
Boot into Firefox OS,play some HTML5 games,make pictures,anything you can then when you get bored :
-Get back in CWM flash the Android Flashable zip and start over again .
I know that my idea may be stupid but i really like to find a "viking method" to problems )
Click to expand...
Click to collapse
you can dowload my kernel then unpuck it with kernel kitchen and look inside ramdisk,then make same changes for your phone and recompile kernel
coolancool said:
And what about coconut?
Click to expand...
Click to collapse
i'm going to try this with coconut,may be we can use this at that step
http://download.cyanogenmod.com/get/jenkins/7071/cm-9.1.0-coconut.zip
yup i need to update theard
Sent from my Xperia Arc S using xda app-developers app
a thought
@n1kolaa if i use your sources of firefox os and use device tree of cynogenmod (FXP) as base then will it able to run on 2011 mdpi ex . mini Pro ..?
cause devices have same processor and ram what say ...?:fingers-crossed:
Mr-Universal said:
@n1kolaa if i use your sources of firefox os and use device tree of cynogenmod (FXP) as base then will it able to run on 2011 mdpi ex . mini Pro ..?
cause devices have same processor and ram what say ...?:fingers-crossed:
Click to expand...
Click to collapse
it will be no problem to macke it for all xperia 2011 but for now i cant compile it coz some error it fail
help needed please
n1kolaa said:
it will be no problem to macke it for all xperia 2011 but for now i cant compile it coz some error it fail
Click to expand...
Click to collapse
@n1kolaa bro can u help me in compiling it please :fingers-crossed:
i have forked repos .. can anyone help me in making sources ready for MDPI's ..
https://github.com/officiallysonyrebel here are sources
Mr-Universal said:
@n1kolaa bro can u help me in compiling it please :fingers-crossed:
i have forked repos .. can anyone help me in making sources ready for MDPI's ..
https://github.com/officiallysonyrebel here are sources
Click to expand...
Click to collapse
i will done on my sorces for mdpi as soon i have time
n1kolaa said:
i will done on my sorces for mdpi as soon i have time
Click to expand...
Click to collapse
great
n1kolaa said:
i will done on my sorces for mdpi as soon i have time
Click to expand...
Click to collapse
@n1kolaa bro working on sources ..??
Mr-Universal said:
@n1kolaa bro working on sources ..??
Click to expand...
Click to collapse
i have no time im soo tired,season for american football will start in september so i must train to be ready for season
sory i cant find time for fixin sources,maybe in avgust,i have twice a day to train its so hard for me im sory
Hello everyone.I want to build firefox os but I am noob.So my question is how difficult is to build firefox os for lww.I have built only stock based kernels so I don't know if it's difficult.And how much time the build will take in my pc with a Intel Core 2 Duo 2.5 Dual Core,3GB RAM,and 200GB 7200rpm hdd.And I have Ubuntu 13.04 32-bit

CrossCompile bsdiff

I want compile bsdiff for android but i have some issue.
- I have download bsdiff source from here http://www.daemonology.net/bsdiff/bsdiff-4.3.tar.gz
- I use this command to compile under Ubuntu
Code:
arm-linux-gnueabi-cpp bsdiff.c -o bsdiff -lbz2
and
Code:
arm-linux-gnueabi-cpp -static -march=armv7 bsdiff.c -o bsdiff -lbz2
but the result file is a text and not a binary, the shell does not output errors.
Thanks
avoid using `arm-*-linux-gnueabi-` or `arm-linux-gnueabi-` related toolchain with default sysroot they will for shared library even after adding `-static` flag to it as your are targeting for `armv7` you can use linaro toolchain they works well for android
anyway correct way for doing this is
HTML:
arm-none-linux-gnueabi-gcc -static -march=armv7 bsdiff.c -o bsdiff -lbz2

General Guide for building TWRP

TWRP for a12s
=============
Mod Edit: TG link removed.
git config --global user.email "your email"
git config --global user.name "your name"
Basic Device Tree
==================
mkdir TWRP
cd TWRP
git init
git clone https://github.com/twrpdtgen/twrpdtgen
pip3 install twrpdtgen
sudo apt install cpio
copy stock recovery.img to ~/TWRP/twrpdtgen
cd twrpdtgen
python3 -m twrpdtgen recovery.img
rename ~/TWRP/twrpdtgen/output/samsung/a12s/omni_a12s.mk to twrp_a12s.mk
delete vendorsetup.sh
Make a copy of recovery.fstab and rename to twrp.flags
Move both files recovery.fstab and twrp.flags to recovery/root/system/etc
(create these folders)
open twrp_a12s.mk and
1. delete the 3 lines below # Inherit from those products, Most specific first.
replace those 3 lines with this
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
2. delete $(call inherit-product, vendor/omni/config/gsm.mk)
3. change omni to twrp (2 places)
open AndroidProducts.mk
change omni to twrp (4 spots)
Optional Extras
==================
To add extra options to recovery you can add theses lines to
boardconfig.mk
• # remove TrueType fonts
• TW_DISABLE_TTF:= true
• # exclude mtp from twrp (disable if you are not able to fix it device/kernel side, saves some space)
• TW_EXCLUDE_MTP := true
• # screen will stay awake
• TW_NO_SCREEN_TIMEOUT := true
• # needed on devices without a recovery partition (some devices have recovery included in boot.img)
• TW_HAS_NO_RECOVERY_PARTITION := true
• # removes the reboot option to boot into bootloader, needed e.g. on samsung devices which use Download mode instead
• TW_NO_REBOOT_BOOTLOADER := true
• # add an option in reboot menu to reboot into Download Mode
• TW_HAS_DOWNLOAD_MODE := true
• # some devices don't have a temp sensor, disable in such case to stop spamming recovery.log
• TW_NO_CPU_TEMP := true
• # recursive delete by default instead fotmatting (available optional inside recovery settings too)
• TW_ALWAYS_RMRF := true
• # system won't be unmounted,
• TW_NEVER_UNMOUNT_SYSTEM := true
• # don't blank screen (available optional inside recovery settings too)
• TW_NO_SCREEN_BLANK := true
• # ToyBox (disables busybox?)
• TW_USE_TOOLBOX := true
• # include f2fs support (make sure your kernel supports f2fs!)
• TARGET_USERIMAGES_USE_F2FS := true
• TW_DEVICE_VERSION : = Your Nikname or else
Establish Android Building Environment
=======================================
cd ~
sudo apt install git aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sudo bash setup/install_android_sdk.sh
• Make a directory called ~/a12s-twrp
cd ~/a12s-twrp
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j4
copy ~/TWRP/twrpdtgen/output/samsung to /a12s-twrp/device
Building
========
. build/envsetup.sh
lunch twrp_a12s-eng
mka recoveryimage –j4
Recovery.img at out/Samsung/a12s/...img
Note: This LastPart Failed For Me For Lack Of RAM In My VB
To Add Things To Your Twrp, You Can Find Them On Experienced Dev's Githubs.
For Example
topser9 - Overview
Kernels for Exynos 7884B | 7904 | 9610 | 9611. topser9 has 16 repositories available. Follow their code on GitHub.
github.com
mohammad92 - Overview
mohammad92 has 172 repositories available. Follow their code on GitHub.
github.com
crazo7924 - Overview
Android developer. crazo7924 has 47 repositories available. Follow their code on GitHub.
github.com
Hello! Even though this tutorial is for a specific device (I think, please correct me if i"m wrong), will this work for basically any device? And will this work for devices running Android 11 and 12?
SM-A032F / DS

Ramdisk changes not reflected on Android filesystem

Hey all,
I am learning how Android works and am trying to figure out how I can update the Android filesystem by extracting a ramdisk from normal boot.img, adding some files, then flashing it back. So far, I have been unsuccessful in doing this and am hoping to figure out why. Here's the steps below I have taken:
Using a Google Pixel 4a, Android 11, kernel v 4.14 (i.e. not GKI)
High level:
Extract ramdisk.cpio from boot.img using magiskboot via adb on device, modify extract contents, sent back up to magiskboot, repackaged, then flashed via fastboot.
Detailed steps:
Grab ramdisk.cpio
Code:
$ # obtain the ramdisk.cpio from magiskboot
$ adb -d shell "cd ${BOOT_IMG_PATH}; ./magiskboot unpack boot.img"
$ adb -d pull /${BOOT_IMG_PATH}/ramdisk.cpio /tmp/
$ # attempt to modify the filesystem
$ mkdir /tmp/rd && cd rd
$ cpio -i < /tmp/ramdisk.cpio
$ touch yolo
$ echo "why doest this work" > system/wtf.txt
$ echo "why doest this work" > sys/wtf.txt
$ echo "why doest this work" > vendor/wtf.txt
#patch this directory back up and send to magiskboot
$ find . | cpio -oH new > /tmp/new.ramdisk.cpio
$ adb -d push /tmp/new.ramdisk.cpio ${BOOT_IMG_PATH}/ramdisk.cpio
$ adb -d shell "cd ${BOOT_IMG_PATH}; ./magiskboot repack boot.img
$ adb -d pull /${BOOT_IMG_PATH}/new-boot.img /tmp/
# apply this modifyied boot.img
$ adb reboot bootloader
fastboot flash boot /tmp/new-boot.img
fastboot reboot
After doing this, I'll adb back in to verify:
Code:
adb -d shell "find / -name "wtf.txt" 2>/dev/null
# silence.... always silence... no file change
* I am aware that Wu modifies the extracted dtb file from boot.img with a "magiskboot dtb dtb patch" command but that doesn't seem to apply to my particular boot.img as the fstab doesn't seem to be around
* I am aware that vbmeta and codesigning, I have disabled vbmeta via fastboot
* I am aware that there's A/B slots for flashing. I have tried flashing both slots to make sure the updated ramdisk is seen
* I am aware of magiskboot's kernel patch from skip_initramfs -> want_initramfs. I could use some clarification on this if it pertains to my problem
* My Android device uses "mount method C" from Wu's great writeup https://github.com/topjohnwu/Magisk/blob/master/docs/boot.md. That is, it's init's job to mount everything on my device. I guess I feel confused as to why init wouldn't mount the additional files that I've added to the ramdisk
Extremely grateful for help or guidance on what I've overlooked. Thanks y'all
You should probably examine your modified boot file to see if the new stuff is in there.
I don't use your tools or even deal with cpio as a file type.
Code:
C:\>echo Hello > sbin\bogus
C:\>imgutil /i boot.img sbin/bogus
C:\>imgutil /l boot.img
...
sbin/bogus
...

Categories

Resources