diff --git a/.github/workflows/hugo-build.yml b/.github/workflows/hugo-build.yml new file mode 100644 index 00000000..d6eb2f9d --- /dev/null +++ b/.github/workflows/hugo-build.yml @@ -0,0 +1,37 @@ +name: GitHub Pages + +on: + push: + branches: + - main # Set a branch to deploy + pull_request: + +jobs: + build-site: + runs-on: ubuntu-22.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true # Incase we subrepo stuff in + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Install deps + run: sudo apt-get update && sudo apt-get install -y asciidoctor + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "0.119.0" + extended: true + + - name: Build + run: hugo --minify + + - name: Upload output artifacts + uses: actions/upload-artifact@v4 + with: + name: website-build.zip + path: ./public + if-no-files-found: error diff --git a/content/documentation/PinePhone_Pro/Various/Multi-distribution_image.adoc b/content/documentation/PinePhone_Pro/Various/Multi-distribution_image.adoc index 97f43dfb..b7732695 100644 --- a/content/documentation/PinePhone_Pro/Various/Multi-distribution_image.adoc +++ b/content/documentation/PinePhone_Pro/Various/Multi-distribution_image.adoc @@ -9,190 +9,206 @@ menu: weight: --- -This article explains how to install megi's rk2aw pre-loader, U-Boot to SPI and a multi-distribution image to the microSD card. Further instructions regarding rk2aw can be found on link:https://xff.cz/kernels/bootloaders-2024.04/ppp/rk2aw/INSTALL[megi's website]. Please note that pre-loader and userspace utility to flash it are free, but not open-source. +This article explains how to install a multiple linux distribution enviroment on your PinePhone Pro that is bootable from microSD card. -== Flash rk2Aw pre-loader to SPI +== Pre-requisite: rk2aw on SPI flash -Connect PinePhone Pro to a Linux machine (USB cable or wifi connection is fine). Make sure phone's ssh server is up and running, and find the target IP address. Start a ssh connection from PC and download from the web the pre-loader installer to flash into the phone's SPI. +Make sure your phone has link:/documentation/PinePhone_Pro/Software/Bootloaders/#rk2aw[rk2aw bootloader] on SPI flash. For older PinePhone Pro editions you can install it on your own, using terminal CLI from the device's stock sofware or throught a SSH connection from a Linux machine via USB cable or Wi-Fi. - sudo systemctl enable --now sshd # on phone's terminal window - ip address # on phone's terminal window +Please note that this pre-loader and the userspace utility to flash it are free, but not open-source. rk2aw is licensed under MIT license and Copyright 2023 Ondřej Jirman - mkdir -p ~/ppp # on pc's terminal window from now on - cd ~/ppp - ssh @ +Open a terminal window on you PinePhone Pro and make sure phone’s ssh server is up and running. + + sudo apt install ssh + sudo systemctl enable --now sshd + ip address # phone's ip address + whoami # user name + +Open terminal window on your linux machine + + ssh USER@PHONEIP # start ssh connection + mkdir -p ~/rk2aw + cd ~/rk2aw curl -O https://xff.cz/kernels/bootloaders-2024.04/ppp.tar.gz - tar -xvzf ppp.tar.gz -C ~/ppp - # scp -r ~/ppp @:~/Downloads # as option when direct download is not possible + tar -xvzf ppp.tar.gz -C ~/rk2aw + cd ~/rk2aw/ppp sudo ./spinor-flash-initial-setup.sh -== Build multi-distro on the microSD card +Further instructions can be found on the link:https://xff.cz/kernels/bootloaders-2024.04/ppp/rk2aw/INSTALL[author's website]. -If your microSD card in not empty, first get rid of any left signature. Use GParted GUI to format `cleared` each partition, than remove all partitions. Next open terminal window an wipe the content. +== Build multi-distro microSD card - sudo wipefs /dev/sdb # shows current signatures - sudo wipefs --all --force /dev/sdb # erase current signatures +Insert microSD card into the Linux computer. Make sure there are no signatures or partitions left. Format cleared any partition using GParted GUI. Than open terminal window to wipe any content. + + lsblk # shows the [DEVICE] name + + sudo wipefs /dev/[DEVICE] # shows current signatures + sudo wipefs --all --force /dev/[DEVICE] # erase current signatures Zero-write the microSD card - sudo dd if=/dev/zero of=/dev/sdb status=progress bs=32768 count=1 # quick way erasing - sudo dd if=/dev/zero of=/dev/sdb status=progress bs=32768 count=945728 # 32 GB - sudo dd if=/dev/zero of=/dev/sdb status=progress bs=32768 count=1908880 # 64 GB - sudo dd if=/dev/zero of=/dev/sdb status=progress bs=32768 count=3872000 # 128 GB + sudo dd if=/dev/zero of=/dev/[DEVICE] status=progress bs=32768 count=1 # quick way erasing + sudo dd if=/dev/zero of=/dev/[DEVICE] status=progress bs=32768 count=$(expr $(lsblk -bno SIZE /dev/[DEVICE] | head -1) \/ 32768) # full erase === Partition the microSD card -Note: A minimum capacity of 64 GB for the microSD card is recommended for 5 distributions. - sudo sfdisk /dev/sdb --wipe always <>> Script header accepted. New situation: Disklabel type: gpt - Disk identifier: F71BFBA6-D2C3-4C20-8079-1401B10C724C + Disk identifier: A012E9D0-B4EB-4677-926F-D93AE4C696FA Device Start End Sectors Size Type sdb1 64 32767 32704 16M unknown - sdb2 32768 23101439 23068672 11G Linux fs - sdb3 23101440 46170111 23068672 11G Linux fs - sdb4 46170112 69238783 23068672 11G Linux fs - sdb5 69238784 92307455 23068672 11G Linux fs - sdb6 92307456 115376127 23068672 11G Linux fs - sdb7 115376128 122167295 6791168 3.2G Linux fs + sdb2 32768 33587199 33554432 16G Linux fs + sdb3 33587200 67141631 33554432 16G Linux fs + sdb4 67141632 100696063 33554432 16G Linux fs + sdb5 100696064 134250495 33554432 16G Linux fs + sdb6 134250496 167804927 33554432 16G Linux fs + sdb7 167804928 247805951 80001024 38.1G Linux fs The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. -=== Build Arch Linux partition +=== Install U-Boot to the microSD card -Download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. + cd ~/rk2aw + sudo dd if=ppp/foss/u-boot-rockchip.bin of=/dev/[DEVICE] bs=512 seek=64 + sudo sync - cd ~/ppp/distros - wget https://github.com/dreemurrs-embedded/Pine64-Arch/releases/download/20230925/archlinux-pinephone-pro-phosh-20230925.img.xz - xz -v -d -k archlinux-pinephone-pro-phosh-20230925.img.xz - mv archlinux-pinephone-pro-phosh-20230925.img archlinux.img - sudo losetup -P /dev/loop2 archlinux.img - sudo mkdir /mnt/archlinux /mnt/archlinux/boot /mnt/archlinux/root /mnt/archlinuxsd - sudo mount /dev/loop2p1 /mnt/archlinux/boot/ - sudo mount /dev/loop2p2 /mnt/archlinux/root/ - - sudo dd if=/dev/loop2p2 of=/dev/sdb2 bs=1M status=progress conv=fsync - sudo mount /dev/sdb2 /mnt/archlinuxsd/ - sudo scp -r /mnt/archlinux/boot/* /mnt/archlinuxsd/boot - sudo mv /mnt/archlinuxsd/boot/boot.scr /mnt/archlinuxsd/boot/boot.scrORIG - sudo mkdir /mnt/archlinuxsd/boot/extlinux - sudo chmod a=rwx /mnt/archlinuxsd/boot/extlinux - sudo chmod a=rwx /mnt/archlinuxsd/etc/fstab - - sudo tee /mnt/archlinuxsd/boot/extlinux/extlinux.conf < - partlabel=ALARM / ext4 rw,relatime 0 1 - EOF +=== Building partition for each linux distribution + +Download, decompress and mount the distribution image on your linux machine. Copy root filesystem and boot to needed partition. Replace/create `/boot/extlinux/extlinux.conf` and `/etc/fstab` files. Make sure you use an updated image from link:/documentation/PinePhone_Pro/Software/Releases[relases download link] for each distribution. This guide has been tested with following images: + +* https://github.com/dreemurrs-embedded/Pine64-Arch/releases/download/20230925/archlinux-pinephone-pro-phosh-20230925.img.xz +* https://github.com/manjaro-pinephone/phosh/releases/download/beta37/Manjaro-ARM-phosh-pinephonepro-beta37.img.xz +* https://images.mobian.org/pinephonepro/weekly/mobian-pinephonepro-phosh-20240121.img.xz +* https://images.postmarketos.org/bpo/v23.12/pine64-pinephonepro/phosh/20240221-0448/20240221-0448-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img.xz +* (https://ci.ubports.com/job/focal-hybris-rootfs-arm64/job/master/lastSuccessfulBuild/artifact/ubuntu-touch-pinephone-pro-img-arm64.raw.xz) Note: this distribution currently doesn't work on the multi-distro image -=== Build Manjaro partition +Replace the VALUES according the updated distribution and real file name: -Download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. + DISTROURL=IMAGE_URL_ADDRESS + PARTNAME=ARCH + PARTNUMBER=2 + mkdir -p ~/ppp/distros cd ~/ppp/distros - wget https://github.com/manjaro-pinephone/phosh/releases/download/beta37/Manjaro-ARM-phosh-pinephonepro-beta37.img.xz - xz -v -d -k Manjaro-ARM-phosh-pinephonepro-beta37.img.xz - mv Manjaro-ARM-phosh-pinephonepro-beta37.img manjaro.img - sudo losetup -P /dev/loop3 manjaro.img - sudo mkdir /mnt/manjaro /mnt/manjaro/boot /mnt/manjaro/root /mnt/manjarosd - sudo mount /dev/loop3p1 /mnt/manjaro/boot/ - sudo mount /dev/loop3p2 /mnt/manjaro/root/ - - sudo dd if=/dev/loop3p2 of=/dev/sdb3 bs=1M status=progress conv=fsync - sudo mount /dev/sdb3 /mnt/manjarosd/ - sudo scp -r /mnt/manjaro/boot/* /mnt/manjarosd/boot - sudo mv /mnt/manjarosd/boot/boot.scr /mnt/manjarosd/boot/boot.scrORIG - sudo mkdir /mnt/manjarosd/boot/extlinux - sudo chmod a=rwx /mnt/manjarosd/boot/extlinux - sudo chmod a=rwx /mnt/manjarosd/etc/fstab - - sudo tee /mnt/manjarosd/boot/extlinux/extlinux.conf < - partlabel=MANJARO / ext4 defaults 0 1 + sudo tee /mnt/$PARTNAME/sd/etc/fstab < + #uncomment for ARCH + #PARTLABEL=$PARTNAME / ext4 rw,relatime 0 1 + # + #uncomment for MANJARO + #PARTLABEL=MANJARO / ext4 defaults 0 1 + # + #uncomment for MOBIAN + #PARTLABEL=$PARTNAME / ext4 defaults,x-systemd.growfs 0 1 + # + #uncomment for PMOS + #PARTLABEL=$PARTNAME / ext4 defaults 0 0 + # + #uncomment for UT + #PARTLABEL=$PARTNAME / ext4 defaults 0 1 + #PARTLABEL=$PARTNAME /boot ext4 defaults 0 2 + #PARTLABEL=$PARTNAME /userdata ext4 defaults 0 2 EOF -=== Build Mobian partition +=== Unmount, detach all building images and resize partition. -Download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. + sudo umount /mnt/$PARTNAME/* + sudo rm -r /mnt/$PARTNAME + sudo losetup -D - cd ~/ppp/distros - wget https://images.mobian.org/pinephonepro/weekly/mobian-pinephonepro-phosh-20240121.img.xz - xz -v -d -k mobian-pinephonepro-phosh-20240121.img.xz - mv mobian-pinephonepro-phosh-20240121.img mobian.img - sudo losetup -P /dev/loop4 mobian.img - sudo mkdir /mnt/mobian /mnt/mobian/boot /mnt/mobian/root /mnt/mobiansd - sudo mount /dev/loop4p1 /mnt/mobian/boot/ - sudo mount /dev/loop4p2 /mnt/mobian/root/ - - sudo dd if=/dev/loop4p2 of=/dev/sdb4 bs=1M status=progress conv=fsync - sudo mount /dev/sdb4 /mnt/mobiansd/ - sudo scp -r /mnt/mobian/boot/* /mnt/mobiansd/boot - sudo chmod a=rwx /mnt/mobiansd/boot/extlinux - sudo chmod a=rwx /mnt/mobiansd/etc/fstab - - sudo nano /mnt/mobiansd/boot/extlinux/extlinux.conf # modify content as following - ## /boot/extlinux/extlinux.conf file - menu label MOBIAN - linux /boot/vmlinuz-6.6-rockchip - initrd /boot/initrd.img-6.6-rockchip - fdtdir /boot/dtb-6.6-rockchip/ - append root=partlabel=MOBIAN console=ttyS2,115200 console=tty0 loglevel=7 rw rootwait - #append root=UUID=b282b619-c9b7-4c15-9c3d-2005b35d5999 consoleblank=0 loglevel=7 ro quiet splash plymouth.ignore-serial> - - sudo tee /mnt/mobiansd/etc/fstab < - partlabel=MOBIAN / ext4 defaults,x-systemd.growfs 0 1 - EOF +On the first boot, if it doesn't happen automatically, you can manually resize each image to fill the entire partition using GParted GUI software or using the following commands: + + sudo e2fsck -f /dev/[DEVICE]$PARTNUMBER + sudo resize2fs /dev/[DEVICE]$PARTNUMBER -To save and close terminal window digit: `Ctrl+X` to save, `Yes`, `Enter`. +Repeat the building process for each needed distribution. -=== Build PostmarketOS partition +=== Build PostmarketOS image -Download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. -Optionally you can use bootstrap to generate distro image. Make sure you install pmbootstrap before building image. +You can optionally use bootstrap to generate distro image, instead of direct download. Make sure you install pmbootstrap before building image. git clone --depth=1 https://git.sr.ht/~postmarketos/pmbootstrap mkdir -p ~/.local/bin @@ -219,115 +235,35 @@ Build PostmarketOS image via pmbootstrap pmbootstrap pull pmbootstrap install --sdcard=/dev/loop0 pmbootstrap shutdown # remember to deactivare chroot after the image creation - -In you don't build PMOS image on your own, download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. - - cd ~/ppp/distros - # wget https://images.postmarketos.org/bpo/v23.12/pine64-pinephonepro/phosh/20240214-0437/20240214-0437-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img.xz - # xz -v -d -k 20240214-0437-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img.xz - # mv 20240214-0437-postmarketOS-v23.12-phosh-22.3-pine64-pinephonepro.img postmarketos.img - sudo losetup -P /dev/loop5 postmarketos.img - sudo mkdir /mnt/postmarketos /mnt/postmarketos/boot /mnt/postmarketos/root /mnt/postmarketossd - sudo mount /dev/loop5p1 /mnt/postmarketos/boot/ - sudo mount /dev/loop5p2 /mnt/postmarketos/root/ - - sudo dd if=/dev/loop5p2 of=/dev/sdb5 bs=1M status=progress conv=fsync - sudo mount /dev/sdb5 /mnt/postmarketossd/ - sudo scp -r /mnt/postmarketos/boot/* /mnt/postmarketossd/boot - sudo mkdir /mnt/postmarketossd/boot/extlinux - sudo chmod a=rwx /mnt/postmarketossd/boot/extlinux - sudo chmod a=rwx /mnt/postmarketossd/etc/fstab - - sudo tee /mnt/postmarketossd/boot/extlinux/extlinux.conf < - partlabel=PMOS / ext4 defaults 0 0 - EOF - -=== Build Ubuntu Touch partition - -Download, decompress and mount the image. Copy rootfs and bootfs to the partition. Edit/replace some files. - - cd ~/ppp/distros - wget https://ci.ubports.com/job/focal-hybris-rootfs-arm64/job/master/lastSuccessfulBuild/artifact/ubuntu-touch-pinephone-pro-img-arm64.raw.xz - xz -v -d -k ubuntu-touch-pinephone-pro-img-arm64.raw.xz - mv ubuntu-touch-pinephone-pro-img-arm64.raw ubuntu.raw - sudo losetup -P /dev/loop6 ubuntu.raw - sudo mkdir /mnt/ubuntutouch /mnt/ubuntutouch/boot /mnt/ubuntutouch/root /mnt/ubuntutouchsd - sudo mount /dev/loop6p2 /mnt/ubuntutouch/boot/ - sudo mount /dev/loop6p3 /mnt/ubuntutouch/root/ - - sudo dd if=/dev/loop6p3 of=/dev/sdb6 bs=1M status=progress conv=fsync - sudo mount /dev/sdb6 /mnt/ubuntutouchsd/ - sudo scp -r /mnt/ubuntutouch/boot/* /mnt/ubuntutouchsd/boot - sudo chmod a=rwx /mnt/ubuntutouchsd/etc/fstab - sudo chmod a=rwx /mnt/ubuntutouchsd/boot/extlinux - - sudo nano /mnt/ubuntutouchsd/boot/extlinux/extlinux.conf # modify content as following - ## /boot/extlinux/extlinux.conf file - menu label UT - linux /boot/vmlinuz-6.5.0-okpine-ut - initrd /boot/initrd.img-6.5.0-okpine-ut - fdtdir /boot/dtb-6.5.0-okpine-ut/rockchip/ - #append root=UUID=9f3cfee6-e7ed-4d4a-bfeb-e54ef502cec7 console=ttyS2,115200n8 consoleblank=0 loglevel=7 ro splash plymouth.ignore-serial-consoles vt.global_cursor_default=0 - append root=partlabel=UT console=ttyS2,115200 console=tty0 loglevel=7 rw rootwait - - sudo tee /mnt/ubuntutouchsd/etc/fstab < - partlabel=UT / ext4 defaults 0 1 - EOF - -=== Unmount and detach all images - - sudo losetup -D - sudo umount /mnt/*/* - sudo umount /mnt/* - sudo umount /media/*/* - sudo umount /media/* - sudo rm -r /mnt/*/* - sudo rm -r /mnt/* - sudo sudo rm -r /media/*/* - sudo sudo rm -r /media/* == Switching on device -According to megi's https://xnux.eu/rk2aw info, to operate your PinePhone Pro use power button and led feedback. +According to megi's linkhttps://xnux.eu/rk2aw[rk2aw info], use the power button and LED feedback to operate the PinePhone Pro: -* Plug in USB power cord. Led blinks: 0.5s on, 0.5s off. Battery is slowly charging. -* Press shortly power button. Graphical menu appears, than just select the image to boot from. -* Press longer power button, led starts to blinks rapidly. Release power button, led blinks N times each second according to the selected image. +* Plug in USB power cord. The LED blinks: 0.5s on, 0.5s off. Battery is slowly charging. +* Press shortly power button. The graphical menu appears, than just select the image to boot from. +* Press longer power button, LED starts to blinks rapidly. Release the power button, LED blinks N times each second depending on the selected image. -In example: +For example: -* Led blinks once each second and 1st image is selected; -* Led blinks twice each second and 2nd image is seleted; -* Led blinks triple each second and 3rd image is selected. +* LED blinks once each second and 1st image is selected; +* LED blinks twice each second and 2nd image is seleted; +* LED blinks triple each second and 3rd image is selected. * Press shortly to move to next image. * Press longer to boot the selected image. * In case you hold the power button too long, the device is forced to power off. == Troubleshooting -On first boot, if it doesn't happen automatically, you can manually resize each image to fill his entire partition using GParted GUI software or running `sudo resize2fs` into terminal window. +To find the exact LABEL, UUID, PARTLABEL, PARTUUID names open a terminal window. + + ssh USER@PHONEIP + sudo blkid Any time a distribution update rebuilds the initramfs it is necessary to delete `/boot/boot.scr` again to keep the rk2aw menu clean. -In case you want to reinstall only one distribution, the easy way is to delete and recreate requested partition using GParted GUI. +In case you want to reinstall only one distribution, the easy way is to delete and recreate the selected partition using the GParted GUI. -If device doesn't start, connect a compatible link:https://pine64.com/product/pinebook-pinephone-pinetab-serial-console[serial cable] to headphone jack, switch off microswitch 6 and start a serial console to further investigate. +If the device doesn't start, connect a compatible link:https://pine64.com/product/pinebook-pinephone-pinetab-serial-console[serial cable] to the headphone jack and a computer, switch off microswitch 6 and start a serial console to investigate further. Type `ls /dev/ttyUSB*` to find out the corresponding usb device from a Linux machine and then connect to it using for example _minicom_: - ls /dev/ttyUSB* # check usb device from linux machine - minicom -b 1500000 -D /dev/ttyUSB0 + minicom -b 1500000 -D /dev/ttyUSB[x]