GUIDE: Extract vendor from stock firmware - Sony Xperia XZ Premium Guides, News, & Discussion

Hello guys, Here I bring a guide for setting up stock dump folder, which could be used to extract propietary from stock firmware.
**IMPORTANT!! THIS GUIDE IS TARGET TO MAPLE WHICH DOESN'T HAVE SEPARATE VENDOR PARTITION
For XZ1/XZ1C and all newer phones which comes with Android 8+ need to unsin, mount & copy vendor at same time.
OK, let's start
1.Download the latest stock firmware by using [TOOL] XperiFirm ~ Xperia Firmware Downloader [v5.4.0]
2. UnSin System and Kernel sin files from stock firmware.
Code:
./path/to/unsin /path/to/Kernel*.sin
./path/to/unsin /path/to/System*sin
Then you will get Kernel image and System ext4 file. In case your UnSin doesn't have execute permission, run chmod +x /path/to/unsin
3.Unpack the Kernel image by using AIK Android Image Kitchen
/path/to/AIK-Linux/unpackimg.sh /path/to/kernel*.img
You will get a ramdisk folder for your stock dump, which would be the root of your dump folder.
4.Change the ramdisk folder owner to yourself
chown -R $USER:$USER ramdisk
5, Mount the System image on somewhere, (e.g. /mnt/system) and change its owner to yourself
Code:
sudo mkdir /mnt/system
sudo mount -o loop /path/to/system*.ext4 /mnt/system/
sudo chown -R $USER:$USER /mnt/system
6, Copy system to your ramdisk folder
cp -r /mnt/system/* /path/to/ramdisk/system/
Then you are ready to extract vendor from stock now, just run the extract script in your device tree and you're all done:
/path/to/extract-files.sh /path/to/ramdisk
ENJOY!!!
Give me like if it helped to you

Related

How to change boot splash image ..

Hello folks, I am using the tytung r9 kernel with Hyperdroid GBX 12 and I want change the default splash image of the kernel. I have already converted the image to .rle thanks to this guide, and I been told I have to unpack the initird, place it on the root of the initrd and pack it back, problem is I don't know how to do it.
Can anyone help me to unpack an pack back the initrd??? Also I couldn't find it on the phone.. Where exactly is it located ???
Thanks
Ok, all the credits goes to @Curious_ from #htc-linux-chat on irc who has kindly helped me to sort this out, and now I want to share it with everyone.
In order to replace the logo.rle image with the one we made we have to mount the /boot partition, so lets begin
Code:
mkdir /data/boot/
mount -t yaffs2 /dev/block/mtdblock2 /data/boot/
now that the /boot partition is mounted we want to pull the initrd.gz file into ur pc
Code:
adb pull /boot/data/initrd.gz /path/to/dir/
now we'r gonna extract the initrd file from initrd.gz and unpack it
Code:
gunzip initrd.gz
cpio -i < initrd
now replace the logo.rle file with our one and lets repack it
Code:
find . | cpio -o -H newc | gzip > initrd.gz
Ok, last step is to push the new initrd.gz file into /data/boot and reboot the phone
Code:
adb push /wherever/it/is/initrd.gz /data/boot/
reboot
Enjoy
In addition here you can find lots of splash screens specifically made for the HD2. Those are not specifically boot splash screen, but you can convert the image to .rle using too565 tool.
Hope you guys will be making lots of custom boot splash screens

[Dev][2.3][Fixed] How to remove stock apps that stored in cust.img?

I installed 2.3 to my phone.
The cust.img contain a lot of unneeded apks. (The cust.img is a disk image file.)
How to extract cust.img and delete a file in that?
The cust.img mounted to /cust folder as "read only" by init.rc (init.rc automatically generated on boot)
ufukyayla said:
i installed 2.3 to my phone.
The cust.img contain a lot of unneeded apk.
How to extract cust.img and delete a file in that?
The cust.img mounted to /cust folder as as read only by init.rc (init.rc automatically generated on boot)
Click to expand...
Click to collapse
Is cust.img or cust_data.img? See on /cust_backup/image/cust...
This is cust.img in image folder. (When pink screen mode)
ufukyayla said:
This is cust.img in image folder. (When pink screen mode)
Click to expand...
Click to collapse
I never change or delete anything on that place (when pink screen mode). I make all on /cust_backup/image/recovery.img or /cust... don't remember all.
Is from here that at each restarting or rebooting is loaded the bootloader (pink screen).
I deleted in this place all Carrier data /cust_backup/image/cust... something.
But take care, that /image/ is backed also on ROM Backups. If you delete the /cust... like I made, and if one day you made a ROM Restore made before, the /cust... return to same place. You must delete this after each ROM Restore.
For all restores I have, I made: Rom Restore-> delete /cust... (carrier data) -> new Rom backup.
..................................
EDIT: I made all this because I'm rooted and whit Root Explorer.
I dont want to delete cust.img.
The cust.img is a disk image file.
I want to delete a file in disk image that contained in cust.img.
The cust.img mounted to /cust folder as read only on boot.
i delete all boot files.
I delete all of boot files in this folder.When i open phone i faced blue screen. can someone zip all files in this folder and upload for me. Otherwise i have to send my phone to technical service.
I fixed it.
I deleted all unneeded apks (stock apps) that stored in cust.img
My method;
1. On Slitaz Linux 3.0
2. Open terminal
3. Copy cust.img from phone to /home folder
4. mkdir tmp
5. mount cust.img /home/tmp
6. cd /home/tmp/hw/default/app
7. Delete apk files what you don't want
8. umount tmp
9. Copy cust.img from /home folder to phone
It is for who don't have linux;
http://www.multiupload.com/EKPGJ7EUGO
This is "cleared" cust.img. That contains only these apks;
BeyondTheSkyTheme.apk
Calendar.apk
CalendarProvider.apk
DeskClock.apk
ToolBox.apk
modify init.rc
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup ro wait
mount ext3 [email protected]_backup/image/cust.img /cust ro
to
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup rw wait
mount ext3 [email protected]_backup/image/cust.img /cust rw
then you could delete any files in cust.img..(/cust in phone)
genokolar said:
modify init.rc
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup ro wait
mount ext3 [email protected]_backup/image/cust.img /cust ro
to
Code:
mount vfat /dev/block/mmcblk0p1 /.cust_backup rw wait
mount ext3 [email protected]_backup/image/cust.img /cust rw
then you could delete any files in cust.img..(/cust in phone)
Click to expand...
Click to collapse
The init.rc automatically generating on boot.
Changes lost when you reboot your phone.
The init.rc is in your boot.img, which you could edit with a tool like abootimg, but you'd need Linux to modify that, anyway.
qwerty12 said:
The init.rc is in your boot.img, which you could edit with a tool like abootimg, but you'd need Linux to modify that, anyway.
Click to expand...
Click to collapse
But, it is very hard to do.
abootimg -x boot.img
rename initrd.img to initrd.gz
gunzip initrd.gz
extract initrc using cpio
edit init.rc
recompess
regzip
update bootimg
...
...
etc. etc.
do you know easy way?
ufukyayla said:
But, it is very hard to do.
abootimg -x boot.img
rename initrd.img to initrd.gz
gunzip initrd.gz
extract initrc using cpio
edit init.rc
recompess
regzip
update bootimg
...
...
etc. etc.
do you know easy way?
Click to expand...
Click to collapse
Combine the commands together; create scripts or add aliases to your .bashrc
Do "abootimg -x boot.img && mkdir newramdisk && cd newramdisk && zcat ../initrd.img | cpio -i --no-absolute-filenames" and you're in the folder with the extracted initrd.
When you're done editing, run "find . -print | cpio -o -H newc | gzip -n -9 > ../initrd.img" followed by "cd .. ; abootimg -u boot.img -r initrd.img" and you're done
thanks a lot. i'll try this.
Is there any other way without Linux to remove a .apk from cust.img?
Yes, look at the page 1
I deleted app, but size boot.img has not changed. How to reduce size boot.img?
Moved To General​
As the OP contains no development, as such this does not belong here​

Howto root tf300 jelly bean

I think I've found a way to root tf300. I'm sorry but it does require unlook. It works for me.
Short story: update asus blob with su.
Warning: Do not update to jelly bean from official asus updates unless you want to lost the option to restore. Set up nvflash first!
Warning #2: Do not unlock! I have to find a knew way.
For those who have made the same mistake as I (installing jelly bean) here is a guide to root.
Requirements: Windows with fastboot / Linux if you can run fastboot and a lot of time
Tools (I haven't found an official qemu.exe and it's tricky to compile that):
-blobunpack and blobupdate
-qemu emulator with a minimalistic linux (bzimage initramfs) where android su is on /root
-fastboot
-official asus firmware blob (asus website)
For windows users:
Unzip all to a directory. Unzip blob twice.
Get blob.APP:
Code:
blobunpack blob APP
Now start Linux:
Code:
qemu -kernel bzImage -initrd initramfs -hda blob.APP
After booting you are in a Linux shell. Run:
Code:
mkdir /mnt
mount -t ext4 /dev/sda /mnt
cp su /mnt/xbin/su
umount /mnt
Close it and run:
Code:
blobupdate blob APP blob.APP
You can transfer the file in fastboot mode:
Code:
fastboot flash system blob
For Linux these steps are much simplier and you don't need qemu:
Code:
$ make
$ chmod 6755 su
$ ./blobunpack blob APP
$ mkdir mnt
$ su
# mount -t ext4 blob.APP mnt
# cp su mnt/xbin/su
# umount mnt
# exit
$ rmdir mnt
$ ./blobupdate blob APP blob.APP
You can download su binary from http://forum.xda-developers.com/showthread.php?t=1704209 and http://db.tt/FBUNeVmo . I don't know if you can run fastboot.
Does the tf300 require a unlocked bootloader?
xSvenHD said:
Does the tf300 require a unlocked bootloader?
Click to expand...
Click to collapse
please read the 1st line of the thread.
Sorry i was reading it fast.
Is this brick free?
Sorry for my bad English Sent From My TF300
Can anyone confirm this?
And does it stay root or do you need an app for su?
grlks said:
Code:
qemu -kernel bzImage -initrd initrd -hda blob.APP
Click to expand...
Click to collapse
This command is not working.Qemu doesn`t start.Maybe wrong linux kernel or some parameters.
UPD:initrd is missing.Only initramfs.
UPD2:Seems like included Linux is corrupted.Can`t get it to work.
UPD3:The whole instruction is a trolling.I can`t mount blob.APP.And string "-hda blob.APP" doesn`t have any sense,because u need a bootable linux image to run qemu,otherwise it will show only bios.And when i `ve booted,i can`t mount blob.app.
OP is a ******.Need another instructions.I have lost 4 hours.
grlks said:
Code:
blobunpack blob APP
Know start Linux:
Code:
qemu -kernel bzImage -initrd initrd -hda blob.APP
After booting you are in a Linux shell. Run:
Code:
mount -t ext4 /dev/sda /mnt
cp su /mnt/xbin/su
poweroff
If it has shuted down update blob:
Code:
blobupdate blob APP blob.APP
You can transfer the file in fastboot mode:
Code:
fastboot flash system blob
Click to expand...
Click to collapse
What I have to do to get updated blob file (I don't have with me the Asus' wire to test the fastoot (last command)) :
Code:
qemu -kernel bzImage -initrd [COLOR="Red"]initramfs[/COLOR] -hda blob.APP
After booting you are in a Linux shell. Run:
Code:
[COLOR="Red"]mkdir /mnt
[/COLOR]mount -t ext4 /dev/sda /mnt
cp [COLOR="Red"]/[/COLOR]su /mnt/xbin/su
[COLOR="Red"]umount /mnt[/COLOR]
poweroff
The poweroff command above didn't work, I kill the quemu proccess after umount /mnt .
If it has shuted down update blob:
Code:
blobupdate blob APP blob.APP
I will try fastboot this afternoon or tomorow.
xSvenHD said:
Sorry i was reading it fast.
Is this brick free?
Click to expand...
Click to collapse
If you downloaded the correct blob file from asus.
It does not require extra tools on android (it will replace any custom recovery with the original SOS / recovery partition).
MantusRus said:
This command is not working.Qemu doesn`t start.Maybe wrong linux kernel or some parameters.
UPD:initrd is missing.Only initramfs.
UPD2:Seems like included Linux is corrupted.Can`t get it to work.
UPD3:The whole instruction is a trolling.I can`t mount blob.APP.And string "-hda blob.APP" doesn`t have any sense,because u need a bootable linux image to run qemu,otherwise it will show only bios.And when i `ve booted,i can`t mount blob.app.
OP is a ******.Need another instructions.I have lost 4 hours.
Click to expand...
Click to collapse
The bootable Linux image is bzImage and initramfs. Sorry for wasting your time.
grlks said:
I think I've found a way to root tf300. There is no unlook required. It works for me.
Short story: update asus blob with su.
Warning: Do not update to jelly bean from official asus updates unless you want to lost the option to restore. Set up nvflash first!
For those who have made the same mistake as I (installing jelly bean) here is a guide to root.
Requirements: Windows with fastboot / Linux if you can run fastboot and a lot of time
Tools (I haven't found an official qemu.exe and it's tricky to compile that):
-blobunpack and blobupdate
-qemu emulator with a minimalistic linux (bzimage initramfs) where android su is on /root
-fastboot
-official asus firmware blob (asus website)
Unzip all to a directory. Unzip blob twice.
Get blob.APP:
Code:
blobunpack blob APP
Now start Linux:
Code:
qemu -kernel bzImage -initrd initramfs -hda blob.APP
After booting you are in a Linux shell. Run:
Code:
mkdir /mnt
mount -t ext4 /dev/sda /mnt
cp su /mnt/xbin/su
umount /mnt
Close it and run:
Code:
blobupdate blob APP blob.APP
You can transfer the file in fastboot mode:
Code:
fastboot flash system blob
For Linux these steps are much simplier:
Code:
$ chmod 6755 su
$ ./blobunpack blob APP
$ mkdir mnt
$ su
# mount -t ext4 blob.APP mnt
# cp su mnt/xbin/su
# umount mnt
$ rmdir mnt
$ ./blobupdate blob APP blob.APP
You can download su binary from http://forum.xda-developers.com/showthread.php?t=1704209 and http://db.tt/FBUNeVmo . I don't know if you can run fastboot.
Click to expand...
Click to collapse
Hello!
Which qemu are you using?
I installed the package from the official fedora repos, I don't have "qemu" alone and "qemu-arm" was not exactly working with the arguments you gave us..
Thanks for the help
edit:
Here an exception thrown when trying to run qemu-system-arm,
I don't know if the problem comes from a wrong usage of the command or if something went wron in the blob unpack...
qemu-system-arm -kernel bzImage -initrd initramfs -hda blob.APP
qemu: fatal: Trying to execute code outside RAM or ROM at 0xff91c756
R00=00000000 R01=00000113 R02=00000100 R03=00000000
R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00010010 R15=ff91c756
PSR=400001f3 -Z-- T svc32
Click to expand...
Click to collapse
aachour said:
Hello!
Which qemu are you using?
I installed the package from the official fedora repos, I don't have "qemu" alone and "qemu-arm" was not exactly working with the arguments you gave us..
Thanks for the help
Click to expand...
Click to collapse
qemu-system-i386 but for linux see the buttom. Linux can mount blob.APP if it has loopback support. You just need qemu for windows.
grlks said:
qemu-system-i386 but for linux see the buttom. Linux can mount blob.APP if it has loopback support. You just need qemu for windows.
Click to expand...
Click to collapse
Hej!
Thanks a lot
I thought you had to emulate an arm cpu to run the image.
Thanks again!
Any idea how to mount the tablet in linux while in fastboot mode?
I set the rule :
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0b05", MODE="0666", OWNER="aachour"
in /etc/udev/rules.d/51-android.rules
but this doesn't seem to change anyhing, fastboot wait for the device
I've been searching but didn't find any different rule...
thanks!
The most interesting question-how to fastboot it wit the locked bootloader?It`s "waiting for device" for me.
MantusRus said:
The most interesting question-how to fastboot it wit the locked bootloader?It`s "waiting for device" for me.
Click to expand...
Click to collapse
You have to install the drivers for tf300.
grlks said:
Code:
fastboot flash system blob
Click to expand...
Click to collapse
Fastboot returns :
Code:
writing 'system'.... failed (remote: (InvalidState))
Apparently due to the locked bootloader.
If someone got an idea ?
RaS_KoR said:
Fastboot returns :
Code:
writing 'system'.... failed (remote: (InvalidState))
Apparently due to the locked bootloader.
If someone got an idea ?
Click to expand...
Click to collapse
Same here.I think it`s a dead end.
Problems with locked bootloader
I was wrong. You can't flash with fastboot on locked bootloaders. I am sorry for all those testing it. I will fix it!
grlks said:
I was wrong. You can't flash with fastboot on locked bootloaders. I am sorry for all those testing it. I will fix it!
Click to expand...
Click to collapse
Yeah, that would be awesome
Thanks for all your efforts!
Does it is possible to re-zip the modified blob into the original Asus's zip and install it with a Sd card ?

<Making Progress> Compile 2013 Nexus 7 – Flash to device – Stuck a Google boot screen

<Making Progress> Compile 2013 Nexus 7 – Flash to device – Stuck a Google boot screen
I am using the following device: 2013 Nexus 7
Android version: 4.3
Kernel version: [email protected]__ #1
Build number: JSS15Q
The problem:
When I try to flash a new boot.img file that contains my own recompiled kernel I am unable to boot the system – it sticks at the Google boot screen (and does not make it to the color X screen)
Below I have detailed out the steps I have taken. Please take a look and tell me if you notice if I am doing something wrong.
The following step were taken while running Ubuntu 12.04 LTS
*******************************************************************************************
Unlocking the 2013 Nexus 7 (Flo=wifi)
Rooting the 2013 Nexus 7 (Flo=wifi)
*** Compile/Recompile the kernel ***
*** Create a new boot.img file ***
….. contains instructions for getting root access
*** Flashing a new boot.img file ***
*******************************************************************************************
Unlocking the 2013 Nexus 7 (Flo=wifi)
Open a terminal and make sure that your system can see the Nexus 7, run:
$ ./adb devices
If you see the Nexus 7, run:
$. /adb reboot bootloader
When the bootloader screen has reappeared, run:
$ sudo ./fastboot devices
-If you can see the Nexus 7, run:
$ sudo ./fastboot oem unlock
-Look at the Nexus 7, a screen should appear asking you if you want to “Unlock the bootloader” – choose Yes.
You will need to use volume up/down to choose a response and press the power button to select.
- The device will flash a new image and exit to prompt
Next, reboot the device:
$ sudo ./fastboot reboot
The device is now unlocked.
*******************************************************************************************
Rooting the 2013 Nexus 7 (Flo=wifi)
*** Compile/Recompile the kernel ***
In the following steps you will be compiling/recompileing a kernel for the Nexus 7.
*Make sure that libncurses5-dev is installed (needed for make menuconfig)
Starting out I am at the following location
[email protected]:/home/user $
In your home directory create a folder named “Razor_Flo”:
$ mkdir Razor_Flo
Move into the new folder:
$ cd Razor_Flo
You should be here – [email protected]:/home/user/Razor_Flo $
In the Razor_Flo directory, create a sub directory named “Kernel”:
$ mkdir Kernel
Move into the new folder:
$ cd Kernel
You should be here – [email protected]:/home/user/Razor_Flo/Kernel $
[----------------- For the next steps, I used the following website to determine what files I needed -----------------]
__http__://source.android.com/source/building-kernels.html
Figuring out which kernel to build
[----------------------------------------------------------------------------------------------------------------------------------------------]
In the Kernel folder, download the following files:
$ git clone __https__://android.googlesource.com/device/asus/flo-kernel
$ cd flo-kernel
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/flo-kernel $
$ git log --max-count=1 kernel
-- Log information will be displayed, under the “flo: prebuilt kernel” you will see a set of numbers and letters that will look like 365a6e0, note that number for future use.
Back out of the flo-kernel folder
$ cd ..
You should be here – [email protected]:/home/user/Razor_Flo/Kernel $
Once you are in the Kernel folder, download the following files:
$ git clone __https__://android.googlesource.com/kernel/msm.git
-- This command will create an msm directory
Move into the msm folder
$ cd msm
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/msm $
[---------------------- For the next step, I used the following website to acquire the files I needed --------------------]
__http__://source.android.com/source/building-kernels.html
On a linux host, if you don't have an Android source tree, you can download the prebuilt toolchain from:
$ git clone __https__://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
[-----------------------------------------------------------------------------------------------------------------------------------------------]
Export the path to the prebuilt gcc files
$ export PATH=$PATH: <link to files>
Additional exports
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
Checkout the correct kernel files
$ git checkout 365a6e0 <-- the number you noted above
Make the Kernel
$ make flo_defconfig
* At this point you can use “make menuconfig” to make any changes to the .config file you need (i.e. kernel modifications)
$ make
* When the make is complete a file named zImage will be created here:
.../arch/arm/boot/zImage <-- Note this, you will need the file later
The kernel compile/recompile is now complete
*** Create a new boot.img file ***
In the following steps you will be taking apart the “Factory boot.img” so that you can create a “Modified boot.img” which will contain your modified and rooted kernel.
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/msm $
Move up two directories
$ cd ../../
You should be here – [email protected]:/home/user/Razor_Flo $
[------------------------------------------------------- Tools need for next step -------------------------------------------------------]
You will need to download the following files.
-- split_bootimg.pl
__http__://code.google.com/p/zen-droid/downloads/detail?name=split_bootimg.pl
-- mkbootimg
__http__://code.google.com/p/zen-droid/downloads/detail?name=mkbootimg
-- 2013 Nexus Factory Images
__https__://dl.google.com/dl/android/aosp/razor-jss15q-factory-4f77b811.tgz
* You will need to copy this file to a unique location so that you can extract the “boot.img” that is located with it.
[------------------------------------------------------------------------------------------------------------------------------------------------]
Create a new folder named Workspace
$ mkdir Workspace
Enter the Workspace directory
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Make two new folders in this directory
$ mkdir Original
$ mkdir Hacked
Move into the Hacked folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
Create a new folders named Hacked_ramdisk
$ mkdir Hacked_ramdisk
Move up two directories – to the Workspace folder
$ cd ../../
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Copy the 2013 Nexus 7 factory boot.img file into the ..Workspace/Original folder
-- can be found within the factory tgz file:
Copy the split_bootimg.pl file to the ..Workspace/Original folder
Copy the mkbootimg file to the ..Workspace/Hacked folder
Move the zIamge file to the ..Workspace/Hacked folder
Move to the Hacked folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
Rename the zImage file to boot.img-kernel
Move up one directory - to the Workspace folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Move to the Original folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Original $
Run the following command:
$ ./split_bootimg.pl boot.img
This will create two files, copy the boot.img-kernel and boot.img-ramdisk.gz
Copy the boot.img-ramdisk.gz file to the “Hacked/Hacked_ramdisk” folder
Move to the Hacked/Hacked_ramdisk folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked/Hacked_ramdisk $
Run the following command:
$ sudo gzip -cd boot.img-ramdisk.gz | cpio -i
This will extract all the files with in the boot.img-ramdisk.gz file.
Delete the original boot.img-ramdisk.gz file that you just extracted the files from.
Edit the default.prop file
change ro.secure=1 to ro.secure=0
change ro.adb.secure=1 to ro.adb.secure=0
Save changes and close the file.
Run the following command :
$ find .| cpio -o -H newc | gzip > insecure_boot.img-ramdisk.gz
This will create a new file named insecure_boot.img-ramdisk.gz.
Rename the insecure_boot.img-ramdisk.gz. file to boot.img-ramdisk.gz and copy it up one folder in the hierarchy to the “Hacked” folder.
Move up one directory - ../Workspace/Hacked
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
List the files in the ../Workspace/Hacked directory, there should be three files:
(1) boot.img-kernel, (2) boot.img-ramdisk.gz, & (3) mkbootimg
Run the following command from within the “Hacked” folder
$ ./mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz -o mynewimage.img
Rename mynewimage.img to boot.img and flash on the device.
The new boot image is now complete and ready to flash.
*** Flashing a new boot.img file ***
[------------------------------------------------------- Tools need for next step -------------------------------------------------------]
You will need to download the following file.
-- 2013 Nexus Factory Images
__https__://dl.google.com/dl/android/aosp/razor-jss15q-factory-4f77b811.tgz
* You will need to copy this file to a unique location so that you can extract the “system.img” file that is located with it.
--- Android SDK (I used the 64-bit version)
__http__://dl.google.com/android/android-sdk_r22.0.5-linux.tgz
[------------------------------------------------------------------------------------------------------------------------------------------------]
You will need to use both the adb and fastboot utilites that come in the Android SDK application.
You will need two image to complete this task
1. boot.img <--file you just created, located in the ../Workspace/Hacked directory
2. system.img <-- can be found within the factory tgz file:
Starting out I am at the following location
[email protected]:/home/user/android-sdk/platform-tools $
Place both the boot.img and system.img files into the same folder as the adb and fastboot utilites.
Verify that you can see the Nexus 7 device that you are about to flash
$ sudo ./adb devices
*if you cannot see the device, make sure that you have checked the “enable USB Debugging” in the developer options.
Run the following commands
$ sudo ./adb reboot bootloader
$ sudo ./fastboot flash boot boot.img
$ sudo ./fastboot flash system system.img
$ sudo ./fastboot format cache
$ sudo ./fastboot format userdata
$ sudo ./fastboot restart
At this point the system should be unlocked and rooted.
Bump - still looking for help
Post your zImage.
Sent from my Nexus 4 using Tapatalk 4
Here is the zImage I created
Here is the zImage that I created.
I have rename it to chad.img
Thanks
jassycliq said:
Post your zImage.
Sent from my Nexus 4 using Tapatalk 4
Click to expand...
Click to collapse
Hi All
I am still looking for feedback - if anyone has any.
Thanks
Chad
Chady said:
Hi All
I am still looking for feedback - if anyone has any.
Thanks
Chad
Click to expand...
Click to collapse
I used this and I got it working:
http://source.android.com/source/initializing.html
I created the msm directory inside the flo-kernel directory as a place to put the kernel source. I don't know if that is right, or if it even matters, but it works for me. Then I had to move the zImage to out/product/target/flo/kernel before doing the make on the framework. Don't forget to do the "source build/envsetup.sh" and "lunch" before making the framework. Before compiling the kernel, be sure to set ARCH, SUBARCH and CROSS_COMPILE environment variables and make sure your PATH includes the prebuilt cross-compiler.
Making headway
Ok, So I made some headway lastnight.
I have not figured out how to compile the kernel on my own however, I am able to compile and boot an AOSP image for the 2013 Nexus 7
My problem getting the image to boot once compiled centered around drivers. I was under the impression that Android would work like Linux and Windows... meaning that if you did not have device drivers installed the OS would still boot - I was wrong. After installing the drivers (via the provided install .sh files) I then compiled the OS, flashed the device, and the system boot.
Now I am off to figure out how to get a custom kernel running.
Chad
for the benifit of others
Chady said:
Ok, So I made some headway lastnight.
I have not figured out how to compile the kernel on my own however, I am able to compile and boot an AOSP image for the 2013 Nexus 7
My problem getting the image to boot once compiled centered around drivers. I was under the impression that Android would work like Linux and Windows... meaning that if you did not have device drivers installed the OS would still boot - I was wrong. After installing the drivers (via the provided install .sh files) I then compiled the OS, flashed the device, and the system boot.
Now I am off to figure out how to get a custom kernel running.
Chad
Click to expand...
Click to collapse
For the benefit of others who might look at this forum in the future.
This is what is required to be done.
source.android.com/source/building-devices.html#obtaining-proprietary-binaries
I faced the same problem and took time to figure out what it really meant.
Also if it is in an infinite loop after the above procedure. Try doing fastboot flashall -w
-w option did the magic for me when I was stuck in an infinite loop after the above procedure.

Help Needed Modifying System Image

Hello XDA, I was attempting to do some experimentation with what I could do on the device via modifying init.rc files and the like. Rather than building and flashing a custom ROM for each run which is time consuming I thought I could just mess with the existing system images.
What I was hoping would work:
1. Download the October 007 (patch) stock binaries from Google
2. Extract the flame_xxxxx.zip image file
3. Convert the sparse system image file to a raw image file
- $ simg2img system.img system.raw
4. Mount the ext2 filesystem to a loopback device
- $ mount -o loop -t ext2 system.raw temp_dir
5. Edit the init file (e.g. init.rc) and save it
6. Unmount the ext2 filesystem
7. Create sparse system image
- Still don't quite know how to do this
8. Flash the sparse image from fastboot
- $ fastboot flash system system.img
So my question to the community at large is, is this track of work even logically correct. If so, how does one do it?
I have been trying to run these steps against image-flame-qd1a.190821.007.zip
My machine is running Ubuntu 19.10
For example Step 4 (mounting the ext2 system is failing for me)
Code:
$ losetup --list
....
/dev/loop8 0 0 1 1 /path/system.raw 0 512
....
$ sudo mount /dev/loop8 sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Also not working for Step 4
Code:
$ file system.raw
system.raw: Linux rev 1.0 ext2 filesystem data, UUID=4729639d-b5f2-5cc1-a120-9ac5f788683c (extents) (large files) (huge files)
$ sudo mount -o loop -t ext2 system.raw sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Thanks for the help.
I have since built my own AOSP build and have the same issue in that I can't mount the resulting system.img file from the AOSP build either.
Not sure if that matters or not, but I found it odd.

Categories

Resources