PINE64
My installation guide starting from messed up eMMC - 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: My installation guide starting from messed up eMMC (/showthread.php?tid=17727)



My installation guide starting from messed up eMMC - Besouro - 12-19-2022

My installation guide starting from a messed up eMMC with a non responsive screen and ending with Debian MATE (and Xfce). The serial cable part can be skipped I think because briefly disabling the eMMC ought to suffice but I'm writing it down anyway.


Have a serial cable so you can use another computer to interact to the PineBook Pro (PBP).


Remove the PBP bottom cover. Make sure you keep the tiny screws in a safe location because they can easily get lost. Make sure the tiny nearly invisible audio/serial lever is switched to serial. Also switch the eMMC using the eMMC lever. The boot loader sucks and will keep booting from the eMMC regardless whether it's broken or not because of the preset boot order. Leave the PBP open because it's pointless to already close it.



Connect the serial cable by plugging the USB part in the PC and the audio jack in the PBP.



Install "minicom" on the PC and fire it up with the following command:


Code:
minicom -s -D /dev/ttyUSB0 -b 1150000 --color=on



Insert the SD card with the Tow boot installation file so the SPI can be overwritten with something that works.




Start the PBP by pressing the button nearly 2 seconds. (Unlike common devices, my PBP requires a long start button press time.)




If everything goes well, on the PC you follow the instructions to overwrite the SPI so Tow boot is installed. Once installed you stop the PBP by pressing the start button for 5 seconds until it stops. Unplug the serial cable. Then start the PBP again and press escape to verify if Tow boot was properly installed. If everything went well and you pressed ESC several times, you should see the boot device selection screen. Stop the PBP again by pressing the start button for 5 seconds.




Now we need to burn the Debian live installation SD. (Information based on https://forum.pine64.org/showthread.php?tid=16862 and https://forum.pine64.org/showthread.php?tid=17484). I managed to install Bookworm but the PBP was highly unstable and never stayed up long than 15 minutes. Afterwards I was unable to reinstall it. Either way, better to install the more stable Bullseye by downloading the following 2 net installer files:


http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/SD-card-images/firmware.pinebook-pro-rk3399.img.gz


http://http.us.debian.org/debian/dists/bullseye/main/installer-arm64/current/images/netboot/SD-card-images/partition.img.gz



Generate an image file


Code:
zcat firmware-pinebook-pro-rk3399.img.gz partition.img.gz > debian-bullseye-installer.img



Burn it to the SD card but first make sure the correct device name is used. Be very careful as choosing the wrong one can render your complete OS partition inoperable.




Code:
/home/pbp# lsblk
NAME              MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda                8:0    0 110.0G  0 disk 
├─sda1             8:1    0    10M  0 part  /boot
└─sda2             8:4    0 100.0G  0 part  /
sdb                8:0    0 119.2G  0 disk 
└─sdb1             8:1    0    3G  0 part



In this case the current OS is running on / on device sda and that partition we most definitely don't want to overwrite. In this case the partition name we want is sdb. If you're not sure, unplug the USB, run the command, plug it back in and run the command again. The USB should have disappeared and reappeared. So the burning command looks as follows:


Code:
dd if=debian-bullseye-installer.img of=/dev/sdb



Put the fresh microSD card in the PBP. Make sure the network cable is connected, disable the eMMC and start the PBP.


Once in the Tow boot screen re-enable the eMMC with the tiny lever. Now choose SD boot in the boot selection screen and if everything goes well the Debian installer is launched.

It's a text installer without mouse so the arrow keys, the enter and tab are the most important keyboard buttons.




Language => English


Location => {choose your country}


Locale => {Choose one}


Keyboard => {choose your keyboard layout}


Mirror => {You country} > {first in the list I guess}



Choose a root password


Create the user for example pbp


Choose a password for this user


Repeat the password



Partitioning disks


Guided - use entire disk

  • this way the eMMC can be chosen because the installation installer might choose microSD to install to which will fail.
  • Choose MMC/SD card #3 (of 62,5 GB)

All files in one partition


An overview is given. Make sure the / and /boot are located on the eMMC partitions that were automatically created. The other partitions aren't touched. I left the swap space as is.

  • Finish partitioning and write changes to disk
  • Write the changes to disks? -> Yes



Go for a coffee brake because this part will take some time.




I always refuse to participate in the survey.




As desktop environment I select Xfce and MATE. Gnome and KDE are I think too heavy for this feather weight laptop. Also unselect the SSH server which could inadvertently serve as a remote backdoor. Standard system utilities should remain selected.




Once the installation is finished, restart the PBP.


Install some useful stuff


Logon as your user (pbp or whatever). In case you're using MATE, go to console by going to Applications > MATE terminal. Enter the following command to logon as root:



Code:
su -
(enter your password)
apt-get install aptitude
aptitude update



My sound at this point didn't work on Bullseye (even not from a Bookworm upgraded from Bullseye) so to fix this (kudos to https://forum.pine64.org/showthread.php?tid=9536) download the following file.


https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/blob/master/asound.state




Copy the file as root to


/etc/asound.state


Now as root enter the following command


Code:
alsactl -f /etc/asound.state restore



This will display some unrelated error messages but should (hopefully) have fixed the sound.