Difference between revisions of "PinePhone Pro/Create a multi-distribution image using rk2aw"

From PINE64
Jump to navigation Jump to search
Line 49: Line 49:
# ''Copy files for Arch Linux ARM''
# ''Copy files for Arch Linux ARM''
## <code>sudo dd if=/dev/loop2p2 of=/dev/sdb2 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part2''
## <code>sudo dd if=/dev/loop2p2 of=/dev/sdb2 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part2''
## <code>sudo scp -r /media/xxx/52CA-6165/* /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot</code> ''# copy bootfs to to part4/boot''
## <code>sudo scp -r /media/xxx/52CA-6165/* /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot</code> ''# copy bootfs to to part2/boot''
## <code>sudo mv /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot/boot.scr /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot/boot.scrORIG</code> ''# hide auto-menu item''
## <code>sudo mv /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot/boot.scr /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/boot/boot.scrORIG</code> ''# hide auto-menu item''
## <code>sudo nano /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/etc/fstab</code> ''# add PARTLABEL=ALARM and delete UUID=xxx from second line''
## <code>sudo nano /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441<del>1</del>/etc/fstab</code> ''# add PARTLABEL=ALARM and delete UUID=xxx from second line''
Line 64: Line 64:
# ''Copy files for ManJaro''
# ''Copy files for ManJaro''
## <code>sudo dd if=/dev/loop0p2 of=/dev/sdb3 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part3''
## <code>sudo dd if=/dev/loop0p2 of=/dev/sdb3 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part3''
## <code>sudo scp -r /media/xxx/BOOT_MNJRO/* /media/xxx/ROOT_MNJRO1/boot</code> ''# copy bootfs to to part2/boot''
## <code>sudo scp -r /media/xxx/BOOT_MNJRO/* /media/xxx/ROOT_MNJRO1/boot</code> ''# copy bootfs to to part3/boot''
## <code>sudo nano /media/xxx/ROOT_MNJRO1/etc/fstab</code> ''# change UUID=xxx to PARTLABEL=MANJARO''
## <code>sudo nano /media/xxx/ROOT_MNJRO1/etc/fstab</code> ''# change UUID=xxx to PARTLABEL=MANJARO''
## <code>sudo mv /media/xxx/ROOT_MNJRO1/boot/boot.scr /media/xxx/ROOT_MNJRO1/boot/boot.scrORIG</code> ''# hide auto-menu item''
## <code>sudo mv /media/xxx/ROOT_MNJRO1/boot/boot.scr /media/xxx/ROOT_MNJRO1/boot/boot.scrORIG</code> ''# hide auto-menu item''
Line 79: Line 79:
# ''Copy files for MObian''
# ''Copy files for MObian''
## <code>sudo dd if=/dev/loop1p2 of=/dev/sdb4 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part4''
## <code>sudo dd if=/dev/loop1p2 of=/dev/sdb4 bs=1M status=progress conv=fsync</code> ''# copy rootfs to sd part4''
## <code>sudo scp -r /media/xxx/boot/* /media/xxx/rootfs1/boot</code> ''# copy bootfs to to part3/boot''
## <code>sudo scp -r /media/xxx/boot/* /media/xxx/rootfs1/boot</code> ''# copy bootfs to to part4/boot''
## <code>sudo nano /media/xxx/rootfs1/etc/fstab</code> ''# replace UUID=xxx with PARTLABEL=MOBIAN and delete UUID=xxx from second line.''
## <code>sudo nano /media/xxx/rootfs1/etc/fstab</code> ''# replace UUID=xxx with PARTLABEL=MOBIAN and delete UUID=xxx from second line.''
## <code>sudo nano /media/xxx/rootfs1/boot/extlinux/extlinux.conf</code> ''# edit path from /bootfs to /part3/boot''
## <code>sudo nano /media/xxx/rootfs1/boot/extlinux/extlinux.conf</code> ''# edit path from /bootfs to /part4/boot''
   >linux '''/boot'''/vmlinuz-6.1-rockchip
   >linux '''/boot'''/vmlinuz-6.1-rockchip
   >initrd '''/boot'''/initrd.img-6.1-rockchip
   >initrd '''/boot'''/initrd.img-6.1-rockchip
   >fdtdir '''/boot'''/dtb-6.1-rockchip/
   >fdtdir '''/boot'''/dtb-6.1-rockchip/
  APPEND root=PARTLABEL=MOBIAN console=ttyS2,115200 console=tty0 loglevel=4 rw rootwait fbcon=rotate:0 pinephone_keyboard.disable_input

Revision as of 19:50, 7 August 2023

Flash Rk2Aw BootLoader to SPI & Multidistro SDcard

References: https://xff.cz/kernels/rk2aw/rk2aw-rk3399-pinephone-pro/INSTALL and https://xnux.eu/rk2aw/. Thanks Megi at https://xnux.eu/log/

Requirements: SSH connection from linux machine to PinePhonePro, internet connection.

Preloader and userspace utility to flash it are non-free.


Download and Run Rk2Aw SPI Flasher

  1. Connect PinePhonePro to linux machine and start a ssh connection
  2. ssh <user>@<phoneip> # set a connection
  3. cd ~/Downloads # enter to directory
  4. curl -O https://xff.cz/kernels/bootloaders/ppp.tar.gz # download installer
  5. tar -xvzf ppp.tar.gz -C ~/Downloads # extract
  6. # scp -r ~/Downloads/ppp <user>@<phoneip>:~/Downloads # copy to phone, non needed
  7. sudo ./spinor-flash-initial-setup.sh # flash SPI

Flash MultiDistro SD Card

  1. Get distro compressend images and decompress them. (i.e. Manjaro.phosh.beta34, Mobian.6.1, ArchLinux)
  2. Mount distro images both partitions "/boot", "/root" for each distro
  3. lsblk # find /loop, /sd references. Use blkid to see the UUID for the partition
    ├─loop0p1 /media/xxx/BOOT_MNJRO
    └─loop0p2 /media/xxx/ROOT_MNJRO
    ├─loop1p1 /media/xxx/boot
    └─loop1p2 /media/xxx/rootfs
    ├─loop2p1 /media/xxx/52CA-6165
    └─loop2p2 /media/xxx/3d99072c-9fd6-4316-8526-9192e192c441
    └─sdb disk (after each dd command you'll see the partition id name to adjust into scripts.)
  4. sudo dd if=/dev/zero of=/dev/sdb count=945728 bs=32768 status=progress # quick erase sd card. i.e. # 32GB SDcard (30989615104bytes/32768dim=945728volte)
  5. or sudo dd if=/dev/zero of=/dev/sdb count=1 bs=32768 status=progress # slow erase sd card. i.e. # 32GB SDcard (30989615104bytes/32768dim=1volta) )
  6. Partition sd card (min 6432GB)
sudo sfdisk /dev/sdb <<EOF
label: gpt
first-lba: 64
table-length: 8
start=64, size=32704, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="loader", attrs=RequiredPartition
size=10G, name="ALARM", attrs="RequiredPartition,LegacyBIOSBootable"
size=10G, name="MANJARO", attrs="RequiredPartition,LegacyBIOSBootable"
size=+, name="MOBIAN", attrs="RequiredPartition,LegacyBIOSBootable"
EOF
  1. lsblk # list partitions on sd and mounted distro images
    1. Device Start End Sectors Size Type
      /dev/sdb1 64 32767 32704 16M unknown
      /dev/sdb2 32768 16809983 16777216 8G Linux filesystem
      /dev/sdb3 16809984 33587199 16777216 8G Linux filesystem
      /dev/sdb4 33587200 60524543 26937344 12.8G Linux filesystem
  2. Copy files for Arch Linux ARM
    1. sudo dd if=/dev/loop2p2 of=/dev/sdb2 bs=1M status=progress conv=fsync # copy rootfs to sd part2
    2. sudo scp -r /media/xxx/52CA-6165/* /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/boot # copy bootfs to to part2/boot
    3. sudo mv /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/boot/boot.scr /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/boot/boot.scrORIG # hide auto-menu item
    4. sudo nano /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/etc/fstab # add PARTLABEL=ALARM and delete UUID=xxx from second line
    5. sudo mkdir /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/boot/extlinux # add directory
    6. sudo nano /media/xxx/3d99072c-9fd6-4316-8526-9192e192c4411/boot/extlinux/extlinux.conf # add file
 #/boot/extlinux/extlinux.conf
 MENU TITLE Pinephone Pro Boot Menu
 LABEL l0
 MENU LABEL ALarm
 FDT /boot/dtbs/rockchip/rk3399-pinephone-pro.dtb
 KERNEL /boot/Image
 INITRD /boot/initramfs-linux.img
 APPEND root=PARTLABEL=ALARM console=ttyS2,115200 console=tty0 loglevel=4 rw rootwait fbcon=rotate:0 pinephone_keyboard.disable_input
  1. Copy files for ManJaro
    1. sudo dd if=/dev/loop0p2 of=/dev/sdb3 bs=1M status=progress conv=fsync # copy rootfs to sd part3
    2. sudo scp -r /media/xxx/BOOT_MNJRO/* /media/xxx/ROOT_MNJRO1/boot # copy bootfs to to part3/boot
    3. sudo nano /media/xxx/ROOT_MNJRO1/etc/fstab # change UUID=xxx to PARTLABEL=MANJARO
    4. sudo mv /media/xxx/ROOT_MNJRO1/boot/boot.scr /media/xxx/ROOT_MNJRO1/boot/boot.scrORIG # hide auto-menu item
    5. sudo mkdir /media/xxx/ROOT_MNJRO1/boot/extlinux # add directory
    6. sudo nano /media/xxx/ROOT_MNJRO1/boot/extlinux/extlinux.conf #add file
 #/boot/extlinux/extlinux.conf
 MENU TITLE Pinephone Pro Boot Menu
 LABEL l0
 MENU LABEL ManJaro
 FDT /boot/dtbs/rockchip/rk3399-pinephone-pro.dtb
 KERNEL /boot/Image
 INITRD /boot/initramfs-linux.img
 APPEND root=PARTLABEL=MANJARO console=ttyS2,115200 console=tty0 loglevel=4 rw rootwait fbcon=rotate:0 pinephone_keyboard.disable_input
  1. Copy files for MObian
    1. sudo dd if=/dev/loop1p2 of=/dev/sdb4 bs=1M status=progress conv=fsync # copy rootfs to sd part4
    2. sudo scp -r /media/xxx/boot/* /media/xxx/rootfs1/boot # copy bootfs to to part4/boot
    3. sudo nano /media/xxx/rootfs1/etc/fstab # replace UUID=xxx with PARTLABEL=MOBIAN and delete UUID=xxx from second line.
    4. sudo nano /media/xxx/rootfs1/boot/extlinux/extlinux.conf # edit path from /bootfs to /part4/boot
 >linux /boot/vmlinuz-6.1-rockchip
 >initrd /boot/initrd.img-6.1-rockchip
 >fdtdir /boot/dtb-6.1-rockchip/
 APPEND root=PARTLABEL=MOBIAN console=ttyS2,115200 console=tty0 loglevel=4 rw rootwait fbcon=rotate:0 pinephone_keyboard.disable_input