yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] althafvly:
The rom is not mounting sdcards. The current 1.2gb is emulated in data partition. He is Still working in it

---------- Post added at 03:06 PM ---------- Previous post was at 03:01 PM ----------

I am also getting this problem. The one only way is to fix is flashing stock. Its about kernal. Also faced this in omni 5.1.1 kernal
[Galaxy S I9000 Android Development] sooti:
I'll add it to the OP but it should be common sense.... always have a full battery when first booting...
[Galaxy S I9000 Android Development] sooti:
New version will be up soon, no big changes, mainly performance

Changes:

* Disabled preoptdex (ART pre optimizing apps) since pre-optimizing may help first boot but makes later performance much worse

* Fixed a small SD bug (not the big one yet guys)

* Fixed the whole f2fs issue, you no longer need to manually format data as f2fs, both system and data are formatted to f2fs using updater script

* Removed some more omni apps that take up precious space and aren't really needed (cough cough, apollo)
[Galaxy S I9000 Android Development] devloz:
[MENTION=4460995]sooti[/MENTION] Do you think it's possible to make updater.sh format partition to format it's already on (some form of detection), and if that's not the thing, then F2FS? Our fstab allows booting both ext4 and f2fs (I might be wrong; 'm not veteran in android), while updater enforces hardwired format (I know I can modify updater.sh to my needs). You know, this kind of algorithm:

DATA=$(cat /proc/mounts | grep lvpool/userdata)
SYSTEM=$(cat /proc/mounts | grep lvpool/system)

if [ "$(echo $DATA | grep -o ext4)" = ext4 ]; then
rm -f /data/data.f2fs
touch /data/data.ext4
else
rm -f /data/data.ext4
touch /data/data.f2fs
fi

if [ "$(echo $SYSTEM | grep -o ext4)" = "ext4" ]; then
rm -f /data/system.f2fs
touch /data/system.ext4
else
rm -f /data/system.ext4
touch /data/system.f2fs
fi
[Galaxy S I9000 Android Development] sooti:
Is this something you added? does it work? if so I will defenetly add it
[Galaxy S I9000 Android Development] (°_o):
It kinda does work but as the script is parsing /proc/mounts the /data and /system have to be mounted first.

A cleaner apprach would be to parse from the output of blkid.

The filesystem need not to be mounted then.

# blkid /dev/lvpool/data
/dev/lvpool/data: UUID="aa37d199-2f0f-4d9f-ab3d-003a25a3f53c" TYPE="ext4"
[Galaxy S I9000 Android Development] sooti:
ok, right the full lines you think should be added and ill look into it
[Galaxy S I9000 Android Development] devloz:
Could you please verify if $DATA_FORMAT and $SYSTEM_FORMAT are returning clear "ext4" or "f2fs" values? I won't have phone close to me for a 'longer' while.

format_partitions() {
# create lvm partitions

DATA_FORMAT=$(blkid /dev/lvpool/userdata | grep -o "ext4");
SYSTEM_FORMAT=$(blkid /dev/lvpool/system | grep -o "ext4");

if [ "$SYSTEM_FORMAT" = "ext4" ]; then
/tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/lvpool/userdata;
else
/tmp/make_f2fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/lvpool/userdata;
fi

if [ "$SYSTEM_FORMAT" = "ext4" ]; then
/tmp/make_ext4fs -b 4096 -g 32768 -i 7680 -I 256 -a /system /dev/lvpool/system;
else
/tmp/make_f2fs -b 4096 -g 32768 -i 7680 -I 256 -a /system /dev/lvpool/system;
fi

/lvm/sbin/lvm lvcreate -L ${SYSTEM_SIZE}B -n system lvpool;
/lvm/sbin/lvm lvcreate -l 100%FREE -n userdata lvpool;

# format partitions
/tmp/busybox umount -l /datadata;
/tmp/erase_image datadata;
}

It's still dirty, but it may work. Also next question: These numbers in format command, how did we get them? 'm not that clever, so 'm just asking :p

PS: I noticed that in updater.sh we avoid brackets. Did you notice that? Why is that being done?

PS2: Do we have access to blkid while in recovery? Cat is rather dirty, but considering that system try to mount partitions anyway... to much thinking. Going learn math.
[Galaxy S I9000 Android Development] (°_o):
Those numbers in format command are options for mkfs_ext4. Which are specific to the ext4 filesystem.

-b block size in bytes

-i number of inodes

-I inode-size

-g blocks per group

-a is Android specific for android mount point.

This of course makes no sense to the mkfs_f2fs command cause f2fs is not a block based filesystem like ext4 but is a log based filesystem. The options for f2fs are different. Just replacing command names wont work.

The "if" statement in sh runs the command and checks it exit code. The bracket [ is also a command. Try running "which [ " . The updater script is using busybox's test command instead of [ command.

I would guess so, it's an busybox applet. If its included in the default busybox from the zip, we could run /tmp/busybox blkid.

Partitions are not mounted at least in the updater.sh. System is mounted by android updater-script, to backup addons then unmounted again. Then system is formatted and mounted to extract rom.

Uhhh... wait then. we need to modify the android updater-script too? Cause now it's like ' format( "ext4" , "EMMC" , "/dev/lvpool/system"....) '

This is too much work :0
[Galaxy S I9000 Android Development] sooti:
New build is uploading now (should be up in a few minutes)

Changes:

* Android 6.0.1

* Big boost in performance thanks to a few tweaks

* removed some omni junk from system to save on system space

* latest omni commits
[Galaxy S I9000 Android Development] nrp31:
Great to see the ROM on the I9000! I will be testing it out today and will be making a video about it too! Good to see such an old phone running Android 6.0.1 while my S6 is still on 5.1.1 :p
[Galaxy S I9000 Android Development] sooti:
Thanks!

I am actually surprised how well it works now, not sure if my changes or android 6.0.1 did something but now I am only using an average of 260MB of ram! with gapps and all, and it runs as well as my s2 did :)

EDIT: The ram usage and a photo taken with the FV-5 camera app
[Galaxy S I9000 Android Development] xc-racer99:
Modifying the updater-script during the build is not that difficult, we actually do it already....

Have a look at the very end of https://github.com/lollipopi9000/an...aries-common/blob/android-6.0/releasetools.py if you're interested. Something similar could be done for formatting /system.
[Galaxy S I9000 Android Development] sooti:
I don't mind adding it, but once you format your data partition to f2fs you shouldn't have anymore issues, so what's the point?
[Galaxy S I9000 Android Development] nrp31:
Great! I'm planning to make an installation tutorial/quick review of your ROM on my YouTube channel once I use it for a while. Will also test and let you know for bugs, if any :)
[Galaxy S I9000 Android Development] xc-racer99:
To be honest, I don't see the point either :D

I was merely pointing out the fact that there is an automated way of doing it.

Thanks for your work on Android 6.0!
[Galaxy S I9000 Android Development] Trainer_H:
i am waiting for the SD fix, than i will try the rom. i can't wait to try it out :)
[Galaxy S I9000 Android Development] devloz:
https://gerrit.omnirom.org/#/c/15918/

https://gerrit.omnirom.org/#/c/15917/

?
[Galaxy S I9000 Android Development] nchc:
Are those good or bad for SGS?
[Galaxy S I9000 Android Development] sooti:
Those commits are already in my rom, dont worry, even if they remove them we can just revert them, so theyre mot bad or good
[Galaxy S I9000 Android Development] (°_o):
The latest build is awesome, booted in 4 minutes, without the Gapps ofcourse.

And it recongized the external sdcard too. But the device just rebooted when I try to set it up in Settings. And the emulated storage disappearead after inserting the sdcard ....

I guess maybe the problem is in storage adoption?

Can anyone test with removing encryptable=userdata from fstab?
[Galaxy S I9000 Android Development] Zippy Dufus:
Greetings [MENTION=4460995]sooti[/MENTION] and awesome work!!

Do you have a manifest so I can try to build your ROM?

I always like to build the ROM for my devices ... just for fun! And I still haven't got a Marshmallow build going. :(

In advance, thanks
[Galaxy S I9000 Android Development] dracov76:
You must add Show recent app in long press home button ...
[Galaxy S I9000 Android Development] VENESOLANITO:
install the alpha 3 with the gapps it works great :D , I have enabled bigmen and the Xposed works well (module greenify and amplify)

screenshots are in Spanish
[Galaxy S I9000 Android Development] sooti:
Home button is not fixed yet in omni, working on it..
[Galaxy S I9000 Android Development] sooti:
Its not updated, I'll updated it, keep in mind you need to pick some commits I have in my github, ill post a guide later
[Galaxy S I9000 Android Development] sooti:
Nice, btw how do u enable bigmem?

Never mind, found it, we should make it easier though, is there a UI option?
[Galaxy S I9000 Android Development] (°_o):
xcracer99 had added options in Device Settings..

and did you see my post about sdcard?
[Galaxy S I9000 Android Development] VENESOLANITO:
I did it with root browser ...

/sys/kernel/bigmem/enable- > touch enable- > open as ..- > text file-> rb text editor- > change the value to 1 , save your changes and reboot the device

I think if the value is changed to 2 increases a little more of memory ram
[Galaxy S I9000 Android Development] Alokhacker:
you can choose values between 0 to 3

2 breaks 720p recording

3 breaks camera

but if you enable it.. it braks video playback on lollipop. I didnt try it on marshmallow
[Galaxy S I9000 Android Development] Coldwindofnowhere:
You need to patch apply this in order to get video playback working in bigmem mode
[Galaxy S I9000 Android Development] sooti:
Ya, that womt fix it, looks like the ony option is for data and sd to share the partition, i tested it and it works, but u will have to format the internal storage to f2fs, ill then use data as the system partition so we only lose 600mb
[Galaxy S I9000 Android Development] althafvly:
But the external sdcard works??
[Galaxy S I9000 Android Development] (°_o):
Checking the android device config examples again, i think noemulatedsd should also be added..

Hmm... if we are gonna have to format internal sdcard anyway... then I think we could go for repartition... the only reason lvm was used is not to format the internal sdcard..

/dev/block/mmcblk0p1 will be 14or 15gb for /data

Android will automatically mount an emulatedsd on top of it.. so we can have 15 gb for apps and media..

/dev/block/mmcblk0p2 will be 1gb for /system

that gives us enough space for gapps

Then one can adopt the external sdcard too, if they want more than 15 gb of apps
[Galaxy S I9000 Android Development] ghertas:
is internal storage space fix or not ?

if it's fixed now or if i should do somthing in instal rom , tell me how ?
[Galaxy S I9000 Android Development] sooti:
No, its not fixed yet
[Galaxy S I9000 Android Development] (°_o):
Ha, the hack worked. :0

And apps can access the files too.. cool.. except for the sizes....well, at least i can access the files B)
[Galaxy S I9000 Android Development] a36233:
I've tested beta 3 with bigmem = 3 (Total memory = 427 MB), recommended gapps, and data in f2fs is pretty usable . Holding on Home Button is not showing recent apps (solved by adding soft buttons );

system partition still in ext4.

My partition table:

mtdblock 663 MB with 7 [0-6] partitions (boot, recovery, datadata/system, cache, efs, radio and reservoir)

mmcblk0 6.93 GB with 4 partitions (mmcblk0p1 -> not mounted, mmcblk0p1 -> /data, mmcblk0boot1 -> not mounted and mmcblk0boot1 -> not mounted as well)
[Galaxy S I9000 Android Development] xc-racer99:
Yes, that is correct.
[Galaxy S I9000 Android Development] sooti:
New version will be up soon, the changes:

* Finally fixed home button wake

* Latest commit from 'Coldwindofnowhere' kernel source

* Latest omnirom commits

I am thinking of uploading an experimental additional build that kinda fixes storage but not sure its worth it because of the following issues:

* Since we use internal sd as also the data partition in this crappy way of fixing it, we need to format it as ext4 or f2fs, this breaks mounting in TWRP (i probably can fix it but for now its broken)

* Other things break in twrp, mainly formatting, if you want to format /data, you also format internal sd... so kinda a bad idea

* system partition is still small, I haven't found a way to fix it without breaking flashing or worst, bricking the phone and spending hours flashing stock and using pit files to restore partitions.

I think for now we need to just wait a bit more until we can fix this issue, using a hack to get more data space is not the answer. I rather focus on fixing external sd so that folks can use app2sd for now.

TODO:

* Fix ext-sd

* Fix internal sd emulation

* Long press home button for recents (should be an easy fix, might even be able to slip it in to this upcoming build

* selinux stuff (lowest priority)

* Fix built in camera app (low priority if at all)
[Galaxy S I9000 Android Development] devloz:
[MENTION=4460995]sooti[/MENTION] emulatedsd is good thing to move on, but please, don't revoke /datadata partition - If I recall there were performance issues when devs tried to redirect it to /cache (it's fast-write area, or something).
[Galaxy S I9000 Android Development] althafvly:
There is one way to unbrick device easily. If it bricks just flash semaphore kk kernal through Odin and flash a rom. I do this all the time. And Its works for me
[Galaxy S I9000 Android Development] (°_o):
I think this is a great idea...

We use the now internal sdcard as /data partition.

The now /data partition as /system

The now /system as /cache

This gives us 13gb for apps and media, (emulated sd), 1.8 gb for /system ( too much but oh well) 600mb for /cache. ( dont know if this is necessary)

And as for TWRP its just a matter of building with a flag.

And its not that hard.

https://github.com/AriesVE-DevCon-T...mmit/0f606e5352bf25dd3f0bc96c295ffddf9c9c000e

Theres no need to modify storage_list and init.rc in Android 6.0

So its just a matter of modifying some fstab and boardconfig.
[Galaxy S I9000 Android Development] iagm12:
And this won't affect people (like me) who has the 8GB storage version of the S1? Just sayin'
[Galaxy S I9000 Android Development] (°_o):
/datadata is on NAND, so its faster.

The internal sdcard is an cheap eMMC, basically an SDcard slapped onto the motherboard. and who knows what class.

I dont think the setupdatadata.sh will be affected if we go by the above route..
[Galaxy S I9000 Android Development] (°_o):
Yes, but this doesnt require repartitioning, so if you ever decide to go back to lollipop. You can just flash the rom, and restore the TWRP backup..
[Galaxy S I9000 Android Development] sooti:
Nah, it doesn't always work when you do the things i do with this device lol
[Galaxy S I9000 Android Development] sooti:
Sounds like a mess, i really want to mount it in a normal way if possible, if i can't do that I'll try your idea, so far everytime I try to change system partition path I can't boot... I rather wait for a better solution... but ill look into it.
[Galaxy S I9000 Android Development] (°_o):
I made a commit if anyone want to test

https://github.com/PsychoGoFullReta...mmit/e9ab1a6b201d4ca616d173c6b1adda36f8f3c5ed
[Galaxy S I9000 Android Development] sooti:
You don't need to change cache, there is already a hack that writes the cache to the /data mount.

In any case I am making some progress, i might be able to fix it after all, meaning it will mount the internal storage, the rest will stay the same, you can use internal sd I believe as extra data storage as per 6.0 changes (also external)
[Galaxy S I9000 Android Development] (°_o):
Yeah, but the 600mb would go to waste, if not mounted anywhere.

The problem with adoptable storage in our case is performance. Adoptable storage are encrytped.

Now whether that will make a difference or not we'll have to test. But then again, our device doesnt have two cores.

If we can just use it as portable storage, then we will just use it like we are using right now..

I'm just pointing an option if we can't :)
[Galaxy S I9000 Android Development] (°_o):
[MENTION=4460995]sooti[/MENTION]

https://android.googlesource.com/platform/system/vold/+/65427f1/main.cpp#219

LOG(WARNING) << "nonremovable no longer supported; ignoring volume";
[Galaxy S I9000 Android Development] althafvly:
I heard that he is fixed the problems. But has problem while USB connected
[Galaxy S I9000 Android Development] xc-racer99:
Alright, I'll throw my hat into the mix as well :)

I came across https://github.com/lollipopi9000/android_system_core/commit/20002c35e98b70235dcf2349a660c1c0c97cf9a6 in your github. While its highly unlikely this is related to the storage issues (but perhaps ext4 stuff?) as it appears to just be error handling, you can fix the build error by apply the following patch in system/core instead:

diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk
index b5b0090..30e11c2 100644
--- a/ext4_utils/Android.mk
+++ b/ext4_utils/Android.mk
@@ -54,6 +54,7 @@ LOCAL_MODULE := utility_make_ext4fs
LOCAL_MODULE_STEM := make_ext4fs
LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
+LOCAL_PACK_MODULE_RELOCATIONS := false
LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities
@@ -64,7 +65,8 @@ LOCAL_STATIC_LIBRARIES += \
libsparse_static \
libz \
libcutils \
- libc
+ libc \
+ liblog

include $(BUILD_EXECUTABLE)
[Galaxy S I9000 Android Development] sooti:
Way... WAY ahead of you, this was fixed about a month ago lol, I don't have build errors anymore :) https://github.com/lollipopi9000/android_system_extras/commit/9c4994532f1ed43801a24069c154e0f26aff884e

The error I was talking about was during flashing, not during build, ill try the suggestions again and see if swapping partitions will work, I really don't like the idea but just for giggles
[Galaxy S I9000 Android Development] (°_o):
MountService: No primary storage mounted.
MountService: No primary storage defined yet. hacking together a stub.

[MENTION=4460995]sooti[/MENTION] maybe try emoving nonremovable flag from fstab.

and adding this to init.rc

setprop ro.vold.primary_physical 1
[Galaxy S I9000 Android Development] xc-racer99:
Hmm, you are using the system/core in the lollipopi9000 github, right? If you have another look at the link to the commit I provided, its in system/core where you removed some error handling in fs_config.

The patch I posted above was two-part:

1) The pack-relocations thing which you already had

2) The addition of liblog to ext4_utils which enables you to revert https://github.com/lollipopi9000/android_system_core/commit/20002c35e98b70235dcf2349a660c1c0c97cf9a6 which removed the error handling. I think this patch was to fix the build (error that it fixed was undefined reference to android_log_print) - but the "better" way of doing it is via my patch.

As I said earlier, it likely won't have any effect, but I think its worth a shot. If I'm missing something really obvious, please let me know;)
[Galaxy S I9000 Android Development] sooti:
Nah, doesn't work already tried it
[Galaxy S I9000 Android Development] sooti:
Thanks but that just deals with errors being logged, ill look into later but not relevant to the fs issues

EDIT: looked at your code again, I tried adding those things to MK but it did nothing to fix the errors
[Galaxy S I9000 Android Development] xc-racer99:
Weird, works on my end. Sorry to waste your time.
[Galaxy S I9000 Android Development] sooti:
You mean storage is mounted?
[Galaxy S I9000 Android Development] sooti:
Hey, tried your commit, system doesn't boot and we go to twrp straight up instead and also USB storage doesn't mount, this isn't a very good solution right now, we need something better
[Galaxy S I9000 Android Development] (°_o):
Hmm.. did you format the new /system /data and /cache as f2fs?

USB storage wont mount on emulated sd... It need MTP i guess..
[Galaxy S I9000 Android Development] sooti:
Yes, i also have tried this in the past and got the same result, that's why i knew it probably won't work.. anyway guys just be patient, it will be fixed, no need to go crazy and swap out all partitions
[Galaxy S I9000 Android Development] (°_o):
Could you give me the build? I dont see why it wouldnt work.. maybe i missed something...

On the other side of thing. I got vold to recongize the internal sdcard, but it restarted with "Failed to setexeccon" causing a bootloop.

Then I deleted my changes and tried with external sdcard. Same error.

Looking at here. https://android.googlesource.com/platform/system/vold/+/master/Utils.cpp#259

Seems like a issue with SELinux...
[Galaxy S I9000 Android Development] sooti:
Selinux is disabled... so idk, i don't have a build sorry... in any case as i said its not the way to go.

you can mount sd using this command:

'adb shell mount -t vfat /dev/block/mmcblk0p1 /sdcard'

but it doesn't work when mounting USB...
[Galaxy S I9000 Android Development] (°_o):
Nor apps can write there. The mount command is default for mounting anything in linux..

Storage devices are managed by vold in Android. And vold is refusing to work without selinux..
[Galaxy S I9000 Android Development] sooti:
New build is up, fixes home button
[Galaxy S I9000 Android Development] (°_o):
This is no different than the hack i posted earlier...

#!/system/bin/sh

## This script hacks the internal sdcard on top of emulatedsd.
## This has some limitations. Like the system and apps won't report storage of internal sd but only show 1.8gb of /data.
## Some apps may refuse to work, because of reported, insuffient storage however you can acesss your files normally.

# Internal storage properties..
INT_FS_BLK=/dev/block/mmcblk0p1
INT_FS_TYPE=vfat

# These are the id's and permisssions for the emulated sd. We need to replicate this in order to let system and apps have access.
EMU_UID=1023
EMU_GID=1023
EMU_UMASK=007
EMU_DMASK=007

# Mount the internal sdcard on /data/media/ instead of /data/media
# So we dont have to migrate the contents of sdcard to a "0" folder.
# We will just bind mount obb, so it doesnt stay in /data

busybox mount -t ${INT_FS_TYPE} -o uid=${EMU_UID},gid=${EMU_GID},umask=${EMU_UMASK},dmask=${EMU_DMASK} ${INT_FS_BLK} /data/media/0
mkdir -p /data/media/0/Android/obb
busybox mount -o bind /data/media/0/Android/obb /data/media/obb

Mounting sdcard manually is not an option either.

We should work on getting SELinux running maybe in Permissive mode.. . As vold wont mount storage automatically without it.. This is why the bootloops when external sdcard is inserted.
[Galaxy S I9000 Android Development] iagm12:
That makes sense :T
[Galaxy S I9000 Android Development] (°_o):
Though you could hack SELinux too... but thats overkill.

But well, if you can then why not.

Finally got internal storage working... somewhat...

Its mounted as Portable Storage..
[Galaxy S I9000 Android Development] sooti:
Can you post your commits?
[Galaxy S I9000 Android Development] sooti:
Sorry folks, forgot the latest kernel commits from 'Coldwindofnowhere', uploading new build now
[Galaxy S I9000 Android Development] xc-racer99:
No, as in there's no build error.

Sorry to get your hopes up.
[Galaxy S I9000 Android Development] (°_o):
Like I said, I hacked selinux.. I could share the hack.. but its better if we focus on getting SELinux to work...

And it seems the external sdcard is working too.

The corrupted sdcard is guess /dev/block/mmcblk0p2 where system and data are... so we're gonna have problem there
[Galaxy S I9000 Android Development] althafvly:
That's great. We have hope ;)
[Galaxy S I9000 Android Development] sooti:
Ok im working on selinux, right now even on permissive it bootloops, must be one of the selinux commits i did, ill revert them and try again

EDIT: OK, I got the selinux fixed in the kernel, we are now in permissive... and damn there are a lot of denials to address if we ever want to enable enforced
[Galaxy S I9000 Android Development] (°_o):
I dont think we need enforced though... It might work with permissive..

And you need to change the fstab to shdci-0 for internal storage to reconigze...