Showing posts with label EMMC. Show all posts
Showing posts with label EMMC. Show all posts

Friday, February 7, 2025

Pinephone Pro (with Tow-Boot) - Installing a new OS on the eMMC

In my previous Pinephone Pro, I was describing how I was coming up to speed on the different storage mechanisms on the Pinephone Pro: SPI vs eMMC vs microSD.  

Contextually, we are talking about block storage, and there is a well known command that one can run to see block storage on a Linux device: lsblk.  Running this command on your Pinephone Pro - in a Terminal - can help you understand "what is what and where". And it's important to understand this.

One concern I had, was installing a new OS to the eMMC, and blowing away the boot process. I had installed Tow-Boot on the phone, but had to make sure it was in its own spot (it was, SPI) - away from where a new OS was going to go - especially if you plan to clean or format the eMMC before installing a new OS. So my previous post discusses how I had to figure all of this out, and learned that Tow-Boot was installed on the SPI - making it safe to install a new OS.

Here was my process for installing this new OS, with comments:

  1. Download the image
    • Figure out what display manager you want. 
      • Phosh? Plasma? Gnome? Xfce? There is not shortage of choices.
      • I went with Plasma - because it worked well when I ran the OS on the microSD
    •  I went with 20250206
      • Check the md5 hash - which is always wise to verify the integrity of the image.
      • Unpack/Uncompress the "xz" file.
        • NOTE: In Mac Pro, xz did not work, and neither did tar xvfz. Using the GUI and clicking the file in File Manager invoked the Archive Utility to unpack the file. But in Linux, xz or tar should work fine.
  2. Make sure your Pinephone Pro is sufficiently charged. 
    • At least 50%, preferably 75%, and optimally fully charged at 90% or greater. 
    • I should note that with Manjaro, the power charge percentage was not always accurate.
  3. Power off your Pinephone Pro.
  4. Connect the Pinephone Pro using USB-C connector, into a USB-C connector of your laptop.
  5. Power the phone up, and after first vibration, hit the Volume-Up button
    • You are looking for a blue light on your Pinephone Pro, signifying that you are in USB Mode.
  6. Make sure the laptop/computer sees the Pinephone Pro as a device.
    • In my case, on a Mac Pro, I used File Manager.
    • Examine the /dev devices and this is IMPORTANT! Because if you install your OS onto your laptop partition, you have a big big problem.
      • I quickly noticed that /dev/disk4 had the BOOT_MJRO volume name on it, ensuring that disk4 was the disk I wanted to install the new OS to.
  7. Unmount the disk
    • because you cannot format or do an image copy on a disk that's already mounted. 
    • on a Mac Pro, diskutil was used for this: sudo diskutil unmountDisk /dev/disk4 
  8. Clean the partition
    • sudo dd if=/dev/zero of=/dev/disk4 bs=1M count=100
  9. Copy the image to the eMMC 
    • Tools like Balena Etcher can be used for this.
    • The "dd" tool is a Linux tried-true way to do this and this is what I chose:
      • sudo dd if=20250206-0046-postmarketOS-v24.12-plasma-mobile-5-pine64-pinephonepro.img of=/dev/dis
        k4 bs=1M status=progress
  10. Watch the progress, and once finished, eject the phone
    • sudo diskutil eject /dev/disk4
  11. Power the Pinephone Pro down
  12. Unplug the USB-C connector that is connected between Pinephone Pro and the laptop/computer.
  13. Power the Pinephone Pro back up.
    • You will see a terminal show up on the screen - don't mess with it - just wait.
    • Eventually the Plasma Display Manager will (or should) light up.
    • The OS will take some minutes to initialize, and to be responsive to user input.
  14. Log into the phone

Wednesday, January 29, 2025

Pinephone Pro - Booting an OS off SPI vs eMMC

I finally got a chance to pick the Pinephone Pro back up and play with it some more.

I was able to charge up the battery, and boot the phone and verify that Tow-Boot was installed on it properly. That was my first step. I believe I verified this by holding the volume down button, and waiting for the light to turn aqua (note, it may have been volume up, I should check this for correctness).

Next, I rebooted the phone,  and it booted into the Manjaro OS which is installed on the eMMC drive of the phone.

Next, I put the PostMarketOS into the microSD card slot, and booted the phone. Apparently Tow-Boot uses the following boot order:

  1. SPI - more on this in a bit, I had to learn what this is
  2. microSD Card
  3. eMMC (which has Manjaro on it)

I didn't get a Boot Menu - but maybe a key sequence (volume up?) would give me such a menu. It booted straight into the PostMarket OS. 

I proceeded to experiment with PostMarket OS, and did a complete update of all of the packages on it.

Next, I wondered how I could "replace" the default Manjaro with the PostMarket OS, which was newer than Manjaro, such that it would boot PostMarket OS on the eMMC, allowing me recycle the microSD card for perhaps another OS distribution I could take a look at later. 

It turns out, that there is a PostMarketOS "on-disk installer".  It is called pmbootstrap.

THIS is where I had to learn about SPI. Because there is a warning about over-writing your Tow-Boot installation, if Tow-Boot was not installed on SPI. 

so...what is SPI? (more search required)

SPI Flash is a type of non-volatile memory that uses the Serial Peripheral Interface (SPI) protocol for communication. It is commonly used in embedded systems for data storage and transfer, allowing devices to retain information even when powered off. 

Apparently it is a newer (or improved, perhaps) concept, found on phones with System-On-A-Chip (SOC) architectures. 

so...how do you know if you even have SPI?

Answer: I had to figure out which version of Pinephone Pro I have. 

I finally learned that there is a Developer Edition of the Pinephone Pro, and there is a Explorer Edition. The Explorer Edition supposedly has the SPI. 

But what confused me, is that it said the phone supporting SPI had the Rockchip RK3399S SoC. And when I went into the terminal on the phone and ran "lscpu", it said I had an ARM Cortex A-53 chip. 

so...now I am thoroughly confused.

Well, I finally learned, that the Rockchip RK3399S SoC combines four Cortex-A53 cores with two Cortex-A72 cores.

hmmm, I did not see the 72 in the lscpu command I ran - but, it does look like I have the SPI.

but, how do I know that Tow-Boot was installed on the SPI, versus the eMMC? Because if I have this wrong, I can't boot an OS as there would be no bootloader partition.

I think the SPI is mmcblk1 device. And /boot is on mmcblk1p1 partition of that device.

The Manjaro (previous installation) is definitely on the eMMC, which is on mmcblk2 device, which has two partitions on it, one of them being /root.

SLAs using Zabbix in a VMware Environment

 Zabbix 7 introduced some better support for SLAs. It also had better support for VMware. VMware, of course now owned by BroadSoft, has prio...