From e2094e190f79c27ec2ee39e75991d4b41465dfc5 Mon Sep 17 00:00:00 2001 From: x1y <23239177+x1y@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:15:28 +0100 Subject: [PATCH 1/5] Syntax highlighting --- config/_default/config.toml | 5 +- .../Software/Multi-distribution_image.adoc | 51 +++-- themes/pinetheme/assets/css/documentation.css | 2 + themes/pinetheme/assets/css/molokai.css | 208 ++++++++++++++++++ themes/pinetheme/assets/css/style.css | 28 ++- themes/pinetheme/assets/css/syntax.css | 95 -------- themes/pinetheme/layouts/partials/head.html | 10 +- 7 files changed, 277 insertions(+), 122 deletions(-) create mode 100644 themes/pinetheme/assets/css/molokai.css delete mode 100644 themes/pinetheme/assets/css/syntax.css diff --git a/config/_default/config.toml b/config/_default/config.toml index feab2b15..a9dfb91b 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -41,7 +41,7 @@ paginate = 9 lineNumbersInTable = true noClasses = true noHl = false - style = 'monokai' + style = 'autumn' tabWidth = 4 [permalinks] @@ -57,6 +57,9 @@ paginate = 9 [params.social] twitter = 'thepine64' + + + [security.exec] allow = ["^asciidoctor$"] diff --git a/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc b/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc index 5b0d7931..f9a8c63d 100644 --- a/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc +++ b/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc @@ -21,6 +21,7 @@ TIP: The multi-boot image _can_ function without rk2aw, but you may need to hold Make sure the phone’s SSH server is up and running on the PinePhone Pro's stock operating system. Then Connect to your phone from your Linux computer using SSH: +[source,shell] ---- ssh USER@PHONEIP mkdir -p ~/rk2aw @@ -37,23 +38,29 @@ Further instructions can be found on the link:https://xff.cz/kernels/bootloaders During processes of partitioning target device or building the image, make sure needed `$VARIABLES` are properly defined: - DEVICE=[…​], where […​] is the device name from the `lsblk` command - DISTROURL is the image downloading URL address of Linux distribution - MENUNAME is the name of graphical boot menu item - PARTNAME is the name of partition/distribution - PARTNUMBER is the number of partition/distribution - PARTSIZE is the GiB capacity of each partition - WORKDIR is the working directory path on your computer +[subs="quotes"] +---- +DEVICE=[…​], where […​] is the device name from the lsblk command +DISTROURL is the image downloading URL address of Linux distribution +MENUNAME is the name of graphical boot menu item +PARTNAME is the name of partition/distribution +PARTNUMBER is the number of partition/distribution +PARTSIZE is the GiB capacity of each partition +WORKDIR is the working directory path on your computer +---- Every time you open a new terminal window, `$VARIABLES` values must be adapted, in example: - DEVICE=sdb - DISTROURL=https://github.com/dreemurrs-embedded/Pine64-Arch/releases/download/20240308/archlinux-pinephone-pro-phosh-20240308.img.xz - MENUNAME=ARCH - PARTNAME=ppp-multi-image-${MENUNAME,,} - PARTNUMBER=2 - PARTSIZE=11GiB - WORKDIR=~/ppp +[source,shell] +---- +DEVICE=sdb +DISTROURL=https://github.com/dreemurrs-embedded/Pine64-Arch/releases/download/20240308/archlinux-pinephone-pro-phosh-20240308.img.xz +MENUNAME=ARCH +PARTNAME=ppp-multi-image-${MENUNAME,,} +PARTNUMBER=2 +PARTSIZE=11GiB +WORKDIR=~/ppp +---- This guide has been tested with following images: @@ -76,6 +83,7 @@ Overwrite the device with zeroes by either overwriting the first sectors with ze Partition the device for the multiple distributions: +[source,shell] ---- sudo sfdisk /dev/$DEVICE --wipe always <> section; if you a Then write the U-Boot image to the device using the following command: +[source,shell] ---- sudo dd if=$WORKDIR/rk2aw/ppp/foss/u-boot-rockchip.bin of=/dev/$DEVICE bs=512 seek=64 status=progress conv=fsync ---- @@ -144,6 +155,7 @@ If you are interested in building this U-Boot image yourself, you will need to c Download and decompress each distribution image on your Linux computer, making sure you use an updated file from relases download link:/documentation/PinePhone_Pro/Software/Releases[relases download link]. +[source,shell] ---- mkdir -p $WORKDIR/distros cd $WORKDIR/distros @@ -154,6 +166,7 @@ mv IMAGE.img $PARTNAME.img Only for Sailfish distribution, use an adatped command to download and decompress the image: +[source,shell] ---- mkdir -p $WORKDIR/distros cd $WORKDIR/distros @@ -166,6 +179,7 @@ sudo tar -xvf sailfish.tar.bz2 -C sailfishfs/ > /dev/null Mount the image for needed distribution, excluding Sailfish image: +[source,shell] ---- cd $WORKDIR/distros sudo losetup -P /dev/loop0 $PARTNAME.img @@ -176,6 +190,7 @@ sudo mount /dev/loop0p2 /mnt/$PARTNAME/root/ Only for Sailfish distribution, you ought to copy the extracted files directly into the device: +[source,shell] ---- #sudo mkfs.ext4 -F /dev/$DEVICE$PARTNUMBER # optional sudo mkdir -p /mnt/$PARTNAME/device @@ -185,6 +200,7 @@ sudo scp -r $WORKDIR/distros/sailfishfs/* /mnt/$PARTNAME/device For all other distributions copy `rootfs` and `boot` content: +[source,shell] ---- sudo dd if=/dev/loop0p2 of=/dev/$DEVICE$PARTNUMBER bs=1M status=progress conv=fsync sudo mount /dev/$DEVICE$PARTNUMBER /mnt/$PARTNAME/device/ @@ -193,6 +209,7 @@ sudo scp -r /mnt/$PARTNAME/boot/* /mnt/$PARTNAME/device/boot Remame `/boot/boot.scr` to keep graphical menu clean: +[source,shell] ---- [ ! -f /mnt/$PARTNAME/device/boot/boot.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.scr /mnt/$PARTNAME/device/boot/boot.scrORIG # rename if exist [ ! -f /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr /mnt/$PARTNAME/device/boot/boot.pinephonepro.scrORIG # rename if exist @@ -200,6 +217,7 @@ Remame `/boot/boot.scr` to keep graphical menu clean: Rename original and write the new `/boot/extlinux/extlinux.conf` file, making sure you remove `#` comment for needed distribution: +[source,shell] ---- sudo mkdir -p /mnt/$PARTNAME/device/boot/extlinux [ ! -f /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf ] || sudo mv /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf /mnt/$PARTNAME/device/boot/extlinux/extlinux.confORIG # rename if exist @@ -241,6 +259,7 @@ EOF Rename original and write the new `/etc/fstab` file, making sure you remove `#` comment for needed distribution: +[source,shell] ---- sudo mv /mnt/$PARTNAME/device/etc/fstab /mnt/$PARTNAME/device/etc/fstabORIG # rename @@ -277,6 +296,7 @@ You can optionally use link:https://wiki.postmarketos.org/wiki/Pmbootstrap[pmboo Start creating 2 GB empty image file, format and mount it. +[source,shell] ---- sudo su dd if=/dev/zero of=postmarketos.img bs=1 count=0 seek=2G status=progress && sync @@ -287,6 +307,7 @@ exit Build the PostmarketOS image via pmbootstrap: +[source,shell] ---- pmbootstrap init pmbootstrap status @@ -299,6 +320,7 @@ pmbootstrap shutdown To unmount and deatch all building images, run: +[source,shell] ---- sudo umount /mnt/$PARTNAME/* sudo rm -r /mnt/$PARTNAME @@ -309,6 +331,7 @@ sudo losetup -D 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 CLI: +[source,shell] ---- sudo e2fsck -f /dev/$DEVICE$PARTNUMBER sudo resize2fs /dev/$DEVICE$PARTNUMBER diff --git a/themes/pinetheme/assets/css/documentation.css b/themes/pinetheme/assets/css/documentation.css index 51d5ce21..bb67dd6e 100644 --- a/themes/pinetheme/assets/css/documentation.css +++ b/themes/pinetheme/assets/css/documentation.css @@ -124,6 +124,7 @@ div#doc-page code { font-family: monospace; display: inline-block; } +/* See style.css div#doc-page pre { padding: 1em; background-color: #f8f9fa; @@ -136,6 +137,7 @@ div#doc-page pre { white-space: -o-pre-wrap; word-wrap: break-word; } +*/ div#doc-page pre code { padding: 0; border: none; diff --git a/themes/pinetheme/assets/css/molokai.css b/themes/pinetheme/assets/css/molokai.css new file mode 100644 index 00000000..8c81d855 --- /dev/null +++ b/themes/pinetheme/assets/css/molokai.css @@ -0,0 +1,208 @@ +.highlight table td { padding: 5px; } +.highlight table pre { margin: 0; } +.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf { + color: #5e5d83; + font-style: italic; +} +.highlight .cm { + color: #5e5d83; + font-style: italic; +} +.highlight .c1 { + color: #5e5d83; + font-style: italic; +} +.highlight .cp { + color: #465457; + font-weight: bold; +} +.highlight .cs { + color: #465457; + font-weight: bold; + font-style: italic; +} +.highlight .err { + color: #f8f8f2; + background-color: #403d3d; +} +.highlight .gi { + color: #a6e22e; +} +.highlight .gd { + color: #f92672; +} +.highlight .ge { + color: #1b1d1e; + font-style: italic; +} +.highlight .gr { + color: #f92672; +} +.highlight .gt { + color: #f92672; +} +.highlight .gh { + color: #403d3d; +} +.highlight .go { + color: #403d3d; +} +.highlight .gp { + color: #66d9ef; +} +.highlight .gs { + font-weight: bold; +} +.highlight .gu { + color: #465457; +} +.highlight .k, .highlight .kv { + color: #66d9ef; + font-weight: bold; +} +.highlight .kc { + color: #66d9ef; + font-weight: bold; +} +.highlight .kd { + color: #66d9ef; + font-weight: bold; +} +.highlight .kp { + color: #66d9ef; + font-weight: bold; +} +.highlight .kr { + color: #66d9ef; + font-weight: bold; +} +.highlight .kt { + color: #66d9ef; + font-weight: bold; +} +.highlight .kn { + color: #f92672; + font-weight: bold; +} +.highlight .ow { + color: #f92672; + font-weight: bold; +} +.highlight .o { + color: #f92672; + font-weight: bold; +} +.highlight .mf { + color: #af87ff; +} +.highlight .mh { + color: #af87ff; +} +.highlight .il { + color: #af87ff; +} +.highlight .mi { + color: #af87ff; +} +.highlight .mo { + color: #af87ff; +} +.highlight .m, .highlight .mb, .highlight .mx { + color: #af87ff; +} +.highlight .se { + color: #af87ff; +} +.highlight .sb { + color: #d7d787; +} +.highlight .sc { + color: #d7d787; +} +.highlight .sd { + color: #d7d787; +} +.highlight .s2 { + color: #d7d787; +} +.highlight .sh { + color: #d7d787; +} +.highlight .si { + color: #d7d787; +} +.highlight .sx { + color: #d7d787; +} +.highlight .sr { + color: #d7d787; +} +.highlight .s1 { + color: #d7d787; +} +.highlight .ss { + color: #d7d787; +} +.highlight .s, .highlight .sa, .highlight .dl { + color: #d7d787; +} +.highlight .na { + color: #a6e22e; +} +.highlight .nc { + color: #a6e22e; + font-weight: bold; +} +.highlight .nd { + color: #a6e22e; + font-weight: bold; +} +.highlight .ne { + color: #a6e22e; + font-weight: bold; +} +.highlight .nf, .highlight .fm { + color: #a6e22e; + font-weight: bold; +} +.highlight .no { + color: #66d9ef; +} +.highlight .bp { + color: #f8f8f2; +} +.highlight .nb { + color: #f8f8f2; +} +.highlight .ni { + color: #f8f8f2; +} +.highlight .nn { + color: #f8f8f2; +} +.highlight .vc { + color: #f8f8f2; +} +.highlight .vg { + color: #f8f8f2; +} +.highlight .vi { + color: #f8f8f2; +} +.highlight .nv, .highlight .vm { + color: #f8f8f2; +} +.highlight .w { + color: #f8f8f2; +} +.highlight .nl { + color: #f8f8f2; + font-weight: bold; +} +.highlight .nt { + color: #f92672; +} +.highlight { + color: #f8f8f2; + background-color: #1b1d1e; +} diff --git a/themes/pinetheme/assets/css/style.css b/themes/pinetheme/assets/css/style.css index f40f6ab9..e6a76e6e 100644 --- a/themes/pinetheme/assets/css/style.css +++ b/themes/pinetheme/assets/css/style.css @@ -1,10 +1,11 @@ * { padding: 0; margin: 0; - font-family: Roboto, sans-serif; } + body { background-color: #fff; + font-family: Roboto, sans-serif; } :root { @@ -298,16 +299,23 @@ div.olist{ margin: 0 48px; } pre { - padding: 1rem; - background-color: #f8f9fa; - border: 1px solid #eaecf0; + padding: 0.3rem; + color: #f8f8f2; + font-family: source code pro, lucida console, monospace; + font-size: 16px; + background-color: #1B1D1E; + /*border: 1px solid #eaecf0;*/ margin-bottom: 1rem; - font-family: monospace; - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ + /*font-family: monospace;*/ + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} +code { + font-weight: 400; + font-family: source code pro, lucida console, monospace; } code, .cl { diff --git a/themes/pinetheme/assets/css/syntax.css b/themes/pinetheme/assets/css/syntax.css deleted file mode 100644 index 629f1820..00000000 --- a/themes/pinetheme/assets/css/syntax.css +++ /dev/null @@ -1,95 +0,0 @@ -/* -Syntax highlighting - -Theme created with: -hugo gen chromastyles --style=autumn > syntax.css - -See https://gohugo.io/content-management/syntax-highlighting/ for further documentation. -*/ - -/* Background */ .bg { background-color: #ffffff; } -/* PreWrapper */ .chroma { background-color: #ffffff; } -/* Other */ .chroma .x { } -/* Error */ .chroma .err { color: #ff0000; background-color: #ffaaaa } -/* CodeLine */ .chroma .cl { } -/* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit } -/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } -/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } -/* LineHighlight */ .chroma .hl { background-color: #ffffcc } -/* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } -/* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } -/* Line */ .chroma .line { display: flex; } -/* Keyword */ .chroma .k { color: #0000aa } -/* KeywordConstant */ .chroma .kc { color: #0000aa } -/* KeywordDeclaration */ .chroma .kd { color: #0000aa } -/* KeywordNamespace */ .chroma .kn { color: #0000aa } -/* KeywordPseudo */ .chroma .kp { color: #0000aa } -/* KeywordReserved */ .chroma .kr { color: #0000aa } -/* KeywordType */ .chroma .kt { color: #00aaaa } -/* Name */ .chroma .n { } -/* NameAttribute */ .chroma .na { color: #1e90ff } -/* NameBuiltin */ .chroma .nb { color: #00aaaa } -/* NameBuiltinPseudo */ .chroma .bp { } -/* NameClass */ .chroma .nc { color: #00aa00; text-decoration: underline } -/* NameConstant */ .chroma .no { color: #aa0000 } -/* NameDecorator */ .chroma .nd { color: #888888 } -/* NameEntity */ .chroma .ni { color: #880000; font-weight: bold } -/* NameException */ .chroma .ne { } -/* NameFunction */ .chroma .nf { color: #00aa00 } -/* NameFunctionMagic */ .chroma .fm { } -/* NameLabel */ .chroma .nl { } -/* NameNamespace */ .chroma .nn { color: #00aaaa; text-decoration: underline } -/* NameOther */ .chroma .nx { } -/* NameProperty */ .chroma .py { } -/* NameTag */ .chroma .nt { color: #1e90ff; font-weight: bold } -/* NameVariable */ .chroma .nv { color: #aa0000 } -/* NameVariableClass */ .chroma .vc { } -/* NameVariableGlobal */ .chroma .vg { } -/* NameVariableInstance */ .chroma .vi { } -/* NameVariableMagic */ .chroma .vm { } -/* Literal */ .chroma .l { } -/* LiteralDate */ .chroma .ld { } -/* LiteralString */ .chroma .s { color: #aa5500 } -/* LiteralStringAffix */ .chroma .sa { color: #aa5500 } -/* LiteralStringBacktick */ .chroma .sb { color: #aa5500 } -/* LiteralStringChar */ .chroma .sc { color: #aa5500 } -/* LiteralStringDelimiter */ .chroma .dl { color: #aa5500 } -/* LiteralStringDoc */ .chroma .sd { color: #aa5500 } -/* LiteralStringDouble */ .chroma .s2 { color: #aa5500 } -/* LiteralStringEscape */ .chroma .se { color: #aa5500 } -/* LiteralStringHeredoc */ .chroma .sh { color: #aa5500 } -/* LiteralStringInterpol */ .chroma .si { color: #aa5500 } -/* LiteralStringOther */ .chroma .sx { color: #aa5500 } -/* LiteralStringRegex */ .chroma .sr { color: #009999 } -/* LiteralStringSingle */ .chroma .s1 { color: #aa5500 } -/* LiteralStringSymbol */ .chroma .ss { color: #0000aa } -/* LiteralNumber */ .chroma .m { color: #009999 } -/* LiteralNumberBin */ .chroma .mb { color: #009999 } -/* LiteralNumberFloat */ .chroma .mf { color: #009999 } -/* LiteralNumberHex */ .chroma .mh { color: #009999 } -/* LiteralNumberInteger */ .chroma .mi { color: #009999 } -/* LiteralNumberIntegerLong */ .chroma .il { color: #009999 } -/* LiteralNumberOct */ .chroma .mo { color: #009999 } -/* Operator */ .chroma .o { } -/* OperatorWord */ .chroma .ow { color: #0000aa } -/* Punctuation */ .chroma .p { } -/* Comment */ .chroma .c { color: #aaaaaa; font-style: italic } -/* CommentHashbang */ .chroma .ch { color: #aaaaaa; font-style: italic } -/* CommentMultiline */ .chroma .cm { color: #aaaaaa; font-style: italic } -/* CommentSingle */ .chroma .c1 { color: #aaaaaa; font-style: italic } -/* CommentSpecial */ .chroma .cs { color: #0000aa; font-style: italic } -/* CommentPreproc */ .chroma .cp { color: #4c8317 } -/* CommentPreprocFile */ .chroma .cpf { color: #4c8317 } -/* Generic */ .chroma .g { } -/* GenericDeleted */ .chroma .gd { color: #aa0000 } -/* GenericEmph */ .chroma .ge { font-style: italic } -/* GenericError */ .chroma .gr { color: #aa0000 } -/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } -/* GenericInserted */ .chroma .gi { color: #00aa00 } -/* GenericOutput */ .chroma .go { color: #888888 } -/* GenericPrompt */ .chroma .gp { color: #555555 } -/* GenericStrong */ .chroma .gs { font-weight: bold } -/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } -/* GenericTraceback */ .chroma .gt { color: #aa0000 } -/* GenericUnderline */ .chroma .gl { text-decoration: underline } -/* TextWhitespace */ .chroma .w { color: #bbbbbb } diff --git a/themes/pinetheme/layouts/partials/head.html b/themes/pinetheme/layouts/partials/head.html index 9eab30bc..d57e8308 100644 --- a/themes/pinetheme/layouts/partials/head.html +++ b/themes/pinetheme/layouts/partials/head.html @@ -6,16 +6,22 @@ + + {{- $style_style := resources.Get "css/style.css" | minify | fingerprint -}} - {{- $style_syntax := resources.Get "css/syntax.css" | minify | fingerprint }} - + {{- $style_print := resources.Get "css/print.css" | minify | fingerprint }} + {{- $style_slider := resources.Get "css/slider.css" | minify | fingerprint }} + {{- $style_docs := resources.Get "css/documentation.css" | minify | fingerprint -}} + + {{- $style_syntax := resources.Get "css/molokai.css" | minify | fingerprint }} + {{ $title := print .Title " - " .Site.Title -}} {{- if .IsHome -}}{{- $title = .Site.Title -}}{{- end -}} From 1659eb4a9231f640224c71e5dd3d41aa24c4ec97 Mon Sep 17 00:00:00 2001 From: x1y <23239177+x1y@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:30:51 +0100 Subject: [PATCH 2/5] Adopted style --- .../Software/Multi-distribution_image.adoc | 224 +++++++++--------- themes/pinetheme/assets/css/darkmode.css | 92 ------- themes/pinetheme/assets/css/molokai.css | 208 ---------------- themes/pinetheme/assets/css/pastie.css | 150 ++++++++++++ themes/pinetheme/assets/css/style.css | 17 +- themes/pinetheme/layouts/partials/head.html | 6 +- 6 files changed, 280 insertions(+), 417 deletions(-) delete mode 100644 themes/pinetheme/assets/css/darkmode.css delete mode 100644 themes/pinetheme/assets/css/molokai.css create mode 100644 themes/pinetheme/assets/css/pastie.css diff --git a/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc b/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc index f9a8c63d..9f24deda 100644 --- a/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc +++ b/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc @@ -17,39 +17,39 @@ This article explains how to install a multiple linux distribution enviroment on Make sure your phone has the link:/documentation/PinePhone_Pro/Software/Bootloaders/#rk2aw[rk2aw pre-loader] installed to SPI flash. PinePhone Pro models ordered after November 2023 are shipped with rk2aw pre-installed. Otherwise, follow the instructions in this section to install it. -TIP: The multi-boot image _can_ function without rk2aw, but you may need to hold down the **RE** button during boot to force the phone to boot from microSD card by disabling the SPI flash memory and the eMMC. +TIP: The multi-boot image _can_ function without rk2aw, but you may need to hold down the _RE_ button during boot to force the phone to boot from microSD card by disabling the SPI flash memory and the eMMC. Make sure the phone’s SSH server is up and running on the PinePhone Pro's stock operating system. Then Connect to your phone from your Linux computer using SSH: -[source,shell] +[source,console] ---- -ssh USER@PHONEIP -mkdir -p ~/rk2aw -cd ~/rk2aw -curl -O https://xff.cz/kernels/bootloaders-2024.04/ppp.tar.gz -tar -xvzf ppp.tar.gz -C ~/rk2aw -cd ~/rk2aw/ppp -sudo ./spinor-flash-initial-setup.sh +$ ssh USER@PHONEIP +$ mkdir -p ~/rk2aw +$ cd ~/rk2aw +$ curl -O https://xff.cz/kernels/bootloaders-2024.04/ppp.tar.gz +$ tar -xvzf ppp.tar.gz -C ~/rk2aw +$ cd ~/rk2aw/ppp +$ sudo ./spinor-flash-initial-setup.sh ---- Further instructions can be found on the link:https://xff.cz/kernels/bootloaders-2024.04/ppp/rk2aw/INSTALL[author's website]. == Setting variables -During processes of partitioning target device or building the image, make sure needed `$VARIABLES` are properly defined: +During processes of partitioning target device or building the image, make sure the needed variables are properly defined: -[subs="quotes"] ----- -DEVICE=[…​], where […​] is the device name from the lsblk command -DISTROURL is the image downloading URL address of Linux distribution -MENUNAME is the name of graphical boot menu item -PARTNAME is the name of partition/distribution -PARTNUMBER is the number of partition/distribution -PARTSIZE is the GiB capacity of each partition -WORKDIR is the working directory path on your computer ----- +[TIP] +==== +_DEVICE_ is the device name from the lsblk command + +_DISTROURL_ is the image downloading URL address of Linux distribution + +_MENUNAME_ is the name of graphical boot menu item + +_PARTNAME_ is the name of partition/distribution + +_PARTNUMBER_ is the number of partition/distribution + +_PARTSIZE_ is the GiB capacity of each partition + +_WORKDIR_ is the working directory path on your computer + +==== -Every time you open a new terminal window, `$VARIABLES` values must be adapted, in example: +Each time you open a new terminal window, the values of the variables must be adapted, for example: [source,shell] ---- @@ -72,7 +72,7 @@ This guide has been tested with following images: == Building -Connect your PinePhone Pro to a Linux computer and press power button on. From the graphical menu select `eMMC over USB` or `SD over USB` to expose the device to your computer. Make sure there are no signatures or partitions left with the command `sudo wipefs /dev/$DEVICE`. To erase all signatures, type `sudo wipefs --all --force /dev/$DEVICE`. +Connect your PinePhone Pro to a Linux computer and press power button on. From the graphical menu select _eMMC over USB_ or _SD over USB_ to expose the device to your computer. Make sure there are no signatures or partitions left with the command `sudo wipefs /dev/$DEVICE`. To erase all signatures, type `sudo wipefs --all --force /dev/$DEVICE`. Overwrite the device with zeroes by either overwriting the first sectors with zeroes (command 1) or the whole device (command 2): @@ -85,24 +85,24 @@ Partition the device for the multiple distributions: [source,shell] ---- -sudo sfdisk /dev/$DEVICE --wipe always <> section; if you already have a copy of it on your computer then you don't have to download it again. Then write the U-Boot image to the device using the following command: -[source,shell] +[source,console] ---- -sudo dd if=$WORKDIR/rk2aw/ppp/foss/u-boot-rockchip.bin of=/dev/$DEVICE bs=512 seek=64 status=progress conv=fsync +$ sudo dd if=$WORKDIR/rk2aw/ppp/foss/u-boot-rockchip.bin of=/dev/$DEVICE bs=512 seek=64 status=progress conv=fsync ---- If you are interested in building this U-Boot image yourself, you will need to copy the `ppp/foss/.config` file from the archive above to the root of your U-Boot source directory. @@ -155,74 +155,79 @@ If you are interested in building this U-Boot image yourself, you will need to c Download and decompress each distribution image on your Linux computer, making sure you use an updated file from relases download link:/documentation/PinePhone_Pro/Software/Releases[relases download link]. -[source,shell] +[source,console] ---- -mkdir -p $WORKDIR/distros -cd $WORKDIR/distros -wget $DISTROURL -xz -v -d -k IMAGE.*.xz -mv IMAGE.img $PARTNAME.img +$ mkdir -p $WORKDIR/distros +$ cd $WORKDIR/distros +$ wget $DISTROURL +$ xz -v -d -k IMAGE.*.xz +$ mv IMAGE.img $PARTNAME.img ---- -Only for Sailfish distribution, use an adatped command to download and decompress the image: +Only for Sailfish distribution, use an adapted command to download and decompress the image: -[source,shell] +[source,console] ---- -mkdir -p $WORKDIR/distros -cd $WORKDIR/distros -wget $DISTROURL -O artifacts.zip -unzip artifacts.zip -mv pinephonepro/*/sfe-pinephonepro*.tar.bz2 sailfish.tar.bz2 -mkdir -p $WORKDIR/distros/sailfishfs -sudo tar -xvf sailfish.tar.bz2 -C sailfishfs/ > /dev/null +$ mkdir -p $WORKDIR/distros +$ cd $WORKDIR/distros +$ wget $DISTROURL -O artifacts.zip +$ unzip artifacts.zip +$ mv pinephonepro/*/sfe-pinephonepro*.tar.bz2 sailfish.tar.bz2 +$ mkdir -p $WORKDIR/distros/sailfishfs +$ tar -xvf sailfish.tar.bz2 -C sailfishfs/ > /dev/null ---- -Mount the image for needed distribution, excluding Sailfish image: +Mount the image for the selected distribution, excluding Sailfish image: -[source,shell] +[source,console] ---- -cd $WORKDIR/distros -sudo losetup -P /dev/loop0 $PARTNAME.img -sudo mkdir -p /mnt/$PARTNAME/boot /mnt/$PARTNAME/root /mnt/$PARTNAME/device -sudo mount /dev/loop0p1 /mnt/$PARTNAME/boot/ -sudo mount /dev/loop0p2 /mnt/$PARTNAME/root/ +$ cd $WORKDIR/distros +$ sudo losetup -P /dev/loop0 $PARTNAME.img +$ sudo mkdir -p /mnt/$PARTNAME/boot /mnt/$PARTNAME/root /mnt/$PARTNAME/device +$ sudo mount /dev/loop0p1 /mnt/$PARTNAME/boot/ +$ sudo mount /dev/loop0p2 /mnt/$PARTNAME/root/ ---- Only for Sailfish distribution, you ought to copy the extracted files directly into the device: -[source,shell] +[source,console] ---- -#sudo mkfs.ext4 -F /dev/$DEVICE$PARTNUMBER # optional -sudo mkdir -p /mnt/$PARTNAME/device -sudo mount /dev/$DEVICE$PARTNUMBER /mnt/$PARTNAME/device -sudo scp -r $WORKDIR/distros/sailfishfs/* /mnt/$PARTNAME/device +$ #sudo mkfs.ext4 -F /dev/$DEVICE$PARTNUMBER # optional +$ sudo mkdir -p /mnt/$PARTNAME/device +$ sudo mount /dev/$DEVICE$PARTNUMBER /mnt/$PARTNAME/device +$ sudo scp -r $WORKDIR/distros/sailfishfs/* /mnt/$PARTNAME/device ---- For all other distributions copy `rootfs` and `boot` content: -[source,shell] +[source,console] ---- -sudo dd if=/dev/loop0p2 of=/dev/$DEVICE$PARTNUMBER bs=1M status=progress conv=fsync -sudo mount /dev/$DEVICE$PARTNUMBER /mnt/$PARTNAME/device/ -sudo scp -r /mnt/$PARTNAME/boot/* /mnt/$PARTNAME/device/boot +$ sudo dd if=/dev/loop0p2 of=/dev/$DEVICE$PARTNUMBER bs=1M status=progress conv=fsync +$ sudo mount /dev/$DEVICE$PARTNUMBER /mnt/$PARTNAME/device/ +$ sudo scp -r /mnt/$PARTNAME/boot/* /mnt/$PARTNAME/device/boot ---- -Remame `/boot/boot.scr` to keep graphical menu clean: +Remame the _/boot/boot.scr_ file to keep the graphical menu clean: -[source,shell] +[source,console] ---- -[ ! -f /mnt/$PARTNAME/device/boot/boot.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.scr /mnt/$PARTNAME/device/boot/boot.scrORIG # rename if exist -[ ! -f /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr /mnt/$PARTNAME/device/boot/boot.pinephonepro.scrORIG # rename if exist +$ [ ! -f /mnt/$PARTNAME/device/boot/boot.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.scr /mnt/$PARTNAME/device/boot/boot.scr.bk # rename if exist +$ [ ! -f /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr ] || sudo mv /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr /mnt/$PARTNAME/device/boot/boot.pinephonepro.scr.bk # rename if exist ---- -Rename original and write the new `/boot/extlinux/extlinux.conf` file, making sure you remove `#` comment for needed distribution: +Rename the original _/boot/extlinux/extlinux.conf_ file -[source,shell] +[source,console] ---- -sudo mkdir -p /mnt/$PARTNAME/device/boot/extlinux -[ ! -f /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf ] || sudo mv /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf /mnt/$PARTNAME/device/boot/extlinux/extlinux.confORIG # rename if exist +$ sudo mkdir -p /mnt/$PARTNAME/device/boot/extlinux +$ [ ! -f /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf ] || sudo mv /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf.bk # rename if exist +---- + +Then write the new _/boot/extlinux/extlinux.conf_ file, making sure you remove `#` comment for the selected distributions: -sudo tee /mnt/$PARTNAME/device/boot/extlinux/extlinux.conf < #uncomment next line for ARCH @@ -290,51 +300,51 @@ sudo tee /mnt/$PARTNAME/device/etc/fstab <