Add SFOS on PP RAW image output only 32MB

(First of all, I don’t know the differents between PinePhone 1.0 or 1.1, but I choose 1.1)

I run the flash-it.sh script and typed ‘raw’ to write image to the folder containing flash-it.sh script. What I have now is;
u-boot-sunxi-with-spl-pinephone.bin 741KB
sdcard.img 32,7MB

But when I flash image to eMMC, nothing seems to happen. Did I do something wrong in the Terminal? Or do I have to use the Terminal inside the phone?

I can’t remember why but the raw option no longer works and maybe even sdcard is problematic. The best option is to use jumpdrive to flash directly to the emmc.
Matbe you should also edit the title to add SFOS on PP.

I can’t see the eMMC in the Terminal. I did this:

adm1n@raspberrypi:~/Downloads $ sudo dd if=/dev/urandom of=/dev/mmcblk0 bs=8M
^C985+0 records in
985+0 records out
8262778880 bytes (8.3 GB, 7.7 GiB) copied, 610.237 s, 13.5 MB/s

adm1n@raspberrypi:~/Downloads $ ls
flash-it.sh mmcblk0 sdb u-boot-sunxi-with-spl-pinephone.bin
adm1n@raspberrypi:~/Downloads $ sudo su
root@raspberrypi:/home/adm1n/Downloads# bash flash-it.sh
Sailfish OS Pine64 device flasher V0.3.3

Which image do you want to flash?

  1. PinePhone 1.0 (Development) device
  2. PinePhone 1.1 (Brave Heart) or 1.2 (Community Editions) device
  3. PineTab device
  4. PineTab Dev device
  5. Pinephone Pro
    #? 2
    Downloading images…
    https://github.com/sailfish-on-dontbeevil/u-boot-bootloader/releases/download/v0.9/u-boot-pinephone
    u-boot.zip 100%[=============================================================================================================================================================================================================================================================================================================================>] 3.56M 3.29MB/s in 1.1s
    u-boot-sunxi-with-spl-pinephone.bin 100%[=============================================================================================================================================================================================================================================================================================================================>] 740.57K 1.92MB/s in 0.4s
    pinephone-1.1-rootfs.zip 100%[=============================================================================================================================================================================================================================================================================================================================>] 399.95M 8.79MB/s in 52s
    Which SD card do you want to flash?
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 1 59.2G 0 disk
    ├─sda1 8:1 1 256M 0 part /boot
    └─sda2 8:2 1 58.9G 0 part /
    sdb 8:16 1 28.9G 0 disk
    ├─sdb1 8:17 1 122M 0 part
    └─sdb2 8:18 1 28.8G 0 part
    sdc 8:32 1 7.3G 0 disk
    └─sdc1 8:33 1 49M 0 part
    mmcblk0 179:0 0 14.8G 0 disk
    raw
    Device node (/dev/sdX): mmcblk0
    Flashing image to: mmcblk0
    WARNING: All data will be erased! You have been warned!
    Some commands require root permissions, you might be asked to enter your sudo password.
    Creating EXT4 file system…
    Unmounting mmcblk0
    umount: mmcblk0: not mounted.
    32+0 records in
    32+0 records out
    33554432 bytes (34 MB, 32 MiB) copied, 2.10747 s, 15.9 MB/s
    Error: The location 256MB is outside of the device /home/adm1n/Downloads/mmcblk0.
    Error: The location 256MB is outside of the device /home/adm1n/Downloads/mmcblk0.
    Error: The location 6250MB is outside of the device /home/adm1n/Downloads/mmcblk0.
    mke2fs 1.46.2 (28-Feb-2021)
    The file mmcblk0p1 does not exist and no size was specified.
    mke2fs 1.46.2 (28-Feb-2021)
    The file mmcblk0p2 does not exist and no size was specified.
    mke2fs 1.46.2 (28-Feb-2021)
    The file mmcblk0p3 does not exist and no size was specified.
    Flashing U-boot…
    Archive: u-boot.zip
    inflating: u-boot-bootloader/pinephone-1.1/boot.scr
    inflating: u-boot-bootloader/devkit/boot.scr
    inflating: u-boot-bootloader/pinephone-pro/boot.scr
    inflating: u-boot-bootloader/u-boot/bl31_0x00040000.bin
    inflating: u-boot-bootloader/u-boot/u-boot.img
    inflating: u-boot-bootloader/u-boot/u-boot-dtb.img
    inflating: u-boot-bootloader/u-boot/spl/u-boot-spl.bin
    inflating: u-boot-bootloader/u-boot/spl/sunxi-spl.bin
    inflating: u-boot-bootloader/u-boot/spl/u-boot-spl-nodtb.bin
    inflating: u-boot-bootloader/u-boot/spl/u-boot-spl-dtb.bin
    inflating: u-boot-bootloader/u-boot/u-boot-dtb.bin
    inflating: u-boot-bootloader/u-boot/u-boot.bin
    inflating: u-boot-bootloader/u-boot/u-boot.itb
    inflating: u-boot-bootloader/u-boot/tools/binman/test/descriptor.bin
    inflating: u-boot-bootloader/u-boot/u-boot-sunxi-with-spl.fit.itb
    inflating: u-boot-bootloader/u-boot/u-boot-sunxi-with-spl.bin
    inflating: u-boot-bootloader/u-boot/u-boot-rockchip.bin
    inflating: u-boot-bootloader/u-boot/bl31_0xff3b0000.bin
    inflating: u-boot-bootloader/u-boot/idbloader.img
    inflating: u-boot-bootloader/u-boot/tpl/u-boot-tpl-nodtb.bin
    inflating: u-boot-bootloader/u-boot/tpl/u-boot-tpl-dtb.bin
    inflating: u-boot-bootloader/u-boot/tpl/u-boot-tpl.bin
    inflating: u-boot-bootloader/u-boot/tpl/u-boot-tpl-rockchip.bin
    inflating: u-boot-bootloader/u-boot/bl31_0xff8c0000.bin
    inflating: u-boot-bootloader/u-boot/u-boot-nodtb.bin
    inflating: u-boot-bootloader/pinephone-1.0/boot.scr
    inflating: u-boot-bootloader/arm-trusted-firmware/build/sun50i_a64/release/bl31.bin
    inflating: u-boot-bootloader/arm-trusted-firmware/build/rk3399/release/m0/rk3399m0.bin
    inflating: u-boot-bootloader/arm-trusted-firmware/build/rk3399/release/m0/rk3399m0pmu.bin
    extracting: u-boot-bootloader/arm-trusted-firmware/plat/arm/board/common/protpk/arm_protpk_rsa_sha256.bin
    extracting: u-boot-bootloader/arm-trusted-firmware/plat/arm/board/common/rotpk/arm_rotpk_ecdsa_sha256.bin
    extracting: u-boot-bootloader/arm-trusted-firmware/plat/arm/board/common/rotpk/arm_rotpk_rsa_sha256.bin
    inflating: u-boot-bootloader/arm-trusted-firmware/plat/rockchip/rk3368/drivers/ddr/rk3368_ddr_reg_resume_V1.05.bin
    inflating: u-boot-bootloader/arm-trusted-firmware/plat/rockchip/rk3399/drivers/dp/hdcp.bin
    inflating: u-boot-bootloader/pinetab/boot.scr
    92+1 records in
    92+1 records out
    758339 bytes (758 kB, 741 KiB) copied, 0.0569735 s, 13.3 MB/s
    Flashing rootFS…
    Archive: pinephone-1.1-rootfs.zip
    inflating: pinephone-1.1/sfe-pinephone-1.1-4.3.0.12-devel-20220501/Jolla-4.3.0.12-pinephone-1.1-aarch64.ks
    inflating: pinephone-1.1/sfe-pinephone-1.1-4.3.0.12-devel-20220501/Jolla-4.3.0.12-pinephone-1.1-aarch64.packages
    inflating: pinephone-1.1/sfe-pinephone-1.1-4.3.0.12-devel-20220501/Jolla-4.3.0.12-pinephone-1.1-aarch64.urls
    inflating: pinephone-1.1/sfe-pinephone-1.1-4.3.0.12-devel-20220501/sfe-pinephone-1.1-4.3.0.12-devel-20220501.tar.bz2
    pinephone-1.1/sfe-pinephone-1.1-4.3.0.12-devel-20220501/sfe-pinephone-1.1-4.3.0.12-devel-20220501.tar.bz2
    mount: /home/adm1n/Downloads/root: special device mmcblk0p2 does not exist.
    Copying kernel to boot partition…
    mount: /home/adm1n/Downloads/boot: special device mmcblk0p1 does not exist.
    Boot partition mount: ./boot
    allwinner Image sun50i-a64-pinephone-1.0.dtb sun50i-a64-pinephone-1.1.dtb sun50i-a64-pinephone-1.2.dtb sun50i-a64-pinetab-dev.dtb sun50i-a64-pinetab.dtb
    Are you installing to an SD card? y
    Clear root password? y
    Cleaning up!
    Unmounting mmcblk0
    umount: mmcblk0: not mounted.
    Flashing mmcblk0 OK!
    You may now remove the SD card and insert it in your Pine64 device!
    root@raspberrypi:/home/adm1n/Downloads# exit
    exit

If you want to flash the emmc you can do it 1. from your pc or 2. from an sdcard on the pinephone.
For option 1 you need to have jumpdrive on an sdcard in the PP, see jumpdrive docs on PinePhone Installation Instructions - PINE64
For option 2 you need to run a distro on the sdcard that has wget, parted, unzip etc. - some of which are not on SFOS, so I used danctnix arch linux. Then when you run the script the emmc will be shown as mmcblk2 I think, anyway 32Gb.

Well, I do everything with Jumpdrive, the easy was! I also have danctnix arch linux on my phone. But I don’t know how to use it with flash-it.sh script. Do I have to use terminal to open phone on rasp or directly open terminal on phone?

When I use Jumpdrive, I think the sdb2 is my eMMC? I get a lot of errors:
Error: The location 256MB is outside of the device /home/adm1n/Downloads/sdb2.
umount: sdb2: not mounted.
The file sdb2 does not exist and no size was specified.

Where did I do something wrong? Or could the SD card be damaged?

ok, try with danctnix. Put the flash-it.sh anywhere. Open a terminal and cd to the folder where the script is. Then run sudo bash ./flash-it.sh …that’s all. The emmc will be the 32Gb partition. You can do it by ssh too but it isn’t much typing on the phone terminal.

I’ll give this a try very soon! I’ll let you know how it goes…

Thanks!

isn’t it a problem that I use the phone? I get a lot of error mkdir No space left on device

The thing I don’t understand is that I use the phone and I think I use it ON the eMMC storage, right? Every time I run the script, I think I have to restart my phone to get Sailfish, right? And I still see Arch Linux.

For me it’s confusing how it install Sailfish on a device that I use at that moment. Or is this something I don’t understand? :smile: I also chooses mmcblk2 and nothing seems to happen at that point: Not mounted

Here you can see the structure, but mmcblk2 & mmcblk2p2 not working. All errors: mkdir No space left on device. Where to flash image to?

well, exactly - you have to run danct on an sdcard!!! then you have access to the unmounted emmc.
So either flash arch linux to an sdcard or try from your pc with jumpdrive. If you have Disks on your pc you’ll see the emmc28.9G and the jumpdrive sdcard, whatever that is. It doesn’t matter what’s on the emmc, it gets wiped.

1 Like

oke! Run arch from SD Card, make sense. I’ll give it another try tomorrow…

Thanks for the info! :pray:t3:

oke, playing for hours now and this is what I did:
First I installed Arch Linux on an SD card and I run from it, a lot of things happend but the weirdest thing was I loosed WiFi connection, so I had to use another image.

Now I’m using Manjaro with succes, but whatever drive I choose at question Which SD card do you want to flash I always get errors like “Unable to write to drive” or “Cannot unmount drive”. What could I do now?
dd: error writing ‘/dev/mmcblk2’: No space left on device

Also the two ast questions, I think the first question Are you installing to an SD card? I choose NO and the last question Clear root password what should I choose?

Are you sure you selected thr right partition? AFAIK it’s always mmcblk2. Run lsblk to check first.
Otherwise, there’s radically wrong with the partitions, I’d say wipe the entire emmc, using dd.
Also AFAIK it’s impossible to brick the PP.
Clear root passwd, I’m not sure what it means, I’ve used both and didn’t notice any difference.

sudo dd if=/dev/urandom of=/dev/mmcblk2 bs=8M
is what I did before flashing
image

strange, some permission problem. Try again from pc, then maybe ask in the telegram group sfos on pinephone

This is what happend on PC, with 3 questions

Which SD card do you want to flash?
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 59.2G 0 disk
├─sda1 8:1 1 256M 0 part /boot
└─sda2 8:2 1 58.9G 0 part /
sdb 8:16 1 28.9G 0 disk
sdc 8:32 1 7.3G 0 disk
└─sdc1 8:33 1 49M 0 part /media/adm1n/A993-6C26
raw
Device node (/dev/sdX): sdb
Flashing image to: sdb
WARNING: All data will be erased! You have been warned!
Some commands require root permissions, you might be asked to enter your sudo password.
Creating EXT4 file system…
ls: cannot access ‘sdb*’: No such file or directory <<<<<<<<<<<<<<<<<<<<<<<<<< Why it can’t access?
32+0 records in
32+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 0.164263 s, 204 MB/s
Error: The location 256MB is outside of the device /home/adm1n/Downloads/sdb. <<<<< And what I do wrong here?
Error: The location 256MB is outside of the device /home/adm1n/Downloads/sdb.
Error: The location 6250MB is outside of the device /home/adm1n/Downloads/sdb.
mke2fs 1.46.2 (28-Feb-2021)
The file sdb1 does not exist and no size was specified.
mke2fs 1.46.2 (28-Feb-2021)
The file sdb2 does not exist and no size was specified.
mke2fs 1.46.2 (28-Feb-2021)
The file sdb3 does not exist and no size was specified.

mount: /home/adm1n/Downloads/root: special device sdb2 does not exist. <<<<<< Is this correct? /Downloads folder
Copying kernel to boot partition…
mount: /home/adm1n/Downloads/boot: special device sdb1 does not exist.
Boot partition mount: ./boot
allwinner Image sun50i-a64-pinephone-1.0.dtb sun50i-a64-pinephone-1.1.dtb sun50i-a64-pinephone-1.2.dtb sun50i-a64-pinetab-dev.dtb sun50i-a64-pinetab.dtb

…this is getting beyond my meagre skills but I’d try adding a partition to sdb2 before flashing. If that fails, flash another distro to it and see what happens. There have been problems recently with flash-it, you could try an older one.

Just in case you’re still attempting to flash sfos, there’s a problem with the current image, the mesa update slows the pinephone to an unusable state. It’s possible to revert to earlier versions but long and tedious…if you wait a few days this will be rectified.

first of all thanks for this info! so I have to wait a couple of days…

is there a way to get an earlier version? I thought it was impossible because of the flash-it.sh script that runs…

but maybe waiting is better for me… :grinning_face_with_smiling_eyes:

the mesa packages have been updated so you can try flashing again. On danctnix you have to install a number of things like jq and wget…the script will tell you.
btw, sfos can be a bit crashy, wifi disconnects after a suspend: turn it off, then back on.