OpenBSD RISCV64 page: simplify script and small rewordings - www.codemadness.org - www.codemadness.org saait content files (HTM) git clone git://git.codemadness.org/www.codemadness.org (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit f577e2abd58e38d2bbb7243af736b22e0a17bf6a (DIR) parent 2ff0b9d3643e1e384eba162ebc01d76e475e530c (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 24 Oct 2021 11:58:41 +0200 OpenBSD RISCV64 page: simplify script and small rewordings Diffstat: M output/atom.xml | 4 ++-- M output/atom_content.xml | 45 +++++++++---------------------- M output/index | 2 +- M output/index.html | 2 +- M output/rss.xml | 2 +- M output/rss_content.xml | 43 +++++++++---------------------- M output/sitemap.xml | 2 +- M output/twtxt.txt | 2 +- M pages/openbsd-riscv64-vm.cfg | 6 +++--- M pages/openbsd-riscv64-vm.md | 37 ++++++++----------------------- 10 files changed, 44 insertions(+), 101 deletions(-) --- (DIR) diff --git a/output/atom.xml b/output/atom.xml @@ -7,10 +7,10 @@ <id>https://www.codemadness.org/atom.xml</id> <link rel="self" type="application/atom+xml" href="https://www.codemadness.org/atom.xml" /> <entry> - <title type="text">Setup an OpenBSD RISCV-64 VM in QEMU</title> + <title type="text">Setup an OpenBSD RISCV64 VM in QEMU</title> <link rel="alternate" type="text/html" href="https://www.codemadness.org/openbsd-riscv64-vm.html" /> <id>https://www.codemadness.org/openbsd-riscv64-vm.html</id> - <updated>2021-10-23T00:00:00Z</updated> + <updated>2021-10-24T00:00:00Z</updated> <published>2021-10-23T00:00:00Z</published> <author> <name>hiltjo</name> (DIR) diff --git a/output/atom_content.xml b/output/atom_content.xml @@ -7,20 +7,20 @@ <id>https://www.codemadness.org/atom.xml</id> <link rel="self" type="application/atom+xml" href="https://www.codemadness.org/atom.xml" /> <entry> - <title type="text">Setup an OpenBSD RISCV-64 VM in QEMU</title> + <title type="text">Setup an OpenBSD RISCV64 VM in QEMU</title> <link rel="alternate" type="text/html" href="https://www.codemadness.org/openbsd-riscv64-vm.html" /> <id>https://www.codemadness.org/openbsd-riscv64-vm.html</id> - <updated>2021-10-23T00:00:00Z</updated> + <updated>2021-10-24T00:00:00Z</updated> <published>2021-10-23T00:00:00Z</published> <author> <name>hiltjo</name> <uri>https://www.codemadness.org</uri> </author> <summary type="text">Setup an OpenBSD RISCV-64 VM in QEMU</summary> - <content type="html"><![CDATA[<h1>Setup an OpenBSD RISCV-64 VM in QEMU</h1> - <p><strong>Last modification on </strong> <time>2021-10-23</time></p> - <p>This describes how to setup an OpenBSD RISCV-64 VM in QEMU.</p> -<p>The script below does the following:</p> + <content type="html"><![CDATA[<h1>Setup an OpenBSD RISCV64 VM in QEMU</h1> + <p><strong>Last modification on </strong> <time>2021-10-24</time></p> + <p>This describes how to setup an OpenBSD RISCV64 VM in QEMU.</p> +<p>The shellscript below does the following:</p> <ul> <li>Set up the disk image (raw format).</li> <li>Patch the disk image with the OpenBSD miniroot file for the installation.</li> @@ -32,40 +32,29 @@ files are not verified. If the host is OpenBSD make sure to instead install the packages (pkg_add u-boot-riscv64 opensbi) and adjust the firmware path for the qemu -bios and -kernel options. </strong></p> -<h2>Script</h2> +<h2>Shellscript</h2> <pre><code>#!/bin/sh mirror="https://ftp.bit.nl/pub/OpenBSD/" release="7.0" -arch="riscv64" - -# base URL for the OpenBSD release for the VM. -baseurl="${mirror}/${release}/${arch}" n="$(printf '%s' "${release}" | tr -d '.')" # remove dot minirootname="miniroot${n}.img" -# for the opensbi and uboot package to extract the firmware needed for qemu. -hostarch="amd64" -packagebaseurl="${mirror}/${release}/packages/${hostarch}" - opensbi() { - pkg="opensbi-0.9p0.tgz" f="opensbi.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/opensbi-0.9p0.tgz" curl -o "${f}" "${url}" - # extract firmware. tar -xzf "${f}" share/opensbi/generic/fw_jump.bin } uboot() { - pkg="u-boot-riscv64-2021.07p0.tgz" f="uboot.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/u-boot-riscv64-2021.07p0.tgz" curl -o "${f}" "${url}" tar -xzf "${f}" share/u-boot/qemu-riscv64_smode/u-boot.bin @@ -74,22 +63,14 @@ uboot() { miniroot() { test -f "${minirootname}" && return # download once - minirooturl="${baseurl}/${minirootname}" - curl -o "${minirootname}" "${minirooturl}" -} - -patchminiroot() { - dd conv=notrunc if=${minirootname} of=disk.raw -} - -createdisk() { - qemu-img create disk.raw 10G + url="${mirror}/${release}/riscv64/${minirootname}" + curl -o "${minirootname}" "${url}" } createrootdisk() { test -f disk.raw && return # create once - createdisk - patchminiroot + qemu-img create disk.raw 10G # create 10 GB disk + dd conv=notrunc if=${minirootname} of=disk.raw # write miniroot to disk } setup() { (DIR) diff --git a/output/index b/output/index @@ -11,7 +11,7 @@ i codemadness.org 70 i codemadness.org 70 iPhlog posts codemadness.org 70 i codemadness.org 70 -12021-10-23 Setup an OpenBSD RISCV-64 VM in QEMU /phlog/openbsd-riscv64-vm codemadness.org 70 +12021-10-23 Setup an OpenBSD RISCV64 VM in QEMU /phlog/openbsd-riscv64-vm codemadness.org 70 12020-06-25 Sfeed_curses: a curses UI front-end for sfeed /phlog/sfeed_curses codemadness.org 70 12019-11-10 hurl: HTTP, HTTPS and Gopher file grabber /phlog/hurl codemadness.org 70 12019-10-13 json2tsv: a JSON to TSV converter /phlog/json2tsv codemadness.org 70 (DIR) diff --git a/output/index.html b/output/index.html @@ -39,7 +39,7 @@ <div id="main"> <h1>Posts</h1> <table> -<tr><td><time>2021-10-23</time></td><td><a href="openbsd-riscv64-vm.html">Setup an OpenBSD RISCV-64 VM in QEMU</a></td></tr> +<tr><td><time>2021-10-23</time></td><td><a href="openbsd-riscv64-vm.html">Setup an OpenBSD RISCV64 VM in QEMU</a></td></tr> <tr><td><time>2020-06-25</time></td><td><a href="sfeed_curses-ui.html">Sfeed_curses: a curses UI front-end for sfeed</a></td></tr> <tr><td><time>2019-11-10</time></td><td><a href="hurl.html">hurl: HTTP, HTTPS and Gopher file grabber</a></td></tr> <tr><td><time>2019-10-13</time></td><td><a href="json2tsv.html">json2tsv: a JSON to TSV converter</a></td></tr> (DIR) diff --git a/output/rss.xml b/output/rss.xml @@ -7,7 +7,7 @@ <description>blog with various projects and articles about computer-related things</description> <link>https://www.codemadness.org</link> <item> - <title>Setup an OpenBSD RISCV-64 VM in QEMU</title> + <title>Setup an OpenBSD RISCV64 VM in QEMU</title> <link>https://www.codemadness.org/openbsd-riscv64-vm.html</link> <guid>https://www.codemadness.org/openbsd-riscv64-vm.html</guid> <dc:date>2021-10-23T00:00:00Z</dc:date> (DIR) diff --git a/output/rss_content.xml b/output/rss_content.xml @@ -7,15 +7,15 @@ <description>blog with various projects and articles about computer-related things</description> <link>https://www.codemadness.org</link> <item> - <title>Setup an OpenBSD RISCV-64 VM in QEMU</title> + <title>Setup an OpenBSD RISCV64 VM in QEMU</title> <link>https://www.codemadness.org/openbsd-riscv64-vm.html</link> <guid>https://www.codemadness.org/openbsd-riscv64-vm.html</guid> <dc:date>2021-10-23T00:00:00Z</dc:date> <author>hiltjo</author> - <description><![CDATA[<h1>Setup an OpenBSD RISCV-64 VM in QEMU</h1> - <p><strong>Last modification on </strong> <time>2021-10-23</time></p> - <p>This describes how to setup an OpenBSD RISCV-64 VM in QEMU.</p> -<p>The script below does the following:</p> + <description><![CDATA[<h1>Setup an OpenBSD RISCV64 VM in QEMU</h1> + <p><strong>Last modification on </strong> <time>2021-10-24</time></p> + <p>This describes how to setup an OpenBSD RISCV64 VM in QEMU.</p> +<p>The shellscript below does the following:</p> <ul> <li>Set up the disk image (raw format).</li> <li>Patch the disk image with the OpenBSD miniroot file for the installation.</li> @@ -27,40 +27,29 @@ files are not verified. If the host is OpenBSD make sure to instead install the packages (pkg_add u-boot-riscv64 opensbi) and adjust the firmware path for the qemu -bios and -kernel options. </strong></p> -<h2>Script</h2> +<h2>Shellscript</h2> <pre><code>#!/bin/sh mirror="https://ftp.bit.nl/pub/OpenBSD/" release="7.0" -arch="riscv64" - -# base URL for the OpenBSD release for the VM. -baseurl="${mirror}/${release}/${arch}" n="$(printf '%s' "${release}" | tr -d '.')" # remove dot minirootname="miniroot${n}.img" -# for the opensbi and uboot package to extract the firmware needed for qemu. -hostarch="amd64" -packagebaseurl="${mirror}/${release}/packages/${hostarch}" - opensbi() { - pkg="opensbi-0.9p0.tgz" f="opensbi.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/opensbi-0.9p0.tgz" curl -o "${f}" "${url}" - # extract firmware. tar -xzf "${f}" share/opensbi/generic/fw_jump.bin } uboot() { - pkg="u-boot-riscv64-2021.07p0.tgz" f="uboot.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/u-boot-riscv64-2021.07p0.tgz" curl -o "${f}" "${url}" tar -xzf "${f}" share/u-boot/qemu-riscv64_smode/u-boot.bin @@ -69,22 +58,14 @@ uboot() { miniroot() { test -f "${minirootname}" && return # download once - minirooturl="${baseurl}/${minirootname}" - curl -o "${minirootname}" "${minirooturl}" -} - -patchminiroot() { - dd conv=notrunc if=${minirootname} of=disk.raw -} - -createdisk() { - qemu-img create disk.raw 10G + url="${mirror}/${release}/riscv64/${minirootname}" + curl -o "${minirootname}" "${url}" } createrootdisk() { test -f disk.raw && return # create once - createdisk - patchminiroot + qemu-img create disk.raw 10G # create 10 GB disk + dd conv=notrunc if=${minirootname} of=disk.raw # write miniroot to disk } setup() { (DIR) diff --git a/output/sitemap.xml b/output/sitemap.xml @@ -2,7 +2,7 @@ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://www.codemadness.org/openbsd-riscv64-vm.html</loc> - <lastmod>2021-10-23</lastmod> + <lastmod>2021-10-24</lastmod> </url> <url> <loc>https://www.codemadness.org/sfeed_curses-ui.html</loc> (DIR) diff --git a/output/twtxt.txt b/output/twtxt.txt @@ -1,4 +1,4 @@ -2021-10-23T00:00:00Z Setup an OpenBSD RISCV-64 VM in QEMU: https://www.codemadness.org/openbsd-riscv64-vm.html +2021-10-23T00:00:00Z Setup an OpenBSD RISCV64 VM in QEMU: https://www.codemadness.org/openbsd-riscv64-vm.html 2020-06-25T00:00:00Z Sfeed_curses: a curses UI front-end for sfeed: https://www.codemadness.org/sfeed_curses-ui.html 2019-11-10T00:00:00Z hurl: HTTP, HTTPS and Gopher file grabber: https://www.codemadness.org/hurl.html 2019-10-13T00:00:00Z json2tsv: a JSON to TSV converter: https://www.codemadness.org/json2tsv.html (DIR) diff --git a/pages/openbsd-riscv64-vm.cfg b/pages/openbsd-riscv64-vm.cfg @@ -1,6 +1,6 @@ -title = Setup an OpenBSD RISCV-64 VM in QEMU +title = Setup an OpenBSD RISCV64 VM in QEMU id = openbsd-riscv64-vm description = Setup an OpenBSD RISCV-64 VM in QEMU -keywords = OpenBSD, RISCV-64, QEMU, vm +keywords = OpenBSD, RISCV64, RISC-V, QEMU, vm created = 2021-10-23 -updated = 2021-10-23 +updated = 2021-10-24 (DIR) diff --git a/pages/openbsd-riscv64-vm.md b/pages/openbsd-riscv64-vm.md @@ -1,6 +1,6 @@ -This describes how to setup an OpenBSD RISCV-64 VM in QEMU. +This describes how to setup an OpenBSD RISCV64 VM in QEMU. -The script below does the following: +The shellscript below does the following: * Set up the disk image (raw format). * Patch the disk image with the OpenBSD miniroot file for the installation. @@ -15,41 +15,30 @@ packages (pkg_add u-boot-riscv64 opensbi) and adjust the firmware path for the qemu -bios and -kernel options. ** -## Script +## Shellscript #!/bin/sh mirror="https://ftp.bit.nl/pub/OpenBSD/" release="7.0" - arch="riscv64" - - # base URL for the OpenBSD release for the VM. - baseurl="${mirror}/${release}/${arch}" n="$(printf '%s' "${release}" | tr -d '.')" # remove dot minirootname="miniroot${n}.img" - # for the opensbi and uboot package to extract the firmware needed for qemu. - hostarch="amd64" - packagebaseurl="${mirror}/${release}/packages/${hostarch}" - opensbi() { - pkg="opensbi-0.9p0.tgz" f="opensbi.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/opensbi-0.9p0.tgz" curl -o "${f}" "${url}" - # extract firmware. tar -xzf "${f}" share/opensbi/generic/fw_jump.bin } uboot() { - pkg="u-boot-riscv64-2021.07p0.tgz" f="uboot.tgz" test -f "${f}" && return # download and extract once. - url="${packagebaseurl}/${pkg}" + url="${mirror}/${release}/packages/amd64/u-boot-riscv64-2021.07p0.tgz" curl -o "${f}" "${url}" tar -xzf "${f}" share/u-boot/qemu-riscv64_smode/u-boot.bin @@ -58,22 +47,14 @@ qemu -bios and -kernel options. ** miniroot() { test -f "${minirootname}" && return # download once - minirooturl="${baseurl}/${minirootname}" - curl -o "${minirootname}" "${minirooturl}" - } - - patchminiroot() { - dd conv=notrunc if=${minirootname} of=disk.raw - } - - createdisk() { - qemu-img create disk.raw 10G + url="${mirror}/${release}/riscv64/${minirootname}" + curl -o "${minirootname}" "${url}" } createrootdisk() { test -f disk.raw && return # create once - createdisk - patchminiroot + qemu-img create disk.raw 10G # create 10 GB disk + dd conv=notrunc if=${minirootname} of=disk.raw # write miniroot to disk } setup() {