PINE64
New to Pinebook Pro and lots of questions! - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114)
+--- Thread: New to Pinebook Pro and lots of questions! (/showthread.php?tid=12655)



New to Pinebook Pro and lots of questions! - Anarethos - 12-28-2020

Hi everyone!


I just got my brand new Pinebook Pro a few days ago. I started to play with it and I must say that I like it.


I am mostly a Windows guy alghouth I played a little bit with Linux (I have a Rpi2, a NextCloud instance, etc.) mostly Ubuntu/Debian and CentOS.


I bought the Pinebook Pro for it’s « Open source » nature in design and the fact that there is a lot of different OS for it, etc.


And, that why I am writing now, I am ready to start playing with the different OS avalable.


Before doing that, I started to read the Wiki and a few forums post about the boot process, the differents flashing options, etc. And I am a little lost!


So here am I to ask some clarifications and confirmation of what I understand and a few more questions.




1 – Boot Order / eMMC
If I understand correctly, the SoC boot from eMMC first. Right now, the eMMC has a U-Boot loader on it that make the computer search the SD card for a bootloader and switch to it. If not found, it continue on the eMMC. If the u-boot bootloader on the eMMC become corrupted, the computer won’t boot, even from SD card. In that case we need to disable the eMMC from the switch under the laptop, boot from SD card, re-enable the eMMC and force redection (instruction from Wiki) and reflash it.


So, Am I right with my understanding of the boot process?
Are the instructions in the Wiki to redetect the eMMC works also for Manjaro? The Wiki says it is for Debian.




2 – Restoring a factory image of Manjaro


On first boot, the Pinebook asked me to create my user account, set hte root paassword, and select the langage. How do I restore the Manjora system on it to act the same way? I took a look at the script to install to eMMC from SD but the script seems to ask the question during the restore process. I would like to know how to restore the eMMC so it act as a new system on first boot.


Should I use an old Manjaro image (eMMC installer) or there is a way to use the new script to have it ask the questions only on next reboot?




3 – Creating a full image of the eMMC from Linux


What is the best way to create a image of the eMMC (when booted from SD card) that will includes everything on the eMMC including the current U-BOOT loader?




4 – Creating a full image of the eMMC from Windows


When using the eMMC to USB adapter, underr Windows, what is the best way to backup the whole eMMC including the U-BOOT bootloader?


5 – Restoring the full image of the eMMC from Linux including U-BOOT


What is the best way (command with parameterrs) to restore the eMMC from a previous backup (see previous question) including the U-BOOT bootloader and everything?




6 – Restoring the full image of the eMMC from Windows including U-BOOT


What is the best way to restore eMMC using USB to eMMC from Windows incldding the u-boot bootloader?


7 – Restoring a eMMC that is corrupted / Non working U-BOOT


Is there a way to backup only the U-BOOT part from the eMMC from Linux (or Windows using the adapter) to restore it if it becomes corrupted or a full image reinstall is always required?




8 – What are the mmcblk2boot0 and mmcblk2boot1 device?


LSBLK show me the eMMC device itself with the ROOT and the BOOT partition as mmcblk2. There is also 2 otherrs device, mmcblk2boot0 et mmcblk2boot1. Are there physical partition on the eMMC? Is the U-BOOT bootloder written there? When using DD to mmcblk2 does it write in that section of the chip also or not?




Thanks all! I know I ask alot but your help will be reallly appreciated to put some light on the differents things I read.


Have a nice day!


RE: New to Pinebook Pro and lots of questions! - tophneal - 12-29-2020

(12-28-2020, 04:56 PM)Anarethos Wrote: 1 – Boot Order / eMMC
If I understand correctly, the SoC boot from eMMC first. Right now, the eMMC has a U-Boot loader on it that make the computer search the SD card for a bootloader and switch to it. If not found, it continue on the eMMC. If the u-boot bootloader on the eMMC become corrupted, the computer won’t boot, even from SD card. In that case we need to disable the eMMC from the switch under the laptop, boot from SD card, re-enable the eMMC and force redection (instruction from Wiki) and reflash it.


So, Am I right with my understanding of the boot process?
Are the instructions in the Wiki to redetect the eMMC works also for Manjaro? The Wiki says it is for Debian.

Mostly, yes. Technically the SoC boot order starts SPI>eMMC>SD (mainline uboot also adds USB here)>USB OTG (rkflashtool)

In most cases, no one will need the USB OTG, though. check out https://wiki.pine64.org/index.php?title=RK3399_boot_sequence


(12-28-2020, 04:56 PM)Anarethos Wrote: 2 – Restoring a factory image of Manjaro


On first boot, the Pinebook asked me to create my user account, set hte root paassword, and select the langage. How do I restore the Manjora system on it to act the same way? I took a look at the script to install to eMMC from SD but the script seems to ask the question during the restore process. I would like to know how to restore the eMMC so it act as a new system on first boot.


Should I use an old Manjaro image (eMMC installer) or there is a way to use the new script to have it ask the questions only on next reboot?

The easiest way to restore your eMMC install to default (out of the box) state would be to use the SD-to-eMMC installer images from Manjaro. You could go through and remove all traces of your user account and settings, but it'd be easier/quicker to just rewrite your eMMC.

(12-28-2020, 04:56 PM)Anarethos Wrote: 3 – Creating a full image of the eMMC from Linux

What is the best way to create a image of the eMMC (when booted from SD card) that will includes everything on the eMMC including the current U-BOOT loader?

Use dd, a disk management app, or similar, to create a .img, .img.gz, .img.xz (again, your preference here.) When you write or restore that img file back to a drive, it will include everything on the drive that was backed up, including uboot.

(12-28-2020, 04:56 PM)Anarethos Wrote: 4 – Creating a full image of the eMMC from Windows

When using the eMMC to USB adapter, underr Windows, what is the best way to backup the whole eMMC including the U-BOOT bootloader?

You can use this guide. There's little difference in use between the SD and eMMC in the adapter.
https://thepihut.com/blogs/raspberry-pi-tutorials/17789160-backing-up-and-restoring-your-raspberry-pis-sd-card#:~:text=Using%20Windows&text=Once%20you%20open%20Win32%20Disk,backed%20up%20to%20your%20PC.

(12-28-2020, 04:56 PM)Anarethos Wrote: 5 – Restoring the full image of the eMMC from Linux including U-BOOT

What is the best way (command with parameterrs) to restore the eMMC from a previous backup (see previous question) including the U-BOOT bootloader and everything?

Check out this wiki section: https://wiki.pine64.org/index.php/NOOB#Imaging_microSD_on_Linux

(12-28-2020, 04:56 PM)Anarethos Wrote: 6 – Restoring the full image of the eMMC from Windows including U-BOOT

What is the best way to restore eMMC using USB to eMMC from Windows incldding the u-boot bootloader?

Just use your WinDiskImager/etcher/whatever app of choice.

(12-28-2020, 04:56 PM)Anarethos Wrote: 7 – Restoring a eMMC that is corrupted / Non working U-BOOT

Is there a way to backup only the U-BOOT part from the eMMC from Linux (or Windows using the adapter) to restore it if it becomes corrupted or a full image reinstall is always required?

There's not much point to this, honestly. uboot files are readily available within each OS' repos, and can easily be reflashed at anytime. If uboot becomes corrupted, it's easier to just boot into SD, find the emmc through lsblk, and download/rewrite uboot that way. It's not something you should really find yourself in need of doing often. Unless, you're intending to take on uboot development, i guess...

(12-28-2020, 04:56 PM)Anarethos Wrote: 8 – What are the mmcblk2boot0 and mmcblk2boot1 device?

LSBLK show me the eMMC device itself with the ROOT and the BOOT partition as mmcblk2. There is also 2 otherrs device, mmcblk2boot0 et mmcblk2boot1. Are there physical partition on the eMMC? Is the U-BOOT bootloder written there? When using DD to mmcblk2 does it write in that section of the chip also or not?

i don't know this one, for sure, but i think they do reside there (but do NOT write to the directly with dd or similar programs, uboot is typically written to drive in the following manner: # dd if=/boot/idbloader.img conv=notrunc seek=64 of=/dev/mmcblkX # dd if=/boot/u-boot.itb conv=notrunc seek=16384 of=/dev/mmcblkX)


RE: New to Pinebook Pro and lots of questions! - Anarethos - 12-29-2020

Wow.

thanks you for your answers!

In the mean time I found some thing by myself also. Like to backup the extlinux.conf file when playing with the uboot package in Manjaro. Ended with an unbootable system.

Which made me test the MicroSD boot and reflash using manjaro-arm-flasher script which correclty rewrote the eMMC like the computer was on firt boot (except it is now using the mainline uboot and not the bsp version).