Related
I am attempting to create my own port of android to my HTC touch diamond (rebranded as the XDA Ignito) and i've hit a slight problem, I'm using dd to create an image file:
Code:
dd if=/dev/zero of=~/system.img count=19000
(not sure if it was 19000 but it created an image of about 90mb.)
I then create an ext2 filesystem out of it:
Code:
mkfs.ext2 ~/system.img
and then mount it to /andsys:
Code:
mount ~/system.img /andsys -o loop
and put the cutomized system into this.
then I unmount it and copy the new system onto my phone,
when hariet runs it say that loop2 is an unvalid ext2 system and
cannot mount /sys. it works fine with the stock system.img that
comes in a zip. and idea's why my modified system isn't working?
thanks,
Sam Aldis
I hate to bump but has no one got any ideas?
am attempting to create a custom android system that
it specifically for other HTC phones rather than being
android for G1/G2 running on a HTC phone.
You may want to do a search. I believe that there are a number of threads which deal with Android porting to different devices.
Sorry I can't be of anymore help, but I wish you luck!
[size=+1]Introduction[/size]
What is GenTop2?
GenTop2 is a full-fledged Gentoo Linux able to replace the original Motorola Webtop. It is faster, fully-customizable and gives you the power of a complete Linux system on a mobile phone. It is a peek into the future of mobile computing!
Thanks goes to kholk, who did the original GenTop, otherwise I would have long given up.
Why use Gentoo Linux as WebTop?
Programs are fully optimized for the ARMv7a CPU contained in the Atrix.
Thus the whole system is faster and more responsive.
No shackles put around the WebTop by Motorola.
You can install any program (which compiles on ARM).
All software (except X11) is fully up-to-date.
You remember old times with desktop computers having far slower CPUs and less RAM than your phone and you wonder what you can do with this pocket computer.
Why NOT use Gentoo Linux as WebTop?
Gentoo is huge because it must install all development files.
The system and all programs must be compiled on the phone. How crazy is that?
Firefox could not be built. But, there is a smaller replacement.
Why bother using a phone, when you already have a notebook?
Working and Installed Applications
X11 via WebTop or HDMI (with hdmi-hack)
Xfce4 with thunar file manager
midori web browser with Flash player
claws-mail client
audacious
evince (pdf viewer)
ssh daemon
rxvt terminal
aiw Android In-A-Window!
Sound output via Android media system.
All are very light-weight Linux applications perfect for a small system.
Not Working:
webtop-panel (system status bar on top)
non-flash video playback ?
Installable as binary packages:
firefox (renamed to Aurora due to trademark stuff), approx 30 MB.
thunderbird (renamed to Earlybird due to trademark stuff), approx 44 MB.
libreoffice, approx 250 MB.
abiword, pidgin, emacs, texlive,
and many more, drop a note for more wishes here. However KDE is just too large.
[size=+1]Installation Instructions[/size]
Prerequisites:
Motorola Atrix
[size=+2][highlight]BACKUP.[/highlight] This will break your device![/size]
Okay hopefully it won't. A full restore will of course overwrite the webtop.
root privileges.
unlocking is not necessary.
adb and Linux knowledge.
webtop2sd is not supported (!)
CM7 is NOT supported
GenTop2 Space Requirements, Disk Speeds and a Note About WebTop2SD
Gentoo is very large because packages contain all development files. This cannot easily be changed, therefore one must work around the space limitation of the /osh partition in some way.
I did some "disk" performance measurements using bonnie++ (see [1] for full info). Here the through-put results in short: /data (ext3) 20,800 KB/s read and 6,200 KB/s write, /sdcard (fat32) 21,500 KB/s read and 8,000 KB/s write, /sdcard-ext (ext3) 12,300 KB/s read and 4,200 KB/s write, /sdcard/loopback.img (ext3) 16,150 KB/s read and 4,400 KB/s write.
One way to go would be to require webtop2sd, however, GenTop2 does not support webtop2sd because the read/write speed of the internal sdcard is much faster than on the external sdcard. Thus I tried to install as much on the /osh partition as possible and move directories onto other partitions as necessary, leaving symlinks behind. WebTop2SD also requires dpkg for some reason, which Gentoo does not have.
Therefore, it's pretty unavoidable that you do some space management yourself.
I have decided to utilize the /preinstall partition for /var. I'm not fully sure that this partition is unused on every Atrix released, but I guess in most cases it contains only provider specific bloatware that people don't want anyhow. On my Atrix it contained some car racing game, which I find hilarious to play on a mobile phone.
Anyway, the /preinstall partition is 300 MB and perfect for /var if reformatted to support many small files. The /var/db/pkg/ directory contains lots and lots of small files describing the installed packages. See the installation instruction for the mkfs line.
I also decided to require some extra ext3 partition for further program, data and portage files. It is needed anyhow to install further programs, which is what most people want to do. The /data partition would be the obvious choice and for that reason the first GenTop2 put files in /data/osh/. However, /home/ is also on /data by default and it gets pretty annoying when your home directory is full.
The only alternative to /data is either a partition on an external sd-card or a loopback mounted file-partition on /sdcard/, both are not as fast as /data (/cache cannot be used as it must be wipeable). So there really isn't much choice left except for external storage.
The main GenTop2 tarball puts 630 MB in /osh (leaving 145 MB free) and 178 MB in /preinstall (with 150 MB free), which must be mkfs formatted.
The portage GenTop2 tarball puts 1460 MB into /mnt/gentoo/ of which 475 MB are data files from /osh/usr/ and 810 MB are the portage tree.
[size=+1]Steps to install GenTop2:[/size]
There are some complications involved when using faux123's kernel, because it only contains ext4 filesystem modules and explicit mounting of ext3 will fail. The ext4 module will however mount ext3 filesystem without problems.
use adb shell and get root:
Code:
$ su
# cd /osh
# mv etc etcx
# reboot
Reboot. The above will disable the webtop.
Download http://kristallsturm.de/GenTop2/GenTop2-20120509.tar.gz (275MB) and put it onto /sdcard via USB or adb push.
use adb shell to overwrite the existing WebTop:
Code:
(first we delete /osh)
# cd /
# ls bin
bin: No such file or directory
(this tests whether the old webtop is disabled)
# rm -r osh/*
# ls osh
(should be empty)
(next we disable and reformat /preinstall)
# mount -o remount,rw /dev/block/mmcblk0p12 /system
# mv /system/bin/load_pia.sh /system/bin/load_pia.sh.disabled
# umount /preinstall
(depending on your ROM this might fail. ignore this problem if the following format works)
# mke2fs -m 0 -i 2048 -j /dev/block/mmcblk0p17
# mount -t ext3 /dev/block/mmcblk0p17 /preinstall
(for faux kernel: replace ext3 -> ext4 in above line)
(now we unpack the main tarball)
# df
(/osh and /preinstall should be almost empty)
# cd /
# tar xvzf /sdcard/GenTop2-20120509.tar.gz
# sync
(begin extra for faux kernel: we change ext3 -> ext4)
# sed -i s/ext3/ext4/ /osh/ubuntu.sh
(end extra for faux kernel)
# sync
# reboot
Once rebooted you will get an X11 login on the HDMI connection or you can access the phone via ssh.
Account Passwords:
root / atrix
adas / atrix
To make GenTop2 more useful and to compile/install further packages you currently must have an external sd-card (or someone must devise a method to use a loopback device).
I have partitioned my external sdcard using a desktop computer into the following two partitions:
/dev/block/mmcblk1p1 (remainder)
/dev/block/mmcblk1p2 (4.0 GB, formatted ext3)
Advanced: (Actually most of this stuff is advanced.) You can also use the new GenTop to partition the external sd-card. Open a terminal, and use something along the lines of:
Code:
# fdisk /dev/block/mmcblk1
(partition it, see further description of fdisk on the net)
# mkfs.ext3 -m0 /dev/block/mmcblk1p2
The boot-up script /osh/ubuntu.sh will mount /dev/block/mmcblk1p2 to /mnt/gentoo. This place is referenced by /usr/portage, /var/tmp and /preinstall/usr and will enable emerge if you install the second GenTop2-portage-20120509.tar.bz2 tarball.
Download http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 (124MB) to /sdcard/ using any method.
Use adb shell or a terminal on the desktop
Code:
$ su
# cd /
# tar xvjf /sdcard/GenTop2-20120509-portage.tar.bz2
Note: If you trust your network connection, you can also download and unpack simultaneously (without saving) it using:
Code:
$ su
# cd /
# wget -O - http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 | tar xvj
[size=+1]Installing further software[/size]
How do I install applications in Gentoo?
- Read http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1
- Read http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3
I have set up a portage overlay "atrix-overlay" which unmasks many packages and includes some custom patches required for compilation on arm. It is included in the main tarball and automatically synced alongside "emerge --sync". Most updates will now be performed via this overlay.
See https://github.com/gendol/atrix-overlay for details.
Furthermore, for large binary packages like firefox, thunderbird and libreoffice I have set up a binary package repository with the same USE flags as the atrix-overlay. These are built using cross-compilation on my desktop computer.
See http://kristallsturm.de/GenTop2/packages/
To force installation from binary packages use emerge -G <package>. See the list of "Installable as binary packages" above.
[size=+1]Miscellaneous Questions[/size]
Why no thumb instructions?
- I did a speed test of cryptography functions and thumb instructions were approximately 10% slower than usual ARM code.
Where was GenTop2 compiled?
- Most of the system was fully compiled on my own Atrix. Larger binary packages are compiled on my desktop using cross-compiling.
Why is X11 not up-to-date?
- The only xorg driver I could get working is the one on the original Webtop, and that requires an older version of X11.
Why is udevd not running?
- If you look at logcat there are lots of the following messages, some of which are due to udevd. Disabling udevd reduces (but does not eliminate) these messages and probably also some unnecessary background process that draws battery.
NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UDEV_LOG' not found
NetlinkListener: ignoring non-kernel netlink multicast message
NetlinkListener: ignoring non-kernel netlink multicast message
[size=+1]Reinstalling the old WebTop[/size]
Some people on the forums struggled to reinstall the old webtop for some reason. It shouldn't be that difficult and I created a tarball of the original Webtop WT-1.2.0-133_38. These instructions were not tested by me:
Download http://kristallsturm.de/GenTop2/WT-1.2.0-133_38.tar.gz to /sdcard/ using any method.
Use adb shell or a terminal to disable mounting of webtop:
Code:
$ su
# cd /osh
# mv etc etcx
# reboot
Use adb shell to unpack original tarball into /osh:
Code:
# cd /
# ls bin
bin: No such file or directory
(this tests whether the webtop is disabled)
# rm -r osh/*
# ls osh
(empty)
# cd /
# /sdcard/WT-1.2.0-133_38.tar.gz
# sync
# reboot
[size=+1]Downloads[/size]
http://kristallsturm.de/GenTop2/GenTop2-20120509.tar.gz (275MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120509-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 (124MB portage tree for /mnt/gentoo/, see above)
http://kristallsturm.de/GenTop2/GenTop2-20120509-portage-filelist.txt (Filelist of tarball for your reference)
Old Downloads
http://kristallsturm.de/GenTop2/GenTop2-20120428.tar.gz (369MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120428-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120428-portage.tar.bz2 (44MB portage tree for /mnt/gentoo/, see above)
http://kristallsturm.de/GenTop2/GenTop2-20120424.tar.gz (364MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120424-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120424-portage.tar.bz2 (44MB portage tree for /mnt/gentoo/, see above)
Changelog
From 20120428 to 20120509:
Added atrix-overlay for pulling in updates using layman.
Reorganized /etc/portage/ to symlink into atrix-overlay files.
Removed mplayer from default install.
Added xarchiver, leafpad and some customization for the terminal.
Reorganized directory structure to use /preinstall.
From 20120424 to 20120428:
Readded resolutions to xorg.conf like in original webtop. Nevertheless you can switch using Xfce's settings dialogs.
Installed Flash: copied libflashplayer.so and emerges nss nspr.
Readded lots of the original .desktop files and corresponding icons. These launch Android apps.
[1] http://kristallsturm.de/GenTop2/docs/atrix-bonnie.html
It is a good job. I try this. Thank you.
This is a very agressive aproach. /osh dose have some Moto magic sauce in it. How well can you drive the screnn with a stock X system? Most of the cutesy features from WT I can live w/o, but the "phone"app really is usefull. Seams like this would be worth the effort to figure out.
If I was using a less "pure" setup (spinning up X and the phone app in Motos osh) then bringimng up the desktop in Gentoo, how would that compare to oither the same concept with other distros?
Please post on. I think this is the first time somebidy has run a non /osh X. Would love to see if it really can be done.
exwannabe said:
This is a very agressive aproach. /osh dose have some Moto magic sauce in it. How well can you drive the screnn with a stock X system? Most of the cutesy features from WT I can live w/o, but the "phone"app really is usefull. Seams like this would be worth the effort to figure out.
Click to expand...
Click to collapse
Thanks for pointing that out. Yes, the approach is radical, but not as aggressive as you may think. All the "magic sauce" in /osh lives in /osr/usr/local/ and all of that is retained. The only problem is that some dynamic link libraries are missing, but most of these problems can be fixed.
They actually had to be fixed because the GenTop2 does need to send some magic signals to Moto's PortalApp/DockService to work correctly. This is done using the /usr/local/bin/rmtest tool via the "fbcp" instance of dbus.
Other than /osh/usr/local/, /osh is really just Debian.
With the phone app, you mean the green phone button? I just tested that, it can be added. The phone button is nothing but a .desktop mime file, which calls one of the magic apps /usr/local/bin/androidlauncher. And it popups up in the aiw display.
I even tested the HD Media Center laucher and that too worked without problems. That really should be included in the next GenTop2 tarball.
exwannabe said:
If I was using a less "pure" setup (spinning up X and the phone app in Motos osh) then bringimng up the desktop in Gentoo, how would that compare to oither the same concept with other distros?
Please post on. I think this is the first time somebidy has run a non /osh X. Would love to see if it really can be done.
Click to expand...
Click to collapse
I guess I don't understand what you mean with a non /osh X. GenTop2 does run X11 and you really need to replace the system libaries to get a well-working Gentoo.
Greetings,
Gendol
Great job! Does this work with cm rom's aswell or only with blur based ones? As another fact, we could use distcc or crosscompile distcc to compile most of the stuff, actually even a crosscompile binhost would be doable for several packages. One more thing, we could probably use an .img file on the internal sdcard partition, that would be ext3/4 formatted instead of using the external sdcard (but probably its better and safer to sue the external card, due to the flash wear)
edit: so i tried it on my atrix with nottachtrix rom installed, it starts fine and seems to work rather well, i only saw two to me rather annoying bugs:
1. somehow the X server thinks that my tv (1080p lg) has a virtual size of 1366x768 and will not allow to use the 1920x1080 resolutions that are in the TV's EDID and that the system puts into the xorg.conf file aswell as it shows in the Xorg.0.log
2. the atrix's screen stays on all the time in the "normal mode" and if one uses the mouse on the gentop its moving and functioning on the atrix's screen aswell (ie you can launch apps by accident with the mouse in android)
I do not know if these are issues with nottachtrix or something else, but for me on the "normal webtop" 1080p worked on this same TV.
here the xorg log: http://dl.dropbox.com/u/24268926/Xorg.0.log
Really nice, installing it right now!
Does flash work on Midori?
I don't know about CM7, you'll have to try to replace the Linux system like moto does it.
The X11 screen size defaults to WebTop resolution 1366x768, but you can change that to 1920x1080 by editing /etc/X11/xorg.conf. The first thing to try is to comment out all Modelines and let EDID detection do the work. But for that a monitor must be present, so you need to Zap (Ctrl+Alt+Bckspace) your X, and that brings up the dual input problem.
I also use nottach's ROM. The dual input problem happens when something in motorola's magic communication goes wrong. I have not been able to figure out how in particular moto disables input on the touchscreen. For me it works most of the time. I also have all the Modelines in xorg.conf enabled, because they fit my monitor.
I didnt really focus on Flash, yet. But as it works on the original Webtop, you should just be able to copy the plugin files.
Gendol
Can't get Midori working .. Got network (via ping), but no web browsing
EDIT: Solved by disabling proxy settings inside Midori
i haven't run gentoo in over 10 years but this is tempting!!!!!
Hello! I am a bit newbie in linux and i have 2 questions
1) Could someon please tell me how to install GenTop2-portage-20120424.tar.bz2 tarball?
2) Is there any way to install synaptic so i can install other linux apps?
snik38 said:
Hello! I am a bit newbie in linux and i have 2 questions
1) Could someon please tell me how to install GenTop2-portage-20120424.tar.bz2 tarball?
2) Is there any way to install synaptic so i can install other linux apps?
Click to expand...
Click to collapse
1) use ADB and first post
2) Gentoo Portage - it's command line but very easy
Hmm, anyone using this with webtop over HDMI? I get the login screen, but the webtop touchpad thingie doesn't come up so it's impossible for me to log in.
nalorite said:
Hmm, anyone using this with webtop over HDMI? I get the login screen, but the webtop touchpad thingie doesn't come up so it's impossible for me to log in.
Click to expand...
Click to collapse
you need to use a hd dock, lapdock or a modded powered usb hub with mouse + kb
Vazay said:
1) use ADB and first post
2) Gentoo Portage - it's command line but very easy
Click to expand...
Click to collapse
1) After the reboot i used
adb shell
# tar xvzf /sdcard/GenTop2-portage-20120424.tar.bz2
but it gave me an error, am i using the correct command or i should use something else?
Yes. The touchpad thingy is also an open end. I have no idea why it doesnt come up. The GenTop2 tries to do everything in the same way as the original one, but for some reason that doesnt appear.
I guess the touchpad is some Android program part of DockService or PortalApp, which drive the Webtop switch. But I havent debugged how to activate it.
@snik38
To extract a .tar.bz2 you use tar xvjf ...
Gendol
three items one that caused some grief, but other than that this has lots of cool potential!
I have a stock rom with root.
1. resolution was pretty screwed up. I did try to adjust the resolution, but it was locked into one setting.
2. flash isnt installed on the browser so many websites where disabled.
3. I could not get AIW to start.
I see you answered #1 in a previous post. But I think all three of those items are minimum requirements to replace webtop. BTW great job again! Its seemed much faster than the webtop app.
2. Try to copy the flashplugin from original webtop(not sure if it works with midori)
3. aiw works fine try to reboot the phone
Took me a while to get this all running, but it's great now it is. Have this over Nottachtrix 1.3.1. Everything installed and works fine!
Cheers!
When my phone turns on and gets to the preparing sd, it takes forever. Does this happen to anyone else?
anyone tried to emerge chrome/chromium?
Always wanted a larger /data partition? Want to add a swap partition or an extra partition for your Debian/Ubuntu/Fedora chroot? Want your ROM to have the combined /data and /sdcard of Honeycomb and ICS devices? Then this guide is for you.
Table of contents
This post: background information
(Advanced) users: modifying your phone to use LVM
Developers: adding LVM support to a ROM
Building LVM for Android
The Linux [URL="http://sourceware.org/lvm2/]Logical Volume Manager[/URL] (LVM) is a set of tools which allows you to create virtual disks ("logical volumes", "LVs") backed by a set of real storage devices ("physical volumes", "PVs") organized into "volume groups" ("VGs"). Using LVM, you can:
Create logical volumes which are larger than any of the individual physical volumes available on your device's real storage.
Create an arbitrary number of logical volumes of arbitrary size, regardless of the number of physical volumes or partitions available on your real storage devices. You could, for example, add a dedicated swap partition, or create a separate /system and /data for a dual-boot setup.
Take a snapshot of a logical volume -- a copy of the LV which only stores differences between it and the original (requires additional kernel support). You could, for example, take a snapshot of the external storage LV and export it via USB mass storage to a computer, without needing to unmount the LV from your device.
Grow or shrink logical volumes without unmounting the file system ("online resize", requires filesystem support).
LVM was developed to manage storage on Linux servers and workstations, but was also used by Palm/HP in WebOS devices. It uses the Linux device-mapper technology used in Android for apps installed on the SD card, so any Android kernel will work with LVM.
This guide was developed with the Nexus S in mind, but the technique described should be applicable to many other Android devices as well.
Modifying your phone to use LVM
WARNING WARNING WARNING
While unlikely, you could brick your phone if you do this incorrectly!!!
Read this guide completely before attempting. If you don't understand the procedure, read it again until you do. If you still don't understand, wait for someone else to make this easier. If you're not sure you understand, you probably don't.
BACK UP EVERYTHING ON YOUR PHONE, INCLUDING THE CONTENTS OF /sdcard, BEFORE ATTEMPTING THIS PROCEDURE! This will erase everything on your phone.
The preassembled images attached to this post are for Nexus S GT-i9020T running stock Android 4.0.4 IMM76D ONLY. They may or may not work with other phones and ROMs. (See the next post for how to modify any ROM to use LVM.)
You will need:
A Nexus S with unlocked bootloader
A computer with fastboot and adb installed and working
A USB cable
Factory images for your phone, in case something goes wrong
Procedure:
Take a nandroid backup of your phone and copy it to your computer. We'll use it to restore the ROM later. You MUST copy the backup to your computer! This procedure will erase EVERYTHING on your phone, including the contents of /sdcard.
Download the boot and recovery images attached to this post. Reboot your phone into the bootloader, then flash the recovery to your phone using fastboot:
Code:
fastboot flash recovery recovery-lvm-clockwork-5.0.2.0-crespo.img
(GPL information: this is the stock kernel image from ClockworkMod 5.0.2.0. For LVM source, see this post.)
Boot into recovery.
Enter the shell on the device:
Code:
adb shell
In the shell on the device, do the following (# is your prompt):
Code:
# /lvm/sbin/lvm pvcreate /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/block/mmcblk0p3
# /lvm/sbin/lvm vgcreate lvpool /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/block/mmcblk0p3
This marks the partitions normally used for /system, /data, and /sdcard for use with LVM, and creates an LVM volume group named "lvpool" using those devices.
In the shell on the device, set up your desired logical volumes (partitions).
Code:
# /lvm/sbin/lvm lvcreate -L 320M -n system lvpool
# /lvm/sbin/lvm lvcreate -L 1G -n userdata lvpool
# /lvm/sbin/lvm lvcreate -L 10G -n media lvpool
[...]
This creates the mandatory logical volumes named "system", "userdata", and "media", which will be mounted on /system, /data, and /sdcard, respectively. Replace the argument to -L with the desired size of each partition. (/system needs to be at least 300 MB to fit the stock ROM.) You can create additional volumes similarly:
Code:
# /lvm/sbin/lvm lvcreate -L [size] -n [name] lvpool
replacing [size] with the desired size and [name] with the desired name. You have a little less than 15 GB space in the volume group to work with; depending on how many partitions you want to create, you can adjust the size of the "media" and "userdata" logical volumes as required.
Reboot back into recovery. Mount the USB storage on your computer. On your computer, format your phone's USB storage as you would a USB flash drive.
Copy your nandroid backup from your computer onto your phone.
Reboot back into recovery. Restore the nandroid backup.
Reboot into the bootloader. Flash the boot image to your phone via fastboot:
Code:
fastboot flash boot boot-lvm-crespo-IMM76D.img
(GPL information: this is the stock kernel image for IMM76D. Source is available from AOSP git. For LVM source, see this post.)
Reboot. You should have a working device running on LVM.
Additional tips and hints
To see the logical volumes you've created, use
Code:
# /lvm/sbin/lvm lvs
and to see how much free space you have remaining in the volume group, use
Code:
# /lvm/sbin/lvm vgs
If you want to delete a logical volume (for example, if you screwed up), use
Code:
# /lvm/sbin/lvm lvremove /dev/lvpool/name
(replacing "name" with the name of the LV you want to delete).
It's often useful to leave a bit of free space in the volume group (512 MB to 1 GB or so). This gives you a bit more flexibility to modify the layout or grow partitions in the future, and allows you to take snapshots of logical volumes.
Removing LVM from your phone
Flash a standard recovery such as the regular ClockworkMod recovery to your phone.
Do a full wipe/factory reset.
Restore your phone from a backup.
If things go really wrong, flash the factory image to your phone via fastboot.
Modifying an existing ROM to use LVM
(This is a condensed version of the full guide: https://raw.github.com/steven676/android-lvm-mod/master/HOWTO-MOD)
You will first want to grab a copy of the binaries and config files by cloning my git repository: https://github.com/steven676/android-lvm-mod.
Unpack the ramdisks from your boot and recovery images. Make the following changes:
Copy the contents of lvm-bin/ in the git repository to lvm/ in the ramdisks.
Copy devices/crespo/lvm.conf to lvm/etc/lvm.conf in the ramdisks.
For the boot image, integrate the changes in devices/crespo/boot/init.herring.rc-changes.diff into your init.herring.rc.
For the recovery image, integrate the changes in devices/crespo/recovery/init.rc-changes.diff into your init.rc.
For the recovery image, copy devices/crespo/recovery/recovery.fstab to etc/recovery.fstab.
Repack the ramdisks and create new boot and recovery images with them (the original kernels are fine to use).
If creating a flashable zip to install your ROM, you will also want to modify the installer script to set up the LVM volume group and logical volumes (see the previous post).
If you're building your own kernel, consider enabling CONFIG_DM_SNAPSHOT in your kernel's build configuration, to allow taking snapshots of logical volumes.
Remember that LVM is released under the terms of the GPL v2 (same as the Linux kernel), so you are required to comply with the GPL's source distribution requirements with respect to LVM.
More extensive modifications (such as changing the devices used to form the volume group) are possible; see the full HOWTO guide for details.
Building LVM from source for Android
The LVM source was written for standard glibc-based GNU/Linux systems, and doesn't build agains Android libc. We could invest time and effort into porting it to Android, but it's easier to just statically link the LVM binary against glibc (we already have to use a statically linked binary, since the boot image doesn't ship shared libraries).
To build LVM with glibc, you will need either an actual GNU/Linux ARM system with a development environment (gcc, make, and glibc header files) set up, or a GNU/Linux ARM cross-compiler toolchain (more difficult to set up). The binaries in lvm-bin/ were compiled with an Emdebian squeeze/armel toolchain running on a Debian squeeze/amd64 machine; this procedure has also been tested with a Nexus S running a Debian squeeze chroot (though any recent Linux distribution and any device should do). The Linaro prebuilt GCC toolchain and the CodeSourcery CodeBench Lite toolchain for ARM GNU/Linux should work; the Android NDK toolchain will not.
Getting the source
Clone the lvm-mod git repository. Then, in the newly cloned repository, do
Code:
git submodule init
git submodule update
You will have a copy of the LVM source (as used to build the binaries in lvm-bin/) in lvm-src/.
(Alternately, clone https://github.com/steven676/lvm2 and checkout branch android-lvm-mod. You can also use upstream's git repository or source tarballs; see their website for details.)
Building the source
(This is a condensed version of the full guide: https://raw.github.com/steven676/android-lvm-mod/master/HOWTO-BUILD)
These instructions are written for a native build (building in a Debian/Ubuntu/Fedora chroot on an actual ARM device).
Configure the LVM source:
Code:
$ ./configure --prefix=/lvm --enable-static_link --disable-readline \
--disable-selinux --with-pool=none --with-cluster=none \
--with-confdir=/lvm/etc --with-default-run-dir=/data/lvm/run \
--with-default-system-dir=/lvm/etc \
--with-default-locking-dir=/data/lvm/lock \
--with-optimisation="-Os -march=armv5te -mtune=cortex-a8 -mthumb"
For a cross build, you need to set up the system to run ARM binaries using QEMU (see the full HOWTO for details). (For extra credit, fix the build so that it works with the configuration produced by running configure without qemu-arm enabled.) Then configure the source with:
Code:
$ export CC=arm-linux-gnueabi-gcc # replace with your cross compiler
$ ./configure --host=arm-linux-gnueabi \
--prefix=/lvm --enable-static_link --disable-readline \
--disable-selinux --with-pool=none --with-cluster=none \
--with-confdir=/lvm/etc --with-default-run-dir=/data/lvm/run \
--with-default-system-dir=/lvm/etc \
--with-default-locking-dir=/data/lvm/lock \
--with-optimisation="-Os -march=armv5te -mtune=cortex-a8 -mthumb"
Build the source:
Code:
$ make
Grab the pieces you need: the statically linked, unstripped lvm binary is located in tools/lvm.static, and a sample configuration file is in doc/example.conf.
(reserved)
Hello steven676,
This post is helpful to me!
But I have some questions on LVM as I am new to it.
1. Is it possible to use LVM only on one pv, say /sdcard?
2. If 1. yes, will lv's on a pv be linear mapped, that is, lv's in a pv are placed one after one?
3. now that removing lvm is possible, is it also possible to backup lvm setting, and switching between non-lvm and lvm environment?
Thanks
solarispika said:
1. Is it possible to use LVM only on one pv, say /sdcard?
Click to expand...
Click to collapse
Sure. Just modify the arguments to pvcreate and vgcreate accordingly:
Code:
# /lvm/sbin/lvm pvcreate /dev/block/mmcblk0p3
# /lvm/sbin/lvm vgcreate lvpool /dev/block/mmcblk0p3
solarispika said:
2. If 1. yes, will lv's on a pv be linear mapped, that is, lv's in a pv are placed one after one?
Click to expand...
Click to collapse
Probably, but in general it is not safe to assume this. Imagine the following sequence of commands:
Code:
# /lvm/sbin/lvm lvcreate -L 1G -n vola lvpool
# /lvm/sbin/lvm lvcreate -L 1G -n volb lvpool
# /lvm/sbin/lvm lvresize -L +1G /dev/lvpool/vola
What's likely to happen here is that vola is going to be split into two segments on disk, like this:
Code:
[ 1GB vola ][ 1 GB volb ][ 1 GB vola ][ remaining free space ]
There are ways in which you can give LVM hints as to what on-disk layout you want, and the LVM tools will generate information about the current layout in /data/lvm/backup if that directory's available (and mounted read-write) at the time, but in general, it's best to treat the on-disk layout of a logical volume as unknown. In practice, unless you have physical volumes with widely varying characteristics in the same volume group (say, an SSD and some spinning-platter hard disks), you shouldn't need to worry about the actual layout.
solarispika said:
3. now that removing lvm is possible, is it also possible to backup lvm setting, and switching between non-lvm and lvm environment?
Click to expand...
Click to collapse
If /data is mounted read-write, running
Code:
# /lvm/sbin/lvm vgcfgbackup
will create a human-readable backup of the current LVM volume group metadata in /data/lvm/backup (if that directory is available and mounted read-write).
I'm not sure what you mean by "switching" between non-LVM and LVM environments. If you mean going between an unmodified stock boot image and an LVM boot image, the answer is yes, but you won't have access to any of the data in your LVM logical volumes while running an image not configured for LVM, and you need to be careful not to accidentally format the LVM physical volume.
If you're asking about having two or more ROMs on the phone, one installed to the normal /data and /system eMMC partitions, and another on LVM logical volumes, the answer is also yes, but both ROMs will need modified ramdisks. The one for the eMMC-installed ROM should only mount /sdcard from LVM, while the others should be set up to mount /data and /system from LVM as well.
Good write up;-)
wonder if lvm swap could be connected as extra memory .
Sent from my Nexus S using XDA
wizardslovak said:
wonder if lvm swap could be connected as extra memory .
Click to expand...
Click to collapse
Sure, of course. From my phone:
Code:
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/mapper/lvpool-swap partition 65532 28196 -1
It works just fine, even if it's not a setup I'd use on a mission-critical server.
Hey Guys,
Thanks for this awesome guide.
I just have a quick question, what are the advantages of using LVM instead of the normal partitioning?
I just want to know cause i might added to my rom.
Thanks
mandaman2k said:
I just have a quick question, what are the advantages of using LVM instead of the normal partitioning?
Click to expand...
Click to collapse
Primarily flexibility in deciding the number and layout of partitions -- see the first post.
Sounds good . Ill try it once home ;-)
Sent from my Nexus S using XDA
I just pushed a couple of changes:
Updated prebuilt binaries and LVM source to 2.02.96.
Fixed the instructions for cross compiling LVM.
The boot and recovery images attached to the second post have been updated accordingly.
Is this the only way to make the device function like HC/ICS/JB devices that ship with combined storage?
Are the images from Google partitioned with internal/external storage or are the latest images partitioned with a layout similar to the Galaxy Nexus?
CocoCopernicus said:
Is this the only way to make the device function like HC/ICS/JB devices that ship with combined storage?
Click to expand...
Click to collapse
If you want a setup that's exactly as on a 3.0+ device with "SD card" data stored in /data, then yes, this is the only way I know of. If you just want MTP functionality, then no.
CocoCopernicus said:
Are the images from Google partitioned with internal/external storage or are the latest images partitioned with a layout similar to the Galaxy Nexus?
Click to expand...
Click to collapse
Official Google software builds use separate userdata and media partitions and continue to offer the 2.x-style USB mass storage access. I'm not sure the partition layout is adjustable in software -- the eMMC presents an EFI partition layout which no one seems to have figured out how to change.
Cool, thanks. Yea, I'm not too interested in the MTP functionality, I just don't want to deal with internal/external storage after using the Galaxy Nexus.
Swap partiton
Hi..
how i can to create a swap partition of 1G and added to system??
I had create a 1G partition "swap" but system no activated this partition.
xxmurdocxx said:
Hi..
how i can to create a swap partition of 1G and added to system??
I had create a 1G partition "swap" but system no activated this partition.
Click to expand...
Click to collapse
You'd need to format the swap partition:
Code:
# mkswap /dev/lvpool/swap
Also, you need to make sure that your kernel has swap support (CONFIG_SWAP=y -- the default kernel does not have this) and that your init scripts are enabling the swap partition (swapon /dev/lvpool/swap).
One other note: you might find lag to be somewhat severe with a 1 GB swap partition -- I'd suggest smaller.
I'm finally getting around to messing with my NS. From what I understand I can't just modify an existing rom(stock JB in this case) to use the larger partitions without compiling an entire new rom, right?
Which would mean I'd be at the mercy of whoever created the ROM to update when an OTA rolls around?
CocoCopernicus said:
I'm finally getting around to messing with my NS. From what I understand I can't just modify an existing rom(stock JB in this case) to use the larger partitions without compiling an entire new rom, right?
Which would mean I'd be at the mercy of whoever created the ROM to update when an OTA rolls around?
Click to expand...
Click to collapse
No, you can modify an existing ROM yourself. It's most definitely not the simplest process around, though -- see the documentation at the top of the thread for instructions. As I say there ... read thoroughly and understand before attempting.
Hi. I am creating this guide because i did not find any particular functional guide with details.
You must be running a 64 or 32 bit version of Ubuntu. Please note that i wont be going in the details on how to setup a build environment and sync sources as there are many guides for that.
Step 1 :
Install the required packages
Step 2 :
Setup the build environment and sync the sources for the required CWM. CWM source comes bundled with the CyanogenMod source.
Code:
CWM 5 - Gingerbread
CWM 6 - Jellybean
Step 3 :
Now we come to the actuall compiling part. Make sure you have synced the latest source using the "repo sync" command.
Change directory to your source.
Issue this command :
Code:
make -j4 otatools
Step 3.5 :
Do this step if your device is not officially supported by CM10.
Using terminal emulator on your device, issue the command
Code:
dump_image boot /sdcard/boot.img
This will dump the boot image to your sdcard. Transfer it to your home directory.
To build Android from source for a new device, you need to set up a board config and its makefiles. This is generally a long and tedious process. Luckily, if you are only building recovery, it is a lot easier. From the root of your Android source directory (assuming you've run envsetup.sh), run the following (substituting names appropriately):
Code:
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
For example if you are having the Samsung Galaxy Ace device, the command will go as follows :
Code:
build/tools/device/mkvendor.sh Samsung cooper ~/boot.img
Please note that Cooper is the device name. Only use "~/boot.img" if you have the boot image in your home directory. Or else please specify the correct path.
You will receive the confirmation "Done!" if everything worked. The mkvendor.sh script will also have created the following directory in your Android source tree:
manufacturer_name/device_name
Step 3.5 ends here.
Step 4 :
Now that you have the device config ready, proceed.
Type the following code in your terminal in the source directory.
Code:
. build/envsetup.sh
This will setup the build environment for you to work.
Now launch the command
Code:
lunch full_device_name-eng
This will set the build system up to build for your new device. Open up the directory in a file explorer or IDE. You should have the following files: AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_.mk, kernel, system.prop, recovery.fstab, and vendorsetup.sh.
The two files you are interested in are recovery.fstab and kernel. The kernel in that directory is the stock one that was extracted from the boot.img that was provided earlier. For the most part, recovery.fstab will work on most devices that have mtd, emmc, or otherwise named partitions. But if not, recovery.fstab will need to be tweaked to support mounts and their mount points. For example, if your /sdcard mount is /dev/block/mmcblk1p1, you would need the following lines in your BoardConfig.mk
/sdcard vfat /dev/block/mmcblk1p1
Once the recovery.fstab has been properly setup, you can proceed to the next step.
Step 5 :
Now we build the actual recovery.
Code:
make -j4 recoveryimage
This command builds the recovery image
You can use the command
Code:
make -j4 recoveryzip
to make a fakeflash recovery i.e. a temporary recovery to test out on the actual device.
Your recovery can then be found at "your_source_directory/OUT/target/product/device/recovery.img" and the temporary fakeflash zip in the utilities folder at the same location.
If everything works out well, you will have a working recovery.
Once you have working builds, notify "koush", on Github and he can build official releases and add ROM Manager support!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Some tips :
If you want to compile CWM 6, sync the jellybean branch using the command :
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync
If you want to compile CWM 6 on a 32 bit system, you need to sync THIS source too. Instructions are given in the readme.
Run "make clobber" between builds if you change the BoardConfig.mk, or the change will not get picked up.
Credits :
Koush for this guide.
Nice.
Will come in handy
Excellent guide!
Thanks!
I will try on my Motorola PRO+, wish me luck
any ideeas how i can make the recovery font smaller? i read somewhere that i have to edit ui.c file, but what syntax? thanks
thank you for this
i will try to compile this
i tried before using koush online builder but the cwm has bugs.
Okay, I'm problly stupid, but.
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
seems to work fine, but
repo sync does this:
Code:
fatal: '../CyanogenMod/android_abi_cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch CyanogenMod/android_abi_cpp
What did I screw up, or not have prepared correctly?
I have built AOSP and currently build kernels on this box, so I know git and all that is setup correctly.
D
.
edited
Got it. Needed an updated repo script.
D
.
what's this ?
shaaan said:
Hey guys, i present to you a new updated version of CyanogenMod Recovery a.k.a CWM 6.0.1.3. The current version that we use is 5.0.2.6
Edit : As you guys know, i bricked my ace while trying to get CWM working. The bootloader is lost. So there is no way i can get it working back. This is the end of developing for me for now atleast. I will have to replace the motherboard or get a new device. Any dev wanting to take over the project, please feel free. Contact me for help and i will try my best. But if you use my sources, please give credits to me and TeamCooper.
My sources are here.
Edit : You can refer my guide on compiling a recovery here.
Click to expand...
Click to collapse
now afraid to do it on my own
So you copy pasted a guide (and linked it in the end), and then you say you can't find any other guide.
Orelly?
Can jou tell a bit more about run "envsetup.sh"thats what i mis in this guide and the original guide. and most other guides.
The file "dump_image" needs to be placed on the phone. Can be put on the sd of the phone and than place on a place you like.(Folder bin/xbin ore some other) Use terminal on the phone. (any from google store play) cd to the dir the dump_image is than run the command.
How do i find the device name for my phone/tablet. I know the name of the tablet i bought.. But still. samsung ace hase device name cooper? Where did you find it?
Thx by the way. This guide is a bit more clear than the original.
the device name is in build.prop
[email protected] said:
Can jou tell a bit more about run "envsetup.sh"thats what i mis in this guide and the original guide. and most other guides.
The file "dump_image" needs to be placed on the phone. Can be put on the sd of the phone and than place on a place you like.(Folder bin/xbin ore some other) Use terminal on the phone. (any from google store play) cd to the dir the dump_image is than run the command.
How do i find the device name for my phone/tablet. I know the name of the tablet i bought.. But still. samsung ace hase device name cooper? Where did you find it?
Thx by the way. This guide is a bit more clear than the original.
Click to expand...
Click to collapse
dump_image would be on the phone, it was for MTD devices now a days ytou want to use DD on mmcblk devices
i solved the font problem, you need to edit the Anndroid.mk from bootable/recovery, but now i got messed up Graphics in the recovery and i cannot boot back into the OS. ideeas? thanks
PS: i think that the graphics.c may be the problem. but for booting, i really have no clue.
This will give you a non touch version of CWM
Any idea if the touch modifications are also available opensource to modify code?
Not yet. But finding it. Once I get it working, will add it to the op.
Thx for the answar on my question.:good:
I have a nother question:silly: For example, my recovery.fstab hase: /sdcard mount is /dev/block/mmcblk1p1
What lines do i ad in my BoardConfig.mk:
? what is here? /sdcard vfat /dev/block/mmcblk1p1
just adding /sdcard vfat /dev/block/mmcblk1p0 does not seem to work..
my recovery.fstab:
# mount point fstype device [device2]
/boot mtd boot
/cache yaffs2 cache
/data yaffs2 userdata
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 system
/sd-ext ext4 /dev/block/mmcblk0p2
My vold.fstab hase:
# External NAND Storage
dev_mount sdcard /mnt/sdcard auto /devices/virtual/block/ndda
# External SD card
dev_mount ext_sd /mnt/ext_sd auto /devices/platform/tcc-sdhc
# External USB storage
dev_mount usb_sda /mnt/usb_sda1 all /devices/platform/dwc_otg /devices/platform/tcc-ohci /devices/platform/tcc-ehci
dev_mount usb_sdb /mnt/usb_sdb1 all /devices/platform/dwc_otg /devices/platform/tcc-ohci /devices/platform/tcc-ehci
Some other info i found..:
/dev/block/platform/tcc-sdhc0.0/mmcblk0
if i use mount in terminal i get this:
/dev/block/vold/179:0 /mnt/ext_sd vfat ...
/dev/block/vold/240:0 /mnt/sdcard vfat ...
cat /proc/mtd
geeft:
dev: size: erasersize: name:
mtd0 00a00000 00100000 ¨boot¨
mtd1 00500000 00100000 ¨kpanic¨
mtd2 12c00000 00100000 ¨system¨
mtd3 00400000 00100000 ¨plash¨
mtd4 09600000 00100000 ¨cache¨
mtd5 40000000 00100000 ¨userdata¨
mtd6 00a00000 00100000 ¨recovery¨
mtd7 00100000 00100000 ¨misc¨
mtd8 00100000 00100000 ¨tcc¨
partitions /proc/partitions:
major: minor: #blocks name:
7 0 16664 loop0
31 0 10240 mtdblock0
31 1 5120 mtdblock1
etc/ sow on
179 0 15339520 mmcblk0
240 0 2392064 ndda
240 1 2392064 ndda1
240 0 16663 dm-0
My boot.img files on github. + some adding ...(/device/YG/m805_892x) https://github.com/Frank77GLD/Telechip_tcc892x
(just testing a github for fun...)
Hope you could give me some advice?
can someone please make an english working cwm for samsung galaxy young cdma ich-509 please?
Porting to a new "unknown" device
Hi folks. I`m trying to start to develop some stuff to an chinese tablet and, of course, my first need is the cmw ...
Then. I only can have it using the fakeflash method(locked bootloader). My problem that it`s kinda new stuff to me.
I have some files built by utkanos to start the job. But now I dont know where to go to ...
Theere appears do be no documentation in what files in what folders I have to edit/add to get it fully functional.
When i flash the zip and the cwm load there`s no partition table. It loads a lot of errors on the screen saying no /dev/block* ...
I little help will be much appreciated here. Even just a start point .. anything that can help!
I didn't see anything about how to convert to f2fs for the nexus 6 so I thought i'd write something up as somebody requested me to do this.
What are the benefits of using f2fs over ext4?
I could list pros and cons, but I strongly encourage you to do your own research on the matter.
Should I do this
If you want to at your own risk
Pre-requisites
You need a recovery that supports f2fs in kernel and has the f2fs tools. Dhacker20 has provided one (TWRP 2.8.5.0) here: https://twitter.com/dhacker29/status/568070387306766336
You will need a kernel that supports f2fs for /cache and /data (Obviously I recommend Zen Kernel, but there are some others. Zen has the newest f2fs from upstream, while others may not)
ONLY YOU ARE RESPONSIBLE FOR YOUR DATA. IT IS YOUR RESPONSIBILITY TO UNDERSTAND THE RISKS AND YOUR RESPONSIBILITY TO BACKUP YOUR DATA
How-To
1.) Back up everything you care about to your PC (everything will be erased, including sdcard)
2.) Install a kernel that supports f2fs. Get the boot.img and do "fastboot flash boot boot.img" in bootloader (Like Zen)
3.) Install the recovery with f2fs support (fastboot flash recovery twrp-recvery-f2fs.img)
4.) In TWRP, go to Wipe
5.) Do a full wipe by swiping right
6.) Go to Wipe -> Advanced Wipe
7.) Choose /cache
8.) Choose "Change Filesystem"
9.) Pick f2fs, proceed
10.) Do the same thing for /data
11.) While still in recovery, plug phone into PC and do this:
Code:
# adb shell
# mount -o rw /system
# cp /sbin/fsck.f2fs /system/bin/
# cp /sbin/mkfs.f2fs /system/bin/
# chmod a+x /system/bin/*f2fs*
12.) Reboot and you are done.
Reserved
Is adb shell in terminal app
jiv101 said:
Is adb shell in terminal app
Click to expand...
Click to collapse
No adb is part of the android SDK platform-tools
I did this a while ago (except for step 12), and I remember something happening, which caused my data partition to become corrupted. I tried to format the partition again using ext3 or whatever the default is and that ended up giving me a soft brick. I had to restore the factory software. I have read things of where it does improve R/W speeds but I don't know if it's worth the hassle of possibly losing everything at the drop of a hat if you flash ROMs often.
RSVP..
Thanks for the information on F2FS well needed..!
brando56894 said:
I did this a while ago (except for step 12), and I remember something happening, which caused my data partition to become corrupted. I tried to format the partition again using ext3 or whatever the default is and that ended up giving me a soft brick. I had to restore the factory software. I have read things of where it does improve R/W speeds but I don't know if it's worth the hassle of possibly losing everything at the drop of a hat if you flash ROMs often.
Click to expand...
Click to collapse
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
bbedward said:
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
Click to expand...
Click to collapse
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
lobrau said:
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
Click to expand...
Click to collapse
That's about it, you can type exit to get out of adb shell or just close it.
On your device you can make sure f2fs took by simply typing "mount" in terminal emulator. You should see you data and cache reads f2fs now.
lobrau said:
Is there any sort of confirmations when you are doing the last steps? I see this when I do them and I'm not sure if it has actually done the last steps.
C:\Development\platform-tools>adb shell
~ # ←[6nmount -o rw /system
mount -o rw /system
~ # ←[6ncp /sbin/fsck.f2fs /system/bin/
cp /sbin/fsck.f2fs /system/bin/
~ # ←[6ncp /sbin/mkfs.f2fs /system/bin/
cp /sbin/mkfs.f2fs /system/bin/
~ # ←[6nchmod a+x /system/bin/*f2fs*
chmod a+x /system/bin/*f2fs*
~ # ←[6n
C:\Development\platform-tools>
Click to expand...
Click to collapse
Nope, it will only inform you if something went wrong (like file not found) of it all went through with no error it worked.
After you bootup you can verify it worked by typing "mount" in adb shell or terminal emulator. It should say f2fs on /data and /cache. Also in something like root Explorer if you navigate to /system/bin you should see the files you copied (fsck.f2fs and mkfs.f2fs)
bbedward said:
Nope, it will only inform you if something went wrong (like file not found) of it all went through with no error it worked.
After you bootup you can verify it worked by typing "mount" in adb shell or terminal emulator. It should say f2fs on /data and /cache. Also in something like root Explorer if you navigate to /system/bin you should see the files you copied (fsck.f2fs and mkfs.f2fs)
Click to expand...
Click to collapse
Perfect thanks for the quick response looked like it worked. Just out of curiosity is there any reason to format system to f2fs or does it end up causing issues, or just no changes in use?
lobrau said:
Perfect thanks for the quick response looked like it worked. Just out of curiosity is there any reason to format system to f2fs or does it end up causing issues, or just no changes in use?
Click to expand...
Click to collapse
I've tested it partly in testing the newest f2fs Zen merges as well as just general f2fs testing before.
It seems like writes are a bit faster, especially sql stuff. I've seen some grossly huge benchmark differences on other devices - on the n6 I've seen improvements but nothing astronomical like those benchmarks portrayed (I presume the 200% increase in write performance they showed is not accurate regardless) .
Recovery
So currently I'm on a 5.1 stock based rom (sinless) and TWRP 2.8.6
HAve Downloaded the latest Zen Kernel, and am downloading the latest 5.1 Benzo Rom.
Am I going to have issues rolling back to a 2.8.5 recovery - does 2.8.5 support 5.1 based roms?
shaitan667 said:
So currently I'm on a 5.1 stock based rom (sinless) and TWRP 2.8.6
HAve Downloaded the latest Zen Kernel, and am downloading the latest 5.1 Benzo Rom.
Am I going to have issues rolling back to a 2.8.5 recovery - does 2.8.5 support 5.1 based roms?
Click to expand...
Click to collapse
Yea it's compatible. There isn't a 2.8.6 with f2fs support yet that I know if and I haven't had the time to make one myself, but the 2.8.5 one works just fine.
@bbedward
I didn’t know any about the part 11 (I mean I convert mine to F2FS before I read this) so I’m wondering I’m gonna face any problem or not?
And also if have to do it, can I do it now or I have to wipe everything and then do it (cause changing partition to F2FS will clean everything)
Also I’m on your kernel.
dany20mh said:
@bbedward
I didn’t know any about the part 11 (I mean I convert mine to F2FS before I read this) so I’m wondering I’m gonna face any problem or not?
And also if have to do it, can I do it now or I have to wipe everything and then do it (cause changing partition to F2FS will clean everything)
Also I’m on your kernel.
Click to expand...
Click to collapse
Every time you boot your phone, it automatically runs fsck (for ext4 on stock). Essentially it's an automatic integrity check and repair.
So if it finds issues at boot up in the file system, it will tend to fix them automatically. If you look at boot up logs currently you will probably see something like "/system/bin/fsck.f2fs not found skipping integrity check"
You don't have to wipe everything though, you can just install the tools now.
I'm almost happy I posted this now hopefully it saves a few filesystems for folks who didn't do it completely.
---
When you see a kernel say f2fs compatible it means:
- f2fs is built into the kernel or a module is provided
- It's ramdisk's fstab allows for mounting of partitions as f2fs. On zen - it supports /data and /cache
When you see a rom say f2fs compatible it means:
- They have an f2fs-compatible kernel included
- They have the f2fs tools in the rom (As step 11 does)
This is why I say in the title this is "Any Rom" compatible as it will work on any rom, while on other devices you may see "Rom x, rom y, and rom z are the only known roms to be fully compatible." If you just do it this way it doesn't matter because it'll make any rom compatible with f2fs.
@bbedward this worked perfectly! But I just want to confirm that it switches back to ext4 after flashing a new ROM? After wiping and doing a clean flash it seems I'm not booting in f2fs anymore.
Am I doing something wrong or will I have to do this every time I clean flash?
Thanks again for the tutorial!
philsfan said:
@bbedward this worked perfectly! But I just want to confirm that it switches back to ext4 after flashing a new ROM? After wiping and doing a clean flash it seems I'm not booting in f2fs anymore.
Am I doing something wrong or will I have to do this every time I clean flash?
Thanks again for the tutorial!
Click to expand...
Click to collapse
I think most likely when you flashed a rom it overwrote your f2fs kernel, which caused it to reformat to ext4 when you booted it up.
Whenever you flash a rom you will need to flash f2fs-kernel right afterwards, and re-copy the tools (step 11) if the rom doesnt have them already in order to keep f2fs.
bbedward said:
I think most likely when you flashed a rom it overwrote your f2fs kernel, which caused it to reformat to ext4 when you booted it up.
Whenever you flash a rom you will need to flash f2fs-kernel right afterwards, and re-copy the tools (step 11) if the rom doesnt have them already in order to keep f2fs.
Click to expand...
Click to collapse
Thanks for responding so soon!
So I did flash zen9 (so good BTW) immediately after but I didn't repeat step 11 again. So that means Chroma doesn't have the necessary files for f2fs, good to know!
Edit: @bbedward does that mean I don't have to reformat again? Just do step 11?
Edit 2: entered step 11 in recovery and now i'm back to f2fs thanks again!
bbedward said:
The last step is a huge component of the whole process. If the rom doesn't have f2fs-tools in by default (most don't have fsck.f2fs/mkfs.f2fs) you will not have standard integrity checking every time you boot like you do on ext4. If you do the last step you will get integrity checking every time you bootup.
Also, since f2fs is a relatively young file system it can do harm to revert to older versions of the file system. For example, zen kernel has the newest f2fs which was updated last about 2 days ago. If you go on stock kernel you will find an f2fs that is 1+ year old. There may be a compatibility issue between these two where if you flash different roms (which almost always bundle a kernel)/kernels you will almost certainly have an issue.
But that's all part of the risk with using a relatively young file system. I do not understate the risks of data corruption in doing something like this - but anybody who is doing this and has significant worry should take precautions is backing up all their important files.
Click to expand...
Click to collapse
That was probably it! It was just a pain because this is the first phone that I've had in a while that doesn't have an SD card, I had a nandroid, but it doesn't do any good if you can't access your data partition Hahaha I have now taken to uploading my nandroids to Google Drive or putting them on my pc just in case that happens.