{"id":16164211,"url":"https://github.com/epsilon-0/openbsd-pine-a64-lts","last_synced_at":"2025-05-07T17:01:52.735Z","repository":{"id":87959489,"uuid":"183701520","full_name":"epsilon-0/openbsd-pine-a64-lts","owner":"epsilon-0","description":"Instructions to install OpenBSD (-current) on the Pine A64 LTS model","archived":false,"fork":false,"pushed_at":"2020-11-15T01:23:06.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:05:27.390Z","etag":null,"topics":["openbsd","pine64","soc"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epsilon-0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-26T22:31:41.000Z","updated_at":"2024-11-08T16:38:55.000Z","dependencies_parsed_at":"2023-05-22T03:15:32.607Z","dependency_job_id":null,"html_url":"https://github.com/epsilon-0/openbsd-pine-a64-lts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epsilon-0%2Fopenbsd-pine-a64-lts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epsilon-0%2Fopenbsd-pine-a64-lts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epsilon-0%2Fopenbsd-pine-a64-lts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epsilon-0%2Fopenbsd-pine-a64-lts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epsilon-0","download_url":"https://codeload.github.com/epsilon-0/openbsd-pine-a64-lts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922040,"owners_count":21825633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openbsd","pine64","soc"],"created_at":"2024-10-10T02:45:42.756Z","updated_at":"2025-05-07T17:01:52.674Z","avatar_url":"https://github.com/epsilon-0.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installing OpenBSD (-current) on the Pine A64-LTS model\n\nThis is a short guide for installing the OpenBSD latest snapshot on the [Pine A64-LTS](https://pine64.com/product/pine-a64-lts/?v=0446c16e2e66) SoC board.\u003cbr/\u003e\nThe official installation instructions are present [here](https://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/INSTALL.arm64).\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"27%\" style=\"border-style:solid; border-radius:10px;\"\u003e\n\n## Contents\n\n0. [Requirements](#requirements)\n1. [Flash `minirootXX.img`](#flash)\n2. [Add `*.dtb` file](#dtb)\n3. [Boot and install OpenBSD](#boot)\n4. [Readd and reflash BOOT partition](#reflash)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Requirements \u003ca name=\"requirements\"\u003e\u003c/a\u003e\nThis guide assumes that this is the first ever SoC computer that the reader has ever seen in life and has no clue how to even connect to this device.\u003cbr/\u003e\nThis guide is designed for a basic introduction to working with SoC boards, along with the components needed for connecting (via a serial console):\n- [Pine A64-LTS](https://pine64.com/product/pine-a64-lts/?v=0446c16e2e66) (along with a [power supply](https://pine64.com/?product=pine-a64-usa-power-supply\u0026v=0446c16e2e66))\n- [USB to TTL converter](https://store.pine64.org/?product=pinebook-serial-console) (cp2102)(needed for serial console access, also available on [amazon](https://www.amazon.com/gp/product/B008AGDTA4/))\n- micro-sd card (+ card reader, to read the micro-sd card from laptop/desktop)\n- Access to another (unix/linux) computer for writing to the micro-sd card (this guide uses a linux computer to install OpenBSD on the pine, so the tty/mmcblk devices will be reflecting the linux nomenclature).\n\n## Flash `minirootXX.img` \u003ca name=\"flash\"\u003e\u003c/a\u003e\n- Download [`minirootXX.img`](https://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/) for the `arm64` machines (Pine A64 is an armv8/aarch64 machine).\n- Put the micro-sd card in the card reader and connect it to the laptop. Make sure the the partitions are **unmounted**.\n  - If this is the only mirco-sd card and in a dedicated card reader, it will most likely be found on `/dev/mmcblk0`\n- Flash the `minirootXX.img`:\n    ```\n    dd if=minirootXX.img of=/dev/mmcblk0 bs=1M status=progress\n    ```\n- After flashing there will be BOOT partition of size 4MB i and a `ufs` partition of size 14MB.\n- Download `u-boot-aarch64-YYYY.MMpX.tgz` from https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/ and extract the file `.../share/u-boot/pine64-lts/u-boot-sunxi-with-spl.bin`\n- Flash the file `u-boot-sunxi-with-spl.bin` with the correct batch size and seek:\n    ```\n    dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8\n    ```\n  - The seek is to format the starting of the disk so that the machine can boot correctly.\n  \nNOTE: The download links are for `amd64`, even though the machine is `arm64`, as the package is actually an `arm64` package. The `amd64` links are used as they are updated and compiled more frequently.\n\n## Add `sun50i-a64-pine64-lts.dtb` \u003ca name=\"dtb\"\u003e\u003c/a\u003e\n- Download the file `dtb-X.YYpZ.tgz` from https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/ and extract the file `.../share/dtb/arm64/allwinner/sun50i-a64-pine64-lts.dtb`\n- Mount the BOOT partition of the micro-sd card and copy the `*.dtb` file into a folder called `allwinner`, and make a copy of **ALL FILES** in the boot partition (needed again in step 4, so this creates a backup):\n    ```\n    mkdir -p /tmp/tmpmnt\n    mount /dev/mmcblk0p1 /tmp/tmpmnt\n    mkdir -p /tmp/tmpmnt/allwinner\n    cp sun50i-a64-pine64-lts.dtb /tmp/tmpmnt/allwinner\n    cp -r /tmp/tmpmnt ~/\n    umount /tmp/tmpmnt\n    ```\n\n## Boot and install OpenBSD \u003ca name=\"boot\"\u003e\u003c/a\u003e\n- Insert the micro-sd card into the pine.\n- OpenBSD does not support HDMI I/O for the Pine A64 LTS so a serial console (the usb to ttl conenctor) is needed to connect to the board.\n- This is the [UART connector](http://linux-sunxi.org/File:Pine64_UART0.jpg) for the pine, connect it to the RIGHT side pins, as shown in the picture (connecting to the left side can mess up voltages).\n  - THE TXD pin of the connector connects to the RXD pin of the board and the RXD connects to the TXD pin [RXD - receiver, TXD - transmitter].\n  - Remove the RXD pin of the board before booting. This means no data can be sent while booting. Connecting the wire during the boot phase can mess up voltages. \n  - Reconnect the RXD pin of the board after booting has finished.\n\n- Connect the usb to your machine and to access the console you can use two commands `cu` or `screen`\n- I will be using `screen` as that comes default in most linux distributions\n- The serial console attaches itself to `ttyUSB0` in most cases and can be connected via\n    ```\n    screen /dev/ttyUSB0 115200\n    ```\n  - Don't forget to hard-boot the machine after connecting the serial console so that you can begin the boot process\n\n## Re-add `u-boot.bin` and `sun50i-a64-pine64-lts.dtb` and re-flash `u-boot-sunxi-with-spl.bin` \u003ca name=\"reflash\"\u003e\u003c/a\u003e\n- Now that you have finished the installation on `sd0`, if you try to reboot the machine you will end up with the following error\n    ```\n    DRAM: 0 MiB\n    ### ERROR ### Please RESET the board ###\n    ```\n- The reason is that the installation removes the `u-boot.bin` and the `sun50i-a64-pine64-lts.dtb` files from the BOOT partition\n- Remove the micro-sd card from the pine and connect it to your laptop (you can safely remove the card when the above error is showing)\n- Now we need to copy all the files from step 2 back into the boot directory, while making sure that other vender `*.dtb` files are **not** present.\n    - Anecdotal personal experience - having rpi `*dtb` files has made the `bsd.mp` kernel hang while booting, `bsd.sp` kernel still boots fine.\n    ```\n    mkdir -p tmp/tmpmnt\n    mount /dev/mmcblk0p1 /tmp/tmpmnt\n    cp -r ~/tmpmnt/* /tmp/tmpmnt\n    rm -f /tmp/tmpmnt/*.dtb\n    umount /tmp/tmpmnt\n    dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8\n    ```\n\n## Enjoy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepsilon-0%2Fopenbsd-pine-a64-lts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepsilon-0%2Fopenbsd-pine-a64-lts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepsilon-0%2Fopenbsd-pine-a64-lts/lists"}