Hy !
i am beginner in rom cooking. I compile with succes Android from Google and ran good in emulator. After that i try to compile Cyanogenmod for my smartphone (jfltexx - Galaxy S4).
Compile with no problems so i try to understand how i can flash my phone and i found Archikitchen.
After somes trys (at the first time i don't understand what is /dev/block/ and where find /boot), finally i have my zip.
Of course, i flash it and it's no working (obviously it would be not funny isn't it ?). My phone start on kernel, display Galaxy S4 logo, after few seconds reboot on recovery mode.
I made a second zip after compile again (make clean, repo sync, source build/envsetup breakfast jfltexx, make -j8) and not working again (compile good but problem with my second zip).
At this point i want to understand how it is works. use Archikitchen is easy but i don't understand process to make a zip. In my folder (~/cyanogen/out/target/product/jfltexx/), i have :
- boot.img
- kernel
- ramdisk.img
-ramdisk-recovery.img
- recovery.img
- system.img
- userdata.img
I don't know exactly how android boots but i know it looks kernel and ramdisk in /boot and after it mounts /system and /data.
I use dd to flash my new recovery from phylz touch to TWRP and i want to do the same thing with my files (system.img to /system, userdata.img /data etc ...) but i think it's not a good idea because i don't know how use boot.img and ramdisk.img to make /boot.
So many questions for a noob, apologize if they are already a thread for all, i didn't found it.
Thx a lot.
Related
Hi to all,
I have a question about this three file :
zImage - initramfs.cpio.gz - openaos-gingerbread-XXX.img.gz
I Know that initramfs.cpio.gz it' useful only to set up the environment (set up filesystem and various exucutable) to boot correctly the zImage (Kernel Android).
So when I flash the device and then I choose the boot from Developer Edition , the device use the initramfs.cpio.gz and the zImage used in flash procedure.
But why i need to copy openaos-gingerbread-XXX.img.gz in the root of the directory?
what is this image file? what's' your role?
thanks so muck
It contains the whole OS,so gingerbread is in there.
Or what did you think where GB is coming from!?
It's right... sorry for my stupid question. I don't know why... but I thought that the OS was the same
thanks a lot...
Hello,
I tried to do a simple task which raise several problem and it start to drive me crazy, so here I am, asking for help. The subject may have been already mentioned, but can't find an issue with the galaxy s3.
I work with ubuntu 12.04 and Odin on win7. My GS3 has XXELL4 baseband, and 3.0.31-742798 kernel version.
I need to load and run a custom module (let's say a "hello world" one for begin) on the galaxy S3.
I compiled it through a Makefile with the toolchain from the ndk package (
Code:
path_to_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
and the source code from the samsung web site (GT-I9300_JB_Opensource_Update8.zip).
Obviously, when i tried to insmod my module, I've got some compatibility error like
Code:
Exec format error
.
The fact is that the kernel from website is not the same as the phone one.
So I tried to put the kernel from the website on the phone
I compiled it with the same toolchain and I received a zImage file in result. But what to do with this file ? I extracted a boot.img from the phone with Odin and split it (with perl script stuff) to use the extracted files with my compiled zImage for reconstruct a new boot.img. But since fastboot is not available on GS3 (or I miss something) I can't simply
Code:
$ fastboot flash boot boot.img
, and need to use Odin again. So I replace the boot.img from odin's backup folder on my PC with my boot.img. But the nandroid.md5 file raise an error. Am I doing it wrong or too complicated ? If I can correct the md5 error, is that my module will work ?
I also tried to compil my module directly with the kernel from the phone but didn't manage to extract the kernel files to do it. Stuck with a boot.img. Same with the stock kernel from http://forum.xda-developers.com/showthread.php?t=1646610
I made a lot of research but don't find any concrete solutions to my simple task. Maybe I miss something or looking too deep.
Is there a more simple way to run a custom module on the GS3 ?
sorry for my english
Hello and welcome to xda!
You do not have to use odin to flash your kernel, you can do it via custom recovery too.
Just get an simple cwm package of another kernel for s3 and replace the boot.img in the zip.
I attached a simple empty cwm package, just drag your boot.img to the root of the zip with winrar or something.
hsrars-d said:
Hello and welcome to xda!
You do not have to use odin to flash your kernel, you can do it via custom recovery too.
Just get an simple cwm package of another kernel for s3 and replace the boot.img in the zip.
I attached a simple empty cwm package, just drag your boot.img to the root of the zip with winrar or something.
Click to expand...
Click to collapse
Thanks
I've got also a md5 error when i tried to restore with cwm, since I have no md5 file in my folder. Do I need to generate one ? how ?
EDIT: so a generate a md5 file with md5sum, but still have the Exec format error when i try to insmod my module.
ok, im not good with kernel stuff/modules so i cant help you any further...
try to find someone that has experience with kernel modules
edit: found something with google, not exactly for s3 but the error is pretty common:
http://www.linuxquestions.org/questions/linux-kernel-70/insmod-error-version-magic-4175424366/
http://forum.xda-developers.com/showthread.php?t=444338&page=1
http://stackoverflow.com/questions/...for-android-unknown-relocation-27-when-insmod
Why are you posting in this section?
Glebun said:
Why are you posting in this section?
Click to expand...
Click to collapse
well ... I don't yet have access to other section. But If someone could move the thread in a more appropriate one I'll thanks him.
Yes, you do. Questions go in the Q&A section, obviously
I used Cm 13 sources to build a bootimage for my device and everything compiled without any serious error, but i got a very large boot image 8 megabytes. I tried flashing it via TWRP but it constantly gave me error saying bootimage too large for the device.
I also forced flash the bootimage that resulted into a bricked any help would be great
My device is Samsung vibrant
Now im currently compiling the entire rom
try
http://k.japko.eu/boot-img-manipulation.html
or
Okay, first off, let me tell you I'm not at all familiar with your device...so, instead of specifically answering your questions (which would be dangerous/irresponsible of me to have you do something for which I cannot be sure of or vouch since I don't have experience with your device), I'll try to give you some general information (it does seem like you have a good grasp of many of the concepts for getting where you want to go, so maybe I can just fill-in some gaps ).
1. Regarding renaming initlogo.rle to initlogo.rle.old: I'm not sure that doing that will change the splash screen or break something when it goes to look for the initlogo.rle file (a special image file). As you've probably researched, these files are a bit odd and are not just simple image files we're all used to dealing with. I've never successfully been able to create a new initlogo.rle file on my previous attempts a few years back.
2. When you re-pack a bootable image file (boot.img or recovery.img), you need:
- re-pack the updated ramdisk to a new ramdisk.gz file
- rebuild the .img file using mkbootimg utility, specifying the kernel file and the updated ramdisk.gz file
- it's might also be important / necessary to specify the base boot address using the --base <address> parameters when issuing the mkbootimg command where <address> is the base boot address of your device; your bootable image split/unpacking utility should tell you what it sees that the base address is; here is the information I saw when I unpacked the boot.img file that you supplied in your first post:
[email protected] ~/boot-img-split-tools/ameen
$ ../split_boot.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 9600396 (0x00927d8c)
Ramdisk size: 1313051 (0x0014091b)
Second size: 0 (0x00000000)
Board name:
Command line: 'console=ttyS0,115200 rw init=/init loglevel=5'
Base address: (0x40000000)
Writing boot/boot.img-kernel ... complete.
Writing boot/boot.img-ramdisk.cpio.gz ... complete.
Unpacking ramdisk... complete.
[email protected] ~/boot-img-split-tools/ameen
- not having properly set the base boot address might explain why your device didn't boot
- not properly re-packing the ramdisk might explain why your device didn't boot
- not properly rebuilding the bootable image (using the mkbootimg utility)
3. I kind of understand what you were trying to do by changing the the .md5 file...I'm guessing that you calculated a new MD5 sum of the new boot.img file thinking that would help CWM restore it; that probably doesn't matter unless you've got the MD5/checksum verification enabled; asking/using CWM to restore / install your boot.img is an interesting and non-traditional way of doing that
4. Is the CWM custom recovery specifically built for your device? I did a quick search for it and couldn't find anything. You do indeed need a custom recovery that is built specifically for your device and it's hardware & partition / filesystem layouts and sizes. Just want to make sure that you were aware of that...using the "wrong" custom recovery might be "problematic" (bad).
Edit: I think I might have found which one you used? http://forum.xda-developers.com/showthread.php?t=2189640
5. If you had previously booted into custom recovery on your "broken" device, you still should be able to re-flash or re-launch the custom recovery in the same way that you originally did, yes? The boot and recovery partitions should be separate--so, if you only messed with the boot partition, then you should be okay--unless you've got an incompatible custom recovery that overwrote important things (like your recovery partition...).
I hope that helps...I know I didn't touch on all of your questions...that's probably enough for this post and for what follow-up questions you might have .
Cheers!
source
http://androidforums.com/threads/help-with-boot-img.963358/
I dont have much knowledge about building bootimage but while i was compiling the bootimage i got an error saying no rule to make busybox flash image. So i just copied those file from kernel sources to the out directoru i dont know if that was the problem. Also i had tried using omni 6 sources a few days back i got the right bootimage size but none of my bootimages would bootup my device. Everytime id flash the omni bootimages i got a buggy twrp recovery(faded colors, unreadable text and bootloops. Also regarding the recovery you mentioned there were some dev that built omni lollipop for my device i used TWRP 2.8 to flash all the bootimages
Good morning. I'm trying to build the kernel for the M4 aqua, but although sony didn't include it in the guides for doing so, I can see the files inside the tulip in sony's github repository. Then, I guess that it's possible to build a kernel from sony's sources. If anyone did so, could please post and briefly describe the steps? More concretely, the line with the arguments for mkbootimg (or the necessary tool). Thanks in advance
alguien24 said:
Good morning. I'm trying to build the kernel for the M4 aqua, but although sony didn't include it in the guides for doing so, I can see the files inside the tulip in sony's github repository. Then, I guess that it's possible to build a kernel from sony's sources. If anyone did so, could please post and briefly describe the steps? More concretely, the line with the arguments for mkbootimg (or the necessary tool). Thanks in advance
Click to expand...
Click to collapse
You can use the same instruction as How to build AOSP Marshmallow for unlocked Xperia devices to download the source.
attached is the sony.xml file you can use to limit to download only tulip builds.
then you can use the follow in commands
$# cd android
android $# export CROSS_COMPILE=/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
add the full path to the above CROSS_COMPILE=/mnt/../../../android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
android $# cd kernel/sony/msm/
android/kernel/sony/msm $# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE aosp_kanuti_tulip_defconfig
android/kernel/sony/msm $# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j1
if make is successful, copy the kernel from arch\arm64\boot folder and past into device/sony/common-kernel
and build your full aosp or only boot.img with android$# make -j1 bootimage
RohitBopnna said:
You can use the same instruction as How to build AOSP Marshmallow for unlocked Xperia devices to download the source.
attached is the sony.xml file you can use to limit to download only tulip builds.
then you can use the follow in commands
$# cd android
android $# export CROSS_COMPILE=/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
add the full path to the above CROSS_COMPILE=/mnt/../../../android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
android $# cd kernel/sony/msm/
android/kernel/sony/msm $# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE aosp_kanuti_tulip_defconfig
android/kernel/sony/msm $# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j1
if make is successful, copy the kernel from arch\arm64\boot folder and past into device/sony/common-kernel
and build your full aosp or only boot.img with android$# make -j1 bootimage
Click to expand...
Click to collapse
Thanks a lot for the answer! Today, I had my computer setup with everything needed, with sony's guide. I've only made one modification. Inside the kanuti folder (~/android/device/sony/kanuti/rootdir) there's a file called fstab.kanuti. I changed the /data mountpoint to the second partition in the sdcard (in order to get more internal space, if I make it work someday I will post it inmediately ).Then, after carefully following the steps you gave me, I finally got the boot.img. Flashed it with fastboot flash boot boot.img, but when I powered the phone on, after half a second it shut down. Tried more than once with the same result. I flashed again the original kernel, and it came back to live with no more problems. Do you (or anyone) know where the problem could be? I also saw that the boot.img file weighs 9 MB, while the original kernel.elf extracted from the ftf takes 20 MB of space. Is this usual?
alguien24 said:
Thanks a lot for the answer! Today, I had my computer setup with everything needed, with sony's guide. I've only made one modification. Inside the kanuti folder (~/android/device/sony/kanuti/rootdir) there's a file called fstab.kanuti. I changed the /data mountpoint to the second partition in the sdcard (in order to get more internal space, if I make it work someday I will post it inmediately ).Then, after carefully following the steps you gave me, I finally got the boot.img. Flashed it with fastboot flash boot boot.img, but when I powered the phone on, after half a second it shut down. Tried more than once with the same result. I flashed again the original kernel, and it came back to live with no more problems. Do you (or anyone) know where the problem could be? I also saw that the boot.img file weighs 9 MB, while the original kernel.elf extracted from the ftf takes 20 MB of space. Is this usual?
Click to expand...
Click to collapse
the latest kernel that sony has implemented image.gz-dtb is a compressed kernel with the DTB combined, and this needs bootloader level gzip feature to unzip the kernel and load, which is not present today in our bootloaders. After building your kernel, Use the uncompressed kernel (image file and dtb) to build your boot image with old way, you may have to make changes in you boot build to indicate uncompressed kernel.
RohitBopnna said:
the latest kernel that sony has implemented image.gz-dtb is a compressed kernel with the DTB combined, and this needs bootloader level gzip feature to unzip the kernel and load, which is not present today in our bootloaders. After building your kernel, Use the uncompressed kernel (image file and dtb) to build your boot image with old way, you may have to make changes in you boot build to indicate uncompressed kernel.
Click to expand...
Click to collapse
I'm not really experienced in building kernels, I'm trying to learn a bit with this stuff I'm doing... And this phone hasn't got a lot of information yet. Could you please tell me what you mean with building it the old way?
LOL
You are in the stock rom, aren't you?
So, why would you try building an aosp kernel (which is f**ked up) in your stock rom?
You have to build from kernel-copyleft
There is also a tutorial from sony developer world
http://developer.sonymobile.com/kno...h-a-linux-kernel-from-sony-copyleft-archives/
I think you have to find the right defconfig and change arm to arm64 and aarch64 when necessary
RohitBopnna said:
the latest kernel that sony has implemented image.gz-dtb is a compressed kernel with the DTB combined, and this needs bootloader level gzip feature to unzip the kernel and load, which is not present today in our bootloaders. After building your kernel, Use the uncompressed kernel (image file and dtb) to build your boot image with old way, you may have to make changes in you boot build to indicate uncompressed kernel.
Click to expand...
Click to collapse
Now I got what you explained me. I've been looking for information, and I thought that after running make, the dtb file should be in the boot folder, but there I can only find the image file. How can I create the dtb file separately from the dts?
dani020110 said:
LOL
You are in the stock rom, aren't you?
So, why would you try building an aosp kernel (which is f**ked up) in your stock rom?
You have to build from kernel-copyleft
There is also a tutorial from sony developer world
http://developer.sonymobile.com/kno...h-a-linux-kernel-from-sony-copyleft-archives/
I think you have to find the right defconfig and change arm to arm64 and aarch64 when necessary
Click to expand...
Click to collapse
Now I'm not in stock, I've flashed the AOSP rom available in this post: http://forum.xda-developers.com/m4-aqua/development/5-0-aosgp-based-stock-t3262330. So that shouldn't be a problem, right?
aosgp?? a stock rom with aosp style dude,,base on stock not a real aosp
Sent from my E2353 using XDA-Developers mobile app
Well, as the title sugests, I've tried to root my phone (Samsung Galaxy J1 SM-J100MU) and failed. Since no twrp or any other custom recovery is made for my specific model, I tried the method that involves mounting the android systems and modifying the famous build.prop, or putting su binaries inside the /system folder.
I ran an unpack script from ubuntu to decompress the boot file, and simg2img to be able to mount /system following some guides I've found, and made use of mkbootimg to repack it and flash it.
The thing is that the phone won't boot because the modified boot image size differs from the original. The system also differs but Odin won't even flash it and I'll have to reflash the stock rom.
Any ideas about what it can happen? I get no apparently errors during the process of unpacking/repacking the images so I don't know. The only thing I can think of is that the unpack script says something like "There's an extra file in ramdisk; though this file can exist, the script is not made for this type of ramdisk", so I edited the script in order to skip this warning, and everything else went well. The bootimg got unpacked and then the ramdisk and then I modified default.prop.
Well, that's it, I hope you can understand and give me some help in order to proceed.
Thank you in advance.