Project

General

Profile

Actions

Issue #2114

open

Create a recovery

Added by Denis 'GNUtoo' Carikli about 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
Start date:
08/25/2020
Due date:
% Done:

0%

Estimated time:
Resolution:
Device:
Galaxy S 3 (I9300), Galaxy S 3 4G (I9305)
Grant:
Porting Replicant to Android 9 (NLnet Foundation)
Type of work:
Any programming languages (scripts, C, etc), Build system integration, System administration
Actions #1

Updated by Denis 'GNUtoo' Carikli about 4 years ago

  • Grant set to Porting Replicant to Android 9 (NLnet Foundation)
Actions #2

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

So far:
  • heimdall flash --BOOT recovery.img --RECOVERY recovery.img doesn't work, even with the recovery being out/target/product/i9300 and being just built with make recoveryimage
  • reboot to recovery in various ways doesn't work (that's probably to implement somewhere)
  • But, but... The power + volume up + menu button when the device is off can boot that recovery
Actions #3

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

Caveats:
  • It has the LineageOS logo instead of the Replicant one
  • It prints this message:
    E: Failed to clear BCB message: failed to find /misc partition
    .
  • The blinking '_' cursor isn't disabled. If it uses the framebuffer, an ioctl is probably need to be issued to disable that (FBIO*?)
Actions #4

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

The colors are also wrong, but that should be fixed once we stop hardcoding that, and choose colorspace with the first client using the framebuffer / DRM interface.

Actions #5

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

We also need to find out how it works under Replicant 10: The partition size for the recovery is 8M and the recovery being generated is about 12M. Yet I had the recovery working and did adb sideload.

So we need to look if it's supposed to work like in AOSP or not and what exactly is flashed in the RECOVERY partition and when it is flashed.

Actions #6

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

I have:

$ heimdall flash --BOOT recovery.img --RECOVERY recovery.img 
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading BOOT
100%
BOOT upload successful

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Rebooting device...
Releasing device interface...

with:

$ ls -lah recovery.img 
-rw-r--r-- 1 1001 1001 12M 22 nov.  20:48 recovery.img

and it boots to the recovery.

Actions #7

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

It seems that I really have a 8M partition:

i9300:/ # ls -la /dev/block/platform/soc/12550000.mmc/by-name/RECOVERY                                                                                   
lrwxrwxrwx 1 root root 20 2020-11-18 19:59 /dev/block/platform/soc/12550000.mmc/by-name/RECOVERY -> /dev/block/mmcblk2p6
i9300:/ # cat /proc/partitions                                                                                                                               
major minor  #blocks  name

   1        0       8192 ram0
   1        1       8192 ram1
   1        2       8192 ram2
   1        3       8192 ram3
   1        4       8192 ram4
   1        5       8192 ram5
   1        6       8192 ram6
   1        7       8192 ram7
   1        8       8192 ram8
   1        9       8192 ram9
   1       10       8192 ram10
   1       11       8192 ram11
   1       12       8192 ram12
   1       13       8192 ram13
   1       14       8192 ram14
   1       15       8192 ram15
 179        0   15388672 mmcblk2
 179        1       4096 mmcblk2p1
 179        2       4096 mmcblk2p2
 179        3      20480 mmcblk2p3
 179        4       8192 mmcblk2p4
 179        5       8192 mmcblk2p5
 179        6       8192 mmcblk2p6
 179        7      32768 mmcblk2p7
 179        8    1048576 mmcblk2p8
 179        9    1572864 mmcblk2p9
 179       10     573440 mmcblk2p10
 179       11       8192 mmcblk2p11
 179       12   12091392 mmcblk2p12

So RECOVERY is mmcblk2p6 which is about 8192KiB.

Actions #8

Updated by Denis 'GNUtoo' Carikli almost 4 years ago

I sideloaded Replicant 10, then It hanged next boot with:

11-22 08:46:33.065  1284  1284 I bootstat: Canonical boot reason: reboot,ota

adb reboot normal fixed it.

Though I wonder if reboot,ota needs to be cleared somehow or where it is written.

Actions #9

Updated by _I3^ RELATIVISM over 3 years ago

  • Type of work Any programming languages (scripts, C, etc), System administration added
Actions #10

Updated by Denis 'GNUtoo' Carikli about 3 years ago

  • Device Galaxy S 3 (I9300), Galaxy S 3 4G (I9305) added
  • Device deleted (Unknown)
  • Type of work Build system integration added

The recovery now works fine, and even there isn't big Replicant logos or text, Replicant is still mentioned anyway as:

Android Recovery
Samsung/replicant_i9300/i9300
11/RP1A.201105.002/replicant09011614
userdebug/test-keys

TODO:
  • We needd to produce zip "otapackage" files.
  • We still have to fix the following error:
    E: Failed to clear BCB message: failed to find /misc partition
    .
  • We didn't test install / upgrades or talking to the recovery from Replicant like we do with our experimental test libraries that can install Replicant 6 automatically.
  • We still need to remove the blinking cursor, but we'll do that once we have a boot animation during the standard Replicant boot, otherwise users have 0 clue the device is on and booting.
Actions

Also available in: Atom PDF