Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,479 Members 47,982 Now Online
XDA Developers Android and Mobile Development Forum

[DEV][TOOL][F2FS/EXT4]Agnostic-kernel - Partition-agnostic kernel flasher[12/05/14]

Tip us?
 
frantisek.nesveda
Old
(Last edited by frantisek.nesveda; 13th May 2014 at 03:25 PM.) Reason: New testing info
#1  
Senior Member - OP
Thanks Meter 103
Posts: 129
Join Date: Jan 2012
Prompt [DEV][TOOL][F2FS/EXT4]Agnostic-kernel - Partition-agnostic kernel flasher[12/05/14]

Agnostic-kernel - partition independent kernel flasher

WARNING!
This tool is experimental and may not work on your ROM/partition layout/kernel. Please, make a backup or be prepared to roll back to a working state somehow. You are using this tool on your own responsibility. You have been warned!
If anything goes wrong, flashing another kernel that was working for you before should return your device to a working state.
I will remove this warning once the tool is properly tested.


This is a recovery tool primarily made for kernel/ROM developers, but anyone is welcome to use it, provided he knows what to do. It was made to enable kernel developers to have a single .zip with the kernel which will work on all partition layouts like All-F2FS, Data-F2FS and All-EXT4 (the standard layout).
It takes a boot.img, unpacks it during the installation, finds out what partition layout is used on the device, changes the fstab in the ramdisk accordingly, repacks the boot.img and flashes it.


Instructions for kernel/ROM developers/flashaholics who wish to incorporate this tool:
0. Make sure your kernel is compiled with F2FS drivers.
1. Download agnostic-kernel-template.zip
2. Change the boot.img in the .zip to your boot.img.
3. OPTIONAL: change the fstab files in fstab/ folder to fstabs you wish to use.
4. OPTIONAL: change the updater-script to print any additional messages or make modifications to the kernel after flashing.

Instructions for users who wish to try this tool:
1. Choose one of the prepacked kernels you wish to install and download it.
2. Install it via recovery.

Currently supported partition layouts:
  • All-EXT4 (original) - /system, /cache, /data on EXT4
  • Data-F2FS - /system, /cache on EXT4, /data on F2FS
  • All-F2FS - /system, /cache, /data on F2FS
It supports only these layouts because I am not aware of any other widely used ones. If you want to add support for some other layout, feel free to do so or contact me.

Tested on:
KernelsRecoveries
Downloads
Pre-packed kernels:
Kernel from SlimROM by @legolas93
3.2.5-XPerience-18 by @TeamMex

Empty template for devs:
agnostic-kernel-template.zip

Credits:
If you wish to incorporate or modify this tool, please, mention me somewhere, thanks
The Following 31 Users Say Thank You to frantisek.nesveda For This Useful Post: [ Click to Expand ]
 
frantisek.nesveda
Old
(Last edited by frantisek.nesveda; 13th May 2014 at 03:29 PM.) Reason: Adding changelog.
#2  
Senior Member - OP
Thanks Meter 103
Posts: 129
Join Date: Jan 2012
Changes:

13 May 2014
  • Fixed an issue with the zip which could arise when /system was not mounted before the install.
  • Tested on a lot of recoveries and partition layouts.
12 May 2014
  • Initial release.
The Following 5 Users Say Thank You to frantisek.nesveda For This Useful Post: [ Click to Expand ]
 
aosp
Old
#3  
aosp's Avatar
Recognized Developer
Thanks Meter 4475
Posts: 1,902
Join Date: Aug 2010

 
DONATE TO ME
Add settings to enable/disable f2fs forcing mode so we can switch on …
…the fly. Force will force all wipe/format calls to use f2fs or ext4 depending on the selection. Also added code to ensure settings are re-written back to internal sd after a super wipe. Also removed fstab code to determine the mode since we now have a setting for it

http://goo.gl/NTamfl

Add code to analyze the fstab to determine whether we are in f2fs mod…
…e or ext4 mode

http://goo.gl/MJXQpE
The Following User Says Thank You to aosp For This Useful Post: [ Click to Expand ]
 
frantisek.nesveda
Old
#4  
Senior Member - OP
Thanks Meter 103
Posts: 129
Join Date: Jan 2012
Quote:
Originally Posted by aosp View Post
Add settings to enable/disable f2fs forcing mode so we can switch on …
…the fly. Force will force all wipe/format calls to use f2fs or ext4 depending on the selection. Also added code to ensure settings are re-written back to internal sd after a super wipe. Also removed fstab code to determine the mode since we now have a setting for it

http://goo.gl/NTamfl

Add code to analyze the fstab to determine whether we are in f2fs mod…
…e or ext4 mode

http://goo.gl/MJXQpE
If I'm not mistaken, this is a code in a custom recovery that enables the user to select if he wants to format his partitions as F2FS or EXT4, similar to what the MultiROM recovery does after yesterday's update?

If so, I don't see the connection that your code has with my tool... My tool is a template for a recovery zip, in which kernel devs can place their boot.img, and when the user installs that zip with the boot.img, the script in that zip will check for which partitions does the user have formatted as F2FS and modify the fstab in the boot.img accordingly.
 
frantisek.nesveda
Old
#5  
Senior Member - OP
Thanks Meter 103
Posts: 129
Join Date: Jan 2012
Updated all the zips with a bugfix. The Android Image Kitchen would not start on CWM when /system was not mounted, because it tried to use sh in /system/bin instead of /sbin.

Also, I tested the zips on more partition layouts and recoveries, and verified that it works right both on CWM and TWRP and on ALL-F2FS, Data-F2FS and ALL-EXT4.
The Following User Says Thank You to frantisek.nesveda For This Useful Post: [ Click to Expand ]
 
TeamMex
Old
#6  
TeamMex's Avatar
Recognized Contributor
Thanks Meter 2466
Posts: 1,476
Join Date: Dec 2011
Location: Michoacán de Ocampo - México

 
DONATE TO ME
awesome work


My roms
Xperience™ | Xperience Walkman™ mod | FROYExp™ | SEMC Debrand Engine
Miui Pikachu edition™ | Xpe hibrid music | Mokee OS|Crema de nieve™ ICS | XpeOS
My github:https://github.com/Klozz some of all
https://github.com/XPerience-montblanc <--Xperia Go,P,U
https://github.com/NexPerience/ <--Nexus 7
My devices:XPERIA™ X8-XPeria U-XPERIA TIPO XPERIA GO - Nexus 7- iPhone 4- Moto G
The Following 2 Users Say Thank You to TeamMex For This Useful Post: [ Click to Expand ]
 
chaostrodamis
Old
#7  
chaostrodamis's Avatar
Senior Member
Thanks Meter 12
Posts: 183
Join Date: Mar 2010
How do we convert if we only have a zimage and no boot.img

Sent from my Nexus 7 using Tapatalk
 
frantisek.nesveda
Old
#8  
Senior Member - OP
Thanks Meter 103
Posts: 129
Join Date: Jan 2012
Quote:
Originally Posted by chaostrodamis View Post
How do we convert if we only have a zimage and no boot.img
The changes are all done to the ramdisk, so you can't do them without one, at least not with this method.
But, if you look how @sgt. meow does it in his Oxydo kernel, perhaps that is the way you could use. He unpacks the ramdisk from the currently installed kernel and then packs it with his zImage to a boot.img which he then flashes. This requires that the user first flashes another kernel with f2fs working, and then flashes your kernel.

Perhaps it would be easier if you packed your kernel with some ramdisk and then used it.
My work on XDA:
Agnostic kernel - filesystem agnostic kernel flasher

The Following 4 Users Say Thank You to frantisek.nesveda For This Useful Post: [ Click to Expand ]
Tags
ext4, f2fs, kernel, recovery, tool
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes