• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROM][UNOFFICIAL][11.0.0][r43][I9100] LineageOS 18.1

Search This thread

jo-so

Member
Nov 23, 2020
15
7
Samsung Galaxy Note II
i9100
Screen is not broken ;) I'm hunting this bug for months. This is the first time someone reported this bug specifically. It is hard to grab a log because it happens after weeks or sometimes twice a day. It is kernel related and it is happening when the display is suspending or resuming. I added some debug lines in my kernel to troubleshoot when it happens and having useful log.
For as far I know there is a racing condition which is prevented using a spinlock. However it sometimes happens when the spinlock is hanging... When this happens, the lcd is not turned off because the display is suspending and hangs during this proces...
Other sympton is that some values while suspending are invalid. This causes a kernel crash due invalid pointers. Hard reboot happens. I have a dirty fix for these issues and testing it for 3 weeks now. It looks promising but the main cause of the corruption is still unknown. I will include these dirty fix in next build.
If you have a kernel to test, I'm happy to try it. Also with debug messages and anything more that might help you.
 

zpunout

Senior Member
Aug 26, 2015
96
14
Samsung Galaxy S5
Moto G5 Plus
It was funny to upgrade my friend's SII to your build of Android 11 and then hand the phone back to him for a surprise. I'm guessing Android 12 might be a bit of a stretch due to its OS size and getting it to work on an old kernel would be a hurdle and then all the other things.
 

js-xda

Senior Member
Aug 20, 2018
220
101
I am having a rather vague issue regarding sleep state and battery drain.

The following situation: I am using a SII currently pretty much only as a MP3 player (using Vinyl from F-Droid) incl. sleep timer. While this was working pretty OK for some time (early September til end September) with battery lasting several days (WiFi off, airplane mode on), I am having lately issues that the devices is often drained after one night and the sleep timer in Vinyl hasn't ended either. Especially due to the last, I assumed that something is plainly getting stuck as the music doesn't last until the battery dies but rather somewhere in the range of what I set the sleep timer. I tried already different performance profiles (saver vs. balanced) and with and without WiFi on (just out of curiosity).

I can"t say for sure whether it is related to the last build which I installed around September 20th but I can say for sure that it hasn't been present before.

Anyone else having issues that could be linked a same underlying issue? Or anyone an idea?
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
Hey @rINanDO

I'm a little bit in a pickle. I have to resort to using my i9100 as a daily driver once again (my n7100 needs some serious repair). I was using a 2019 version on my S2 for a while without problem, at some point, it somehow 'crashed' (bootloop both normal and twrp) so couldn't recover it easily.

Now, I'm back at it again, and hooked up a serial port to see what was really going on. So the bootloop was triggered by mmcblk0p10 (user data partition) causing fsck to take a bit, and then segfaulting. As I want to see if there's anything that needs recovering (foto's) I figured, lets start by upgrading the kernel + twrp.

edit: see the posts below for potentially more info; I didn't manage to fix the segfault; but, transfering the image to my desktop, and fsck/mounting it there, it works just fine, doesn't even think it's corrupted. So def. a bug in the f2fs driver of that kernel, as the disk-format is not the issue.
Code:
sudo fsck.f2fs datafs.img
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 26697728 (13036 MB)
Info: MKFS version
  ""
Info: FSCK version
  from "Linux version 3.0.101-lineage-gc2aaf5ba3b8-dirty ([email protected]) (gcc version 4.9.4 20151028 (prerelease) (Linaro GCC 4.9-2016.02) ) #0 SMP PREEMPT Mon Oct 18 11:31:46 UTC 2021"
    to "Linux version 5.14.0-1-amd64 ([email protected]) (gcc-10 (Debian 10.3.0-10) 10.3.0, GNU ld (GNU Binutils for Debian) 2.37) #1 SMP Debian 5.14.6-2 (2021-09-19)"
Info: superblock features = 0 : 
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 26697728 (13036 MB)
Info: CKPT version = d8f6
Info: checkpoint state = 3 :  orphan_inodes unmount

[FSCK] Unreachable nat entries                        [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking                [Ok..]
[FSCK] Hard link checking for regular file            [Ok..] [0x0]
[FSCK] valid_block_count matching with CP             [Ok..] [0x11285a]
[FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x73f2]
[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x73f2]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x70a9]
[FSCK] free segment_count matched with CP             [Ok..] [0x1076]
[FSCK] next block offset is free                      [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 1.343300 secs
So at least i can recover my data (if there is any, I'd expect some fotos probably though)

I downloaded the latest image from this thread, and used heimdall to flash the KERNEL to the kernel partition, and the latest twrp (3.5.2) image and flashed that into the RECOVERY partition.

Sadly, it still fails to boot normally (init crashing, due to factoryfs being wrong, understandable) however, for some reason isorec is not kicking in to load twrp.

Here's a snippet of the bootlog
Code:
[    6.165529] c0 gpio_table = [2]
[    6.270613] c0 Warning: unable to open an initial console.
[    6.275105] c0 Freeing init memory: 2292K
[    6.440088] c0 max8922-charger max8922-charger: max8922_is_charging: charging state = 0x0
[    6.448103] c0 sec-battery sec-battery: sec_bat_check_temper: recovery count = 0
[    6.455948] c0 sec-battery sec-battery: sec_bat_check_temper: temp=280, adc=903
[    6.462904] c0 sec-battery sec-battery: Time past : 0 secs
[    6.468058] c0 max8922-charger max8922-charger: max8922_is_charging: charging state = 0x0
[    6.476098] c0 sec-battery sec-battery: soc(58), vfocv(3844), vcell(3843), temp(28), charging(1), health(1), chg_adc(1103)
[    6.861527] c0 init: init first stage started!
[    6.864948] c0 init: Unable to open /lib/modules, skipping module loading.
[    6.872697] c0 init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[    6.883243] c0 init: Using Android DT directory /proc/device-tree/firmware/android/
[    6.925093] c0 notify_change_of_tmu_state: uevent: 0, name = TMUSTATE=0
[    6.930458] c0 normal: free cpufreq_limit & interrupt enable.
[    6.971078] c0 init: DSU not detected, proceeding with normal boot
[    6.977853] c0 init: [libfs_mgr]superblock s_max_mnt_count:65535,/dev/block/platform/dw_mmc/by-name/FACTORYFS
[    6.992477] c0 EXT4-fs (mmcblk0p9): mounted filesystem without journal. Opts:
[    6.998696] c0 init: [libfs_mgr]__mount(source=/dev/block/platform/dw_mmc/by-name/FACTORYFS,target=/system,type=ext4)=0: Success
[    7.010736] c0 init: Switching root to '/system'
[    7.015683] c0 init: Unable to move mount at '/dev': No such file or directory
[    7.023282] c0 init: InitFatalReboot: signal 6
[    7.100323] c0 init: #00 pc 000cb988  /init (UnwindStackCurrent::UnwindFromContext(unsigned int, void*)+84)
[    7.108873] c0 init: #01 pc 0005e709  /init (android::init::InitFatalReboot(int)+132)
[    7.116596] c0 init: #02 pc 0005e9ed  /init (android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+20)
[    7.127104] c0 init: #03 pc 00122f78  /init (__restore)
[    7.132099] c0 init: #04 pc 0011fe40  /init (abort+168)
[    7.137322] c0 init: #05 pc 00060667  /init (android::init::InitAborter(char const*)+22)
[    7.145394] c0 init: #06 pc 0009a9a1  /init (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+48)
[    7.158327] c0 init: #07 pc 0009a3c9  /init (android::base::LogMessage::~LogMessage()+224)
[    7.166622] c0 init: #08 pc 0005f1dd  /init (android::init::SwitchRoot(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+612)
[    7.181709] c0 init: #09 pc 0005b925  /init (android::init::FirstStageMount::TrySwitchSystemAsRoot()+240)
[    7.191228] c0 init: #10 pc 0005ab1f  /init (android::init::FirstStageMount::MountPartitions()+134)
[    7.200251] c0 init: #11 pc 0005cbfb  /init (android::init::DoFirstStageMount()+54)
[    7.207873] c0 init: #12 pc 00058a77  /init (android::init::FirstStageMain(int, char**)+2594)
[    7.216424] c0 init: #13 pc 0011f2fb  /init (__real_libc_init(void*, void (*)(), int (*)(int, char**, char**), structors_array_t const*, bionic_tcb*)+402)
[    7.230275] c0 init: Reboot ending, jumping to kernel

After this we get a reboot into download mode; though reboot takes like 30 seconds (could be related to your mentioned bug, improper shutodwn)

So my recovery plan next is, to a) get a kernel built with a busybox shell active; so I can explorer and manually fix stuff from a linux terminal and b) convert the update image from your zip into an ext4.img so I can use heimdall to flash it.

So on both accounts a few questions.

How can I rebuild the kernel without having to do the whole lineage build? I'm very familiar with kernel builds, so that's not an issue, but from a 'traditional' kernel build I end up with a zImage. Afaik, I need to atleast use mkbootimg to convert it into an android boot image, so what else is in your kernel image so i have a drop-in replacement?

Secondly, do you happen to know an easy trick to convert the update image? I'm gonna probably just chroot into the twrp image and fake-install the update file into a loop device, that should work well enough.

Thirdly, do you know if the latest twrp even works on our device? I downloaded it and it's 8708998 bytes, looking at the 'download-pit' from heimdall, the recovery partition is 16384 blocks, which would be 8388608 bytes so twrp doesn't even fit, which could be an explanation of isorec failing.
Code:
twrp-3.5.2_9-0-i9100.img    8.3M    2021-04-06 05:59:38 UTC
twrp-3.5.1_9-0-i9100.img    8.3M    2021-03-15 00:53:27 UTC
twrp-3.5.0_9-0-i9100.img    7M    2020-12-29 01:10:47 UTC
so I'll try downgrading first :)

edit: So with twrp 3.5.0 recovery works again; so indeed, 8.3M is obviously to big. I'll open a bugreport there and see how easy it is to add a compile-time check to produce a warning on their pipeline; they shouldn't be publishing files that won't fit on 'stock' partitions'

It bootloops again however, since the newer kernel won't allow me to recover either (kernel crashing on the image) the only options I have left; create a kernel, dump the partition to an SD card and fix it on a normal linux system; and/or flash a f2fs image into the user partition so the kernel won't crash anymore :(

edit2: Bah, this sucks; For whatever reason, the DATAFS partition can't be heimdalled, `
ERROR: Failed to confirm end of file transfer sequence!`

I'll have to start to compile your kernel and add a shell (should be trivial really) so i can run mkfs on the device instead :(

I think TWRP trying to fsck and crashing is really bad; we can't fix the kernel (too old, should upgrade to mainline really) but can fix TWRP imo to not crash. There should be just a button 'fsck filesystem's instead ... it's a recovery, the whole point is being able to recover no? :)
 
Last edited:

Badger50

Forum Moderator
Staff member
Feb 27, 2011
12,965
16,354
61
Kansas City
Greetings to all, and I certainly hope everyone is doing well. I dropped in for a little thread cleaning since things were getting a bit off topic. As a friendly reminder, if you are having difficulties with a particular rom or kernel, please report them in a respectful, and informative way, without impugning the integrity of this, or any developer on XDA, with things you may have experienced in the past.

Furthermore, we would be most appreciative if members would just report potential problems, rather than replying in a confrontational manner, which usually leads to piling on, and the inevitable flame war. So let us please keep things civil and respectful going forward shall we. I thank you all for your cooperation, and have a pleasant day.

-Best regards: Badger50 FSM
 
  • Like
Reactions: 2faraway2

rINanDO

Senior Member
Dec 17, 2009
654
4,413
After some days of usage, I can confirm that this helps. I've disabled the Ambient display and saw no crashes any more.
Nice! My dirty fix and logging for troubleshooting this issue still leads in rare crashes. The message to display driver is corrupt, causing hangs or null references and reboots. But if my dirty fix is triggered, it crashes the next driver... I saw wifi and touchscreen crash. It always happens (when it happens) when pressing power button to set the phone to sleep. At least after few weeks I never had a white corrupted 'broken' display screen. :)
I will try this workaround and investigate how this actually prevents these crashes.
This helps, thanks guys!
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
@rINanDO your current HEAD of your kernel repo is not the one in use right? As there are some things in that don't seem to work (causing init exit errors)

e.g. `busybox cd /` doesn't make sense, `cd` is a shell built in, so doesn't need busybox prefixed. Also `exec >>boot.txt` I don't even know what's that supposed to do, as `exec` normally swappes out the current process (and pid) with the new process, but no process is listed there ...

edit: must be fine though; because that part of the script was not touched for almost 10 years, and now with everything fixed it's working ...

I managed to compile and run a shell however :) I did use alpine's latest static busybox, because the 2010 android one lacks some stuff. I'll actually be cleaning the init up a bit, and want to enable some more features (you can call it isorec2 :p) as the latest twrp's don't work anymore due to size, so want to change that too, to either squashfs and/or to xz.

Anyway, I've run out of all options on trying to fix my lost partition, dd-ing it now to a microSD card to see if I can recover some files (you'll see it'll turn out to be nothing of value there :p) and then mkfs.ext4 it. I think f2fs is a great FS and is super stable, but not on the 3.0 kernel series ...

edit: So i finally have everything working again :) after re-installing the ROM, i got the kernel that's part of the build back, and with everything wiped, it should all be perfect.

However, for whatever reason, I keep having the serial console enabled (with a pop up from android) and it's all really slow (probably caused by the console).

I do see
Code:
[    0.000000] c0 Linux version 3.0.101-lineage-g24b4dc225265 ([email protected]) (gcc version 4.9.x 20150123 (prerelease)
i9100:/ # cat /proc/cmdline                                                                                               
console=ttySAC2,115200 consoleblank=0 androidboot.hardware=smdk4210 loglevel=3 console=ram androidboot.serialno=0009e7990bcc4f sec_debug.enable=0 sec_debug.enable_user=0 c1_watchdog.sec_pet=5 [email protected] s3cfb.bootloaderfb=0x5ec00000 ld9040.get_lcdtype=0x2 consoleblank=0 lpj=3981312 vmalloc=144m
hah, actually console is set twice, once as per bootloader, and once from somewhere else. So is this something that needs to be fixed? I do notice quote some choppiness and slowness ... probably turning off animations might help significantly ...

btw, doing a strings om PARAM (/dev/block/mmcblk0p4) I do see something resembling the SBL environment ...
Code:
I9000XXIL
loglevel=3 console=ram
/ttySAC2,115200
(I did set the loglevel lower) but console, as you can see is set to ram ... I'll tripple check to make sure, but i'm very certain i did set things up properly, maybe I should put some garbage in the CMDLINE first to ensure it's properly wiped/empty and that I see is just some left-over stuff.

Here's the env;
Code:
SBL> printenv
PARAM Rev 1.3
SERIAL_SPEED : 7
LOAD_RAMDISK : 0
BOOT_DELAY : 0
LCD_LEVEL : 50
SWITCH_SEL : 1
PHONE_DEBUG_ON : 0
LCD_DIM_LEVEL : 1
LCD_DIM_TIME : 6
MELODY_MODE : 1
REBOOT_MODE : 0
NATION_SEL : 0
LANGUAGE_SEL : 0
SET_DEFAULT_PARAM : 0
FLASH_LOCK_STATUS : 0
PARAM_INT_14 : 0
VERSION : I9000XXIL
CMDLINE : loglevel=3 console=ram
DELTA_LOCATION : /mnt/rsv
PARAM_STR_3 :
PARAM_STR_4 :
SBL> setenv BOOT_DELAY 1
So is there anywhere in the ROM that sets the console to something else? I cannot find it in your kernel img and I doubt its in the boot.cpio ...
 
Last edited:
  • Like
Reactions: SethGeckoXDA

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
Also, I installed micro-g via fdroid (microg repo) and signature spoofing enablement as per OP fails?

255|i9100:/ $ pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.FAKE_PACKAGE_SIGNATURE
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1445)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1404)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2287)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:249)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21696)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4351)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
255|i9100:/ $ pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.FAKE_PACKAGE_SIGNATURE
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1445)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1404)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2287)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:249)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21696)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4351)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
regardless of reboot, root etc.

edit: Scrap the above; I think this is a copy/paste thing on the start-post; I see that [1/2] was only merged yesterday :) https://github.com/rINanDO/android_frameworks_base/commit/aaa5bcf5ed39f585000572640de65c965cc7a8aa so most definitely not part of the 2020 release from the first-post.

Gah, the opening post isn't updated with the latest links :) https://forum.xda-developers.com/t/...43-i9100-lineageos-18-1.4199759/post-85625999 is the latest zip post :)
 
Last edited:

mirhl

Senior Member
Oct 15, 2012
3,086
1,158
I am having a rather vague issue regarding sleep state and battery drain.

I can"t say for sure whether it is related to the last build which I installed around September 20th but I can say for sure that it hasn't been present before.

Anyone else having issues that could be linked a same underlying issue? Or anyone an idea?
As with all battery problems, install BBS and check from there?

I'm a little bit in a pickle. I have to resort to using my i9100 as a daily driver once again (my n7100 needs some serious repair). I was using a 2019 version on my S2 for a while without problem, at some point, it somehow 'crashed' (bootloop both normal and twrp) so couldn't recover it easily.

Now, I'm back at it again, and hooked up a serial port to see what was really going on. So the bootloop was triggered by mmcblk0p10 (user data partition) causing fsck to take a bit, and then segfaulting. As I want to see if there's anything that needs recovering (foto's) I figured, lets start by upgrading the kernel + twrp.

edit: see the posts below for potentially more info; I didn't manage to fix the segfault; but, transfering the image to my desktop, and fsck/mounting it there, it works just fine, doesn't even think it's corrupted. So def. a bug in the f2fs driver of that kernel, as the disk-format is not the issue.


Sadly, it still fails to boot normally (init crashing, due to factoryfs being wrong, understandable) however, for some reason isorec is not kicking in to load twrp.
Sigh.. That sounds like the bug I have been trying to report for almost 10 years.
The kernel explodes whenever it doesn't like mounting a partition.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
As with all battery problems, install BBS and check from there?


Sigh.. That sounds like the bug I have been trying to report for almost 10 years.
The kernel explodes whenever it doesn't like mounting a partition.
I'll also look into the battery stuff; I notice that the battery drain is quite high. One thing I noticed, it might be related to the relative high frequency during 'sleep'. It's currently running at 100Mhz at its slowest, while I'm quite certain that my note2 runs at something much slower. If we can get it to 10 - 25MHz; that's another win there (if we can also scale the voltage down a bit; that's even a bigger win.


As for the bug; yeah the kernel should not explode on mount failures. I think this is some really weird kernel behavior; that's specific to this android build.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
I'll also look into the battery stuff; I notice that the battery drain is quite high. One thing I noticed, it might be related to the relative high frequency during 'sleep'. It's currently running at 100Mhz at its slowest, while I'm quite certain that my note2 runs at something much slower. If we can get it to 10 - 25MHz; that's another win there (if we can also scale the voltage down a bit; that's even a bigger win.


As for the bug; yeah the kernel should not explode on mount failures. I think this is some really weird kernel behavior; that's specific to this android build.

I would expect that the best work-around is to ensure that twrp/recovery don't auto-mount the partitions, the user can mount them via a click on the UI; update scripts should do this already anyway, and it ensures we still have a recovery shell we can access to manually fix things. I'm not sure however who makes this policy 'twrp shall automount everything from fstab'. I believe we do have a specific recovery fstab already anyway, and so having the 'no-auto' flag there is an easy work-around.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
I haven't run logcat yet, but I tried to save an attachment from k9, which kept crashing (creating a 0 byte file, so storage access was working) on internal/external storage; Using the 'SimpleMail' app something similar happened.

Also I noticed 'sometimes' the phone just hard-locks, but always 'while' doing something, and you have to force-reboot.

The white snow screen I've also seen twice now. Interestingly enough; the OS seems to be still functional. I could push the menu/back button and got haptic feedback. I didn't have time to poke-around to see If I could get any useful logs however ...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hello js-xda,

    it is not the first start after flashing. I restarted it some times, some apps are installed. in the settings/battery is now special app mentioned, that needs to mutch battery. It says, everything is OK. But the battery is emty so fast.

    Regards
    Sebastian
    2
    Hello,

    I have instaled the latest version 2021-09-12 and nano-gapps. The battery is going down to fast, halve in 5:30 H without using it. I tryed bbs statistic, the log-file is attached. It seems, as it doesnt sleep the hole time. I didn't turn on the screen during this time. Is something I can do? Or should I wate for the next update, is someone in planing?

    Best regards
    Sebastian
    2
    I was just returned to Samsung's latest official firmware with Android 4.1.2 for Galaxy S2 and almost all problems are gone away. So, I'm happy with it.
    It is not the ideal firmware but much more useful according my experience.

    I'm still watching to custom firmwares announcements for Samsung Galaxy S2 but now become very cautious about it after my personal strongly disappointing experience with LOS 14.1 and based on it RR 5.8.3-5.8.4.

    As an ordinary smartphone user I do not found a worth reason for flashing the risky custom firmware instead of reliable using the official original firmware for Galaxy S2.
    Then what are you doing here if you think this firmware is risky. Then stick with the original Samsung firmware. No one is forcing you to. Above all, no one is forcing you to lie here.
    BTW...The Galaxy S II can be used with microSD™ or microSDHC™ memory cards with a maximum capacity of 32 GB. I have a 64 GB micro SDXC Class 10 card in it and everything works. So I wouldn't recommend inserting cards with an even larger capacity.
    1
    Hello,

    I have instaled the latest version 2021-09-12 and nano-gapps. The battery is going down to fast, halve in 5:30 H without using it. I tryed bbs statistic, the log-file is attached. It seems, as it doesnt sleep the hole time. I didn't turn on the screen during this time. Is something I can do? Or should I wate for the next update, is someone in planing?

    Best regards
    Sebastian
    You didn't grant the app all the right permissions, and you have no wakelock information.
    1
    The Galaxy S II can be used with microSD™ or microSDHC™ memory cards with a maximum capacity of 32 GB. I have a 64 GB micro SD card in it and everything works. So I wouldn't recommend inserting cards with an even larger capacity.
    I have opposite opinion based on my successful experience:
    I recommend to use Samsung Galaxy S2 with microSD cards up to 256GB of storage because modern fast microSD cards can slightly increase the performance of the old smartphone and yet adding more storage space. So, I recommend really to choose only a firmware which works with such memory cards reliable without a battery drain.
  • 60
    Code:
    /*
    ** Your warranty is now void.
    **
    ** We are not responsible for bricked devices, dead SD cards,
    ** thermonuclear war, or you getting fired because the alarm app failed. Please
    ** do some research if you have any concerns about features included in this ROM
    ** before flashing it! YOU are choosing to make these modifications, and if
    ** you point the finger at us for messing up your device, we will laugh at you.
    **
    **/

    Hi all,

    Well... It is still possible. Galaxy SII running Android 11! I could have made this port sooner, but the lack of time stalled a bit. Thanks to @ChronoMonochrome who ported LOS 18.0 for S3 couple months ago still using kernel 3.0.101 (or optionally 3.4) it should also be possible to build it for S2. Building for i9100 isn't straight forward because of the major changes in the image creation routines (creating boot.img, etc for the installable zip). And the GCC compiler support of Kernel 3.0.101 is removed. After resolving these issues I got my first flashable zip! Then I needed to get manifest.xml properly. Thanks to Shivaay who helped me and I got it finally booting! It was horribly slow because of some internal changes in LMKD which our kernel doesn't support some features. The Settings-app crashes immediately leaving me unable to investigate. After reverting some patches in LMKD and things in framework/base it started to run like Android 10. I addressed the HAL's and got almost everything working in this ROM. Of course it isn't perfect and there will be bugs or instability. I'm no Samsung, just a DIY :)

    For these builds you NEED ISOlated-RECovery because I had to eliminate the embedded (.cpio) ramdisk-images in zImage.
    Upgrade from Samsung stock ROM using ODIN 3.07
    lineage-18.0-20201207-UNOFFICIAL-i9100.zip

    PIT: i9100-LOS-16.0-Emulated-Storage.pit
    PDA: i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.tar.md5

    1. Boot your phone into Download-mode (Volume down + Power/Standby + Home and hold for 10 seconds).
    2. Start ODIN 3.07 on your PC.
    3. Connect your phone via USB to your PC.
    4. Press volume up on your phone, ODIN should detect your phone.
    5. In ODIN:
    Auto Reboot : unchecked
    Re-Partition: checked
    PIT : i9100-LOS-16.0-Emulated-Storage.pit
    PDA : i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.tar.md5
    6. Press Start.
    7. After succesful flash, reboot phone into Recovery:
    - Press Volume up + Power/Standby + Home and hold for 10 seconds.
    The phone shuts down.
    - Repeat Press Volume up + Power/Standby + Home and hold for 10 seconds
    Phone boots in recovery TWRP 3.3.1-1.
    8. Swipe to Allow Modifications
    9. In TWRP 3.3.1-1 you need to format partions
    - Wipe -> Format Data -> Type [yes]
    - Wipe -> Advanced Wipe -> Select:
    * Davik / ART Cache
    * Cache
    * System
    * Non-emulated Storage
    -> Swipe to Wipe
    10. Install LOS-18 ( + optionally Gapps or MicroG)
    To prevent "Uncryption unsuccessful" error of GAPPS at first start:
    - Reboot to recovery and Wipe -> Format Data -> Type [yes] again
    11. Boot System
    DON'T INSTALL TWRP APP. This will cause bootloop!
    12. For MicroG users:
    You need manualy grant permissions via ADB to get things working properly.
    These are the commands:
    adb shell pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE
    adb shell pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE


    Thanks To
    • @ChronoMonochrome
    • Shivaay
    • @lee.wp14
    • @ze7zez
    • arco68
    • Team Infusion
    • LineageOS team
    • and all prior developers that were working on this phone.
      I hope I didn't missed someone, please let me know.
    • Last but not least @channel48 which reviews custom ROMS from all kind of phones including my work on this ancient one :)
    Source code:
    https://www.github.com/lineageos
    https://www.github.com/rinando

    Current state:
    Working:
    - RIL (Phone/SMS)
    - AGPS
    - Audio
    - Bluetooth (audio & headset)
    - Wifi
    - IMEI
    - Touchkeys
    - Camera Pictures
    - Camera Videorecording
    - Hardware encode/decoder
    - Display
    - Sensors
    - DRM, for e.g. Netflix
    - PowerHAL
    - LiveDisplay
    - Selinux enforced
    - BitGapps
    - Magisk v22.1
    - FM Radio using Spirit2)


    Not tested:
    - Bluetooth headset
    - BLN
    - FM-Radio (using Spirit2)
    - TWRP 3.4.0-0

    Not working/known issues:
    - Magisk support (misses some frameworks patches I guess)
    - FM-Radio (using Spirit2)
    - Home
    - MicroG support
    - Home-button not working while charging when phone is turned off. Use power-button

    - Sometimes shutdown phone hangs (and draining your battery)
    - Bluetooth headset connected via SCO

    Won't fix:
    - HDMI (MHL) (support broken/removed since CM 10)
    22
    Build #12 2021-09-13
    Overall state: Stable-ish
    Android build: 11.0.0-r43
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210912-UNOFFICIAL-i9100.zip
    lineage-18.1-20210912-UNOFFICIAL-i9100_magisk_boot.img

    Build #11 2021-08-27
    Overall state: Stable-ish
    Android build: 11.0.0-r40
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Fixed Bluetooth headset


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210827-UNOFFICIAL-i9100.zip
    lineage-18.1-20210827-UNOFFICIAL-i9100_magisk_boot.img

    Build #10 2021-08-10
    Overall state: Stable-ish
    Android build: 11.0.0-r40
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Adjusted OLED brightness levels
    - Enabled auto brightness


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210810-UNOFFICIAL-i9100.zip
    lineage-18.1-20210810-UNOFFICIAL-i9100_magisk_boot.img

    Build #9 2021-07-15
    Overall state: Stable-ish
    Android build: 11.0.0-r39
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Applied WifiOverlay to disable WPA3, please test, I don't have WPA3 router
    - Decreased Exynos_Ion_Heap and TV-out to free 70MB memory
    - Fixed reboot issue when using Magisk kernel
    - Addressed unknown netlink mapping (SOCK_DESTROY) in kernel
    - Disabled ColorFade, ColorFade indirectly trigger sometimes blackscreen crash when in high memory pressure. It allocates multiple fullscreen frames to animate fadeout effect when pressing powerkey to turn off/lock phone.

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210715-UNOFFICIAL-i9100.zip
    lineage-18.1-20210715-UNOFFICIAL-i9100_magisk_boot.img

    Build #8 2021-06-28
    Overall state: Stable-ish
    Android build: 11.0.0-r38
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - MicroG support thanks to @2faraway2
    - Forward port Memory optimizations from LOS 16.0 thanks to @acroreiser
    - Home-button fix offline charging

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210628-UNOFFICIAL-i9100.zip
    lineage-18.1-20210628-UNOFFICIAL-i9100_magisk_boot.img

    Build #7 2021-05-17
    Overall state: Stable-ish
    Android build: 11.0.0-r37
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Disabled Lineage GO configuration, forgotten in build #6

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210517-UNOFFICIAL-i9100.zip
    lineage-18.1-20210517-UNOFFICIAL-i9100_magisk_boot.img

    Build #6 2021-05-14
    Overall state: Stable-ish
    Android build: 11.0.0-r37
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Magisk v23.0 support

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210514-UNOFFICIAL-i9100.zip
    lineage-18.1-20210514-UNOFFICIAL-i9100_magisk_boot.img

    Build #5 2021-05-04
    Overall state: Stable-ish
    Android build: 11.0.0-r34
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Disabled low_ram flag, but other GO optimized memory-settings are still applied
    - Disabled Lineage GO configuration, so we have Widgets againin Trebuchet
    - Magisk v22.1 support!
    Download Magisk v22.1 from here and install APK.
    Reboot into recovery and flash lineage-18.1-20210504-UNOFFICIAL-i9100_magisk_patched.img via TWRP "Install image" and choose "Boot".
    Reboot and enjoy Magisk!

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210504-UNOFFICIAL-i9100.zip
    lineage-18.1-20210504-UNOFFICIAL-i9100_magisk_patched.img

    Build #4 2021-04-06
    Overall state: Stable-ish
    Android build: 11.0.0-r32
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Finally fixed RIL (using i9300 blob) and GPS!
    - Removed temporary permission hacks due missing kernel commits


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210406-UNOFFICIAL-i9100.zip

    Build #3 2021-02-12
    Overall state: Stable-ish
    Android build: 11.0.0-r29
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Added network fix caused Firefox to crash, thanks to florencebirée
    -
    Build with LineageGO (more memory, but also more limitations)


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210212-UNOFFICIAL-i9100.zip

    Build #2 2021-01-11
    Overall state: Unknown, but hopefully better than #1
    Android build: 11.0.0-r19
    Required recovery: TWRP 3.3.1-1

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210111-UNOFFICIAL-i9100.zip

    Build #1 2020-12-07
    Overall state: Unstable, max reach uptime about 12h
    Android build: 11.0.0-r17
    Required recovery: TWRP 3.3.1-1

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.0-20201207-UNOFFICIAL-i9100.zip
    16
    New build is up!
    Finaly I made some real progress. I was stuck why the ROM needed permission hacks at framework-level and lmkd hacks. GPS causes RIL to crash and RIL crashes when the audio driver (tiny-alsa) uses libsecril-client to send phone audio commands. It was a pain in the neck. I also tried replicant drivers (which almost worked) but I got lost nevertheless. (for months... :( )

    Suddenly by accident I stumbled upon some kernel patches which fixed the framework-level patch. A few hours later I found the missing kernel code to fix lmkd hacks (merge conflict resolve from kernel v3.4.113). It still left me stuck with crashing RIL. I hoped it had the same root cause... unfortunately not... So I tried libsec-ril.so from i9300, patched it for R and hope for the best.... And that fixed RIL! GPS runs stable, audio control works, calling/receiving calls, data 2G/3G works! My guess is that i9100's libsec-ril.so is missing some newer socket codes which were handled by i9300's version. I can't change that because it is proprietary blob and I don't know assembly/ARM.

    I tried BitGapps and try to stress the ROM. Yes it is slow compared for nowadays Android R phone but it doesn't crashed yet. Apps are installing and working. Magisk doesn't work. It has something to do how i9100 boots with Android R which skips starting Magisk at boot. Need to figure that out.

    I'm now running it for a day so, lets ship it and mark it as BETA :)


    Build #4 2021-04-06 (BETA)
    Overall state: Stable-ish
    Android build: 11.0.0-r32
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Finally fixed RIL (using i9300 blob) and GPS!
    - Removed temporary permission hacks due missing kernel commits


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210406-UNOFFICIAL-i9100.zip
    14
    New build is up!
    That theory has been proven... Building LOS without GO 'fixed' Magisk from booting because of the memcg/acct differences when low_ram is enabled. For normal builds (low_ram disabled) Magisk has a fix here. Thanks to @mirhl for pointing me this out. So now just a new build and I updated it for Magisk v23.0. I looked shortly to Wifi, but I don't have a clue what is wrong yet.

    Build #6 2021-05-14
    Overall state: Stable-ish
    Android build: 11.0.0-r37
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources
    - Magisk v23.0 support

    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210514-UNOFFICIAL-i9100.zip
    lineage-18.1-20210514-UNOFFICIAL-i9100_magisk_boot.img
    14
    New build is up!
    Only updated sources.

    Build #12 2021-09-13
    Overall state: Stable-ish
    Android build: 11.0.0-r43
    Required recovery: TWRP 3.3.1-1

    Changes:
    - Updated sources


    Downloads
    i9100-LOS-16.0-Emulated-Storage.pit
    i9100-LOS-16.0-Emulated-Storage-TWRP-3.3.1-1.img

    lineage-18.1-20210912-UNOFFICIAL-i9100.zip
    lineage-18.1-20210912-UNOFFICIAL-i9100_magisk_boot.img