diff --git a/README.md b/README.md index c4caf3e6..86f3eea3 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,14 @@ cd website-main ### Get Hugo -Install *Hugo* as explained under https://gohugo.io/installation/. - -* Arch Linux: `sudo pacman -S hugo` -* Debian: `sudo apt install hugo` -* Fedora: `sudo dnf install hugo` -* Gentoo: `sudo emerge --ask www-apps/hugo` (SASS/SCSS support not required) -* NixOS: `nix-shell -p hugo` (to temporarily test it in a nix-shell) -* openSUSE: `sudo zypper install hugo` -* Solus: `sudo eopkg install hugo` +Install *Hugo* as explained under https://gohugo.io/installation/, as well as [Asciidoctor](https://asciidoctor.org/) and [Rouge](https://github.com/rouge-ruby/rouge): + +* Arch Linux: `sudo pacman -S hugo asciidoctor ruby-rouge` +* Debian: `sudo apt install hugo asciidoctor ruby-rouge` +* Fedora: `sudo dnf install hugo rubygem-asciidoctor rubygem-rouge` +* Gentoo: `sudo emerge --ask www-apps/hugo dev-ruby/asciidoctor dev-ruby/rouge` (SASS/SCSS support not required) +* NixOS: `nix-shell -p hugo asciidoctor rubyPackages.rouge` (to temporarily test it in a nix-shell) +* openSUSE: `sudo zypper install hugo rubygem-asciidoctor rubygem-rouge` * Windows: See [here](https://gohugo.io/installation/windows/) * MacOS: See [here](https://gohugo.io/installation/macos/) * BSD: See [here](https://gohugo.io/installation/bsd/) @@ -50,7 +49,6 @@ The html pages can be generated to the *public* folder using: hugo ``` - ## Site structure ``` 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..9f24deda 100644 --- a/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc +++ b/content/documentation/PinePhone_Pro/Software/Multi-distribution_image.adoc @@ -17,43 +17,50 @@ 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,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: - 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: - 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: @@ -65,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): @@ -76,24 +83,26 @@ Overwrite the device with zeroes by either overwriting the first sectors with ze Partition the device for the multiple distributions: ----- -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,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. @@ -144,67 +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,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,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,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,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,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,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,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 @@ -271,47 +300,51 @@ sudo tee /mnt/$PARTNAME/device/etc/fstab < 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..df5e49c2 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/pastie.css" | minify | fingerprint }} + {{ $title := print .Title " - " .Site.Title -}} {{- if .IsHome -}}{{- $title = .Site.Title -}}{{- end -}} diff --git a/themes/pinetheme/layouts/partials/header.html b/themes/pinetheme/layouts/partials/header.html index addfa818..1a5f60d0 100644 --- a/themes/pinetheme/layouts/partials/header.html +++ b/themes/pinetheme/layouts/partials/header.html @@ -29,28 +29,26 @@ {{- $currentPage := . -}} {{- range .Site.Menus.additional -}} - {{- end -}}