yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Android Development] gotzinger:
My mistake, it was neverending animated logo, not boot loop.

I tried to give phone into stock rom and repeated installation, still neverending animated logo.

After installing ROM and Gapps try to reboot into Recovery and Format Data partition, it dont format data, freeze and after 1 minute restarts phone.
[Galaxy S II Android Development] DevisG79:
So this is what worked for me:

Repeat the steps on the first page from 1 to 11 except formatting data after you flashed rom+magisk.img in boot partition(optional)+gapps.
[Galaxy S II Android Development] gotzinger:
I returned phone to stock ROM 4.1.2.
[Galaxy S II Android Development] xdalurker1:
Tasker solution to spiritF FM radio issue

Replying to my own request :)

On the latest 20191009 build, every restarts wipes out /system/lib/modules and the included Si4709_driver.ko resident there, I'm sure because of some obscure security measure.

So here is a Tasker task that I found helpful. It recreates the module folder, copies the driver to it and starts SpiritF: import the following task and create a shortcut to it for easy access

<?xml version="1.0"?>

-<TaskerData tv="5.8.3" dvi="1" sr="">

-<Task sr="task5">

<cdate>1571481810256</cdate>

<edate>1571495190386</edate>

<id>5</id>

<nme>radio-copy</nme>

<pri>7</pri>

-<Action sr="act0" ve="7">

<code>409</code>

<se>false</se>

<Str sr="arg0" ve="3">/system/lib/modules</Str>

<Int sr="arg1" val="0"/>

<Int sr="arg2" val="1"/>

</Action>

-<Action sr="act1" ve="7">

<code>404</code>

<se>false</se>

<Str sr="arg0" ve="3">/vendor/lib/modules/Si4709_driver.ko</Str>

<Str sr="arg1" ve="3">/system/lib/modules/Si4709_driver.ko</Str>

<Int sr="arg2" val="1"/>

</Action>

-<Action sr="act2" ve="7">

<code>20</code>

-<App sr="arg0">

<appClass>fm.a2d.sf.gui_act</appClass>

<appPkg>fm.a2d.sf</appPkg>

<label>SpiritF</label>

</App>

<Str sr="arg1" ve="3"/>

<Int sr="arg2" val="0"/>

<Int sr="arg3" val="0"/>

</Action>

-<Img sr="icn" ve="2">

<cls>fm.a2d.sf.gui_act</cls>

<pkg>fm.a2d.sf</pkg>

</Img>

</Task>

</TaskerData>
[Galaxy S II Android Development] guest4711:
How about linking the driver systemless into the right place? Or creating a little MagiskModule which does it for you?
[Galaxy S II Android Development] xdalurker1:
SpiritF driver linking

Thanks for the reply.

Care to elaborate how to do either? I'm familiar with magisk but don't know how to create a module from a driver etc.

Cheers
[Galaxy S II Android Development] K9100ii:
This is possible, however, the driver in the module must be updated everytime the ROM is updated and the kernel is updated with it. Otherwise, you will get version magic errors as evident in dmesg. If we are going to make an installer for this and not make a module manually, then it has to be installed everytime the ROM is updated and there are changes to the kernel. The kernel version has changes to the last part of its version (few characters long) everytime sources are updated via commits. I'd say this isn't much better than copying the module from /system/vendor/lib/modules to /system/lib/modules, unless you really want to be systemless with no chance of failing safetynet.
[Galaxy S II Android Development] guest4711:
If you symlink it systemlessly with magisk there is no need to change anything when updating (except if the name has been altered).
[Galaxy S II Android Development] ol1ver:
Thanks for that, already very useful information; so someone has to make work of this for the S3 n7100 ...

I am not sure how dead the eMMC really is; it still boots to recovery (partially) after all.

I use f2fs for my data partition; for the simple reason, it's supposed to be more reliable then ext4. In this case, I think it's one of the ext4 partitions are barfed.

But why do we need to manually e2fs, I would expect a startup script to run it and attempt to fix the fixables?

As I can't get into any terminal variant (just power cycles) I can't do anything other then running heimdall I guess ...

---------- Post added at 12:36 PM ---------- Previous post was at 12:34 PM ----------

I'll read up on your posts, thanks that valueable information. As for needing e2fsk for the settings, that's just odd (but could explain a few things). It is odd as some settings are kept just fine ... but if nobody else is noticing it; i'll see if I can fix things.

I'll try to create a bootable SD card which gives me a shell to fi things ...
[Galaxy S II Android Development] K9100ii:
You're welcome. Interesting. But something could still be corrupted. I remember my old S2 and how it corrupted itself with its fake battery. I was using it while it was charging, battery voltage appeared to go too low and CPU load was maximum and the screen was flashing at different brightnesses uncontrollably for a few seconds. It rebooted and would never boot again with a loop of the bootloader logo and a black screen. TWRP would flash its splash screen for 4 seconds and then reboot to that same loop. Sometime after I got a new S2, I rigged the USB board from the new S2 to my old S2, installed boot and recovery and same thing. I reinstalled the stock ROM which booted and then installed boot and recovery with a repartition, where I could restore a nandroid backup and the phone could finally boot again. I use EXT4 now. Something more could be corrupted, as in my case, but I don't know what.

I have never heard of F2FS ever having better reliability, only better performance (performance as in benchmark scores, not real world usage). F2FS was always more experimental and in development than EXT4 and has many more data corruption issues which often can't be fixed. I think your EXT4 partitions would be fine. The kernel fscks my EXT4 partitions just fine on boot, I don't know what really happens with F2FS.

<6>[ 12.635193] c0 e2fsck: e2fsck 1.43.3 (04-Sep-2016)
<6>[ 12.635223] c0
<6>[ 12.635326] c0 e2fsck: Pass 1: Checking inodes, blocks, and sizes
<6>[ 12.635361] c0
<6>[ 12.635380] c0 e2fsck: Pass 2: Checking directory structure
<6>[ 12.635411] c0
<6>[ 12.635428] c0 e2fsck: Pass 3: Checking directory connectivity
<6>[ 12.635461] c0
<6>[ 12.635477] c0 e2fsck: Pass 4: Checking reference counts
<6>[ 12.635507] c0
<6>[ 12.635523] c0 e2fsck: Pass 5: Checking group summary information
<6>[ 12.635557] c0
<6>[ 12.635575] c0 e2fsck: /dev/block/mmcblk0p10: 75928/851968 files (0.2% non-contiguous), 1230698/3405820 blocks
<6>[ 12.635629] c0
<6>[ 12.647104] c0 EXT4-fs (mmcblk0p10): mounted filesystem with ordered data mode. Opts: noauto_da_alloc,journal_async_commit,errors=panic
<7>[ 12.647203] c0 SELinux: initialized (dev mmcblk0p10, type ext4), uses xattr
<6>[ 12.647472] c0 init: [libfs_mgr]__mount(source=/dev/block/mmcblk0p10,target=/data,type=ext4)=0: Success
<3>[ 12.647563] c0 init: [libfs_mgr]mount_with_alternatives(): Mounted /dev/block/mmcblk0p10 on /data with fs_type=ext4 instead of f2fs

Are you saying your phone is bootlooping and you can't get into recovery? My old S2 was basically the same, if so as I have described.

Could you explain how you did this if you managed to do this? I was always under the impression that the bootloader will only ever be able to boot whats on eMMC.
[Galaxy S II Android Development] Catfish78:
Hello,

this could be the answer for my issue last year with my first reflashed i9100. Corrupted partition and bootloop, no chance to get it back running. I just changed the board with some other parts, and put the board in a case. A few months ago the board was running fine again in another S2.

I just would try to reflash to stock and see if it is running. If so, retry LOS16 step by step with the manual on the first page in this thread.

Regards
[Galaxy S II Android Development] mirhl:
Or perhaps, as I suggested on page 8, just recompile sprit with the right path and call it a day?
[Galaxy S II Android Development] JaLoou:
I'm sorry...

Anybody tried to record a long video by size more than 4GB on an external microSD card with this custom ROM?

Please, try it writing answer here.
[Galaxy S II Android Development] K9100ii:
No one is answering you as no one knows! Also, of course you're going to be ungrateful if someone tries to help you. I'm talking about "This ROM SUCKS! It can't even do videos more then 4GB!!!!1!1!1" The moderator has already tried to tell you! You won't be recording long videos bigger than 4 GB on FAT32 without multiple files, and we don't have a better filesystem (ExFAT uses a slow userspace driver, all other filesystems like EXT4 have permission issues on SD Cards). However, on internal storage thats formatted as EXT4/F2FS, thats for you to try, not us. Good luck with your very bright display. You could have tried it yourself. If the stock camera doesn't work, try Open Camera, it has settings relating to 4GB filesize limits. (Don't try setting these to bigger filesizes on FAT32. I suggest you disable the setting Settings -> On screen GUI -> Force maximum brightness.) Why don't you do at least some research first than lazily spam forums, and try stuff for yourself and then maybe present findings? Also, why are you using an ancient phone as a camera for hours long video, aren't there better devices for you to use?
[Galaxy S II Android Development] mirhl:
You could use adoptable storage for maximum compatibility.

Also, I'm relatively sure there were kernel drivers for fat64 (samsung originally created it for phones after all)
[Galaxy S II Android Development] K9100ii:
You could, but inserting the SD card into some SD card reader and moving files won't be possible and that would be quite a big disadvantage. You could use MTP, but MTP is slower and seems to be less reliable for bigger files, at least for me. ExFAT (AKA FAT64!) works but it works by a slow userspace driver thats not in kernel, and running with the userspace driver isn't favorable. There are some native kernel drivers, but Microsoft has never licensed them, which may affect LineageOS official status things if it will be decided to make this ROM official.
[Galaxy S II Android Development] mirhl:
Re-pitting is certainly an option, but can't you use some better compression for it, like zstd?
[Galaxy S II Android Development] K9100ii:
Maybe we can, but I have a feeling that the bootloader can't read zstd format kernel images, maybe it can as long as it is a zImage? The ramdisk needs a solution, too, though. Also, I don't really trust Facebook with my phone. How much of a difference will there really be and how long until we have images that are too large again?

Seems like I have a lot of interest, I will upload prebuilt images hopefully later today and make a new thread, if not, tomorrow.
[Galaxy S II Android Development] JaLoou:
Thanks. Your message looks very promising.

Sorry may for stupid question: is it possible to flash and use your kernel with Samsung's latest official firmware with Android 4.1.2?
[Galaxy S II Android Development] JaLoou:
MAC address can be changed on GT-I9100 by the famous app attached to this message.
[Galaxy S II Android Development] K9100ii:
Hi,

You're welcome. You will most certainly not be able to use the magisk ramdisk kernels and you will most probably not be able to use the kernel with a ramdisk with no Magisk. I can't be certain if you will be able to use the no magisk boot images, as I don't use the stock ROM, but you can test for yourself when I release some images. If it does boot, expect bugs that wouldn't be there if you use LineageOS. Good luck.

Thank you for this suggestion. The "Manage Networks" option in this app appears blank (not greyed out) probably due to API changes from 4.1.2 to 9.0, and I can't try changing the MAC address for any network. This app appears to change file /efs/wifi/.mac.info. Changing this file doesn't appear to do anything with the rather maybe too simplistic patch though, it still reads the MAC address off of the WiFi chip itself. I will either continue to try to find out how this patch works or find another patch. Hopefully everyone has intact EFS partitions.
[Galaxy S II Android Development] K9100ii:
Prebuilt boot images. Thread being made soon.

Hi everyone,

I have now built boot images with my kernel and a selection of Magisk Stable, Magisk Canary or no Magisk in the ramdisk and am uploading everything earlier before making a new thread so you don't have to wait. I will make a thread either tomorrow or in the weekends. I will be busy and making a thread isn't the quickest thing for me to do (This is an understatement.), especially with the details on the features so it may just be on the weekends. Attached are all of the boot images. The kernel has all of the features I have promised in my earlier reply.

Choose whichever way you would like to install:

Install using TWRP: Download the image of your choosing and transfer your chosen boot image to your phone or your SD card. Boot into TWRP, select the usual Install feature, select the option "Install Image" and browse for where ever you have stored the boot image. Select the image, select for it to be installed to "Boot" and swipe to install. Now reboot your device and you will be running my kernel.

Install using adb in TWRP: Make sure you have downloaded the image of your choosing, make sure you have a working installation of adb and boot into TWRP. Open a bash shell (Linux and MacOS) or command prompt (Windows), change directories to where you have the downloaded image stored using "cd" and execute

adb push i9100_LOS_16.....img /dev/block/mmcblk0p5

Now, reboot your device either by

adb reboot

or by Reboot -> System in TWRP.

Install using Heimdall: Boot into download mode. Select the "Utilities" tab and click "Detect" under "Detect Device". If it tells you that the device is detected in download mode, continue. Under "Download PIT", click "Save As..." and select a save location and choose a name for the pit file. If you have used the pit file prepared by [MENTION=2222292]rINanDO[/MENTION], you can skip this and use that instead. Click on the "Flash" tab. Under "PIT", click on "Browse" and locate the pit file from 1 step earlier. Under Partitions (Files), click "Add". Under "Partition Details", select "Partition Name" to be "KERNEL". Click "Browse" under "File (zImage)" and locate the boot image you have downloaded earlier. Then, simply click "Start" and wait until the image is flashed. If it fails, restart download mode as the PIT download process you might have done earlier will have interfered with this. Your phone will restart.

You can also install using Heimdall in a shell. Run "heimdall" in a shell and follow through the GUI instructions but using commands as in the help provided when you run it.

A brief description of all the features of my kernel is a few replies back, use that as reference on how to use the features or wait until I make a more detailed thread. Enjoy my kernel! :)
[Galaxy S II Android Development] rINanDO:
Hi,

The zimage includes a recovery-image ramdisk-recovery-device.cpio which is the Lineage Recovery. This image can be removed from the kernel build so the zImage shrinks to about 5mb. We have IsoRec which boots twrp on /dev/block/mmcblk0p6 anyway. Just remove this line https://github.com/rINanDO/android_.../lineage-16.0/usr/galaxys2_initramfs.list#L28
[Galaxy S II Android Development] mirhl:
I have mixed feelings about that, considering already the "first time procedure" is already complicated enough.

Anyway, if the bootloader requires a zimage straightly, compression in there certainly couldn't help. But I'd assume initrd/cpio is where tinkering could be at?

ZSTD and asymmetric numeral systems are the best things since sliced bread.

It has come to my attention though, that another interesting toy to try could be uboot (which I think they already use here and there on the i9300?)
[Galaxy S II Android Development] K9100ii:
Removing this has shrunk the image to 5.5MB and there is no difference in functions with TWRP being loaded by IsoRec, thank you.

I also have mixed feelings about it and am also not certain about moving many partitions also after the boot image, a mistake could mean quite a lot could go wrong. The Initrd and CPIO ramdisk could be it, I'm not exactly sure. Maybe you could describe these new compression algorithms like that. Also, [MENTION=2222292]rINanDO[/MENTION] has suggested removing the recovery ramdisk, which works great and reduces boot image size to 5.5MB. I don't think we have to do anything for a long time like this.

I have had interest in Uboot, especially since the Replicant project (https://replicant.us) has some stuff to do with replacing the bootloader with Uboot and the bootloader signing issues that make it a work in progress. Maybe it could be interesting to try whats already here.
[Galaxy S II Android Development] Shahrokh.KING:
can someone please lead me through installing this rom and other new roms if you are coming from stock samsung 4.1.2? i know it needs re-partitioning and isorec but im a little confused, thanks
[Galaxy S II Android Development] js-xda:
If I recall correctly, it was a multistage approach. First follow this instruction and only then (& if aiming to go for this LOS build!) install the latest TWRP build and #18 LOS build as mentioned in the OP under "Upgrade from Samsung stock ROM to Build #14 and higher using ODIN 3.07". But wait maybe a bit whether someone knows a more direct approach.
[Galaxy S II Android Development] K9100ii:
I have finally made a thread for my kernel: https://xdaforums.com/galaxy-s2/dev...ageos-16-0-t3996021/post80757727#post80757727

No one should use the old release here due to an exFAT driver bug causing kernel panics that has been fixed in my new release.
[Galaxy S II Android Development] JaLoou:
Sorry, I decided to write briefly what I'm, as the average smartphone user, kindly asking to add to this ROM:

1) The ability to record long videous by file size more than 4GB is needful for use a smartphone as a handy video registrator without sad interruptions. The user can record long life events, lectures, interviews and so on with FHD quality that way.

2) A call recording API in this custom ROM for any call recording app works properly. May it is possible to extract such API from older versions of Android OS (for example from Android 4.1.2 where it works excellent).

3) And finally please, make it more easy to migrate to this ROM from the latest Samsung's official firmware with Android 4.1.2 preferable without using of computer. May someone can make a clear manual like it was with LOS 14.1.

Then I will install it high probably.

If the custom ROM will be actually good for regular use then I will send some small money to its developers.
[Galaxy S II Android Development] DevisG79:
Feel free to make your own custom ROM with all the things you like to have.
[Galaxy S II Android Development] MelTraX:
I'm still having trouble with encryption. I was still running build #13 with an encrypted data partition. A few days ago something crashed really hard and corrupted some files (Signal could not start anymore and some media process kept crashing). So I decided to just build from the ground up.

Here's what I did:

0. Flashed and rebooted into TWRP 3.3.1-1
0. Tested all the below first with TALUs_Custom_Kernel_i9100_LOS_16_20191102_Magisk_Stable_v20.1_ramdisk.img

1. Format data
2. Advanced wipe -> Dalvik, Cache, System, Non-emulated storage
3. adb push lineage-16.0-20191006-UNOFFICIAL-i9100.zip /sdcard/
4. adb shell md5sum /sdcard/lineage-16.0-20191006-UNOFFICIAL-i9100.zip -> e24e359e26ec19b6d6d9c6baff5768e8
5. Flashed lineage-16.0-20191006-UNOFFICIAL-i9100.zip
6. Format data again
7. Reboot system (did not install TWRP app)
8. Skipped through the wizard, setup a PIN and clicked on "Encrypt phone"

The robot appears for a second, then the screen goes black and after a few seconds the lockscreen reappears. A logcat contains these error messages:

11-04 20:33:41.299 1927 5009 E Cryptfs : Bad magic for real block device /dev/block/mmcblk0p10
11-04 20:33:41.300 1927 5009 E Cryptfs : Orig filesystem overlaps crypto footer region. Cannot encrypt in place.

A quick search turns up this so it's probably a problem with the "disk" layout.

In case it helps:

~ # fdisk -l /dev/block/mmcblk0
Found valid GPT with protective MBR; using GPT

Disk /dev/block/mmcblk0: 30777344 sectors, 2740M
Logical sector size: 512
Disk identifier (GUID): 52444e41-494f-2044-4d4d-43204449534b
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30775262

Number Start (sector) End (sector) Size Code Name
1 8192 49151 20.0M 0700 EFS
2 49152 51711 1280K 0700 SBL1
3 53248 55807 1280K 0700 SBL2
4 57344 73727 8192K 0700 PARAM
5 73728 90111 8192K 0700 KERNEL
6 90112 106495 8192K 0700 RECOVERY
7 106496 311295 100M 0700 CACHE
8 311296 344063 16.0M 0700 MODEM
9 344064 3489791 1536M 0700 FACTORYFS
10 3489792 30736383 12.9G 0700 DATAFS
11 30736384 30752767 8192K 0700 UMS
12 30752768 30769151 8192K 0700 HIDDEN

Any idea how I can fix it? I used the flashable repit-zip a few builds before #13 and back then encrypting the phone worked just fine.

Edit: I actually tried the tip in the link and it seems to work. I rebooted to recovery and did this through adb:

umount /data
umount /sdcard
resize2fs /dev/block/mmcblk0p10 3405820

I got the number by just doing

resize2fs /dev/block/mmcblk0p10

and then subtracting 4 from the size it told me.

That still means though that somewhere you should tell the ROM to leave a little room after the data partition.

Edit 2: TWRP is still unable to mount the encrypted data partition though. The first message in its log says:

Could not mount /data and unable to find crypto footer.

I'm not sure if that's usable in the long run...

Edit 3: Am I the only one having problems with the vanilla mail app? It just won't start for me. I don't have any GAPPS or MicroG installed.
[Galaxy S II Android Development] viglaman:
Hello everyone and million thanks! The ROM is fantastic. How do I flash lineage-16.0-20191006-UNOFFICIAL-i9100_magisk_boot.img ? With which tool?

I suppose this is a ready-made Magisk boot image? Which version Magisk is it? Or is the image just one supporting installation of Magisk via TWRP?
[Galaxy S II Android Development] roynatech:
You can flash the img file in TWRP. In install- flash images. Flash it to boot. Magisk version is 19.3
[Galaxy S II Android Development] viglaman:
Thank you very much! I realised how to do it last night after doing some digging. Btw, why does this ROM not support the normal installation of Magisk? Is there a way to update Magisk?
[Galaxy S II Android Development] roynatech:
Unfortunately, there is no way to update magisk on our own. The developers say that the kernel doesn't support magisk. So they have to patch it manually. I tried installing magisk via TWRP though, didn't work because it said unsupported boot.img format was installed on our device
[Galaxy S II Android Development] Little Rooster:
Is there hope to get a kernel Update to update Magisk sometime? ... or nope? :(
[Galaxy S II Android Development] roynatech:
I think that when the developers update the ROM, they will update the magisk too.
[Galaxy S II Android Development] Iv4n99:
Hi rlnando!

Thanks for this great rom!

I use my Galaxy S2 for music and the rom is super smooth.

Did you manage to boot LineageOS 17 on our ancient Galaxy S2? I saw that you started working on it

Greetings!
[Galaxy S II Android Development] Little Rooster:
Yes, I think so, too. But when the Rom not updated anymore, what is expected very soon, magisk will run off. So it would be a better point for the future to have a kernel which supports magisk updates.

There are already magisk problems right now with the old integrated v19.3. (safetynet don't pass when Edxposed is installed with any activated moduls)
[Galaxy S II Android Development] K9100ii:
The kernel isn't the issue, it's the kernel format that's the issue. We need a zImage as that is the only format our bootloader will boot, and Magisk installer doesn't support it. What is needed is a way to install Magisk without needing to compile the whole kernel with a bash script, more like a recovery zip that can be used to install Magisk.

Also, edxposed will trip safetynet whatever you try. I wonder why people still use Xposed.
[Galaxy S II Android Development] mirhl:
Something like boot bridge?