CM-13.0 Work-In-Progress - Nook Color Android Development

I have made a cm-13.0 rom for the encore tablet. It will probably never become official because of some hacks required for our boot process. It also does not have SElinux set to secure which is a requirement for official status. Still, it works well. I have been discussing it over in the cm-11 thread: http://forum.xda-developers.com/showthread.php?t=1370873
It works fairly well. It even lets you do the new marshmallow multiple windows as you can see by this screen shot.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Its performance is a bit slower than cm-11.0. Installing many Google gapps slows it to a crawl. Just about everything works. The first boot is slow. I disables the boot animation so it just sits on a blank screen for about 1/2 hour. You can use adb logcat to see that it is running.
I am not posting a ROM yet but am encouraging user builds. This is continuing the tradition of fattire and eyeballer. If folks ask politely, I will post a rom.
Continuing build discussions from the cm-11.0 thread:
We no longer need a custom compiler for the kernel. Some changes from sluo fixed that.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="drmarble/android_external_alsa-lib" path="external/alsa-lib" remote="github" revision="encore-cm-13.0" />
<project name="drmarble/android_hardware_alsa_sound" path="hardware/alsa/sound" remote="github" revision="cm-12.1" />
<project name="drmarble/android_device_bn_encore" path="device/bn/encore" remote="github" revision="wip-cm-13.0-f" />
<project name="drmarble/android_kernel_bn_encore" path="kernel/bn/encore" remote="github" revision="wip-cm-13.0-c" />
<project name="drmarble/proprietary_vendor_bn" path="vendor/bn" remote="github" revision="cm-12.1-wip" />
<remove-project name="platform/hardware/ti/omap3" />
<project name="drmarble/android_hardware_ti_omap3" path="hardware/ti/omap3" remote="github" revision="encore-cm-13.0-wip-a" />
</manifest>
Build is now changes with a patch rather than a new tree. This makes updating for cm changes easier. I just repo sync the cm source and apply my patches before building. Most patches are available from gerrit but have been abandoned so you need to use the special command repopick -f <12xxx23> to force the use of an abandoned patch. I just downloaded the patch to my pc and use git am <patchname> to apply it. I am attaching a zip file containing the patch files that I use. Put the 0001*.patch files into the appropriate directories. Below is a part of a shell script that shows both methods of applying patches.
Code:
#!/bin/bash
export CM_EXTRAVERSION=myown--encore-udb
export CM_EXPERIMENTAL=test
export CM_BUILDTYPE=EXPERIMENTAL
#first, a couple of good unmerged (never to be merged) changes
#fix reboot recover
repopick 115693
# adb insecure by default
repopick 120393
# Revert "libion: Turn on -Werror"
pushd system/core
git am 0001-Revert-libion-Turn-on-Werror.patch
popd
#or just use
#repopick -f 120433
# core: fix custom make recovery patch scripts
pushd build/core
git am 0001-core-fix-custom-make-recovery-patch-scripts.patch
popd
#or just use
#repopick -f 120557
# core: copy installed ramdisk and bootloader to BOOT/
pushd build
git am copy_installed_ramdisk_and_bl_to_BOOT.patch
popd
#or just use
#repopick -f 120558
#not necessary but these shrink the .zip so I can use sideload
pushd vendor/cm
git am 0001-My-zip-file-names-and-fewer-apps-and-sounds-for-enco.patch
popd
pushd external/noto-fonts
git am 0001-Remove-noto-fonts.patch
popd
#pause
read -p "press [enter] to continue..."
lunch cm_encore-userdebug
time make -j9 bacon 2>&1 | tee make.log ; rm -r /tmp/targetfiles-??????
# I don't like that file removal but the build process fills up /tmp and problems can ensue.
Note that this requires you to repartition your device. System is just way too small. I use 1gig for system but it should fit in 600megs. It uses the newer data/media partitioning system so you can enlarge the data partition and shrink media down to zero. There were some good posts earlier in the cm-11 thread on doing that. Unlike some other systems we can still mount and use the internal media partition. The external sd-card is useable in the nifty, high security ways of marshmallow. Apps can no longer default to storing data there unless you encrypt it. I expect encryption would be laboriously slow on this device. I just use the external sd-card for storing pictures, books, movies and other external storage stuff.
I looked at my partitioning.
253 0 98304 zram0
179 0 7757824 mmcblk0
179 1 72261 mmcblk0p1
179 2 72292 mmcblk0p2
179 3 305235 mmcblk0p3
179 4 1 mmcblk0p4
179 5 1140583 mmcblk0p5
179 6 4803403 mmcblk0p6
179 7 361431 mmcblk0p7
179 8 995998 mmcblk0p8
179 32 1024 mmcblk0boot1
179 16 1024 mmcblk0boot0
179 48 15558144 mmcblk1
179 49 15554048 mmcblk1p1
That is a 1.1Gig system partition, 4.8Gig data and 1Gig userdata.
I only use 450MB for system without gapps. Pico gapps upped it by about 60 or so but it got stuck in setup wizard. Nano gapps adds 150MB. You need some spare room in system but not 700MB empty. I am sure that you could get away with a much smaller partition. Maybe even 600MB. I am no expert.
I don't remember what the nook standards are, there were two different ones as I recall one with big data/small userdata and the other with big userdata/small data. There is a good discussion on reformatting on the cm-11.0 thread. Look here: http://forum.xda-developers.com/show...70873&page=418 and keep reading. An excellent guide to reformatting with some flashable zips is here: http://forum.xda-developers.com/show...postcount=4177
I had trouble with doing gapps setup so I just dirty flashed over my cm-11 install and flashed the updated open gapps nano package. This may be fixed now, I just don't feel like doing a clean install to test it. I have to reflash gapps since the backup script is broken in this cwm recovery. It didn't work in cm-11 either. I am not sure why it fails. You do need to use the latest CWM to flash this. You can get it from get.cm.
This is from a post by steven676:
Actually ... and I've been meaning to post about this for a while ... CM now autobuilds recoveries. If someone could test http://download.cyanogenmod.org/get/...e-recovery.img (it's a ZIP file -- rename it to .zip, unpack it, and push kernel to /boot/uRecImg and ramdisk-recovery.ub to /boot/uRecRam), that would be greatly appreciated. (The version number should be newer, but it should otherwise be equivalent to the existing hand-build recoveries I've been posting.)
Click to expand...
Click to collapse
To get recovery working you need two files in the /boot directory of the Nook. uRecRam and uRecImg. These are the ramdisk and the kernel respectively, the Rec tells cyanoboot that these are recovery. Once you get them on you computer you need to get them into the boot directory. That is contained in /dev/block/mmcblk0p1
We need a place to mount this block if it isn't already mounted. I use adb:
Code:
#elevate adb status
adb root
#mount the block. I have been using /boot which already exists. You could mkdir /boot or /emmc or whatever and use that
adb shell mount -t vfat /dev/block/mmcblk0p1 /boot
#push the files
adb push <path to ramdisk file> /boot/uRecRam
adb push <path to kernel file> /boot/uRecImg
Now you have the updated recovery ready to boot into from the cyanoboot Menu.
You want to use the minimum of apps, especially google apps. They really hog our poor single processor. Get rid of games, newsstand, movies-and-tv, books, maps and anything else you don't use. I even had to get rid of my homescreen weather widget because it took up too much processing power. Running: > adb shell toybox top < will show you what apps are using too much cpu time.
XDA:DevDB Information
CM-13.0 for Encore, ROM for the Barnes & Noble Nook Color
Contributors
drmarble, steven676
ROM OS Version: 6.0.x Marshmallow
Based On: CyanogenMod
Version Information
Status: Testing
Created 2016-01-20
Last Updated 2016-01-21

Reserved
Here are the promised patch files in zip format. I can't seem to figure out how to attach them to the first post.
Also, is there interest in a flashable zip? You have to reformat your emmc to enlarge system. It is just as slow and annoying as cm-11.0 if not more so. Still, it is kind of fun to have marshmallow running on a 2010 device.

Reserved

Just want to say this is the best thing happening on the Internet!

drmarble said:
time make -j9 bacon 2>&1 | tee make.log ; rm -r /tmp/targetfiles-??????
# I don't like that file removal but the build process fills up /tmp and problems can ensue.
Click to expand...
Click to collapse
This is probably why my two CM-13 builds wouldn't install. I'll see if I can do a new build but right now I am having sync issues on platform/prebuilts/maven_repo/android
Thanks!

bowguy said:
This is probably why my two CM-13 builds wouldn't install. I'll see if I can do a new build but right now I am having sync issues on platform/prebuilts/maven_repo/android
Thanks!
Click to expand...
Click to collapse
I don't think the files in /tmp were causing booting problems. They fill up the root directory and cause the build to crash.
I expect it was caused by not having the correct/current patches to build. My git hub repos for the standard cm base are not current. I only update the repos that aren't standard cm. You don't need any <remove> lines in roomservice.xml. Just applying patches over the current cm repos keeps everything up to date. When you repo sync, the patches are overwritten and have to be reapplied. Eventually, the cm base will change enough that the patches no longer apply. We will have to update the patches then. Using patches lets us keep up with all the other cm changes and improvements.
I don't know why you are having problems with maven_repo. It syncs fine for me.

drmarble said:
I don't think the files in /tmp were causing booting problems. They fill up the root directory and cause the build to crash.
I expect it was caused by not having the correct/current patches to build. My git hub repos for the standard cm base are not current. I only update the repos that aren't standard cm. You don't need any <remove> lines in roomservice.xml. Just applying patches over the current cm repos keeps everything up to date. When you repo sync, the patches are overwritten and have to be reapplied. Eventually, the cm base will change enough that the patches no longer apply. We will have to update the patches then. Using patches lets us keep up with all the other cm changes and improvements.
I don't know why you are having problems with maven_repo. It syncs fine for me.
Click to expand...
Click to collapse
I fixed the sync issue by selectively removing the "clone-depth=1" in default.xml. I now have a clean sync. I tried to run your script with the patches but had all kinds of issues. I will applied the patches by hand. I have a clean build and will try installation tonight
Fun stuff!!

drmarble said:
# core: copy installed ramdisk and bootloader to BOOT/
pushd build
- git am copy_installed_ramdisk_and_bl_to_BOOT.patch
+ git am 0001-copy_installed_ramdisk_and_bl_to_BOOT.patch
popd
#or just use
#repopick -f 120558
Click to expand...
Click to collapse
Minor typo

CM-13.0 up and running
Followed all drmarbles directions above and have a working marshmallow tablet on the nook. I had to fight a little with the default.xml file to get it to sync but after applying all the patches the build went fine and install no problem.
Playing now!
Thanks

bowguy said:
Followed all drmarbles directions above and have a working marshmallow tablet on the nook. I had to fight a little with the default.xml file to get it to sync but after applying all the patches the build went fine and install no problem.
Playing now!
Thanks
Click to expand...
Click to collapse
Hooray!
Now that there are two, my marshmallow nook won't be so lonely anymore.

Dual boot with cm-13
Dual boot works fine on the Nook. Install cm-11 or lower on the SD card as usual. Install cm-13 on emmc. When you boot into cm-13 it will ask you to configure the SD card. Pick the option for portable storage and it will still dual boot. An added advantage on cm-13 is it sees all the SD card partitions and files instead of just the boot partition as in previous versions

drmarble said:
If folks ask politely, I will post a rom.
Click to expand...
Click to collapse
I'd be interested in a ROM if you're willing to upload it!

I'm willing to try..pretty please

I am glad that there is interest. I am currently too sick to trust posting a rom but will put one up soon.
There are a few improvements since I last described it. It now backs up and restores your gapps. You do need to overwrite your old cm-11 gapps on the first install. It correctly mounts the data partition.
You will need the larger system partition described here: http://forum.xda-developers.com/showpost.php?p=54401912&postcount=4177 along with his flashable zips.
I am currently trying to get f2fs working. When I do, I will post new flashable repartition and format zips.

cm-13 rom available:
As promised, here is a flashable rom:
http://d-h.st/lAkX
I recommend reading the last cople of pages of the cm-11 development thread where I discuss some of the limitations of this rom.
You sill need a larger than standard (450M) system partition so use the link provided in my previous post to flash the 1GB system 4.5GB data 1GB media. You will then need to format those partitions with vfat or ext4 as appropriate. You can also do the partitioning by hand as was discussed in the cm-11.0 thread. Start reading here: http://forum.xda-developers.com/showthread.php?t=1370873&page=417 and continue for a few pages. As I remember the update binary in those zips required an earlier cwm version. You can always do the repartitioning by hand with adb shell in recovery.
Note, you will lose all data stored on the internal sdcard. Marshmallow insists on encrypting the data-media partition. Make backups. Store them off the tablet. After formatting, you can restore those cwm backups and get your /data back. Your personal files are up to you.
You can install the open gapps nano gapps. I don't recommend using any larger gapps. These apps really slow down the device. The fewer applications running the better.
If I was healthier I would probably make some repartition and reformat zips with a current update binary. I think I made some back when but cannot locate them now. I expect to get better soon. Never eat bad peanut butter with a broken seal.

Thank you so much for this!!! I repartitioned to a 1GB /system and 5.5GB /data (leaving /media to <8MB since it's useless in Marshmallow) and then clean installed this ROM with pico gapps. It has been running pretty smoothly but definitely slightly slower than KitKat (except with app launches because of ART vs. Dalvik).
A couple notes:
1) The built-in File Manager does not have the option to request root. Is this because SELinux is disabled?
2) I noticed your patches removed the Noto fonts, leaving lots of "tofu boxes" around non-English characters. Was this to save space in /system, and can it be added back?
3) I seem to be getting best performance (especially with YouTube) at max 1200MHz CPU clock and the Deadline scheduler (128kb read-ahead). I/O speed feels like the bottleneck... would f2fs give tangible improvement?
4) None of the fancy display stuff (LiveDisplay, inversion) work which is to be expected. Could it ever be supported by our poor old GPU?

hliew88 said:
A couple notes:
1) The built-in File Manager does not have the option to request root. Is this because SELinux is disabled?
2) I noticed your patches removed the Noto fonts, leaving lots of "tofu boxes" around non-English characters. Was this to save space in /system, and can it be added back?
Click to expand...
Click to collapse
1) Titanium Backup has the same issue.
2) I added back the fonts and it adds 20MB (10%) to the build so it is doable.

Glad things are working for you.
I have finished the f2fs work. It is running fine for me. You can use the f2fs device and kernel trees. I don't think I had to change anything else. I don't notice any improved performance, it is still slow. Maybe a little less. No major change in quadrant scores. We just spend all our time being I/O limited (according to toybox top). I have made a cwm that supports f2fs and an f2fs compatible twrp 3.0 that will backup/restore twrp and change file system types. It just crashes on flashing a rom. I used the twrp to backup and restore my data partition. I don't like reinstalling. I view having to re-login to the play store as a sign of failure. I will get these posted someday. I should also post a document on repartitioning and reformatting. Maybe I can make some flashable zips for that. I think I found my old data/media and format flashable zips. I will leave using twrp to restore the data partition to those who care to look up how it is done. There are some good tutorials elsewhere on xda.
I don't include the noto fonts because adding that 20mb to the zip prevented me from sideloading it. I hate having to upload the roms to the devices.
I should add it back for the zips that I post. I just dumped them for space. Actually, my zips have been getting smaller. The CM code base has been tightened up. Maybe I can include it in sideloadable zips.
I doubt we will get any of that fancy display stuff working. I have been trying to backport the new graphic drivers from the Motorola 360 watch. It uses a 3.10 omap3660 kernel. I haven't had any luck yet. I am just happy that I can watch a youtube video.
I will keep working on making this better. If I try real hard, I might be able to get this official again. There are just a couple of tough build patches. Making the sound libraries and ti omap3 hardware branches into prebuilts shouldn't be too hard. Getting it non-permissive will be a problem. I managed to boot up an selinux enforcing rom but it was mostly just errors in the logcat. There is a lot of niggling, boring work to get enforcing right.
I am glad that someone else is using this rom. Sometimes I feel like I am just building into a vacuum.

drmarble said:
Glad things are working for you.
I will get these posted someday. I should also post a document on repartitioning and reformatting. Maybe I can make some flashable zips for that. I think I found my old data/media and format flashable zips.
Click to expand...
Click to collapse
I would be happy to try the partitioning zip & flashing the rom if you get them all and the updated CWM/TWRP posted. :good:

Is this ROM supported for booting from the SD card or just EMMC?
Thanks for all the hard work. As I don't have the time right now to build, I'll try the flashable version you posted.
I might have to get a build environment running again...

Related

[DEV] CM7 Developers Thread

Please limit this thread to development comments and questions!
The users thread is for all other posts.
When in doubt, post in the users thread.
After many long nights of banging our heads against keyboard, the CM7 port is finally shaping up.
In addition to nightly releases, we may from time to time be releasing test builds here for your feedback and enjoyment. If you find issues please feel free to post here in this thread. Leave all other feedback for the user thread.
Where to get progress news:
I will tweet progress from time to time.
Twitter: @dalingrin
We are usually in #nookie on freenode.
You can always check the Cyanogen [email protected] http://github.com/cyanogenmod​
Current Issues
DO NOT FORMAT YOUR SD CARD IN CM7. DUE TO A VOLD ISSUE THIS WILL FORMAT YOUR /BOOT INSTEAD OF THE SD CARD!
****Should be fixed in nightly 13****
-Standy battery life is not as good as stock
Because of a kernel bug CM7 does not fully sleep. The result
is ~1% battery drain per hour while the screen is off. With normal use I usually go
1 - 2 days between charging.
***fixed in 2.6.32 builds***
-A few apps do not scale to full screen
In order to get Market and Maps to work fully the lcddensity has to be
set to something other than 160 causing a few apps not to scale properly.
-Wifi slow to reconnect at times
****fixed****
-Video playback is slow
****fixed****
-Default rotary lockscreen does not fit screen
****fixed****
-Market partially works
****fixed****
-Bluetooth does not work
****Update**** Bluetooth now works in CM7.
Bluetooth is working seemingly perfect except for the range. Unfortunately, the range is terrible.
Depending on the device you are paried with, the range is between 1-5ft. Any ideas on how to
fix the range issue would be much appreciated.
-Do not use SetCPU profiles
If you enable SetCPU profiles it will become a runaway process eating 100% cpu.
Setting your cpu clock can be done in Cyanogenmod Settings. Under Performance->CPU Settings
-Internal storage partition is not mounted on boot and is not shareable via USB
****fixed****​
Download and Install
MUST USE 3.0.1.0+ RECOVERY:
This is installable ONLY with an ext4 aware Clockwork Mod Recovery.
*** Also it is critical to be aware that installing CM7 will write to the internal emmc of your device. You are advised NOT to try it. But if you choose to do so, understand you do so entirely at your own risk. Read sections 15-17 of the GPL for the gist of this disclaimer. There is no warranty or claim of usefulness or fitness for any particular purpose. No one but you shall accepts responsibility for what may happen if you download or try to use this development software. ***
Download for CM7:
Nightlies:
http://mirror.teamdouche.net/?device=encore
Install instructions:
http://forum.xda-developers.com/showpost.php?p=11452450&postcount=19​
Post Reserved.
Developer Tips
(Standard do-at-your-own-risk-and-responsibility disclaimers apply.)
* For those developers building from source:
In $OUT, you'll find a few files:
recovery.img --> rename to uRecRam
kernel --> rename to uRecImg
Now you've got the ext4 clockworkmod for mmc built from source.
* Also, there's also a script in $OUT called:
sd_ramdisk_packer.sh
Assuming this works, it should repack your $OUT/root (mmc ramdisk) into a uRamdisk that can be used with a bootable SDcard. The stuff in /system would go in the /system partition of the SD card (p2).
The result: a bootable CM7 on SD. It may not be wise to distribute as Cyanogenmod for encore is a fast-moving target-- unless you plan to create a new one every day or something.
* If you don't like the buttons at the top for some reason, there's the SoftKeys app as well as Button Savior.
* There is a slightly-themed u-boot.bin in device/bn/encore/prebuilt/boot/. It is simply a recompiled u-boot from BN's source.​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Info about emmc geometry
If your emmc is hosed and you want to start COMPLETELY from scratch, understand that the underlying geometry (before any partitions are created) of your emmc must be set up correctly on OMAP machines such as the nook before any partitions are created.
You can read more about that stuff here. If you are booted into an "emergency" SD card and have a totally hosed emmc, you can use fdisk to format /dev/block/mmcblk0 to the correct geometry, and then create the partitions one at a time, with a vfat partition as your /boot partition (p1). Then put mlo, u-boot.bin, uImage, uRamdisk, uRecImg, and uRecRam in /boot (p1) and you should have a bootable system.
Read the link above about SD/MMC formatting for OMAP3. Your nook is an OMAP3621, so you gotta get that geometry right, otherwise it won't boot. Luckily, the instructions on using fdisk are pretty good.
More info:
your emmc: /dev/block/mmcblk0
your sd: /dev/block/mmcblk1
Partition Info
the partitions you should have created are at:
/dev/block/mmcblk0p1 == /boot
/dev/block/mmcblk0p5 == /system
etc
/boot, /rom, and /media are of type "vfat"
/system, /data, and /cache are of type "ext4"
/factory (p3) isn't used by cm7
partition 4 is just there to allow you to create partitions 5-8
Sample instructions for copying files from cm7 update.zip on local computer to emmc /boot
You should be able to copy those four files simply by getting the lastest cm7, unzipping it on your computer, then once you boot into your bootable SD card, do:
Code:
COMPUTER> adb shell
# mkdir /data/bootmountpoint
# mkdir /data/systemmountpoint
# mount /dev/block/mmcblk0p1 /data/bootmountpoint
# mount /dev/block/mmcblk0p5 /data/systemmountpoint
# exit
COMPUTER> adb push mlo /data/bootmountpoint/
COMPUTER> adb push u-boot.bin /data/bootmountpoint/
COMPUTER> adb push uImage /data/bootmountpoint/
COMPUTER> adb push uRamdisk /data/bootmountoint/
COMPUTER> adb push my/path/to/sdcard/system /data/systemmountpoint/
Man, everyone makes better (prettier) release threads than I do.
oups, to delete
I can mount SD card find from my PC on Ubuntu.
Some apps don't show up on search, only one worth noting right now is Dolphin browser. I can find all kinds of add-ons, but not the app itself.
The lockscreen defaulted to the slider, but when I rebooted it went back to rotary. I went to settings and changed it back to slider.
Edit: Also to note is when I first launch the market, I get a force close on search function unless I use menu->search first. Will try fix permissions. Edit: fix permissions doesn't work, I must use menu->search the first time.
Edit 2: Beautiful Widgets shows up in market but says it isn't there when I try to install.
I had no trouble mounting SD to my PC (windows 7 64). I don't remember which now, but many apps showed in market, allowed me to install, but when I tried to 'open' from their market page I was told they weren't there - just opening my app drawer showed them and they worked fine. Something in market for that one.
screen on/off notification
is the screen on/off setting working?
I've also been able to mount to sd via Ubuntu and OS X.
Is there any way to get/use the recovery without using a burn to SD method?
going to try it out now... thanks dalingrin
i notice the file name is the same as the first test release. hopefully i have the right file.
-edit-
so yes i did have the correct file. lockscreen fix works and am still able to change it to rotary although it 'appears' to be set on rotary already.
market works... so far i have not found anything missing.
i have not been able to connect to usb. first connect got me a failed driver install and i don't see any usb mounting option in settings. -edit- just tried again and now it works? probably a windows thing.
dalingrin said:
Fixes that need testing
-USB storage mounting
We need folks to test mounting your sd card from within CM7 onto your computers.
-Market Access
This build contains a partial fix for Android market filters. I don't expect all apps to be available yet but I'm not sure what is and not available in the current build.
-Default lockscreen
I have submitted a patch upstream to change the default lockscreen from rotary to the traditional slider. This is because the rotary lockscreen does not scale for the nook. This patch required changing some mechanics in CM and needs testing. In particular, it needs to be verified that the initial lockscreen is the traditional slider but can still be changed in Cyanogenmod Settings.
Click to expand...
Click to collapse
zpure awesomeness! I can't wait for the bugs to get ironed out
here is a problem I have noticed. When I try to buy and app I get a force close and I cannot purchase an app.
UPDATE: I installed the newest market 2.3.2 and it does the same thing. I did the wipe cache, force stop on market and framework services, rebooted and still cannot purchase apps. Gotta be something in the build that is causing it to stop. I can download free apps just fine and the apps I already purchased.
jkurl said:
here is a problem I have noticed. When I try to buy and app I get a force close and I cannot purchase an app.
Click to expand...
Click to collapse
just checked this and i get force closes as well.
It's a beautiful thing. Thanks for the great work, guys!
I flashed the update from the original version that thecubed released and can report the following market bugs:
Astrid, Facebook, and Flixster do not show up in the market.
In the market, clicking on All Games / Top Free leads to a loading circle that never completes (no results ever get shown).
So there seem to be 2 different RC1s (both called the same thing) plus a single nightly. Which one should we be testing?
No maps, Facebook, or pulse in market running release from this thread
FletchF said:
So there seem to be 2 different RC1s (both called the same thing) plus a single nightly. Which one should we be testing?
Click to expand...
Click to collapse
OK, I gather it went like this:
old RC1->first nightly->this newer RC1
so, test the RC1 from this thread until newer nightlys start to appear.
These are the only apps I use I can't see in the market:
imdb
minimalistic text
google maps and street view
simi clock
wolframalpha
speedtest.net
I tried adb pushing all of them but wolfram from my htc desire. Imdb, minimalistic text and simi clock work, speedtest and google maps force close.
I also pushed Cyanbread.apk to /system/app and selected it from theme manager, it also seems to work great.
In the market, clicking on All Games / Top Free leads to a loading circle that never completes (no results ever get shown).
Click to expand...
Click to collapse
That only happens sometimes for me. Most of the times it works without problems.
(edit) Oh, and mounting the sd card also works ok.

[2015/03/07] BotBrew: *nix tools for Android

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The remainder of this post contains historical information. Please read the update. Thank you.
__________________
​ BotBrew is
a repository of *nix software (such as bzip2, curl, openssl, python, and ruby) for ARM-based Android
a package manager powered by Opkg, a lightweight program that feels like dpkg+apt
a service manager powered by runit
a build system for anyone looking to build and package his/her own scripts and programs
Thanks: mateorod and xela92 for testing the heck out of this thing; racks11479 for delicious artwork; you for using this project, reporting bugs, and making it better
If I missed anyone, let me know!
Warning: BotBrew has been used successfully on a variety of rooted ARM devices, and is developed using a Nook Color, but you should still make backups before trying, just in case.
Install BotBrew
[ Google Play | BotBrew.apk | BotBrew.debug.apk ]
Read the Quick-Start Guide & Manual
[ botbrew.com/manual.htm ]​
Click to expand...
Click to collapse
Alternative (Command Line) Installation
If the BotBrew app fails to bootstrap, you might be able to bootstrap using the command line:
Code:
wget http://repo.botbrew.com/anise/bootstrap/install.sh -O- | su
Such a setup should be compatible with the app, though it may not work perfectly. The manual has more tips for command line usage.
Enjoy!
Install BotBrew+1
The next release of BotBrew, named basil, will be powered by Debian's Dpkg and Apt. This is a non-trivial update, so the app is being rewritten from scratch. I've posted some usage instructions, in case you are adventurous enough to try. Thanks! This app may be used in parallel with the current-stable BotBrew release, without conflict.
[ Google Play | GitHub ]​
Click to expand...
Click to collapse
Changes
5/20: the next release of BotBrew is in development!
4/20: improve support for long package names; fix list of repairable packages
4/16: new UI for devices with wide-enough screens; experimental support for moving to /sd-ext
4/9: Google Play release of BotBrew "anise"; previous release is now BotBrew.oldstable.apk; lots of updates since oldstable
3/16: lots of installer and filesystem changes for cross-device compatibility, work started on multiuser support
3/10: installers now depend on botbrew-core, which will (in the future) pull in basic packages that everyone should have
3/4: swipe left and right to see all/installed/upgradable packages
3/3: added ability to start installation of *.opk files from file managers
3/2: added ability to start installation from browser after clicking *.opk link
3/1: fixed some BotBrew.apk bugs; updated command line installer
2/27: reworked BotBrew.apk; new packages in stable repo
2/18: testing repository now open; new opkg -- please read before upgrading
2/16: make BotBrew.apk display latest versions in the package list
2/2: bugfix release of BotBrew.apk
Well, I now have python, ncurses, openssl and a couple other packages running on my nook. I have indeed printed 42, and even wrote my own (proprietary) code to advance the project some that printed 43. Advanced scripting.
But seriously, this is sweet. I am all over anything that opens up this device. I don't think I have ever bought a piece of hardware that has so outstripped my expectations.
Thanks for the program. I will report back after I play with it some.
Wow, what a great idea! Looks like my Nook will be used for a bit more than entertaining my family with casual games; nice to have some productivity back I was thinking about installing Ubuntu on my Nook for this sort of thing, but there's no need anymore.
It would be great to get this a bit more recognition, and getting more useful things such as gcc or even the GNU toolchain installable with this package manager. Might put a link in my signature, if you don't mind.
Now to look for an affordable lightweight bluetooth keyboard...
You read my mind I got binutils, gmp, mpfr, and mpc working earlier today... and gcc is in the pipeline. My main reason for wanting a native gcc is that some software (such as python) do not like to be cross-compiled at all. I'm having a bit of trouble with gcc, but I'll keep hacking away at it.
Please, go right ahead and share this thread; this is a young project but I think it could be more useful. On the one hand, there's a whole lot of free software (such as the GNU stuff) just asking to be built and packaged; on the other hand, many people who hang out around here have a few scripts/programs of our own to distribute.
In case you're interested, here's where all the packages live. There are actually two more ways to install (remote and local) stuff using Opkg:
Code:
opkg install http://host/path/to/package.opk
Code:
opkg install path/to/package.opk
Very nice project !!!
I have python 2.7 standalone on android.
One problem, in python commandline i can't import hashlib, i can fix this?
Thanks.
So, I just got a working build of GCC+binutils and pushed the packages to the stable repo. Please keep in mind that for now, stable means I tested it a couple of times and it works, so be careful and use at your own risk.
To install gcc and binutils, make sure you have about 160mb of storage free in /system and run:
Code:
opkg update
opkg install gcc-4.6
That's about 70mb's worth of downloads, and my server's underpowered, so please wait patiently and retry if it fails (failure when receiving data from the peer). When that's done, you might want to compile something:
Code:
cd /cache
wget http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c
gcc -o hello hello.c
And if that completed successfully, you should have a new executable, which you could run for a classic greeting. I was not able to get the C++ libraries compiled, but C code should compile alright.
@Fritos2: I've been trying to fix this issue, but I'm not confident that I could do it without help. Python (and Perl) are very resistant to cross-compilation, and even after I hammered it into submission, some modules do not work. Another module that I'd really like is readline, which gives you enhanced editing capabilities in the interactive interpreter. I'm a Pythonista, but I've got to say: Ruby does cross-building right. Even sqlite3 supports readline. I suspect that Python might have to be compiled natively, and this is where native gcc comes in.
I'd appreciate any help, of course
I'll follow this project with great interesting.
Hey guys, there have been a few updates:
opkg's lock file has been moved to /cache/opkg/lock so there's no need for a read-write /system just to query packages
gnupg has been packaged, for those who like to sign their stuff
python... well, I'm still working on it >.<
Anyway, I thought I'd do something to make this project more accessible. I don't have any apk's for you yet, but I've attached a screenshot of the work-in-progress
I am very impressed with the progress. I am a super-noob but have enjoyed toying with the packages from your opening post. I haven't had time to do much but explore, but this sure does open up a whole new world for the nook, from an accessability stand point alone. I wouldn't be suorised to see an uptick in interest as some if the more experienced coders are able to turn their attention from cm9.
I will probably install those latest packages sometime this weekend. Just real strong stuff.
Edit. Ok, o I just went ahead and did it now. Obviously, I couldn't get it to work. Have downloaded the FCC and got the hello file fro the dropbox. I ran the gcc -o hello hello.c and was returned a hashtag only. If I ran gcc hello, it outputted the hello program code. I tried several things basically willynilly until I got tired of getting a fatal error and having the build canceled.
If this is too basic and will clog the thread, I would happily accept a pm with a good tutorial. Thanks a bunch.
The problem with python maybe relationed with python-devel package?
Sorry is the question is stupid, i'm so noob.
The Python build process has two steps: first, you get the main Python executable, and then you get the modules. The executable built in the first step is used to test the modules in the second step. So, naively cross-compiling Python would result in most modules not passing the test (because you cannot actually run the Python you just built), and these modules would be removed. As it turns out, you could patch the build scripts to run the tests using a host-native Python, but even then, there are a few modules with particular requirements that still don't pass. This is where we are now, but I think we could do better.
Okay, so more progress: BotBrew.apk is out in the wild! I decided to put it off until I got some basic functionality working. What is this?
a basic GUI for package management
lists all packages
searches for packages by name
shows package information
installs/upgrades/removes packages
manages list of repositories
I've only really tested it with CM7, but it works on the latest CM9 previews as well.
Screenshots
​
mateorod said:
Edit. Ok, o I just went ahead and did it now. Obviously, I couldn't get it to work. Have downloaded the FCC and got the hello file fro the dropbox. I ran the gcc -o hello hello.c and was returned a hashtag only. If I ran gcc hello, it outputted the hello program code. I tried several things basically willynilly until I got tired of getting a fatal error and having the build canceled.
Click to expand...
Click to collapse
No worries. If gcc did not complain and dropped you back in the shell, this means it's done! Just list the directory to find a new file named hello, which you could run:
Code:
# gcc -o hello hello.c
# ls
backup download hello.c opkg
dalvik-cache hello lost+found recovery
# ./hello
hello world
#
I hope this helps!
Sorry if this sounds ignorant but is there any future usage aside from being a very interesting project? Will we be able to distribute open source projects / software specifically made for Android devices like on common Linux distributions?
BobbyBest said:
Sorry if this sounds ignorant but is there any future usage aside from being a very interesting project? Will we be able to distribute open source projects / software specifically made for Android devices like on common Linux distributions?
Click to expand...
Click to collapse
A valid question, I think. BotBrew has the potential of becoming a Cydia of sorts, distributing system extensions, interface customizations, and other useful software for rooted Android devices. Android has a vibrant community of programmers and scripters, but there isn't any standard way to manage software that are not apps. And there's a large body of open source Linux software that might work well on Android. Of course, BotBrew is also able to handle root apps that live in /system/app (i.e. gapps); for user-level apps, the various app stores already work quite well.
In order for this to become a serious platform, we'll need a couple of things: a solid technical foundation, developer support, and a user base. I've been making progress mostly towards the first point; hopefully the rest would follow.
Well I'll be. Yeah it worked. Who knew?
Okay, so that's great! I have printed 43 (my own design) and now the standard greeting has been successfully built and ran as well. I must toodle with it some more. What would you recommend to try? Remember, i am slow-witted and totally inexperienced.
If you say print 44 i will totally understand. : )
How about this, i would like to learn and i would like to help you with your program. I will probably be of most use as a guinea pig, but since i spend a fair amount of time jiggering system files and databases, I have to complete wipe about once a week. failure or risk doesn't bother me.
---------- Post added at 02:27 AM ---------- Previous post was at 01:51 AM ----------
Okay, i just got the apk. I autoremoved all installed packages. I installed opkg, python, gcc (binutils came along as a dependency) and the hello executable. But when i went into a terminal once i cd cache, it only lists opkg out of the five packages. This worked when i did the wget through the terminal. The packages show as installed within the botbrew app (nice icon and UI, btw).
I known I am doing something very simple incorrectly. Do you have enough information to be able to tell me what that is?
Congrats on a successful build! Now that you have a working program, you could package it up for distribution
What's more, you could do it directly on Android. Let's call this package mateorod-hello, prefixing it with the vendor's (your) name to avoid conflicts with other variants. We'll also rename the executable itself.
We'll install the program to /system/bin, where it would feel at home with all the other programs; so we create a staging directory tree that mimics the structure of an Android system, but contains just the one program:
Code:
cd /cache
mkdir -p system/bin
cp hello system/bin/mateorod-hello
Next, we need a control file to describe what's in the package. It might be easier to create the file on a computer and push it over, but we could also create it using the command line:
Code:
echo "Package: mateorod-hello" > control
echo "Version: 1.0" >> control
echo "Architecture: armeabi" >> control
echo "Description: a greeting from mateorod" >> control
And, finally, a magic value to signify what kind of package this is:
Code:
echo -n "2.0" > debian-binary
Okay, now let's pack this up:
Code:
tar zcvf data.tar.gz system
tar zcvf control.tar.gz control
ar -r mateorod-hello.opk debian-binary data.tar.gz control.tar.gz
We now have mateorod-hello.opk, which we could test by installing:
Code:
opkg install mateorod-hello.opk
Now that it's installed, the program within is also available:
Code:
mateorod-hello
This is quite a bit of work for something that could just be pushed over adb, but it could be automated and it works tremendously well for more complex software. The control file helps keep track of versions, and lets you specify dependencies too.
Oh, and to clean up a bit: (the first command makes sure you're in /cache and do not accidentally erase /system)
Code:
cd /cache
rm -r system control data.tar.gz control.tar.gz debian-binary
/edit:
mateorod said:
But when i went into a terminal once i cd cache, it only lists opkg out of the five packages. This worked when i did the wget through the terminal. The packages show as installed within the botbrew app (nice icon and UI, btw).
Click to expand...
Click to collapse
What did you do, cd /cache then ls? If so, you're most likely looking at the /cache/opkg directory, which contains temporary data. If you want to see what's installed using the command line, try opkg list-installed
I uh... picked a random icon I had lying around, and I plan to swap it out when I have time to make one. Thanks, though :3
The amount of help you're offering is just staggering. I will put the above together tonight and will report back.
I have a bug here in the GUI.
Rotation makes the app start looking for updates again.
edit: Reentering does the same...
opkg has then problems with set locks.
(CM7 KANG by MiRaGe)
Currently trying to install gcc to compile and run a small program...
edit2: gcc-4.6 installed. Still trying to compile a small prog. Will continue tomorrow...
Edit3: Well, problem with GUI fixed itself somehow.
Still, maybe you should check out how the GUI behaves during the installation process when rotated.
Yes, I can see how this bug could occur, and it should only happen during the first run. When the package cache is empty, the app tries to update by itself, and it seems that rotation causes something to restart. I've uploaded an update, which hopefully fixes this issue. Thanks for the report.
/edit:
Bug fixed for real. You may now rotate with impunity. Man, why can't Android have sensible defaults?
Okay, took me awhile, but...
$ export PATH=/data/local/bin:$PATH:.
$su
# cd cache/
# wget http://dl.dropbox.com/u/1213413/htdocs/agcc/hello.c
Connecting to dl.dropbox.com (174.129.218.194:80)
hello.c 100% |************************************| 93 0:00:00 ETA
# gcc -o hello hello.c
#ls
dalvik-cache hello lost+found recovery
download hello.c opkg
# ./hello
hello world
#mkdir -p system/bin
# cp hello system/bin/mateo-hello
#echo "Package: mateo-hello" > control
#echo "Version: 1.0" >> control
#echo "Architecture: armeabi" >> control
# echo "Description: a word from Mateo" >> control
#echo -n "2.0" > debian-binary
# tar zcvf data.tar.gz system
system/
system/bin/
system/bin/mateo-hello
# tar zcvf control.tar.gz control
control
# ar -r mateo-hello.opk debian-binary data.tar.gz control.tar.gz
ar: creating mateo-hello.opk
#opkg install mateo-hello.opk
Installing mateo-hello (1.0) to root...
Collected errors:
Two sets of collected errors related to system not being mounted R/W excised
Installing mateo-hello (1.0) to root...
Configuring mateo-hello.
#mateo-hello
hello world
#
So there it is. I just followed your more-then-generous guide, with some phrasing changes to show i didn't just copy/paste.
Some notes from the inexperienced:
-As you can see, I had to use the wget command to work on the hello.c script. I had hello as an installed package through the Botbrew GUI already, but no matter what permutation of hello command I ran, gcc would not recognize it as an input file. Just to say that your guide to the initial build, as written, i don't think will work for anyone who installs the packages through the apk. I don't know the solution, but i bet it's simple.
Edit: I guess the package you get through your apk is a fully built executable? I hadn't gone through the later steps when I first tried to build it, so I never thought to simply enter "hello". Output a much fancier greeting then the one I built. Capital letters and an exclamation mark! Very nice.
- For other newbies- make sure that system is mounted R/W through root explorer or some such. And if you employ a firewall, if you intend to use the wget command, not only do you need to allow your terminal through, you also need to allow applications running as root! I am sure this is news to no one, but it cost me FOREVER!
I feel like this constitutes progress. Thanks for all the work!

[GUIDE] Make any rom OS2SD

OS2SD for any rom ​
As I see there is many P500 users interested to put their ROM to sd card, so I'm providing this tutorial how to make any rom bootable from sd.
Requirements:
Linux or cygwin for Windows
Boot.img tools
Modified updater-script
Modified fstab
Correctly partitioned sdcard (Guide)
TWRP-OS2SD or TWRP-MULTI
Steps:
Replace updater-script in your's ROM zip with provided. It will probably work with all kitkat based roms. If not the idea is mounting /system on sd card so change all "mount("yaffs2", "MTD", "system", "/system");" lines with "mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/system");" in original updater-script
Extract bootimg-tools.zip and paste boot.img from your rom in same foder
Open terminal or cygwin, locate folder with boot.img tools and type "./extractboot boot.img"
This will create out folder. Replace fstab.p500 and init.qcom.rc in out/ramdisk with provided (they might need rework on older roms)
In terminal type "./packboot"
Now rename boot_new.img to boot.img and pase it to rom zip
Flash rom zip with one of provided TWRP versions
should probably work back thru 4.0 but froyo/gingerbread init won't mount any sd partitions before boot is completed.
just curious, why this partition layout?
I used p2 for /data until wiping it by accident several times swapping my sd to a phone with pre-os2sd recovery.
of course, I've modded my own os2sd partition map several times now experimenting, and the order doesn't seem to matter.
and i was wondering, could you post your twrp modifications for internal/os2sd hybrid? i had one kinda working but it was glitchy.
I used this configuration to keep swap working if enabled, because default is p3. Also p4 for /data because it not used by anything else, so it's safe. I think you are right, order doesn't impact performance. Will send you config of twrp then be on pc.
Sent from my LG-P500 using xda premium
HardLight said:
I used this configuration to keep swap working if enabled, because default is p3. Also p4 for /data because it not used by anything else, so it's safe. I think you are right, order doesn't impact performance. Will send you config of twrp then be on pc.
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
I'm not seeing any other ROMs of this style floating around.
The only reason I didn't leave p3 for swap is that it wasn't being used yet when I started with the os2sd stuff. I tried sticking it on p2 (instead of the stubby sd-ext I had there to satisfy the odd this-or-that which demanded sd-ext,) and that worked ok, but I hadn't set sd-swap as a default in any builds.
since you're building similar stuff now, maybe I'll drift mine into your partition map in the interest of some sort of unification. and I'd like to match up the twrps, too.
especially if the sd-swap is working well on the p500.
everybody who's been dealing with my versions for any length of time now since it came out in February, is used to having to upgrade recovery and deal with incompatible backups from earlier releases anyway.
thanks for your contributions.
Thank You
HardLight said:
OS2SD for any rom ​
As I see there is many P500 users interested to put their ROM to sd card, so I'm providing this tutorial how to make any rom bootable from sd.
Requirements:
Linux or cygwin for Windows
Boot.img tools
Modified updater-script
Modified fstab
Correctly partitioned sdcard (Guide)
TWRP-OS2SD or TWRP-MULTI
Steps:
Replace updater-script in your's ROM zip with provided. It will probably work with all kitkat based roms. If not the idea is mounting /system on sd card so change all "mount("yaffs2", "MTD", "system", "/system");" lines with "mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/system");" in original updater-script
Extract bootimg-tools.zip and paste boot.img from your rom in same foder
Open terminal or cygwin, locate folder with boot.img tools and type "./extractboot boot.img"
This will create out folder. Replace fstab.p500 and init.qcom.rc in out/ramdisk with provided (they might need rework on older roms)
In terminal type "./packboot"
Now rename boot_new.img to boot.img and pase it to rom zip
Flash rom zip with one of provided TWRP versions
Click to expand...
Click to collapse
Thank You for posting the guide as requested. Awesome, now I will try to make some ROMs bootable in sdcard, and try them in my phone.
bigsupersquid said:
should probably work back thru 4.0 but froyo/gingerbread init won't mount any sd partitions before boot is completed.
Click to expand...
Click to collapse
i think that you are wrong
i have a gingerbread installed on SD (and kitkat CM11 by mukulsoni on internal)
i used Multirom manager 5.1 by arnab321 based on work by Tassadar
http://forum.xda-developers.com/showthread.php?t=1828151
HardLight: can you make this procedure work like the one in Multirom ?
it allows me to have GB and KitKat installed at the same time, both are bootebel using the same recovery and im only a boot away from moving from one to the oder
danielboro said:
i think that you are wrong
i have a gingerbread installed on SD (and kitkat CM11 by mukulsoni on internal)
i used Multirom manager 5.1 by arnab321 based on work by Tassadar
http://forum.xda-developers.com/showthread.php?t=1828151
HardLight: can you make this procedure work like the one in Multirom ?
it allows me to have GB and KitKat installed at the same time, both are bootebel using the same recovery and im only a boot away from moving from one to the oder
Click to expand...
Click to collapse
multirom has preinit of its own, runs before GB init, and uses busybox to mount sd folders. It also mods init.rc to not mount the MTD partitions.
it would have to be recoded because, among other things, init.rc doesn't mount the filesystems anymore, it's moved to init.qcom.rc or init.device.rc (init.p500.rc or init.thunderc.rc in the current OS2SD versions.)
to use OS2SD like multirom, it would have to bind-mount folders or filesystem images from the card instead of mounting partitions directly, unless android can 'see' more than 4 card partitions now. It used to be limited to 4 back in GB.
Plus unless kexec is working every OS installed has to work with the kernel in the boot.img for tasssadar's original code (the app you're using is reflashing a new boot.img every time you change OS's, which will eventually trash your boot NAND memory,)
bigsupersquid said:
multirom has preinit of its own, runs before GB init, and uses busybox to mount sd folders. It also mods init.rc to not mount the MTD partitions.
it would have to be recoded because, among other things, init.rc doesn't mount the filesystems anymore, it's moved to init.qcom.rc or init.device.rc (init.p500.rc or init.thunderc.rc in the current OS2SD versions.)
to use OS2SD like multirom, it would have to bind-mount folders or filesystem images from the card instead of mounting partitions directly, unless android can 'see' more than 4 card partitions now. It used to be limited to 4 back in GB.
Plus unless kexec is working every OS installed has to work with the kernel in the boot.img for tasssadar's original code (the app you're using is reflashing a new boot.img every time you change OS's, which will eventually trash your boot NAND memory,)
Click to expand...
Click to collapse
ill start at the end
flashing boot is no worse then flashing a new rom but its less work and less time
i like GB for the speed and batt use but from time to time i need to run ting that wont work on GB(at list not on the 1 i chose after trying ~12 rom`s)
having kitkat installed and using multirom to change is faster
so, any chance of implementing the bind-mount option?
prite please
:fingers-crossed:
danielboro said:
ill start at the end
flashing boot is no worse then flashing a new rom but its less work and less time
i like GB for the speed and batt use but from time to time i need to run ting that wont work on GB(at list not on the 1 i chose after trying ~12 rom`s)
having kitkat installed and using multirom to change is faster
so, any chance of implementing the bind-mount option?
prite please
:fingers-crossed:
Click to expand...
Click to collapse
Just install your GB rom to internal memory and cm11 OS2SD to sd card, then make two flashable zips (or backups) of both roms boot.img and flash them respectively to rom you want to boot. Just keep in mind that GB won't be able to use sd-ext, because it's os2sd system partition.
Sent from my LG-P500 using xda premium
HardLight said:
Just keep in mind that GB won't be able to use sd-ext,
Click to expand...
Click to collapse
this is way i was hoping for the mount-bind
at the moment GB is on P2, swap on P3 and kitkat uses P4 as /sd-ext
i have some limited knowledge, ill try to see if i can do something wen ill have the time
any pointer on how i can use mount-bind ?
all the work on developing the p500 helps extend it life
thanks
p.s.
what is the MULTI in TWRP-MULTI?
danielboro said:
this is way i was hoping for the mount-bind
at the moment GB is on P2, swap on P3 and kitkat uses P4 as /sd-ext
i have some limited knowledge, ill try to see if i can do something wen ill have the time
any pointer on how i can use mount-bind ?
all the work on developing the p500 helps extend it life
thanks
p.s.
what is the MULTI in TWRP-MULTI?
Click to expand...
Click to collapse
the multi can flash os2sd & normal rom, so you have not to change between recoveries
ThAnKs
Thanks alot for this guide.....
have anyone tried it on an ICS rom ?
getting this error using cygwin
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
maybe it doesnt work with cygwin , i am trying to make genetICS 9.1.6 OS2SD compatible ..
nomancoolboy said:
getting this error using cygwin
maybe it doesnt work with cygwin , i am trying to make genetICS 9.1.6 OS2SD compatible ..
Click to expand...
Click to collapse
For starters , you need Perl installed for that script.
Second, ics don't use fstab, you'll have to change init.rc
And maybe even recompile init with a delay inside, like on GB.
otherwise init may not mount the card partitions.
The easy way to run ICS from card is tasssadar's multirom. You can find the thread buried in this forum.
I'm using HardLight's GenetICS 9.1.7 with the OS2SD mod. It's the most stable and smoothest with long battery life and 1.5GB in the data partition for my apps. Also successfully made it with Hephappy's ICS Plus simply modifying the updater-script inside the zip and search the mounting points in the 'init.rc' and 'init.qcom.rc', then just have to modify the lines following the first post.
Greetings from Costa Rica!
Enviado desde mi LG-P500 usando Tapatalk
@HardLight
This is twrp-multi, renamed to boot.img. I have previously extracted recovery images this way using apktool.
[email protected]:~/bootimg-tools$ ./extractboot boot.img
Page size: 2048 (0x00000800)
Kernel size: 2803424 (0x002ac6e0)
Ramdisk size: 2294087 (0x00230147)
Second size: 0 (0x00000000)
Board name:
Command line: mem=471M console=ttyMSM2,115200n8 androidboot.hardware=p500 no_console_suspend
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
gzip: ../../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Any other tools needed to make this work? (ubuntu 14.04)
manu3193 said:
I'm using HardLight's GenetICS 9.1.7 with the OS2SD mod. It's the most stable and smoothest with long battery life and 1.5GB in the data partition for my apps. Also successfully made it with Hephappy's ICS Plus simply modifying the updater-script inside the zip and search the mounting points in the 'init.rc' and 'init.qcom.rc', then just have to modify the lines following the first post.
Greetings from Costa Rica!
Enviado desde mi LG-P500 usando Tapatalk
Click to expand...
Click to collapse
Can you share the modified files to be replaced in the rom.
hi all - thanks for these instructions. I tried to apply these to cm-9.1.5-GenetICS-Final-P500+gapps.zip and cm-9.1.7-GenetICS-HardLight-p500.zip.
In those roms I had to update the updater-script (I had to remove the format command otherwise the install would fail - but i figured that should be ok since the ext4 partition can be formatted externally - if i remember to do it).
I also updated the init.rc in the (mount mtd partitions section), but no updates to the init.qcom.rc
Each time I try to install a ROM, the device gets stuck at the LG boot logo.
I get the same problem with those zip's installing from TWRP MULTI's "Internal" mode. So I suspect something else is wrong...
interestingly, the only zip I can install successfully is the cm11.0.0-20160101-os2sd-ext4-p500.zip. Works like a charm, just dies in a matter of hours with Wifi on.
eldamobo said:
hi all - thanks for these instructions. I tried to apply these to cm-9.1.5-GenetICS-Final-P500+gapps.zip and cm-9.1.7-GenetICS-HardLight-p500.zip.
In those roms I had to update the updater-script (I had to remove the format command otherwise the install would fail - but i figured that should be ok since the ext4 partition can be formatted externally - if i remember to do it).
I also updated the init.rc in the (mount mtd partitions section), but no updates to the init.qcom.rc
Each time I try to install a ROM, the device gets stuck at the LG boot logo.
I get the same problem with those zip's installing from TWRP MULTI's "Internal" mode. So I suspect something else is wrong...
interestingly, the only zip I can install successfully is the cm11.0.0-20160101-os2sd-ext4-p500.zip. Works like a charm, just dies in a matter of hours with Wifi on.
Click to expand...
Click to collapse
roms not built for kernel swapped system/userdata (kitkat only built this way, and not older kitkat versions) will flash to the wrong partition and won't boot.
change your updater-script to switch system and userdata for older roms to flash correctly with the twrp-multi in internal mode.

Moving dalvik-cache from /data to free up some space

Hi guys !
I wanted to share some thoughts on more efficient dalvik-cache placement.
There are two paths we can take here:
- move some or all of dalvik-cache to /cache partition,
- increase size of cache partition using other, unused parts of or flash.
I'll write all the stuff in order from the easiest to most complicated.
1A. Moving some dex files to /cache
Open your /system/build.prop and make sure that parameter dalvik.vm.dexopt-data-only is set to zero - either change it or explicitly set it, if is not there. This will cause dex files for all apks from /system partition to go to /cache - for Vanir it's about 65M. Good start
In theory you could move an apk from /data/app to /system/app and after reboot the dex file would move to /cache, but this creates two kinds of problems:
- after an update the app is on /data again and the dex file also,
- if you flash another rom, you'll most likely loose those apps, which isn't always desired, but this has a solution I'll give later.
1B. Moving entire dalvik-cache to /cache partition
If your dalvik-cache is smaller than /cache partition you might as well move it there entirely. There are few ways to do it, I'll show one of them.
Copy /fstab.samsungjanice somewhere (like /data/local/tmp/) and append (at the end!) the following line
Code:
/cache/dalvik-cache /data/dalvik-cache none bind defaults
Reboot into recovery and ensure that /data and /cache are mounted. Connect with adb and then run those:
Code:
mkdir -p /cache/dalvik-cache
chown system.system /cache/dalvik-cache
chmod 771 /cache/dalvik-cache
cp -a /data/dalvik-cache/* /cache/dalvik-cache
rm -f /data/dalvik-cache/*
Now move the modified fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice and reboot.
If everything went fine, you've just earned up to 300M more on /data
BEWARE that those two solutions are exclusive - either one, or the other. I don't know what happens if you use both - either nothing or it won't boot. You can of course switch between them - just don't enable both at the same time.
But... what if 300M is not enough? Then you can either stay with solution 1A or:
2. Enlarge /cache partition
Since preload, fota and kernel2 partitions aren't used (usually), we can extend /cache with them. This can be achieved either with repartitioning the flash or using lvm. I suggest the latter.
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
Converting Cache and Preload to LVM
This way you can have over 600M of /cache, and if you throw in fota and kernel2, even around 670M.
Having done that you can use either 1A or 1B depending on what you want. If you don't intend to switch to ART, you can safely assume 600M is more than enough - use 1B. If however you want to give ART a try, I suggest trying 1A first - after switch to ART /cache usage increased from 65M to 195M and total dalvik-cache size went from 285M to 780M!!!
That's it for now - I'll extend this tut later.
Now the homework I gave you the ideas, now if someone could create recovery scripts that do this automatically, many more people could use them Any volunteers? It's not difficult - of course I'll help (as in check them and do minor corrections, not as in doing it all). If nobody does it, I'll probably do it... eventually... I'm kind of lazy ;P
I'm thinking about creating a repository of scripts/plugins for mk kernel on github - those will be a good addition.
Now tell me how many people are interested in using this - hit 'thanks' on this post since that's the easiest - by all means DON'T write posts "I'm interested" etc
@ChronoMonochrome, @ace2nutzer - it might be useful on codina as well.
P.S.
ART is awesome (using with my Vanir build which I'll make available soon)!!! Now Janice is even faster ;D
Just an add on/ info / guide if someone wants to use RE-PARTITION FLASH DRIVE by @AntaresOne
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
And
@mkaluza
i really want to move devik from /data to another partition but i'm still using stock based rom so lvm method won't work for me and i still didn't thoroughly understand re-partition method from above.
but your opt 1B. seem to interesting to me so i'm goona try it now and let you know the results
btw is there any way to move delvik to /preload ? ( the stock base rom i'm using SamiOS more precisely don't use /preload partition so that 300MB is free so is there any way to use this instead of /cache ? )
jineshpatel30 said:
Just an add on/ info / guide if someone wants to use RE-PARTITION FLASH DRIVE by @AntaresOne
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
Click to expand...
Click to collapse
Yes, thank you (did I say I'm lazy...?)
i really want to move devik from /data to another partition but i'm still using stock based rom so lvm method won't work for me and i still didn't thoroughly understand re-partition method from above.
Click to expand...
Click to collapse
Yes it will. The only real requirements are to have free /preload partition (so JB is ok, just don't use Samsung crap) and have a kernel that supports lvm. Using my kernel and overlay system it's only easier, but it is not required.
but your opt 1B. seem to interesting to me so i'm goona try it now and let you know the results
Click to expand...
Click to collapse
Ok, just remember that overlays work with my kernel only (this /efs/... stuff is overlay). (I'll soon make better stock ramdisk recovery zip)
btw is there any way to move delvik to /preload ? ( the stock base rom i'm using SamiOS more precisely don't use /preload partition so that 300MB is free so is there any way to use this instead of /cache ? )
Click to expand...
Click to collapse
Yes - just replace /cache with /preload in the fstab line there's no (straightforward) way to do it with 1A.
mkaluza said:
1B. Moving entire dalvik-cache to /cache partition
If your dalvik-cache is smaller than /cache partition you might as well move it there entirely. There are few ways to do it, I'll show one of them.
Copy /fstab.samsungjanice somewhere (like /data/local/tmp/) and append (at the end!) the following line
Code:
/cache/dalvik-cache /data/dalvik-cache none bind defaults
Reboot into recovery and ensure that /data and /cache are mounted. Connect with adb and then run those:
Code:
mkdir -p /cache/dalvik-cache
chown system.system /cache/dalvik-cache
chmod 771 /cache/dalvik-cache
cp -a /data/dalvik-cache/* /cache/dalvik-cache
rm -f /data/dalvik-cache/*
Now move the modified fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice and reboot.
If everything went fine, you've just earned up to 300M more on /data
Click to expand...
Click to collapse
well it's not working atleast for me
ROM : SamiOS 1.3.1
kernel CoCore 8.2
did everything as you said
put fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice ( with 777 and system as owner , PS : also tried with root as owner )
but every time i reboots after all this procedure it generates dakvik in /data/dalvik-cache again via optimizing apps 1 of xxx.
anyway as of know i removed common folder from /efs ( which was there before ) and wiped /cache & /dalvik-cache via recovery ...i'm hopping it these reverted all the changes i have may by those commands ...right ?
...................................................................................................................................................
Edit : @mkaluza
sorry i didn't know that 1B. works with your kernel only
i'm not using your kernel on stock ROMs bcz i get tearing on some apps while rotating screen and also it take much time to load some games like COC and stuck on loading screen with black screen.
also it's much brigher with auto brightness on stock roms.
some of these things were fixes by polishvodka in his version of your kernel for JB but he didn't posted any sources so we don't know what changes he made
so if there will be some fixes for these things in future i'll give it try again & check 1B. also
PS: you can contact me if you want to fix these things and make bug free kernel for stock roms..and need beta tester ...i'll be happy to help
I like that scripts/plugins repo idea.
And wow, ART takes a lot of space, I never knew that
Never try ART before, so I'm just gonna wait for your Vanir build so I can try it
mkaluza said:
Now tell me how many people are interested in using this - hit 'thanks' on this post since that's the easiest - by all means DON'T write posts "I'm interested" etc
@ChronoMonochrome, @ace2nutzer - it might be useful on codina as well.
Click to expand...
Click to collapse
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.
ChronoMonochrome said:
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.
Click to expand...
Click to collapse
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app
nss357 said:
I like that scripts/plugins repo idea.
Click to expand...
Click to collapse
GitHub repo
So far only ramdisk images, but I'll slowly add stuff...
And wow, ART takes a lot of space, I never knew that
Never try ART before, so I'm just gonna wait for your Vanir build so I can try it
Click to expand...
Click to collapse
Yeah, it's huge... But it's fast as well I've decided to try it after briefly using hasta's lollipop - while it's far from being usable for me, it was fast (although there's a very aggressive governor set as well). And i don't regret it - in fact with Art running I don't even care much about lollipop anymore - I like my KitKatVanir very much
I'll upload it soon - still need to work on few details.
ChronoMonochrome said:
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.
Click to expand...
Click to collapse
mkaluza said:
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app
Click to expand...
Click to collapse
Here is script for SGSA/i9070 to Re-Partition , modded by me from ChronoMonochrome's Script
Must Read this post before using this script
Download : SGSA i9070 Repartition 2.5GB Data 8MB Cache 5MB Preload
it'll murge /cache & /hidden (preload) partition to /data
so you will get 2.5 GB in /data
8MB in /cache
5MB in /preload
( if you are changing values for self use DON'T FURTHER DECREASE /CACHE & /PRELOAD SIZE otherwise u won't able to format it via recovery ( even though AntaresOne suggested min 128kb for /preload it won't let you format /preload via cwm so min 5mb require for that)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Cradits:
Concept&Research by @AntaresOne
Script by @ChronoMonochrome
Moded for SGSA by Me
mkaluza said:
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app
Click to expand...
Click to collapse
yeah, I know what you mean. It's quite straight-line but what importantly, practical way. I tried to implement lwm feature being guided your wiki on github but caught myself thinking that I'm too lazy for that and decided to stick with repartition
ChronoMonochrome said:
yeah, I know what you mean. It's quite straight-line but what importantly, practical way. I tried to implement lwm feature being guided your wiki on github but caught myself thinking that I'm too lazy for that and decided to stick with repartition
Click to expand...
Click to collapse
i second that... actually i never properly understand what Antras's guide is suggesting to do, due to my lack of knowledge of adb and only one example in guide.
but after checking your script i thought logically this is straightforward and i can remove UMS and add all things to DATA as i wanted. so i checked my partition sizes as per Antras's guide and changed some values and on second trial i get all right (on 1st trail i got /preload not formatting due to very less size )
also did you checked my modification in scripts ? is it good ? or some cautions/addition needed ?
@mkaluza with all due respect , even though LVM method is much safer than Re-partitioning i think Re-partition script is easier to use if one knows what to do. plus it doesn't require kernel support.
btw it's always better to have alternatives so your work on LVM is much appreciated
jineshpatel30 said:
@mkaluza with all due respect , even though LVM method is much safer than Re-partitioning i think Re-partition script is easier to use if one knows what to do. plus it doesn't require kernel support.
btw it's always better to have alternatives so your work on LVM is much appreciated
Click to expand...
Click to collapse
I write those things in case someone was interested... my little wierdness ;P repartitioning is stone age (in terms of current state of knowledge) - lvm is much more flexible when one knows how to use it (like you can create new partitions on-the-fly i.e. to test f2fs or sth), while repartitioning is kind of a major surgery
But in no way I want to force them upon you Use whatever works for you I'll also prepare a cwm flashable version of lvm at some point probably...
jineshpatel30 said:
also did you checked my modification in scripts ? is it good ? or some cautions/addition needed ?
Click to expand...
Click to collapse
I haven't noticed big difference between original variant and this. Did you something besides of change of partition sizes? Btw, it is odd that you can't format preload partition, when it's too small (I've used script that resizes it to ~60kb, and it is still formattable, at least via shell script).
ChronoMonochrome said:
I haven't noticed big difference between original variant and this. Did you something besides of change of partition sizes? Btw, it is odd that you can't format preload partition, when it's too small (I've used script that resizes it to ~60kb, and it is still formattable, at least via shell script).
Click to expand...
Click to collapse
well i removed UMS part from your script as my janice is 16GB one so i don't need extra space there
and changed values according to Janice partitions.
that's pretty much
anyway when i set /preload for 128KB i got this message in recovery on formatting it
Code:
/preload
E: format_volume: make_extf4fs failed on /dev/block/mmcblk0p9
jineshpatel30 said:
well i removed UMS part from your script as my janice is 16GB one so i don't need extra space there
and changed values according to Janice partitions.
that's pretty much
anyway when i set /preload for 128KB i got this message in recovery on formatting it
Code:
/preload
E: format_volume: make_extf4fs failed on /dev/block/mmcblk0p9
Click to expand...
Click to collapse
If you don't need preload for anything then it doesn't need to be formatted... You're fine the way you are now. But remember you can't remove it completely because them partition numbers would change.
jineshpatel30 said:
Here is script for SGSA/i9070 to Re-Partition , modded by me from ChronoMonochrome's Script
Must Read this post before using this script
Download : SGSA i9070 Repartition 2.5GB Data 8MB Cache 5MB Preload
it'll murge /cache & /hidden (preload) partition to /data
so you will get 2.5 GB in /data
8MB in /cache
5MB in /preload
( if you are changing values for self use DON'T FURTHER DECREASE /CACHE & /PRELOAD SIZE otherwise u won't able to format it via recovery ( even though AntaresOne suggested min 128kb for /preload it won't let you format /preload via cwm so min 5mb require for that)
Click to expand...
Click to collapse
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).
isaak said:
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition situation is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).
Click to expand...
Click to collapse
Sorry but i been away from SGSA for long time now (2+ years) and i don't even remember how i managed this script at 1st place so i'm afraid i can't help you with the script, as i don't have device and patience now
you may ask some of active experience members at i9070 they might able to help you :good:
isaak said:
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).
Click to expand...
Click to collapse
Why TWRP is a requirement for the Repit, is there some tehnical dependence on TWRP (like /cache partition being unable unmount on CWM)? Anyway can't you flash TWRP kernel just to flash this zip, then flash your currently used kernel back?
I'd be keeping away from using command line instructions without fully understanding how it works. You can also check CWM reparted topic on codina forum, there are some internal memory layouts available (that can be theoretically be flashed on janice), though you need to thoroughly check whether the partition numbers used are matching with janice (I'd suggest anyway being cautious with it - check twice, cut once).
ChronoMonochrome said:
Why TWRP is a requirement for the Repit, is there some tehnical dependence on TWRP (like /cache partition being unable unmount on CWM)? Anyway can't you flash TWRP kernel just to flash this zip, then flash your currently used kernel back?
I'd be keeping away from using command line instructions without fully understanding how it works. You can also check CWM reparted topic on codina forum, there are some internal memory layouts available (that can be theoretically be flashed on janice), though you need to thoroughly check whether the partition numbers used are matching with janice (I'd suggest anyway being cautious with it - check twice, cut once).
Click to expand...
Click to collapse
After many attempts I solved using a TWRP kernel and flashing Repit zip with this name:
lanchon-repit-20160317-system=1.0-data=3.1-cache=same-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice.zip
The result of this command is in the attachment below.
But, if want more data space, you can try something like this:
lanchon-repit-20160317-system=1.0-data=4.1-cache=same-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice.zip
With this command, the additional data space would be taken directly from UMS (internal sdcard). Not from cache because it has the "same" parameter.
**If you don't know what is REPIT**
Read REPIT manual before using:
https://github.com/Lanchon/REPIT
Main topic support:
https://forum.xda-developers.com/galaxy-s-advance/development/flashable-emmc-repartition-t3369278
REPIT download (all versions):
https://androidfilehost.com/?w=files&flid=49911
Don't try it with stock Samsung ROMs. Only for custom ROMs. Make a backup first (including internal sdcard)!

[SM-G9750] Random root reboot fix (Snapdragon S10 & S10e probably, too)

WARNING: This won't work currently for the SM-G9730. I need a recovery.img(.lz4) from the latest firmware.
Here's a not-so-widely-tested fix for the spontaneous reboot that occurs after rooting the SM-G9750 and other Snapdragon S10 models.
tulth located this patch. If you read the description of that patch, it mentions a NULL pointer getting dereferenced in find_get_entry (such a thing tends to cause crashes in your average program, so when this happens in the kernel, it's not surprising that a crash and reset is the response). If you look at tulth's last_kmsg, my last_kmsg and G-ThGraf's last_kmsg from a G9730, you'll notice they all have one thing in common: SHTF at smaps_pte_range+0x29c. What's at that location on those devices' kernel? Why it's only find_get_entry(vma->vm_file. So yeah, it's the same bug, already known to Google and it's been fixed in their kernel tree since January. The bug is triggered externally by reading /proc/<pid>/smaps_rollup under certain conditions. You might be able to workaround this by disabling programs to get more free RAM, but The Only Way To Fix the Underlying Kernel Bug Is To Fix the Kernel Itself™.
We're probably not going to see a new kernel update until (if?) we get an update for the next major version of Android. We Snapdragon S10* users already have an older kernel compared to Exynos S10 owners (our 4.14.78 vs. their 4.14.85) and it's probably because of that they don't see this bug. So I think the idea of Samsung fixing this is a non-starter. While I did manage to build an SM-G9750 kernel from source (their instructions leave a lot to be desired) with that patch applied, I could not get my phone to boot the result.
I am not a programmer, but I do know just slightly enough to get the ball rolling and provide the fix that that aforementioned patch does in the opcode form that can be applied onto the existing kernel on the phone.
While I've not half-arsed it in the sense I took the easy way out (always having mss->check_shmem_swap set to zero is an easy one-liner workaround; however, freeing of unneeded SHM pages wouldn't happen, eventually causing your phone to crawl to a halt), I am not familiar with assembly language for any platform at all and, as such, I could not find a way to free up enough space in the show_smap function. So I jump quite far out into a chunk of the .text section where it's full of zeroes. I don't know anything about the ELF format to be able to tell you why this section of zeroes exists - I make the probably-wrong assumption it's perhaps a requirement of the ELF format if a linker that's very good at producing optimised code still bothers to output that or it's optimisation by alignment - but it's there and it's a good place to add extra code to on account of, you know, being empty and marked executable.
As far as I can see, where I have placed the code isn't referenced by anything else at all in the kernel but I can't be 100% certain on that. Nevertheless, I've been testing this on and off (I've had to manually initiate reboots in between for various reasons) myself for the past seven days or so and I've not noticed any adverse effects.
EDIT: Saying that, I think I'll try and move the code into load_module() when I get time because this kernel can't actually load modules (see below) thus much of the code there is pointless.The risk is yours, should you choose to apply this fix.
I would've liked to wrote this as a kernel module, being far easier to maintain, and hooked the relevant smap functions (in a similar vein to flar2's wp_mod and AleksJ's ric_mod) but thanks to the geniuses at Samsung, load_module() will always return early and the compiler accordingly realises it can optimise the function by excising all the code needed to actually load a module - there's no point in keeping unreachable code. Why Samsung bothered turning on mandatory module signing is beyond me because modules will never load! You can see this for yourself: insmod /system/vendor/lib/modules/wil6210.ko will always fail with "Exec format error", and that's a signed module built and shipped by Samsung themselves for their kernel. Anyway.
As long as the kernel version remains the same, it's likely, but not guaranteed, the same patches will work for future software updates from Samsung and all I'll have to do is update the compatibility list. If you try this on any other kernel version, the chances of not being able to boot are very high. The task of maintaining this doesn't enthuse me, but I'll continue to do so out of necessity, for I like having a rooted phone but not one that restarts at the worst of times.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I know people have reported longer uptimes than that on their phone before having a forced restart, but in my case, my phone has AOD enabled, the latest stable Magisk version installed and is running EdXposed. Before this fix, I've never seen an uptime longer than about 16 hours (usually less), regardless of whether the phone was in use or not, as getting multiple restarts in a day tends to have that effect.
As long as you only write to the recovery partition (and that's the only block device that this guide tells you to write to ), you should always be able to use Odin to reflash it to reverse this, the process being somewhat similar to flashing Magisk in the first place but with the notable exception of not needing to factory reset anything. The following flashing routine was adapted from Magisk, so my thanks to topjohnwu.
If someone has the bright idea of sharing their already-patched recovery.img because typing copy and pasting commands is hard, I'll point out the following: anybody flashing such an image should really make sure they're running the same firmware and Magisk version the image was designed for. (And after reading ianmacd's posts, topjohnwu supposedly doesn't like pre-patched images with Magisk being shared. I'll respect that, and so should you.)
I won't take any responsibility if this damages your phone. Perform the following at your own risk. If you agree, then:
If you haven't already, root the phone with Magisk. Make sure to keep a copy of the magisk_patched.tar somewhere on your computer so you can reflash it with ODIN if something goes wrong here. Always make sure Magisk is installed before modifying the recovery partition yourself. If you have a pending software update, install that with Odin and root that first before doing the following.
Set up ADB on your phone and computer
From your computer, adb shell into the phone
Run
Code:
uname -r
Only attempt to apply these patches if you get 4.14.78-16509050 back. For an older version, the bottom of this post has previous patches that may or may not apply. Or just update your phone.
Run
Code:
su
and then
Code:
rm -rf /data/local/tmp/q12kpwrk ; mkdir /data/local/tmp/q12kpwrk && cd /data/local/tmp/q12kpwrk
Run
Code:
mkdir recovery && cd recovery
Find the recovery partition on your phone by running:
Code:
recovery_blk="`readlink -f /dev/block/by-name/recovery`" ; [ -b "$recovery_blk" ] || echo "Eh, something's off here. Don't continue"
Dump it to a file by running:
Code:
dd if="$recovery_blk" of=recovery.img
Extract the kernel by running:
Code:
/data/adb/magisk/magiskboot unpack recovery.img || echo "Stop! Do not continue!"
If you see the warning message again on a new line, then stop.
Otherwise, if all went well with the step above (the message "Kernel is uncompressed or not a supported compressed type!" can be safely disregarded), then note that for any of these patches, if you don't get any matches or get more than one, then do not continue any further. Don't selectively apply any of these patches; it's all or nothing.
Apply the first patch by running:
Code:
/data/adb/magisk/magiskboot hexpatch kernel F7030032895240F9F64F00F9 F7030032FD10F997F64F00F9
Run
Code:
/data/adb/magisk/magiskboot hexpatch kernel 02000014C02E00F9E1630191 02000014ED10F997E1630191
If you have an SM-G9750/Snapdragon S10+: run
Code:
/data/adb/magisk/magiskboot hexpatch kernel F30300AAA1010035F40313AA750640F9890E41F83F7500F103010054AA02098BC10501B0407100D121B83191 F30300AA0D000014895240F9DF420239C0035FD600000000D22E40F94E02008BCE2E00F9C0035FD621B83191
OR if you have an SM-G9730/Snapdragon S10: there is currently no patch. Feel free to send me a recovery.img from the latest firmware and I'll adapt it
OR if you have an SM-G9700/Snapdragon S10e (thanks to Laikar_ for the recovery.img and testing): run
Code:
/data/adb/magisk/magiskboot hexpatch kernel F30300AAA1010035F40313AA750640F9890E41F83F7500F103010054AA02098BA10501D0407100D121B81D91 F30300AA0D000014895240F9DF420239C0035FD600000000D22E40F94E02008BCE2E00F9C0035FD621B81D91
Have the patched kernel placed into a new recovery image, new-boot.img, by running:
Code:
/data/adb/magisk/magiskboot repack recovery.img || echo "Stop! Do not continue!"
Check to see if new-boot.img isn't somehow larger than the recovery partition itself by running
Code:
[ `stat -c '%s' "new-boot.img"` -gt `blockdev --getsize64 "$recovery_blk"` ] && echo "Do not continue!"
Flash the new recovery image by running
Code:
cat new-boot.img /dev/zero >"$recovery_blk" 2>/dev/null
Run
Code:
sync ; sync ; sync ; reboot recovery
If the phone boots again, great! If you're stuck at the Samsung-only logo that fades in and out for many minutes, just restart the phone again whilst holding the recovery button combo to boot into Android with Magisk activated like normal.
You can rm -rf the /data/local/tmp/q12kpwrk folder afterwards to get some space back.
If your phone keeps restarting, or you automatically get put into semi-bootloader flashing mode, hold the bootloader button combo to get to the blue-background downloading mode and reflash magisk_patched.tar (and HOME_CSC) with Odin. If you didn't keep said file or a Magisk-patched recovery.img you can tar up with 7-Zip and get Odin to flash as AP, you'll need to download the latest firmware for your SM-G9750 with Frija or similar, reflash that and then follow the instructions to root your phone again with Magisk.
If you do get a reboot after applying this, looking at /proc/last_kmsg will indicate if it's something to do with this patch or something else entirely.
Q&A:
Q: Will I have to reapply this if I update Magisk from Magisk Manager with a direct install?
A: No.
Q: Will I have to reapply this if I update the phone's firmware?
A: Yes, but check the new kernel's version first and see if it's listed in the compatibility section. If not, then you'll need to wait for an update to this fix. And remember to make sure that Magisk is installed first before modifying the recovery partition yourself.
Q: I don't want to wait hours to see if my phone will restart out of the blue. How can I test for this bug?
A: A variation on the steps to reproduce here, you can do this:
Code:
su
dd if=/data/media/0/AP_G9750ZHU1ASF1_CL16082828_QB24224470_REV00_user_low_ship_MULTI_CERT_meta_OS9.tar.md5 of=/dev/shm # or any very large file (3-4 GB, /dev/urandom might work). This fills up the allocated space for shared memory
cat /proc/*/smaps_rollup
If your kernel isn't patched, restart your phone certainly does. (Of course, you should probably run reboot recovery anyway if not because a full SHM isn't really conducive to a well-running Android session.)
Q: Do you have any other kernel patches?
A: Just the one, only tested on the SM-G9750, and it seems to not be needed at all - it has no bearing on this specific reboot issue anyway. This one disables one aspect of RKP. Again, I don't think this is actually needed on the S10+ , but Magisk still attempts to patch for this issue indiscriminately (probably for the benefit of older devices), although its patch will not apply to our kernel.
Code:
/data/adb/magisk/magiskboot hexpatch kernel 1FA50F7143010054491540B93FA50F71E30000544B0940B97FA50F71830000544A1940B95FA10F7168090054 1FA10F71810A0054491540B93FA10F71200A00544B0940B97FA10F71C00900544A1940B95FA10F7161090054
Q: Are you a dirty GPL violator, qwerty12?
A: No! What I am providing is the compiled form of the patch linked to in the beginning of this thread. If you want to understand what this does in lovely C, just look at that patch. Of course, I have to deal with this on the assembler level, so there is no source per se, just dump all the hex strings into an online disassembler. The first two magiskboot hexpatch invocations replace two existing instructions with jumps into the new code I add. The third hexpatch invocation adds the additional code implementing the patch - the original replaced instruction is executed, along with the code I added to set mss->check_shmem_swap to zero before vma->vm_file is checked for != NULL and for shmem_swapped to be added to mss->swap instead of replacing it.
Patches for older kernels:
4.14.78-16082828:
Use Magisk Manager to install the Busybox Magisk module. No, this is not optional. You can use a version of Busybox from another source, but note that this is the version I have personally tested all this with. Restart your phone anyway if you already have it installed; you want your phone's running state to be as fresh as possible to avoid the possibility of running into this bug while attempting to fix it.
Code:
/data/adb/magisk/magiskboot hexpatch kernel F7030032895240F9F64F00F9 F70300327ED15494F64F00F9
Code:
/data/adb/magisk/magiskboot hexpatch kernel 02000014C02E00F9E1630191 020000146ED15494E1630191
Code:
printf '\x89\x52\x40\xF9\xDF\x42\x02\x39\xC0\x03\x5F\xD6\x00\x00\x00\x00\xD2\x2E\x40\xF9\x4E\x02\x00\x8B\xCE\x2E\x00\xF9\xC0\x03\x5F\xD6' | busybox dd of=kernel bs=1 seek="$((0x017F9AAC + 20))" conv=notrunc
The magiskboot hexpatch equivalent of this was too large, so I settled for writing to a hard coded offset.
I have random reboot... will try this patch tomorrow.
Sent from my SM-G9750 using Tapatalk
Hi... already doing your patches... i thinks succesfully, because i dont have any error, and boot normally after last command.
So.... i have to wait if random reboot appear right ? *to test*
Thank you... will report in about 3 days
Hi,
Vuska said:
So.... i have to wait if random reboot appear right ? *to test*
Click to expand...
Click to collapse
You can run the commands under "Q: I don't want to wait hours to see if my phone will restart out of the blue. How can I test for this bug?" in the first post. If your phone restarts automatically when running cat, then your phone is still susceptible to restarting itself during use.
If it doesn't restart, then you need to run reboot recovery yourself immediately, but it means the fix was successfully applied.
PS D:\S10+\ADB platform-tools> ./adb devices
List of devices attached
R28M31K3DNZ device
PS D:\S10+\ADB platform-tools> ./adb shell
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
N1ldo said:
PS D:\S10+\ADB platform-tools> ./adb devices
List of devices attached
R28M31K3DNZ device
PS D:\S10+\ADB platform-tools> ./adb shell
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
Click to expand...
Click to collapse
do you already install busybox via magisk ? also there will be a pop up in your device to request access from computer. accept it
already enable usb debugging in developer menu ?
permission denied .... [emoji848] .. strange... already rooted right ?
Sent from my SM-G9750 using Tapatalk
Vuska said:
do you already install busybox via magisk ? also there will be a pop up in your device to request access from computer. accept it
already enable usb debugging in developer menu ?
permission denied .... [emoji848] .. strange... already rooted right ?
Sent from my SM-G9750 using Tapatalk
Click to expand...
Click to collapse
Yes.
As you can see in the prints below.
i try install another busybox to.
N1ldo said:
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
Click to expand...
Click to collapse
Check your Magisk settings to see if you haven't turned off ADB superuser access and your apps list for a denied Shell entry.
qwerty12 said:
Check your Magisk settings to see if you haven't turned off ADB superuser access and your apps list for a denied Shell entry.
Click to expand...
Click to collapse
Thank you all ...:good::good:
Yes Shell was unauthorized root on Magisk application list :victory:
3 days now.... i can say it successfully fixed.... [emoji106][emoji106]
Thank you.
hope you will update too when new firmware arrives....
because i dont understand some code mean.... just follow and copy paste
Sent from my SM-G9750 using Tapatalk
*ASG7 firmware is out
I can provide a recovery.img from s10e (smg9700), also any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
FlatOutRU said:
*ASG7 firmware is out
Click to expand...
Click to collapse
Downloading...
is ASG7 can use this patches ?
Sent from my SM-G9750 using Tapatalk
FlatOutRU said:
*ASG7 firmware is out
Click to expand...
Click to collapse
Vuska said:
s ASG7 can use this patches ?
Click to expand...
Click to collapse
I'll download the update later and give it a once-over; however, I'll quote myself:
qwerty12 said:
As long as the kernel version remains the same, it's likely, but not guaranteed, the same patches will work for future software updates from Samsung and all I'll have to do is update the compatibility list.
Click to expand...
Click to collapse
Laikar_ said:
I can provide a recovery.img from s10e (smg9700), also any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
Click to expand...
Click to collapse
That would be appreciated, thanks. I can move the S10e into the "Patch not tested" section of the compatibility list.
I wish you'd have asked me this a few days ago, I deleted the kernel tree I had on my disk because I thought a new source ZIP from Samsung would be forthcoming for the new firmware. I'd've just attached a diff...
I did get the kernel to build but I could not get the result to boot. Some of the compiler warnings displayed during build didn't make it seem like I was going to get a working kernel image. I'll get back to you soon with some steps
qwerty12 said:
That would be appreciated, thanks. I can move the S10e into the "Patch not tested" section of the compatibility list.
I wish you'd have asked me this a few days ago, I deleted the kernel tree I had on my disk because I thought a new source ZIP from Samsung would be forthcoming for the new firmware. I'd've just attached a diff...
I did get the kernel to build but I could not get the result to boot. Some of the compiler warnings displayed during build didn't make it seem like I was going to get a working kernel image. I'll get back to you soon with some steps
Click to expand...
Click to collapse
I can't post links yet, tinyurl(dot)com/y537462u for the drive download link
Does EdXposed work for G9750?
qwerty12 said:
I'll download the update later and give it a once-over; however, I'll quote myself:
Click to expand...
Click to collapse
Its changed a bit
kakahoho said:
Does EdXposed work for G9750?
Click to expand...
Click to collapse
Yes.
FlatOutRU said:
Its changed a bit
Click to expand...
Click to collapse
Good call; there's now code at 0x017F9AAC + 20, probably not a good idea to overwrite that...
I was hoping the newer build date might have meant that Samsung applied the patch, meaning I could abandon this thread, but no such luck: I did the quick writing to /dev/shm test and my phone kernel panicked. Lovely.
I've updated the first thread with an updated patch. I followed through with my plan of moving my extra code into load_module() instead of the empty section of zeros as, thanks to Samsung's kernel developers' ineptness, that function will always fail - may as well make it early return and then use the extra space gained to store my code in.
Laikar_ said:
I can't post links yet, tinyurl(dot)com/y537462u for the drive download link
Click to expand...
Click to collapse
Thanks for the S10e recovery image, Laikar_. I've checked the recovery image's kernel and moved the S10e into the "Patch not tested" section. I'll write up some steps soon on building a kernel that won't boot
Anyway,
The S10 and S10e recovery images are not from ASG7, however, so I don't know if my newer patch applies to it but my old ones do. I think my newer one will do, too, but that's an educated guess.
Just like with the S10, anybody's welcome to try this on their S10e and let me know of the result.
qwerty12 said:
Yes.
Good call; there's now code at 0x017F9AAC + 20, probably not a good idea to overwrite that...
I was hoping the newer build date might have meant that Samsung applied the patch, meaning I could abandon this thread, but no such luck: I did the quick writing to /dev/shm test and my phone kernel panicked. Lovely.
I've updated the first thread with an updated patch. I followed through with my plan of moving my extra code into load_module() instead of the empty section of zeros as, thanks to Samsung's brainiac developers, that function will always fail - may as well make it early return and then use the extra space gained to store my code in.
Thanks for the S10e recovery image, Laikar_. I've checked the recovery image's kernel and moved the S10e into the "Patch not tested" section. I'll write up some steps soon on building a kernel that won't boot
Anyway,
The S10 and S10e recovery images are not from ASG7, however, so I don't know if my newer patch applies to it but my old ones do. I think my newer one will do, too, but that's an educated guess.
Just like with the S10, anybody's welcome to try this on their S10e and let me know of the result.
Click to expand...
Click to collapse
so the first post already update to 050 kernel right ?
mean after i updated my s10+ magisk etc.. i can do that all steps right ?
cool...
still not yet finished my download since yesterday... my internet down.. [emoji2357]
Sent from my SM-G9750 using Tapatalk
Vuska said:
so the first post already update to 050 kernel right ?
mean after i updated my s10+ magisk etc.. i can do that all steps right ?
Click to expand...
Click to collapse
Yep, the first post is updated for ASG7. Those steps are working on my SM-G9750 running it, anyway
Laikar_ said:
[...]any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
Click to expand...
Click to collapse
I'll mention again that I couldn't get the result to boot. If you work it out, please let me know. I hate loading kernel images into a disassembler
I did this on a Ubuntu 18.04.2 minimal installation. I figure that if you want to build a kernel then you, like me, have at least a working familiarity with GNU/Linux, so I won't go too in-depth.
First, install the packages needed to build:
Code:
sudo apt install git-core gnupg flex bison gperf build-essential zip zlib1g-dev libxml2-utils xsltproc unzip python bc libssl-dev
Download the toolchain mentioned in README_kernel.txt:
Code:
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
Download Snapdragon LLVM Compiler for Android v6.0.9 - Linux64 from https://developer.qualcomm.com/software/snapdragon-llvm-compiler-android/tools and untar it somewhere on your system. (This isn't actually the exact compiler Samsung use - if you look at /proc/version on your phone, you'll see it says 6.0.10 - but this is the closest we mere mortals will get.)
Download the source code zip from Samsung and untar Kernel.tar.gz into a newly-created folder. Inside said folder, run chmod 644 Makefile ; chmod 755 build_kernel.sh.
Open build_kernel.sh in your favourite editor. Make the following changes:
Set BUILD_CROSS_COMPILE to the folder where aarch64-linux-android-gcc, aarch64-linux-android-ld etc. are after cloning from git. Make sure to leave the aarch64-linux-android- suffix at the end. For me, this line looks like this:
Code:
BUILD_CROSS_COMPILE=/home/fp/x/aarch64-linux-android-4.9/bin/aarch64-linux-android-
KERNEL_LLVM_BIN needs to be set to the location of the Clang binary downloaded from Qualcomm. For me, this line looks like this:
Code:
KERNEL_LLVM_BIN=/home/fp/x/93270/toolchains/llvm-Snapdragon_LLVM_for_Android_6.0/prebuilt/linux-x86_64/bin/clang
After both REAL_CC=$KERNEL_LLVM_BIN instances add
Code:
CFP_CC=$KERNEL_LLVM_BIN
(although I think this is the wrong way to do it, consider just disabling CONFIG_RKP_CFP)
Open the Makefile in your favourite editor. Find the following line
Code:
@echo Cannot use CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
$(stackp-flag) not supported by compiler >&2 && exit 1
Remove the "&& exit 1". The proper way to fix this would be to set CONFIG_CC_STACKPROTECTOR_STRONG to n in the config file; however if you run clang --help, you'll see that -fstack-protector-strong is actually supported. Why turn off a useful security feature?
Run build_kernel.sh and the kernel should build (albeit with a metric crap-ton of warnings, which is just one reason why it's not surprising the resulting kernel won't boot)

Categories

Resources