<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aarondabomb</id>
	<title>PINE64 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aarondabomb"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Aarondabomb"/>
	<updated>2026-04-17T13:45:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=21132</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=21132"/>
		<updated>2023-11-12T19:45:35Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Kernel/driver TODOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Kernel/driver TODOs ==&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
== Artifacting ==&lt;br /&gt;
&lt;br /&gt;
There is some artifacting with the current driver that has been difficult to diagnose and resolve. The github issue tracking this is here: https://github.com/PNDeb/pinenote-debian-image/issues/47&lt;br /&gt;
&lt;br /&gt;
Some members of the community have been considering hiring an e-ink professional to consult on this issue. The thought is to hire someone with expertise in developing drivers for e-ink displays to provide advice and pointers, not to do the actual work (because that's expensive).&lt;br /&gt;
&lt;br /&gt;
== Userspace TODOs ==&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the PineNote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Themes ===&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
==== GNOME ====&lt;br /&gt;
Untested: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
&lt;br /&gt;
==== GTK ====&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== GNOME Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
=== Sway Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Documentation TODOs ==&lt;br /&gt;
&lt;br /&gt;
* Pin Mesa Packages so they don't update when we upgrade other packages&lt;br /&gt;
** Add the information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
* Control the backlight&lt;br /&gt;
* Building alacritty correctly&lt;br /&gt;
* Force a screen refresh?&lt;br /&gt;
** See conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;br /&gt;
&lt;br /&gt;
=== Status table draft ===&lt;br /&gt;
&lt;br /&gt;
This table is a draft for the wiki development page:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (Android from factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (Linux)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched U-Boot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works, audio stutters&lt;br /&gt;
| [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth Switching the driver] provides stable connections for keyboards, but audio still stutters. Trying to fix this [https://wiki.pine64.org/wiki/PineNote_Development/Software_Tweaks#Preliminary_fix_for_stuttering_bluetooth_audio here].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineNote]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Software_Tweaks&amp;diff=15701</id>
		<title>PineNote Development/Software Tweaks</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Software_Tweaks&amp;diff=15701"/>
		<updated>2023-01-18T18:51:57Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Fixing Bluetooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware (`/lib/firmware/brmc/`). Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Preliminary fix for stuttering bluetooth audio ===&lt;br /&gt;
Following a fix used for the Quartz Model A (which uses the same SoC as the Pinenote), we can modify the device tree prior to building the kernel to try to mitigate poor Bluetooth audio streaming. (reference: see https://lore.kernel.org/linux-arm-kernel/20220926055435.31284-1-leo@nabam.net/T/)&lt;br /&gt;
&lt;br /&gt;
'''Steps:'''&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;code&amp;gt;arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi&amp;lt;/code&amp;gt;&lt;br /&gt;
* Go to line 939, &amp;quot;bluetooth&amp;quot;, under the &amp;quot;uart1&amp;quot; section&lt;br /&gt;
* Edit the two lines that read &amp;quot;device-wake-gpios&amp;quot; and &amp;quot;host-wake-gpios&amp;quot;; you want them to read &amp;quot;device-wakeup-gpios&amp;quot; and &amp;quot;host-wakeup-gpios&amp;quot; respectively&lt;br /&gt;
* Add the following line to the end of the bluetooth section (under the vddio-supply line in my .dtsi): &amp;quot;max-speed = &amp;lt;3000000&amp;gt;;&amp;quot; &lt;br /&gt;
* Count your zeros, don't forget your punctuation..&lt;br /&gt;
&lt;br /&gt;
'''Caveats:'''&lt;br /&gt;
&lt;br /&gt;
This will improve BT audio quality at least when using the AAC codec. In my experience, the quality is more than acceptable, but there are still issues apparent: occasional isolated stutters even on AAC; prohibitively frequent stutters on SBC-XQ remain. Fully resolving BT audio issues might require further changes similar to the one described above, or may alternatively be a matter of audio software settings (e. g., process priority, audio server buffer settings). Investigation ongoing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineNote]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15131</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15131"/>
		<updated>2022-12-10T14:55:02Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Trying to fix bluetooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works, audio stutters&lt;br /&gt;
| [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth Switching the driver] provides stable connections for keyboards, but audio still stutters. Trying to fix this [https://wiki.pine64.org/wiki/PineNote_Development/TODOs#Trying_to_fix_bluetooth here].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the Pinenote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;br /&gt;
&lt;br /&gt;
= Trying to fix bluetooth =&lt;br /&gt;
I tried to add latency [https://askubuntu.com/questions/475987/a2dp-on-pulseaudio-terrible-choppy-skipping-audio as described here], but to no avail. I noticed the best performance with SBC codec, but still not usable.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15116</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15116"/>
		<updated>2022-12-08T01:18:19Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works, audio stutters&lt;br /&gt;
| [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth Switching the driver] provides stable connections for keyboards, but audio still stutters. Trying to fix this [https://wiki.pine64.org/wiki/PineNote_Development/TODOs#Trying_to_fix_bluetooth here].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the Pinenote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;br /&gt;
&lt;br /&gt;
= Trying to fix bluetooth =&lt;br /&gt;
I tried to add latency [as described here https://askubuntu.com/questions/475987/a2dp-on-pulseaudio-terrible-choppy-skipping-audio], but to no avail. I noticed the best performance with SBC codec, but still not usable.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15115</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15115"/>
		<updated>2022-12-08T01:17:32Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works, audio stutters&lt;br /&gt;
| [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth Switching the driver] provides stable connections for keyboards, but audio still stutters. Trying to fix this here.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the Pinenote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;br /&gt;
&lt;br /&gt;
= Trying to fix bluetooth =&lt;br /&gt;
I tried to add latency [as described here https://askubuntu.com/questions/475987/a2dp-on-pulseaudio-terrible-choppy-skipping-audio], but to no avail. I noticed the best performance with SBC codec, but still not usable.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15114</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=15114"/>
		<updated>2022-12-08T01:14:10Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works, audio stutters&lt;br /&gt;
| [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth Switching the driver] provides stable connections for keyboards, but audio still stutters. Trying to fix this here.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the Pinenote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=File:Download_mode.jpeg&amp;diff=15113</id>
		<title>File:Download mode.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=File:Download_mode.jpeg&amp;diff=15113"/>
		<updated>2022-12-07T20:00:56Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: pen placement to get into download mode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
pen placement to get into download mode&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14943</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14943"/>
		<updated>2022-12-04T20:53:23Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Fixing Bluetooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ./mw_pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware (`/lib/firmware/brmc/`). Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14942</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14942"/>
		<updated>2022-12-04T20:52:43Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Fixing Bluetooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ./mw_pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware (&amp;lt;pre&amp;gt;/lib/firmware/brmc/&amp;lt;/pre&amp;gt;). Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=14626</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=14626"/>
		<updated>2022-11-05T17:44:36Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Steps to patch uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script. We'll use the script to pull the uboot environment out of the stock uboot partition. We'll then apply the patch, recreate the image, add a configuration file, and flash the new image to the PineNote.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write your uboot partition to an img file: &amp;lt;code&amp;gt;dd if=/dev/mmcblk0p1 of=~/uboot.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Extract the environment: &amp;lt;code&amp;gt; ./pinenote-uboot-envtool.py extract uboot.img uboot.env&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Poke around the files (or skip this if you don't like to learn...):&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;uboot.env&amp;lt;/code&amp;gt; -- see, it's just text at this point!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;boot-menu.patch&amp;lt;/code&amp;gt; to get a feel for how that works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The boot-menu.patch makes assumptions about where your linux partition lives. Specifically, it will look at partition 0x11 (which is 17 in decimal). Change this in boot-menu.patch to reflect where your linux boot partition lives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Apply boot-menu.patch: &amp;lt;code&amp;gt;patch uboot.env boot-menu.patch&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This doesn't work for me for some reason:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ patch uboot.env boot-menu.patch                                                             &lt;br /&gt;
patching file env.original&lt;br /&gt;
Hunk #3 FAILED at 24.&lt;br /&gt;
patch unexpectedly ends in middle of line&lt;br /&gt;
patch: **** unexpected end of file in patch at line 27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I couldn't figure out what it's complaining about here, so I ended up applying the patch manually. It's pretty straight-forward.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Rewrite the new environment to the image: &amp;lt;code&amp;gt;./pinenote-uboot-envtool.py insert uboot.img uboot.env uboot-patched.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write the image to the boot partition from the pinenote: &amp;lt;code&amp;gt;dd if=~/uboot-patched.img of=/dev/mmcblk0p1&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point, restarting your system will boot into Android -- this is because the patched uboot we've just created looks for &amp;lt;code&amp;gt;/boot/which_os.txt&amp;lt;/code&amp;gt; to determine whether to boot android or linux, and since it can't find this file (we haven't made it yet), the bootloader defaults to android. Create that file on the same boot partition you specified in the boot-menu.patch file, placing an &amp;lt;code&amp;gt;l&amp;lt;/code&amp;gt; in the file for linux.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Reboot into linux and go &amp;quot;wow&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources and further reading ==&lt;br /&gt;
# [https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html U-boot with rockchip docs]&lt;br /&gt;
# [https://stackoverflow.com/questions/31244862/what-is-the-use-of-spl-secondary-program-loader Helpful stack overflow to learn a bit about the boot process/terminology]&lt;br /&gt;
# [https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$bVBxdD3E01da7w4LRm45-mwbw_jPk6CrJTQWGMG3B2I?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de This conversation in matrix between pgwipeout, vveapon, and pinenewb about flashing uboot.]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=14625</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=14625"/>
		<updated>2022-11-05T17:19:47Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Steps to patch uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script. We'll use the script to pull the uboot environment out of the stock uboot partition. We'll then apply the patch, recreate the image, add a configuration file, and flash the new image to the PineNote.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write your uboot partition to an img file: &amp;lt;code&amp;gt;dd if=/dev/mmcblk0p1 of=~/uboot.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Extract the environment: &amp;lt;code&amp;gt; ./pinenote-uboot-envtool.py extract uboot.img uboot.env&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Poke around the files (or skip this if you don't like to learn...):&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;uboot.env&amp;lt;/code&amp;gt; -- see, it's just text at this point!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;boot-menu.patch&amp;lt;/code&amp;gt; to get a feel for how that works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The boot-menu.patch makes assumptions about where your linux partition lives. Specifically, it will look at partition 0x11 (which is 17 in decimal). Change this in boot-menu.patch to reflect where your linux boot partition lives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Apply boot-menu.patch: &amp;lt;code&amp;gt;patch uboot.env boot-menu.patch&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This doesn't work for me for some reason:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ patch uboot.env boot-menu.patch                                                             &lt;br /&gt;
patching file env.original&lt;br /&gt;
Hunk #3 FAILED at 24.&lt;br /&gt;
patch unexpectedly ends in middle of line&lt;br /&gt;
patch: **** unexpected end of file in patch at line 27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I couldn't figure out what it's complaining about here, so I ended up applying the patch manually. It's pretty straight-forward.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Rewrite the new environment to the image: &amp;lt;code&amp;gt;./pinenote-uboot-envtool.py insert uboot.img uboot.env uboot-patched.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write the image to the boot partition: &amp;lt;code&amp;gt;dd if=~/uboot-patched.img of=/dev/mmcblk0p1&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point, restarting your system will boot into Android -- this is because the patched uboot we've just created looks for &amp;lt;code&amp;gt;/boot/which_os.txt&amp;lt;/code&amp;gt; to determine whether to boot android or linux, and since it can't find this file (we haven't made it yet), the bootloader defaults to android. Create that file on the same boot partition you specified in the boot-menu.patch file, placing an &amp;lt;code&amp;gt;l&amp;lt;/code&amp;gt; in the file for linux.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Reboot into linux and go &amp;quot;wow&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources and further reading ==&lt;br /&gt;
# [https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html U-boot with rockchip docs]&lt;br /&gt;
# [https://stackoverflow.com/questions/31244862/what-is-the-use-of-spl-secondary-program-loader Helpful stack overflow to learn a bit about the boot process/terminology]&lt;br /&gt;
# [https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$bVBxdD3E01da7w4LRm45-mwbw_jPk6CrJTQWGMG3B2I?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de This conversation in matrix between pgwipeout, vveapon, and pinenewb about flashing uboot.]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14614</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14614"/>
		<updated>2022-11-02T17:57:01Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* High-level developer new to embedded linux? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new and down to try a new installation process, the easiest way to get linux is likely to [https://wiki.pine64.org/wiki/PineNote_Development/Installing_Debian install Debian] -- NOTE THAT THIS INSTALLATION PROCESS IS VERY NEW. While many people have been using the kernel that will be installed safely at this point, the instructions for installing Debian via rootfs are very new. Take backups!&lt;br /&gt;
&lt;br /&gt;
The more stable recommended approach is described below:&lt;br /&gt;
&lt;br /&gt;
Start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]]. To boot Linux by default instead of Android, see [[PineNote Development/Booting Linux]]. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] of a user running Manjaro and some apps on their PineNote on 9/10/2022.&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
== High-level developer new to embedded linux? ==&lt;br /&gt;
Here are some resources I have found helpful in learning to develop on embedded linux devices:&lt;br /&gt;
* Great youtube series introducing you to the kernel and lower-level components of Linux: https://www.youtube.com/watch?v=WiZ05pnHZqM&lt;br /&gt;
* https://embetronicx.com/&lt;br /&gt;
* https://bootlin.com/training/&lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14611</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14611"/>
		<updated>2022-11-02T02:07:05Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Userspace TODOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Some folks have reported poor BT performance, but [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth switching the driver may help.]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
The TODOs in this space are organized around what functionality they enable. A table of the important functions that a user may want in the Pinenote and a status are listed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Approaches (apps)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Level of support (subjective)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Supports&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Does not yet support&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;3&amp;quot; | Reading Documents&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/koreader/koreader Koreader]&amp;lt;/code&amp;gt;&lt;br /&gt;
! style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Great&lt;br /&gt;
| Fully featured ebook reader; Supports many filetypes;&lt;br /&gt;
| Handwritten notes&lt;br /&gt;
| Large user base on many devices; codebase has a somewhat of a reputation for being messy&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;[https://github.com/xournalpp/xournalpp Xournalpp]&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Good&lt;br /&gt;
| Reading/writing PDFs and other files; &lt;br /&gt;
| No definition support (long-press for definition)&lt;br /&gt;
| Billed more as a note-taking app than a document reading app&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14606</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14606"/>
		<updated>2022-11-01T05:37:11Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable plainrowheaders&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Functionality&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;min-width: 260px;&amp;quot;  | Component&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (factory)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width: 120px;&amp;quot; | Status (updated)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
! | Bootloader&lt;br /&gt;
| &amp;lt;code&amp;gt;Bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Android only&lt;br /&gt;
| style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP for Linux&lt;br /&gt;
| Booting into linux requires a patched uboot. [https://wiki.pine64.org/wiki/PineNote_Development/Booting_Linux Instructions here.]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;4&amp;quot; | Operating System&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Stability&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Users have successfully booted Arch, Manjaro, and Debian. Debian has most support right now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Suspend&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| [https://gitlab.com/hrdl/pinenote-shared/-/blob/main/patches/linux/0001-Rudimentary-attempt-to-keep-PMIC-usable-after-suspen.patch This kernel patch] adds suspend support. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Updates&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| GPU libs (mesa) and mutter rely on patched packages. These should not be updated via the package manager at the moment, make sure to exclude them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Code&amp;gt;Networking&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; rowspan=&amp;quot;5&amp;quot;| Components&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;E-Paper Display&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightyellow; text-align:center;&amp;quot; | WIP&lt;br /&gt;
| Mostly functional. There is some ghosting and work remains, but the device and screen are usable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Touch&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Bluetooth&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Some folks have reported poor BT performance, but [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Fixing_Bluetooth switching the driver may help.]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightBlue; text-align:center;&amp;quot; | Unsure&lt;br /&gt;
| Light sensors? Rotational sensors?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Buttons&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightGreen; text-align:center;&amp;quot; | Works&lt;br /&gt;
| Power button works.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Accessory compatibility, spare parts&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Spare parts&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:lightcoral; text-align:center;&amp;quot; | Not available yet&lt;br /&gt;
| Spare parts currently not available yet in the store.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! | Software notes&lt;br /&gt;
&lt;br /&gt;
| &amp;lt;code&amp;gt;Firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;background:LightYellow; text-align:center;&amp;quot; | GPU Rendering Possible&lt;br /&gt;
| Requires patched mesa and &amp;lt;pre&amp;gt;MOZ_ENABLE_WAYLAND=1&amp;lt;/pre&amp;gt;. [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Firefox See here.]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs =&lt;br /&gt;
These exist, but they haven't been written down yet.&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14604</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14604"/>
		<updated>2022-11-01T05:36:09Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: Aarondabomb moved page PineNote Development/TODOs old to PineNote Development/TODOs over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs=&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14602</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=14602"/>
		<updated>2022-11-01T05:35:34Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: Aarondabomb moved page PineNote Development/TODOs to PineNote Development/TODOs old: updating&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Under construction}}&lt;br /&gt;
&lt;br /&gt;
[[PineNote|Back to PineNote main page]]&lt;br /&gt;
&lt;br /&gt;
TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Kernel/driver TODOs=&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14590</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14590"/>
		<updated>2022-11-01T04:45:58Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* More Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new and down to try a new installation process, the easiest way to get linux is likely to [https://wiki.pine64.org/wiki/PineNote_Development/Installing_Debian install Debian] -- NOTE THAT THIS INSTALLATION PROCESS IS VERY NEW. While many people have been using the kernel that will be installed safely at this point, the instructions for installing Debian via rootfs are very new. Take backups!&lt;br /&gt;
&lt;br /&gt;
The more stable recommended approach is described below:&lt;br /&gt;
&lt;br /&gt;
Start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]]. To boot Linux by default instead of Android, see [[PineNote Development/Booting Linux]]. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] of a user running Manjaro and some apps on their PineNote on 9/10/2022.&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
== High-level developer new to embedded linux? ==&lt;br /&gt;
Here are some resources I have found helpful in learning to develop on embedded linux devices:&lt;br /&gt;
* https://embetronicx.com/&lt;br /&gt;
* https://bootlin.com/training/&lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14552</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=14552"/>
		<updated>2022-10-23T19:06:31Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new and down to try a new installation process, the easiest way to get linux is likely to [https://wiki.pine64.org/wiki/PineNote_Development/Installing_Debian install Debian] -- NOTE THAT THIS INSTALLATION PROCESS IS VERY NEW. While many people have been using the kernel that will be installed safely at this point, the instructions for installing Debian via rootfs are very new. Take backups!&lt;br /&gt;
&lt;br /&gt;
The more stable recommended approach is described below:&lt;br /&gt;
&lt;br /&gt;
Start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]]. To boot Linux by default instead of Android, see [[PineNote Development/Booting Linux]]. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] of a user running Manjaro and some apps on their PineNote on 9/10/2022.&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14420</id>
		<title>User:Aarondabomb/PineNote Development/Building Kernel new</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14420"/>
		<updated>2022-10-10T16:02:24Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
To get your PN running this smoothly, we'll need to build our own kernel. There are two major kernel efforts:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
And then there is a third effort adding to smaeul's efforts by incorporating various community patches and several new features:&lt;br /&gt;
&lt;br /&gt;
# maximilian: https://github.com/m-weigand/linux&lt;br /&gt;
&lt;br /&gt;
Most of the kernel work has been in creating a DRM driver for the eink display. You can learn more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
These changes are all experimental and may damage your panel. However, there have been no confirmed instances of damage from this work and only a few mysterious hardware issues that may be entirely unrelated.&lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
This guide will help you build the latest kernel and move it to your PineNote, but it does not cover installing an operating system. You should either already have a linux distro in place, or you should be following Dorian's guide to get Arch installed and  use this guide to replace the steps described in [https://github.com/DorianRudolph/pinenotes#compile-the-kernel Compiling the Kernel]. &lt;br /&gt;
&lt;br /&gt;
Some steps from his guide (especially the commands to build the kernel) were borrowed from Dorian's guide. Thanks to Dorian for his work.&lt;br /&gt;
&lt;br /&gt;
TODO: rewrite this guide in the wiki.&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
Compiling a kernel is not very complicated compared to some of the other steps required to put an operating system on the PineNote. You'll be fine :) If you are intimidated, that's okay! I'd still encourage you to try -- you will learn a lot. Just be patient and back up any data you're worried you might lose. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's repository: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/linux.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; If this is your first Kernel, download the arm toolchain. Which version you want depends on your host machine (the machine which will do the compiling). The target machine is the PineNote, which is a &amp;lt;pre&amp;gt;AArch64 GNU/Linux target (aarch64-none-linux-gnu)&amp;lt;/pre&amp;gt; target.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel:&lt;br /&gt;
  &amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt; Set the necessary environment variables:&lt;br /&gt;
    &amp;lt;pre&amp;gt;&lt;br /&gt;
    export CROSS_COMPILE=&amp;quot;&amp;lt;PATH_TO_TOOLCHAIN&amp;gt;/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-&amp;quot;&lt;br /&gt;
    export ARCH=arm64&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt; Build the kernel:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make clean&lt;br /&gt;
make pinenote_defconfig&lt;br /&gt;
make -j $(nproc) all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware. Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14418</id>
		<title>User:Aarondabomb/PineNote Development/Building Kernel new</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14418"/>
		<updated>2022-10-10T15:51:43Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two major kernel efforts:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
And then there is a third effort adding to smaeul's efforts by incorporating various community patches and several new features:&lt;br /&gt;
&lt;br /&gt;
# maximilian: https://github.com/m-weigand/linux&lt;br /&gt;
&lt;br /&gt;
Of course, most of the work in the kernel has been in creating a DRM driver for the eink display. You can learn more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
These changes are all experimental and may damage your panel. However, there have been no confirmed instances of damage from this work and only a few mysterious hardware issues that may be entirely unrelated.&lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
TODO: rewrite this guide in the wiki.&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's repository: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/linux.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; If this is your first Kernel, download the arm toolchain. Which version you want depends on your host machine (the machine which will do the compiling). The target machine is the PineNote, which is a &amp;lt;pre&amp;gt;AArch64 GNU/Linux target (aarch64-none-linux-gnu)&amp;lt;/pre&amp;gt; target.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel:&lt;br /&gt;
  &amp;lt;ol&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt; Set the necessary environment variables:&lt;br /&gt;
    &amp;lt;pre&amp;gt;&lt;br /&gt;
    export CROSS_COMPILE=&amp;quot;&amp;lt;PATH_TO_TOOLCHAIN&amp;gt;/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-&amp;quot;&lt;br /&gt;
    export ARCH=arm64&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware. Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14417</id>
		<title>User:Aarondabomb/PineNote Development/Building Kernel new</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=User:Aarondabomb/PineNote_Development/Building_Kernel_new&amp;diff=14417"/>
		<updated>2022-10-10T15:33:38Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: Created page with &amp;quot;= Building the Kernel =  After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two major kern...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two major kernel efforts:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
And then there is a third effort adding to smaeul's efforts by incorporating various community patches and several new features:&lt;br /&gt;
&lt;br /&gt;
# maximilian: https://github.com/m-weigand/linux&lt;br /&gt;
&lt;br /&gt;
Of course, most of the work in the kernel has been in creating a DRM driver for the eink display. You can learn more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
These changes are all experimental and may damage your panel. However, there have been no confirmed instances of damage from this work and only a few mysterious hardware issues that may be entirely unrelated.&lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
TODO: rewrite this guide in the wiki.&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's repository: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/linux.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ./mw_pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous firmware. Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine64,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14155</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14155"/>
		<updated>2022-09-21T16:28:29Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Fixing Bluetooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous friver. Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;br /&gt;
&lt;br /&gt;
=== Autoconnect to your Bluetooth devices ===&lt;br /&gt;
This [https://github.com/jrouleau/bluetooth-autoconnect bluetooth-autoconnect project] may help.&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14154</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=14154"/>
		<updated>2022-09-21T15:57:20Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Next Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;br /&gt;
&lt;br /&gt;
== Fixing Bluetooth ==&lt;br /&gt;
Some users have noticed instability with their wireless driver. Upgrading the driver to the version provided by LibreELEC may help! To do this, download the BCM4345C0.hcd, brcmfmac43455-sdio.bin, and brcmfmac43455-sdio.txt from the [https://github.com/LibreELEC/brcmfmac_sdio-firmware/tree/master libreELEC repositories] and place them in the same location as your previous friver. Then rename brcmfmac43455-sdio.{txt,bin} as `brcmfmac43455-sdio.pine,pinenote-v1.2.{txt,bin}`. If this doesn't help, ask about it in the matrix chat!&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=14153</id>
		<title>PineNote Development/Apps</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=14153"/>
		<updated>2022-09-21T15:48:23Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= App support on PineNote =&lt;br /&gt;
&lt;br /&gt;
The PineNote is a specialized device. Finding and configuring apps that work well will require a lot of tweaking and a lot exploring. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] showing the performance of a few applications.&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
=== Sway ===&lt;br /&gt;
[https://github.com/0cc4m/pinenote-misc/blob/main/sway/config/sway/config 0cc4m's config]&lt;br /&gt;
&lt;br /&gt;
==== Getting touch + pen working on sway ====&lt;br /&gt;
If you notice that touching the screen works, but when you use the pen the mouse coordinates are inverted, don't worry! We can fix it! Set &amp;lt;code&amp;gt;rockchip_ebc.panel_reflection=0&amp;lt;/code&amp;gt; on boot (see [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Configuring_the_driver this page] for more info). Add the following line to your sway config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This line rotates the mouse input by 180 degrees. See https://wayland.freedesktop.org/libinput/doc/1.11.3/absolute_axes.html&lt;br /&gt;
input &amp;quot;type:table_tool&amp;quot; calibration_matrix -1 0 1 0 -1 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Gnome ===&lt;br /&gt;
[https://github.com/m-weigand/mw_pinenote_misc/tree/main/gnome Maximilian's Config]&lt;br /&gt;
&lt;br /&gt;
{{info|You may need to compile a [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mutter.sh modified mutter] as well.}}&lt;br /&gt;
&lt;br /&gt;
== Notetaking ==&lt;br /&gt;
&lt;br /&gt;
=== xournal++ ===&lt;br /&gt;
Works well, writing is pretty quick.&lt;br /&gt;
&lt;br /&gt;
== Web Browsing ==&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
Pretty good experience! Enabling GPU acceleration is helpful.&lt;br /&gt;
&lt;br /&gt;
==== GPU Acceleration in Firefox ====&lt;br /&gt;
See [https://github.com/0cc4m/pinenote-misc#firefox-hardware-acceleration 0ccam's notes here].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13983</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13983"/>
		<updated>2022-09-11T04:23:43Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new, you should probably start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]]. To boot Linux by default instead of Android, see [[PineNote Development/Booting Linux]]. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] of a user running Manjaro and some apps on their PineNote on 9/10/2022.&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13982</id>
		<title>PineNote Development/Apps</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13982"/>
		<updated>2022-09-11T04:17:17Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* App support on PineNote */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= App support on PineNote =&lt;br /&gt;
&lt;br /&gt;
The PineNote is a specialized device. Finding and configuring apps that work well will require a lot of tweaking and a lot exploring. [https://www.youtube.com/watch?v=ZCLyJfbzbrU Here is a video] showing the performance of a few applications.&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
=== Sway ===&lt;br /&gt;
[https://github.com/0cc4m/pinenote-misc/blob/main/sway/config/sway/config 0cc4m's config]&lt;br /&gt;
&lt;br /&gt;
==== Getting touch + pen working on sway ====&lt;br /&gt;
If you notice that touching the screen works, but when you use the pen the mouse coordinates are inverted, don't worry! We can fix it! Set &amp;lt;code&amp;gt;rockchip_ebc.panel_reflection=0&amp;lt;/code&amp;gt; on boot (see [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Configuring_the_driver this page] for more info). Add the following line to your sway config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This line rotates the mouse input by 180 degrees. See https://wayland.freedesktop.org/libinput/doc/1.11.3/absolute_axes.html&lt;br /&gt;
input &amp;quot;type:table_tool&amp;quot; calibration_matrix -1 0 1 0 -1 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Gnome ===&lt;br /&gt;
[https://github.com/m-weigand/mw_pinenote_misc/tree/main/gnome Maximilian's Config]&lt;br /&gt;
&lt;br /&gt;
{{info|You may need to compile a [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mutter.sh modified mutter] as well.}}&lt;br /&gt;
&lt;br /&gt;
== Notetaking ==&lt;br /&gt;
&lt;br /&gt;
=== xournal++ ===&lt;br /&gt;
Works well, writing is pretty quick.&lt;br /&gt;
&lt;br /&gt;
== Web Browsing ==&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
Viewing static webpages is okay right now. Webapps like Google Docs are almost unusable.&lt;br /&gt;
&lt;br /&gt;
==== GPU Acceleration in Firefox ====&lt;br /&gt;
See [https://github.com/0cc4m/pinenote-misc#firefox-hardware-acceleration 0ccam's notes here].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13981</id>
		<title>PineNote Development/Apps</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13981"/>
		<updated>2022-09-11T04:16:07Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Sway */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= App support on PineNote =&lt;br /&gt;
&lt;br /&gt;
The PineNote is a specialized device. Finding and configuring apps that work well will require a lot of tweaking and a lot exploring.&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
=== Sway ===&lt;br /&gt;
[https://github.com/0cc4m/pinenote-misc/blob/main/sway/config/sway/config 0cc4m's config]&lt;br /&gt;
&lt;br /&gt;
==== Getting touch + pen working on sway ====&lt;br /&gt;
If you notice that touching the screen works, but when you use the pen the mouse coordinates are inverted, don't worry! We can fix it! Set &amp;lt;code&amp;gt;rockchip_ebc.panel_reflection=0&amp;lt;/code&amp;gt; on boot (see [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Configuring_the_driver this page] for more info). Add the following line to your sway config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This line rotates the mouse input by 180 degrees. See https://wayland.freedesktop.org/libinput/doc/1.11.3/absolute_axes.html&lt;br /&gt;
input &amp;quot;type:table_tool&amp;quot; calibration_matrix -1 0 1 0 -1 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Gnome ===&lt;br /&gt;
[https://github.com/m-weigand/mw_pinenote_misc/tree/main/gnome Maximilian's Config]&lt;br /&gt;
&lt;br /&gt;
{{info|You may need to compile a [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mutter.sh modified mutter] as well.}}&lt;br /&gt;
&lt;br /&gt;
== Notetaking ==&lt;br /&gt;
&lt;br /&gt;
=== xournal++ ===&lt;br /&gt;
Works well, writing is pretty quick.&lt;br /&gt;
&lt;br /&gt;
== Web Browsing ==&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
Viewing static webpages is okay right now. Webapps like Google Docs are almost unusable.&lt;br /&gt;
&lt;br /&gt;
==== GPU Acceleration in Firefox ====&lt;br /&gt;
See [https://github.com/0cc4m/pinenote-misc#firefox-hardware-acceleration 0ccam's notes here].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13980</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13980"/>
		<updated>2022-09-11T04:11:50Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Configuring the driver for faster draws */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13979</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13979"/>
		<updated>2022-09-11T04:10:31Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Configuring the driver for faster draws */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver for faster draws ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13978</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13978"/>
		<updated>2022-09-11T04:10:22Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Next Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
== Configuring the driver for faster draws ==&lt;br /&gt;
The driver has several options that can improve performance. These can be read about [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#new-features-as-of-2022august08 here]. Personally, I use &amp;lt;code&amp;gt;rockchip_ebc.bw_mode=1 rockchip_ebc.default_waveform=1 rockchip_ebc.refresh_threshold=30 rockchip_ebc.auto_refresh=1&amp;lt;/code&amp;gt; to make the image lower quality, but much faster to update. The auto_refresh setting is also essential to clear ghosting which will otherwise accrue on screen. I added the above settings the &amp;lt;code&amp;gt;APPEND&amp;lt;/code&amp;gt; line in my &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to make sure they are applied on boot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13901</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13901"/>
		<updated>2022-09-05T06:50:39Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Steps to build */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Debian Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13900</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13900"/>
		<updated>2022-09-05T05:42:09Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: add info about ignoring mesa packages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Arch Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|If you frequently update your system with something `pacman -Syu`, you will end up updating these packages and losing the patches. Add this line to your &amp;lt;code&amp;gt;/etc/pacman.conf&amp;lt;/code&amp;gt; to prevent them from being updated: &amp;lt;pre&amp;gt;IgnorePkg = libva-mesa-driver mesa mesa-debug mesa-vdpau opencl-mesa vulkan-mesa-layers vulkan-broadcom vulkan-panfrost vulkan-radeon vulkan-swrast&amp;lt;/pre&amp;gt;}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13899</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13899"/>
		<updated>2022-09-05T05:37:58Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Sway Configurations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13857</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13857"/>
		<updated>2022-09-01T06:34:41Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Userspace TODOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
=== GTK ===&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
=== Mouse/Touch ===&lt;br /&gt;
# How should pen work? How should finger work? Are there Linux tablets that already do this decently well?&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13856</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13856"/>
		<updated>2022-09-01T06:31:53Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
Untested as far as I know: https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
=== Mouse/Touch ===&lt;br /&gt;
# How should pen work? How should finger work? Are there Linux tablets that already do this decently well?&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13855</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13855"/>
		<updated>2022-09-01T06:29:58Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODOs to get the pinenote to a user ready state. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Userspace TODOs=&lt;br /&gt;
== Themes ==&lt;br /&gt;
A lot of getting the PineNote to work nicely will be theming things appropriately. Please list themes for various components here:&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
https://github.com/fujimo-t/gnome-shell-theme-e-ink&lt;br /&gt;
&lt;br /&gt;
== GNOME Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
== Sway Configurations ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
=== Mouse/Touch ===&lt;br /&gt;
# How should pen work? How should finger work? Are there Linux tablets that already do this decently well?&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13854</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13854"/>
		<updated>2022-09-01T04:53:52Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Documentation TODOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are a list of open questions that pertain to configurations necessary for the OS to function nicely in the short-term during development and in the long term for people. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Configuration TODOs =&lt;br /&gt;
&lt;br /&gt;
== Work that will need to be done long-term ==&lt;br /&gt;
=== GNOME Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
=== Sway Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
=== Mouse/Touch ===&lt;br /&gt;
# How should pen work? How should finger work? Are there Linux tablets that already do this decently well?&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet. If you know how to do one of these things, please make a page for it. If you aren't sure where to put it or just don't feel like doing it, please just message @aarondabomb on matrix and I'll be happy to document it.}}&lt;br /&gt;
&lt;br /&gt;
=== Pin Mesa Packages so they don't update when we upgrade other packages === &lt;br /&gt;
Should be super simple, I just don't know how. If you know, it would be helpful for you to add that information near step 5 [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel#Steps_to_build here].&lt;br /&gt;
=== Control the backlight? ===&lt;br /&gt;
=== Building alacritty correctly ===&lt;br /&gt;
=== Force a screen refresh? === &lt;br /&gt;
Maximilian mentioned how to do this, but I don't know enough to know what it means XD see conversation here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13853</id>
		<title>PineNote Development/TODOs</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/TODOs&amp;diff=13853"/>
		<updated>2022-09-01T04:47:54Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Configurations that will likely be needed long-term */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are a list of open questions that pertain to configurations necessary for the OS to function nicely in the short-term during development and in the long term for people. If you know the answer to one of these or want something to do, please make a page with this info and link it here :)&lt;br /&gt;
&lt;br /&gt;
= Configuration TODOs =&lt;br /&gt;
&lt;br /&gt;
== Work that will need to be done long-term ==&lt;br /&gt;
=== GNOME Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Gnome here].&lt;br /&gt;
=== Sway Configurations ===&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps#Sway here].&lt;br /&gt;
=== Mouse/Touch ===&lt;br /&gt;
# How should pen work? How should finger work? Are there Linux tablets that already do this decently well?&lt;br /&gt;
&lt;br /&gt;
== Open questions that would be helpful during development ==&lt;br /&gt;
# How do we pin packages so Mesa isn't updated when we update using our package manger?&lt;br /&gt;
&lt;br /&gt;
= Documentation TODOs =&lt;br /&gt;
{{info|These are things we know how to do, but they just haven't been documented in the wiki yet.}}&lt;br /&gt;
&lt;br /&gt;
# How do we control the backlight?&lt;br /&gt;
# How do we build alacritty correctly?&lt;br /&gt;
# How do we force a screen refresh? See converstaion here: https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$tfumBpnP2UPouNpaeFrggR40ZkrD_pHAtJdQmQvzL-o?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13801</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13801"/>
		<updated>2022-08-27T21:16:54Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: add booting linux info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new, you should probably start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]]. To boot Linux by default instead of Android, see [[PineNote Development/Booting Linux]].&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13800</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13800"/>
		<updated>2022-08-27T21:15:55Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: add booting linux info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Arch Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|that you should be careful when upgrading your packages from now on -- it's possible your package manager will want to upgrade these, but we don't want it to do this (TODO include section on how to tell package manager not to upgrade these).}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;br /&gt;
&lt;br /&gt;
== Booting Linux instead of Android ==&lt;br /&gt;
[[PineNote Development/Booting Linux]]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13799</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13799"/>
		<updated>2022-08-27T21:13:30Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: v1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script. We'll use the script to pull the uboot environment out of the stock uboot partition. We'll then apply the patch, recreate the image, add a configuration file, and flash the new image to the PineNote.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write your uboot partition to disk: &amp;lt;code&amp;gt;dd if=/dev/mmcblk0p1 of=~/uboot.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Extract the environment: &amp;lt;code&amp;gt; ./pinenote-uboot-envtool.py extract uboot.img uboot.env&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Poke around the files (or skip this if you don't like to learn...):&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;uboot.env&amp;lt;/code&amp;gt; -- see, it's just text at this point!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open &amp;lt;code&amp;gt;boot-menu.patch&amp;lt;/code&amp;gt; to get a feel for how that works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The boot-menu.patch makes assumptions about where your linux partition lives. Specifically, it will look at partition 0x11 (which is 17 in decimal). Change this in boot-menu.patch to reflect where your linux boot partition lives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Apply boot-menu.patch: &amp;lt;code&amp;gt;patch uboot.env boot-menu.patch&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This doesn't work for me for some reason:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ patch uboot.env boot-menu.patch                                                             &lt;br /&gt;
patching file env.original&lt;br /&gt;
Hunk #3 FAILED at 24.&lt;br /&gt;
patch unexpectedly ends in middle of line&lt;br /&gt;
patch: **** unexpected end of file in patch at line 27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I couldn't figure out what it's complaining about here, so I ended up applying the patch manually. It's pretty straight-forward.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Rewrite the new environment to the image: &amp;lt;code&amp;gt;./pinenote-uboot-envtool.py insert uboot.img uboot.env uboot-patched.img&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Write the image to the boot partition: &amp;lt;code&amp;gt;dd if=~/uboot-patched.img of=/dev/mmcblk0p1&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point, restarting your system will boot into Android -- this is because the patched uboot we've just created looks for &amp;lt;code&amp;gt;/boot/which_os.txt&amp;lt;/code&amp;gt; to determine whether to boot android or linux, and since it can't find this file (we haven't made it yet), the bootloader defaults to android. Create that file on the same boot partition you specified in the boot-menu.patch file, placing an &amp;lt;code&amp;gt;l&amp;lt;/code&amp;gt; in the file for linux.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Reboot into linux and go &amp;quot;wow&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
== Sources and further reading ==&lt;br /&gt;
# [https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html U-boot with rockchip docs]&lt;br /&gt;
# [https://stackoverflow.com/questions/31244862/what-is-the-use-of-spl-secondary-program-loader Helpful stack overflow to learn a bit about the boot process/terminology]&lt;br /&gt;
# [https://matrix.to/#/!QtTzSRYMuozjbOQkzJ:matrix.org/$bVBxdD3E01da7w4LRm45-mwbw_jPk6CrJTQWGMG3B2I?via=matrix.org&amp;amp;via=kde.org&amp;amp;via=tchncs.de This conversation in matrix between pgwipeout, vveapon, and pinenewb about flashing uboot.]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13798</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13798"/>
		<updated>2022-08-27T21:00:22Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: almost done&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script. We'll use the script to pull the uboot environment out of the stock uboot partition. We'll then apply the patch, recreate the image, add a configuration file, and flash the new image to the PineNote.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&lt;br /&gt;
# Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Write your uboot partition to disk: &amp;lt;code&amp;gt;dd if=/dev/mmcblk0p1 of=~/uboot.img&amp;lt;/code&amp;gt;&lt;br /&gt;
# Extract the environment: &amp;lt;code&amp;gt; ./pinenote-uboot-envtool.py extract uboot.img uboot.env&amp;lt;/code&amp;gt;&lt;br /&gt;
# Poke around the files (or skip this if you don't like to learn...):&lt;br /&gt;
## Open &amp;lt;code&amp;gt;uboot.env&amp;lt;/code&amp;gt; -- see, it's just text at this point!&lt;br /&gt;
## Open &amp;lt;code&amp;gt;boot-menu.patch&amp;lt;/code&amp;gt; to get a feel for how that works&lt;br /&gt;
# The boot-menu.patch makes assumptions about where your linux partition lives. Specifically, it will look at partition 0x11 (which is 17 in decimal). Change this in boot-menu.patch to reflect where your linux boot partition lives.&lt;br /&gt;
# Apply boot-menu.patch: &amp;lt;code&amp;gt;patch uboot.env boot-menu.patch&amp;lt;/code&amp;gt;&lt;br /&gt;
## This doesn't work for me for some reason:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ patch uboot.env boot-menu.patch                                                             &lt;br /&gt;
patching file env.original&lt;br /&gt;
Hunk #3 FAILED at 24.&lt;br /&gt;
patch unexpectedly ends in middle of line&lt;br /&gt;
patch: **** unexpected end of file in patch at line 27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I couldn't figure out what it's complaining about here, so I ended up applying the patch manually. It's pretty straight-forward.&lt;br /&gt;
# Rewrite the new environment to the image: &amp;lt;code&amp;gt;./pinenote-uboot-envtool.py insert uboot.img uboot.env uboot-patched.img&amp;lt;/code&amp;gt;&lt;br /&gt;
# Write the image to the boot partition: &amp;lt;code&amp;gt;dd if=~/uboot-patched.img of=/dev/mmcblk0p1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, restarting your system will boot into Android -- this is because the patched uboot we've just created looks for &amp;lt;code&amp;gt;/boot/which_os.txt&amp;lt;/code&amp;gt; to determine whether to boot android or linux, and since it can't find this file (we haven't made it yet), the bootloader defaults to android.&lt;br /&gt;
&lt;br /&gt;
Create that file on the same boot partition you specified in the boot-menu.patch file, placing an `l` in the file for linux. &lt;br /&gt;
&lt;br /&gt;
== Sources and further reading ==&lt;br /&gt;
[https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html U-boot with rockchip docs]&lt;br /&gt;
[https://stackoverflow.com/questions/31244862/what-is-the-use-of-spl-secondary-program-loader Helpful stack overflow to learn a bit about the boot process/terminology]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13797</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13797"/>
		<updated>2022-08-27T20:17:46Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script. We'll use the script to pull the uboot environment out of the stock uboot partition. We'll then apply the patch, recreate the image, add a configuration file, and flash the new image to the PineNote.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&lt;br /&gt;
# Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Write your uboot partition to disk: &amp;lt;code&amp;gt;dd if=/dev/mmcblk0p1 of=~/uboot.img&amp;lt;/code&amp;gt;&lt;br /&gt;
# Extract the environment: &amp;lt;code&amp;gt; ./pinenote-uboot-envtool.py extract uboot.img uboot.env&amp;lt;/code&amp;gt;&lt;br /&gt;
# Poke around the files (or skip this if you don't like to learn...):&lt;br /&gt;
## Open &amp;lt;code&amp;gt;uboot.env&amp;lt;/code&amp;gt; -- see, it's just text at this point!&lt;br /&gt;
## Open &amp;lt;code&amp;gt;uboot.&lt;br /&gt;
&lt;br /&gt;
== Sources and further reading ==&lt;br /&gt;
[https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html U-boot with rockchip docs]&lt;br /&gt;
[https://stackoverflow.com/questions/31244862/what-is-the-use-of-spl-secondary-program-loader Helpful stack overflow to learn a bit about the boot process/terminology]&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13796</id>
		<title>PineNote Development/Booting Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Booting_Linux&amp;diff=13796"/>
		<updated>2022-08-27T20:07:49Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: init&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To boot linux, we need to patch stock uboot. I used [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f charasyn's method], based off work from Dorian as credited in the script.&lt;br /&gt;
&lt;br /&gt;
== Steps to patch uboot ==&lt;br /&gt;
&lt;br /&gt;
# Get the [https://gist.github.com/charasyn/206b2537534b6679b0961be64cf9c35f patch and the python tool]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir pinenote-uboot &amp;amp;&amp;amp; cd pinenote-uboot&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/boot-menu.patch -o boot-menu.patch&lt;br /&gt;
$ curl https://gist.githubusercontent.com/charasyn/206b2537534b6679b0961be64cf9c35f/raw/cc513998a36fac0cea266260e3ca3e64abfe3696/pinenote-uboot-envtool.py -o pinenote-uboot-envtool.py&lt;br /&gt;
$ chmod o+x pinenote-uboot-envtool.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13794</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13794"/>
		<updated>2022-08-27T04:16:36Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Building the Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
Perhaps the main component of the kernel is the DRM driver. You can read more about the driver by reading [https://lore.kernel.org/linux-rockchip/20220413221916.50995-1-samuel@sholland.org/T/ Smaeul's RFC].&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Arch Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|that you should be careful when upgrading your packages from now on -- it's possible your package manager will want to upgrade these, but we don't want it to do this (TODO include section on how to tell package manager not to upgrade these).}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13793</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13793"/>
		<updated>2022-08-27T04:13:47Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* What do you need to know? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the [https://discord.com/invite/pine64 Discord]/[https://matrix.to/#/#pinenote:matrix.org Matrix]. Please try to solve problems on your own first, and then ask for help -- if nobody replies, please be patient and ask again soon.&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Arch Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|that you should be careful when upgrading your packages from now on -- it's possible your package manager will want to upgrade these, but we don't want it to do this (TODO include section on how to tell package manager not to upgrade these).}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13792</id>
		<title>PineNote Development/Building Kernel</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Building_Kernel&amp;diff=13792"/>
		<updated>2022-08-27T04:11:19Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* What you should have already done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Building the Kernel =&lt;br /&gt;
&lt;br /&gt;
After followed [https://github.com/DorianRudolph/pinenotes#starter-guide Dorian's directions] to get Arch installed you've seen someone [https://github.com/m-weigand/mw_pinenote_misc/blob/main/videos/20220808_bw_dither_mode_picture_doom_video_small.mp4 playing DOOM]  and you want to learn how to get the features that enable that kind of performance. To get your PN running this smoothly, we'll need to build our own kernel. There are two kernel efforts underway right now:&lt;br /&gt;
&lt;br /&gt;
# pgwipeout: https://gitlab.com/pgwipeout/linux-next&lt;br /&gt;
# smaeul: https://github.com/smaeul/linux/tree/rk35/pinenote-next&lt;br /&gt;
&lt;br /&gt;
We'll be using smaeul's kernel + some additional patches provided by DorianRudolph, pgwipeout, Maximilian Weigand, occam_razor, and hrdl. Thanks so much to them, and all the other users who have worked on piecing together drivers, twiddling configs, answering questions, and sharing their work in other ways. Brava!&lt;br /&gt;
&lt;br /&gt;
=== A small warning ===&lt;br /&gt;
&lt;br /&gt;
This guide is completely based off of the scripts provided by Maximilian. We'll be cloning and running them, but he owns them and he -- or others -- might change them. It's smart to have a look at what's going on, check when this page was last updated vs when his scripts were last updated, etc. Be nimble!&lt;br /&gt;
&lt;br /&gt;
Additionally, as Maximilian warns [https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches here], these changes are all experimental and may damage your panel. &lt;br /&gt;
&lt;br /&gt;
{{info|If anyone reading this has recommended reading for how we can understand what may damage our panels (IE is the risk in fast updates? The types of updates? something more complicated?), please add it here!}}&lt;br /&gt;
&lt;br /&gt;
== What you should have already done ==&lt;br /&gt;
&lt;br /&gt;
I assume you've already got an operating system installed on your Pinenote other than the stock Android. Doing this isn't trivial, but it is well understood -- you will be following the footsteps of many others. Dorian Rudolph made a guide for doing this, available [https://github.com/DorianRudolph/pinenotes#starter-guide here].&lt;br /&gt;
&lt;br /&gt;
== What do you need to know? ==&lt;br /&gt;
&lt;br /&gt;
If you followed Dorian's guide to get here and felt semi-comfortable, you'll be fine. This is no more complicated than that. If you are intimidated, that's okay! I'll still encourage you to try :) you will learn a lot, just be patient and don't put any data on your PineNote that you wouldn't be okay losing. If you run into trouble, ask for help in the Discord/Matrix (TODO link). Please try to solve problems on your own first, and if nobody replies, please be patient and ask again soon. You can reach me at @aarondabomb on Matrix. Please edit this document if you think something could be clearer or you see a great opportunity for a joke! Have fun :)&lt;br /&gt;
&lt;br /&gt;
== Steps to build ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Clone Maximilian's scripts: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone https://github.com/m-weigand/mw_pinenote_misc.git &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Make a separate directory for patching the kernel. Then run Maximilian's &amp;lt;code&amp;gt;clone_and_prepare_git.sh&amp;lt;/code&amp;gt;. This will clone smaeul's kernel and a number of patches. Read the script to see which patches it is using. Feel free to open the patches too -- it's helpful to get a slim idea of what's going on, if only looking at the commit messages in them: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ../&lt;br /&gt;
 $ sh mw_pinenote_misc/custom_kernel/clone_and_prepare_git.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Compile the kernel: &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; $ sh ../mw-pinenote_misc/custom_kernel/compile.sh &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Next we want to perform the work captured in &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, but the work may vary slightly from person to person. For example, I believe Maximilian is running Arch Sid, and I am running Manjaro -- because of this, and personal preference, some of our files live at different places. As long as you put them somewhere and configure your &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; to point at it, things will be okay. Looking at &amp;lt;code&amp;gt;install_to_pn.sh&amp;lt;/code&amp;gt;, we can see that there are three pieces to installing the kernel: the kernel image (called &amp;lt;code&amp;gt;Image&amp;lt;/code&amp;gt;), the device tree (&amp;lt;code&amp;gt;rk3566-pinenote-v1.2.dtb&amp;lt;/code&amp;gt;), and the modules. All of these files have been compiled and placed into the &amp;lt;code&amp;gt;linux/pack&amp;lt;/code&amp;gt; folder. The easiest way to send these over is by using scp or rsync -- read the script and decide how you would like to get your files in the correct location. You may need to install rsync on your PineNote if it doesn't already have it.&lt;br /&gt;
  &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;If it helps, I installed my dtb like this: &amp;lt;code&amp;gt;$ scp rk3566-pinenote-v1.2.dtb root@pinenote:/boot/dtbs/rockchip/&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;After installing the dtb as above, I updated my &amp;lt;code&amp;gt;/boot/extlinux/extlinux.conf&amp;lt;/code&amp;gt; to point to this new file (previously, my dtb did not have the &amp;lt;code&amp;gt;-v1.2&amp;lt;/code&amp;gt; on the end).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; (Perhaps not necessary?) The last step is to generate a new initrd image. (If you're like me and don't know what initrd is, the [https://en.wikipedia.org/wiki/Initial_ramdisk wiki] is very enlightening.) This is done on the PineNote itself. Send Maximilian's installation script over and run it. Then place the generated image (from the last step of the shell script) into your boot partition and update &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; if needed to point at this new file.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ scp initrd/gen_uboot_image.sh root@pinenote:/root # Do this part on local to put script on PN&lt;br /&gt;
 $ ssh root@pinenote # Or use UART, the dongle + picocom, and change to root&lt;br /&gt;
 $ cd /root&lt;br /&gt;
 $ ./gen_uboot_image.sh&lt;br /&gt;
 $ mv initrd.img /boot/initrd.img&lt;br /&gt;
 $ vim /boot/extlinux/extlinux.conf # Update this to reference this new initrd image&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; At this point your kernel is in place! However, there are a few more steps you may need to complete to ensure the display and networking continue to work:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For display, you may need to change &amp;lt;code&amp;gt;/lib/firmware/waveform.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/rockchip/ebc.wbf&amp;lt;/code&amp;gt; (TODO is this a difference between PG and smaeul's kernel? or a patch?)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;For networking (and I imagine more as well), you may need to change &amp;lt;code&amp;gt;/lib/firmware/pinenote.bin&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/lib/firmware/pinenote-v1.2.bin&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; This part technically isn't kernel specific, but we need to install a patched version of Mesa. If you are running an Arch based system, you're in luck! occam_razor provides prebuilt patched packages (say that 5 times fast) [https://github.com/0cc4m/pinenote-misc/releases here]. Simply extract these files, send them to PN, and install them using the package manager. You can also patch it yourself by looking at Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mesa.sh compile_mesa.sh]. {{info|that you should be careful when upgrading your packages from now on -- it's possible your package manager will want to upgrade these, but we don't want it to do this (TODO include section on how to tell package manager not to upgrade these).}}&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; To ensure the GPU stays on, we need to use Maximilian's [https://github.com/m-weigand/mw_pinenote_misc/blob/main/systemd/mweigand_eglinfo.service mweigand_eglinfo.service]. The Readme.md in that same directory has instructions for how to install this, but basically we need to copy it to &amp;lt;code&amp;gt;/etc/systemd/system/&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;sudo systemctl daemon-reload&amp;lt;/code&amp;gt; to make sure systemd knows it exists, then execute &amp;lt;code&amp;gt;sudo systemctl enable mweigand_eglinfo.service&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it! Now are equipped with the freshest kernel + patches.&lt;br /&gt;
&lt;br /&gt;
= Next Steps =&lt;br /&gt;
&lt;br /&gt;
== Fixing Suspend ==&lt;br /&gt;
If you're using a logind system, edit your &amp;lt;code&amp;gt;/etc/systemd/logind.conf&amp;lt;/code&amp;gt; config. More information on what to do [https://wiki.archlinux.org/title/Power_management#ACPI_event in Arch's documentation].&lt;br /&gt;
&lt;br /&gt;
== Configuring your apps ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Apps this page].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13786</id>
		<title>PineNote Development/Apps</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13786"/>
		<updated>2022-08-27T03:20:11Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Gnome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= App support on PineNote =&lt;br /&gt;
&lt;br /&gt;
The PineNote is a specialized device. Finding and configuring apps that work well will require a lot of tweaking and a lot exploring.&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
=== Sway ===&lt;br /&gt;
[https://github.com/0cc4m/pinenote-misc/blob/main/sway/config/sway/config 0cc4m's config]&lt;br /&gt;
&lt;br /&gt;
=== Gnome ===&lt;br /&gt;
[https://github.com/m-weigand/mw_pinenote_misc/tree/main/gnome Maximilian's Config]&lt;br /&gt;
&lt;br /&gt;
{{info|You may need to compile a [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mutter.sh modified mutter] as well.}}&lt;br /&gt;
&lt;br /&gt;
== Notetaking ==&lt;br /&gt;
&lt;br /&gt;
=== xournal++ ===&lt;br /&gt;
Works well, writing is pretty quick.&lt;br /&gt;
&lt;br /&gt;
== Web Browsing ==&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
Viewing static webpages is okay right now. Webapps like Google Docs are almost unusable.&lt;br /&gt;
&lt;br /&gt;
==== GPU Acceleration in Firefox ====&lt;br /&gt;
See [https://github.com/0cc4m/pinenote-misc#firefox-hardware-acceleration 0ccam's notes here].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13785</id>
		<title>PineNote Development/Apps</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development/Apps&amp;diff=13785"/>
		<updated>2022-08-27T03:20:00Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: /* Gnome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= App support on PineNote =&lt;br /&gt;
&lt;br /&gt;
The PineNote is a specialized device. Finding and configuring apps that work well will require a lot of tweaking and a lot exploring.&lt;br /&gt;
&lt;br /&gt;
== Desktop Environments ==&lt;br /&gt;
=== Sway ===&lt;br /&gt;
[https://github.com/0cc4m/pinenote-misc/blob/main/sway/config/sway/config 0cc4m's config]&lt;br /&gt;
&lt;br /&gt;
=== Gnome ===&lt;br /&gt;
[https://github.com/m-weigand/mw_pinenote_misc/tree/main/gnome Maximilian's Config]&lt;br /&gt;
{{info|You may need to compile a [https://github.com/m-weigand/mw_pinenote_misc/blob/main/compile_mutter.sh modified mutter] as well.&lt;br /&gt;
&lt;br /&gt;
== Notetaking ==&lt;br /&gt;
&lt;br /&gt;
=== xournal++ ===&lt;br /&gt;
Works well, writing is pretty quick.&lt;br /&gt;
&lt;br /&gt;
== Web Browsing ==&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
Viewing static webpages is okay right now. Webapps like Google Docs are almost unusable.&lt;br /&gt;
&lt;br /&gt;
==== GPU Acceleration in Firefox ====&lt;br /&gt;
See [https://github.com/0cc4m/pinenote-misc#firefox-hardware-acceleration 0ccam's notes here].&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13784</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=13784"/>
		<updated>2022-08-27T02:59:32Z</updated>

		<summary type="html">&lt;p&gt;Aarondabomb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]. If you are new, you should probably start with [https://github.com/DorianRudolph/pinenotes Dorian's guide] which will guide you through getting Arch installed. For instructions on building the latest kernel, see [[PineNote Development/Building Kernel]]. For helpful configurations, see [[PineNote Development/Apps]]. For ways to pitch in, see [[PineNote Development/TODOs]].&lt;br /&gt;
&lt;br /&gt;
= More Information = &lt;br /&gt;
&lt;br /&gt;
== Notes Written by Some Developers ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/m-weigand/mw_pinenote_misc (Not super legible &amp;quot;notes&amp;quot;, but very helpful repo with patches, videos, etc)&lt;br /&gt;
** specifically see this section for helpful install/configure scripts: https://github.com/m-weigand/mw_pinenote_misc/tree/main/rockchip_ebc/patches#compiling. &lt;br /&gt;
* https://github.com/0cc4m/pinenote-misc&lt;br /&gt;
** patch for enabling gpu: https://github.com/0cc4m/pinenote-misc/blob/main/mesa-archlinux-arm/mesa/rockchip_ebc.patch&lt;br /&gt;
** prebuilt pkg's: https://github.com/0cc4m/pinenote-misc/releases&lt;br /&gt;
* https://pwarren.id.au/pinenote/build_notes.txt&lt;br /&gt;
* https://github.com/DorianRudolph/pinenotes&lt;br /&gt;
* https://github.com/tpwrules/nixos-pinenote&lt;br /&gt;
&lt;br /&gt;
== Building the most recent kernel ==&lt;br /&gt;
See [https://wiki.pine64.org/wiki/PineNote_Development/Building_Kernel here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Video of Factory Android OS ==&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=DWuTGgQHw98 PineNote Developer Edition w/Tech Demo Android OS (Video Only)]&lt;br /&gt;
&lt;br /&gt;
Informal walkthrough of the factory Android installation on the PineNote Developer Edition, recorded by a community member (Apr 2022). This is useful to look back at the original OS after erasing it from your device, or to get some additional detail before your device arrives.&lt;br /&gt;
&lt;br /&gt;
The video also includes a chapter at the end showing [https://www.youtube.com/watch?v=DWuTGgQHw98&amp;amp;t=802s how to enable Android Debug Bridge (`adb`) over USB]. Once enabled, keep the device powered and connect a USB cable directly to the PineNote (i.e. no UART breakout) to a computer running `adb`.&lt;br /&gt;
&lt;br /&gt;
== Emulator for Developing/Testing Pinenote Apps ==&lt;br /&gt;
https://github.com/michaelshiel/picom-epaper&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only ways to flash software are from the factory Android installation (UART shell, adb, or fastboot) or by using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Side-by-side setup ==&lt;br /&gt;
&lt;br /&gt;
It is possible to set up a partition for mainline development without disturbing the factory Android installation. This allows updating a mainline kernel, DTB, and initramfs over Wi-Fi until WiFi or USB OTG is working in mainline Linux.&lt;br /&gt;
&lt;br /&gt;
=== Without Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
The recommended partition for this is &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt; aka &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. It is large and already formatted as &amp;lt;tt&amp;gt;ext4&amp;lt;/tt&amp;gt;, so it is readable from U-Boot. Here are some general steps:&lt;br /&gt;
&lt;br /&gt;
# From the UART or adb shell, set up your chroot in &amp;lt;tt&amp;gt;/cache&amp;lt;/tt&amp;gt;. I used the Alpine Linux rootfs tarball.&lt;br /&gt;
# Copy in your kernel and DTB, using for example &amp;lt;tt&amp;gt;scp&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; inside the chroot.&lt;br /&gt;
# Finally, create and boot an &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below.&lt;br /&gt;
&lt;br /&gt;
=== With Repartitioning ===&lt;br /&gt;
&lt;br /&gt;
It is possible to shrink the &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; partition, and create a new partition at the end for use with mainline Linux. This provides much more space than &amp;lt;tt&amp;gt;cache&amp;lt;/tt&amp;gt;. However, because &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt; is formatted with &amp;lt;tt&amp;gt;f2fs&amp;lt;/tt&amp;gt;, and that filesystem cannot be shrunk, resizing the partition requires wiping &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# Back up any necessary files from userdata&lt;br /&gt;
# Boot to a mainline kernel from &amp;lt;tt&amp;gt;mmcblk0p11&amp;lt;/tt&amp;gt;, either using that partition as rootfs (see above), or using an initramfs with repartitioning tools&lt;br /&gt;
# Modify the partition table with your favorite tool, e.g. &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdisk&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;parted&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Reboot into &amp;lt;tt&amp;gt;fastboot&amp;lt;/tt&amp;gt; and wipe &amp;lt;tt&amp;gt;userdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Reboot into Android, where you can now chroot in and install your favorite distribution to the new partition.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0, its development headers and scdoc installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm control --reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copying the udev rules is also performed automatically when you &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work. To build you'll also need to install device-tree-compiler.&lt;br /&gt;
&lt;br /&gt;
You also need to install Python and pyelftools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Note that rkbin is a &amp;amp;gt;5GB download!&amp;lt;/b&amp;gt; This will take some time to clone and process the deltas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
# If using Arch Linux, export CROSS_COMPILE=aarch64-linux-gnu-&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
In the version I cloned (current as of 2022-01-02), I had to make a change to one line to get a clean compilation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/lib/avb/libavb/avb_slot_verify.c b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
index 123701fc3b..64a1ce6450 100644&lt;br /&gt;
--- a/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
+++ b/lib/avb/libavb/avb_slot_verify.c&lt;br /&gt;
@@ -296,7 +296,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(&lt;br /&gt;
   bool image_preloaded = false;&lt;br /&gt;
   uint8_t* digest;&lt;br /&gt;
   size_t digest_len;&lt;br /&gt;
-  const char* found;&lt;br /&gt;
+  const char* found = NULL;&lt;br /&gt;
   uint64_t image_size;&lt;br /&gt;
   size_t expected_digest_len = 0;&lt;br /&gt;
   uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For systems where the global python executable points to python2, compilation fails with an error related to pyelftools not being installed (even if it is). To fix this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/make.sh b/make.sh&lt;br /&gt;
index 2bba05b4e4..cfe5b0afd5 100755&lt;br /&gt;
--- a/make.sh&lt;br /&gt;
+++ b/make.sh&lt;br /&gt;
@@ -758,7 +758,7 @@ function pack_fit_image()&lt;br /&gt;
        fi&lt;br /&gt;
 &lt;br /&gt;
        if [ &amp;quot;${ARM64_TRUSTZONE}&amp;quot; == &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
-               if ! python -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
+               if ! python3 -c &amp;quot;import elftools&amp;quot; ; then&lt;br /&gt;
                        echo &amp;quot;ERROR: No python 'pyelftools', please: pip install pyelftools&amp;quot;&lt;br /&gt;
                        exit 1&lt;br /&gt;
                fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Entering Maskrom/Rockusb Mode ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to get into Maskrom/Rockusb mode:&lt;br /&gt;
&lt;br /&gt;
====  The easy way ====&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt; (note that &amp;quot;Loader&amp;quot; here indicates U-Boot's Rockusb; separately, booting with an erased eMMC displays &amp;quot;Maskrom&amp;quot; [not &amp;quot;Loader&amp;quot;] from the RK3566).&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in Rockusb mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
==== Shorting test points ====&lt;br /&gt;
&lt;br /&gt;
If the bootloader is broken/corrupted, you cannot get to Maskrom without opening up the device (it can be opened using spudger and a bit of patience).&lt;br /&gt;
&lt;br /&gt;
Once inside, short TP1301 and TP1302 with a small tweezers, this is how it looks on board view (credit to Caleb):&lt;br /&gt;
&lt;br /&gt;
[[File:PineNote_Maskrom_TP.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Then plug the device to the computer and if you see the device with VID=2207/PID=350a then it should be in Maskrom mode, you can verify by typing &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device found, idVendor=2207, idProduct=350a, bcdDevice= 1.00&lt;br /&gt;
Jan 07 15:04:13 melttower kernel: usb 1-14: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
&lt;br /&gt;
$ rkdeveloptool list-devices&lt;br /&gt;
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=10e    Maskrom&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If nothing shows up, you can try to hold down the power button for 5 seconds and then try again.&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
=== Creating a mainline boot image ===&lt;br /&gt;
&lt;br /&gt;
You can create a filesystem image that replaces the Android boot or recovery partition by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
# Erase boot and dtbo with rkdeveloptool or fastboot (back them up first!!!)&lt;br /&gt;
# Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
# Build your mainline kernel&lt;br /&gt;
# Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
# Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; as described below&lt;br /&gt;
# Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
== Using fastboot ==&lt;br /&gt;
&lt;br /&gt;
Follow the steps for &amp;quot;Creating a mainline boot.img&amp;quot;, but instead of flashing it with rkdeveloptool, use fastboot. You can enter fastboot in either of two ways:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;quot;reboot bootloader&amp;quot; from adb or a UART console.&lt;br /&gt;
# Get a U-Boot prompt and run &amp;lt;code&amp;gt;fastboot usb 0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
Further work is being done here: https://github.com/smaeul/linux/commits/rk356x-ebc-dev. This has a complete device tree, with working eMMC. Pen input also works out of the box. Wi-Fi and BT work with firmware copied from the factory Android image.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default, UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
You can compile a u-boot that uses extlinux by default by following the instructions [https://github.com/JoshuaMulliken/pinenote_uboot/blob/aa9ecbd3d3e716f163f5a900824630f24e9f04ba/README.md#changing-default-boot-order here].&lt;br /&gt;
&lt;br /&gt;
=== Getting to a U-Boot prompt ===&lt;br /&gt;
&lt;br /&gt;
You can get to a U-Boot prompt by:&lt;br /&gt;
&lt;br /&gt;
# Holding Ctrl-C while the display panel initializes.&lt;br /&gt;
# Wiping the &amp;quot;boot&amp;quot; partition.&lt;br /&gt;
&lt;br /&gt;
=== Using sysboot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; should have the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting with individual commands ===&lt;br /&gt;
&lt;br /&gt;
Booting with individual commands can be useful when you need to temporarily add some kernel command line arguments. Use these or similar commands at the U-Boot shell:&lt;br /&gt;
&lt;br /&gt;
 load mmc 0:b ${kernel_addr_r} boot/Image&lt;br /&gt;
 load mmc 0:b ${fdt_addr_r} boot/rk3566-pinenote.dtb&lt;br /&gt;
 setenv bootargs ignore_loglevel root=/dev/mmcblk0p11 rootwait init=/bin/bash&lt;br /&gt;
 booti ${kernel_addr_r} - ${fdt_addr_r}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware ===&lt;br /&gt;
&lt;br /&gt;
Copy WiFi/BT firmware from Android:&lt;br /&gt;
 mkdir -p /cache/lib/firmware/brcm&lt;br /&gt;
 cp /vendor/etc/firmware/fw_bcm43455c0_ag_cy.bin /cache/lib/firmware/brcm/brcmfmac43455-sdio.bin&lt;br /&gt;
 cp /vendor/etc/firmware/nvram_ap6255_cy.txt /cache/lib/firmware/brcm/brcmfmac43455-sdio.txt&lt;br /&gt;
 cp /cache/lib/firmware/BCM4345C0.hcd /cache/lib/firmware/brcm/BCM4345C0.hcd&lt;br /&gt;
&lt;br /&gt;
Copy waveform partition (via previously dumped file):&lt;br /&gt;
 adb root&lt;br /&gt;
 adb push waveform.img /cache/lib/firmware/waveform.bin&lt;br /&gt;
&lt;br /&gt;
Or via dd within Linux:&lt;br /&gt;
 dd if=/dev/mmcblk0p3 of=/lib/firmware/waveform.bin bs=1k count=2048&lt;br /&gt;
&lt;br /&gt;
=== Touchscreen and Pen In X.org ===&lt;br /&gt;
&lt;br /&gt;
By default the pen config is flipped 180° (which makes it unusable) and the touchscreen doesn't work. Placing the following config in &amp;lt;code&amp;gt;/etc/X11/xorg.conf.d/50-touchscreen.conf&amp;lt;/code&amp;gt; will fix both problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier &amp;quot;evdev touchscreen&amp;quot;&lt;br /&gt;
    MatchProduct &amp;quot;tt21000&amp;quot;&lt;br /&gt;
    MatchIsTouchscreen &amp;quot;on&amp;quot;&lt;br /&gt;
    Driver        &amp;quot;evdev&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
Section &amp;quot;InputClass&amp;quot;&lt;br /&gt;
    Identifier    &amp;quot;RotateTouch&amp;quot;&lt;br /&gt;
    MatchProduct    &amp;quot;w9013&amp;quot;&lt;br /&gt;
    Option    &amp;quot;TransformationMatrix&amp;quot; &amp;quot;-1 0 1 0 -1 1 0 0 1&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aarondabomb</name></author>
	</entry>
</feed>