Browse Source

replace a few places ``` w/ tags as it otherwise doesn't work well..

main
John-Mark Gurney 4 years ago
parent
commit
18fb9afaec
2 changed files with 28 additions and 28 deletions
  1. +14
    -14
      content/2014/10/building-bhyve-images-using-makefs-and.html
  2. +14
    -14
      content/2018/07/making-freebsd-magnet-links.html

+ 14
- 14
content/2014/10/building-bhyve-images-using-makefs-and.html View File

@@ -24,15 +24,15 @@ First, you need to make sure that you have a complete source check out
along with a completed buildworld and buildkernel. Then follow these steps: along with a completed buildworld and buildkernel. Then follow these steps:


1. Install world and distribution into a temporary directory using the `NO_ROOT` option: 1. Install world and distribution into a temporary directory using the `NO_ROOT` option:
<pre>```
<pre class="fullwidth"><code>
make installworld DESTDIR=<tmpdir> -DDB_FROM_SRC -DNO_ROOT make installworld DESTDIR=<tmpdir> -DDB_FROM_SRC -DNO_ROOT
make distribution DESTDIR=<tmpdir> -DDB_FROM_SRC -DNO_ROOT make distribution DESTDIR=<tmpdir> -DDB_FROM_SRC -DNO_ROOT
```</pre>
</code></pre>
This preps everything with the defaults as necessary. This preps everything with the defaults as necessary.
2. Install a kernel either into a different directory (I do this) or into the same directory above: 2. Install a kernel either into a different directory (I do this) or into the same directory above:
<pre>```
<pre class="fullwidth"><code>
make installkernel DESTDIR=<tmpkerndir> -DNO_ROOT KERNCONF=<conf> make installkernel DESTDIR=<tmpkerndir> -DNO_ROOT KERNCONF=<conf>
```</pre>
</code></pre>
3. Make a directory with your custom configuration files. The basics 3. Make a directory with your custom configuration files. The basics
are `/etc/rc.conf` and `/etc/fstab` and you might want `/firstboot` on are `/etc/rc.conf` and `/etc/fstab` and you might want `/firstboot` on
there too. You will also need a METALOG file which contains the there too. You will also need a METALOG file which contains the
@@ -40,17 +40,17 @@ along with a completed buildworld and buildkernel. Then follow these steps:
you could use mtree to generate this instead of creating it by hand. you could use mtree to generate this instead of creating it by hand.
The file contents are below. The file contents are below.
4. Build the ufs image using the `makeroot.sh` script in the src tree at `tools/tools/makeroot/makeroot.sh`: 4. Build the ufs image using the `makeroot.sh` script in the src tree at `tools/tools/makeroot/makeroot.sh`:
<pre>```
<pre class="fullwidth"><code>
/usr/src/tools/tools/makeroot/makeroot.sh -e <custdir>/METALOG -e <tmpkerndir>/METALOG -p <tmpdir>/etc/master.passwd -s 2g ufs.img root /usr/src/tools/tools/makeroot/makeroot.sh -e <custdir>/METALOG -e <tmpkerndir>/METALOG -p <tmpdir>/etc/master.passwd -s 2g ufs.img root
```</pre>
</code></pre>
5. Build the disc image: 5. Build the disc image:
<pre>```
<pre class="fullwidth"><code>
mkimg -s gpt -b <tmpdir>/boot/pmbr -p freebsd-boot:=<tmpdir>/boot/gptboot -p freebsd-swap::1G -p freebsd-ufs:=ufs.img -o disc.img mkimg -s gpt -b <tmpdir>/boot/pmbr -p freebsd-boot:=<tmpdir>/boot/gptboot -p freebsd-swap::1G -p freebsd-ufs:=ufs.img -o disc.img
```</pre>
</code></pre>
6. Run the image: 6. Run the image:
<pre>```
<pre class="fullwidth"><code>
sh /usr/share/examples/bhyve/vmrun.sh -d disc.img vm0 sh /usr/share/examples/bhyve/vmrun.sh -d disc.img vm0
```</pre>
</code></pre>


There you have it. Besides running the image, all the other steps can There you have it. Besides running the image, all the other steps can
be done as a normal user w/o root access. be done as a normal user w/o root access.
@@ -62,13 +62,13 @@ seed for entropy at first boot for things such as sshd key generation.
File contents: File contents:


* `/etc/fstab`: * `/etc/fstab`:
<pre>```
<pre class="fullwidth"><code>
/dev/vtbd0p3 / ufs rw 1 1 /dev/vtbd0p3 / ufs rw 1 1
```</pre>
</code></pre>
* Custom `METALOG`: * Custom `METALOG`:
<pre>```
<pre class="fullwidth"><code>
#mtree 2.0 #mtree 2.0
./etc/rc.conf type=file uname=root gname=wheel mode=0644 ./etc/rc.conf type=file uname=root gname=wheel mode=0644
./etc/fstab type=file uname=root gname=wheel mode=0644 ./etc/fstab type=file uname=root gname=wheel mode=0644
./firstboot type=file uname=root gname=wheel mode=0644 ./firstboot type=file uname=root gname=wheel mode=0644
```</pre>
</code></pre>

+ 14
- 14
content/2018/07/making-freebsd-magnet-links.html View File

@@ -25,24 +25,24 @@ adjust as necessary.
are a few directories that you have mirror, I use wget for this. The are a few directories that you have mirror, I use wget for this. The
mirroring feature for wget isn't great. After each command I have to mirroring feature for wget isn't great. After each command I have to
remove the `CHECKSUM.SHA256`, `CHECKSUM.SHA512` and `index.html*` files. remove the `CHECKSUM.SHA256`, `CHECKSUM.SHA512` and `index.html*` files.
```
<pre class="fullwidth"><code>
$ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.2/ $ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.2/
$ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/aarch64/Latest/ $ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/aarch64/Latest/
$ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/amd64/Latest/ $ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/amd64/Latest/
$ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/i386/Latest/ $ wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/i386/Latest/
```
</code></pre>
2. Fetch the signature files: 2. Fetch the signature files:
```
<pre class="fullwidth"><code>
$ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-{amd64,i386,powerpc,powerpc-powerpc64,sparc64,arm64-aarch64}.asc $ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-{amd64,i386,powerpc,powerpc-powerpc64,sparc64,arm64-aarch64}.asc
$ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-{amd64,i386,arm64-aarch64}-vm.asc $ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-{amd64,i386,arm64-aarch64}-vm.asc
$ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-arm-armv6-{BANANAPI,BEAGLEBONE,CUBIEBOARD,CUBIEBOARD2,CUBBOX-HUMMINGBOARD,GUMSTIX,PANDABOARD,RPI-B,RPI2,WANDBOARD}.asc $ wget https://www.freebsd.org/releases/11.2R/CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-arm-armv6-{BANANAPI,BEAGLEBONE,CUBIEBOARD,CUBIEBOARD2,CUBBOX-HUMMINGBOARD,GUMSTIX,PANDABOARD,RPI-B,RPI2,WANDBOARD}.asc
```
</code></pre>
3. Verify the GPG key that signed the above files. This is usually Glen 3. Verify the GPG key that signed the above files. This is usually Glen
Barber's key, but not always. I have met and verified his fingerprint Barber's key, but not always. I have met and verified his fingerprint
in person, If you have verified someone's key who has signed Glen's in person, If you have verified someone's key who has signed Glen's
key, that is another good way. key, that is another good way.
4. Verify the checksum files: 4. Verify the checksum files:
```
<pre class="fullwidth"><code>
$ for i in *.asc; do gpg --verify $i; done $ for i in *.asc; do gpg --verify $i; done
You should see a bunch of lines like: You should see a bunch of lines like:
Warning: using insecure memory! Warning: using insecure memory!
@@ -53,7 +53,7 @@ adjust as necessary.
gpg: aka "Glen Barber <gjb@glenbarber.us>" [full] gpg: aka "Glen Barber <gjb@glenbarber.us>" [full]
gpg: aka "Glen Barber <gjb@keybase.io>" [unknown] gpg: aka "Glen Barber <gjb@keybase.io>" [unknown]
gpg: WARNING: not a detached signature; file 'CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-amd64-vm' was NOT verified! gpg: WARNING: not a detached signature; file 'CHECKSUM.SHA512-FreeBSD-11.2-RELEASE-amd64-vm' was NOT verified!
```
</code></pre>
The last line can be ignored. The non-`.asc` files were d/l'd and will The last line can be ignored. The non-`.asc` files were d/l'd and will
not be used. Make sure that all of the files report Good signature. not be used. Make sure that all of the files report Good signature.
5. In the past I have used BitTornado for other things, so I ended up 5. In the past I have used BitTornado for other things, so I ended up
@@ -65,7 +65,7 @@ adjust as necessary.
similar enough that it could be modified and used. I copied similar enough that it could be modified and used. I copied
`btmakemetafile.py` to `btmaketrackerless.py` and applied the following `btmakemetafile.py` to `btmaketrackerless.py` and applied the following
patch: patch:
```
<pre class="fullwidth"><code>
$ diff -u btmakemetafile.py btmaketrackerless.py $ diff -u btmakemetafile.py btmaketrackerless.py
--- btmakemetafile.py 2004-05-24 12:54:52.000000000 -0700 --- btmakemetafile.py 2004-05-24 12:54:52.000000000 -0700
+++ btmaketrackerless.py 2016-10-10 17:13:32.742081000 -0700 +++ btmaketrackerless.py 2016-10-10 17:13:32.742081000 -0700
@@ -95,13 +95,13 @@ adjust as necessary.
print 'error: ' + str(e) print 'error: ' + str(e)
print 'run with no args for parameter explanations' print 'run with no args for parameter explanations'


```
</code></pre>
If you notice, the only thing that is done is to drop the first argument, If you notice, the only thing that is done is to drop the first argument,
and instead of passing it into `make_meta_file`, a `None` is passed and instead of passing it into `make_meta_file`, a `None` is passed
instead. This will simply not add trackers to the torrent file. instead. This will simply not add trackers to the torrent file.
6. I then run the following script to verify the downloaded files, and 6. I then run the following script to verify the downloaded files, and
generate the torrent files: generate the torrent files:
```
<pre class="fullwidth"><code>
$ cat cmp.sh $ cat cmp.sh
#!/bin/sh - #!/bin/sh -
# wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.2/ # wget -c -r -l 1 -nd --limit-rate=800k https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.2/
@@ -133,10 +133,10 @@ adjust as necessary.
exit 1 exit 1
fi fi
done < sha512.from.asc done < sha512.from.asc
```
</code></pre>
7. Once all the torrents have been generated, I then make the magnet 7. Once all the torrents have been generated, I then make the magnet
links: links:
```
<pre class="fullwidth"><code>
$ cat btmakemagnet.sh $ cat btmakemagnet.sh
#!/bin/sh - #!/bin/sh -


@@ -155,9 +155,9 @@ adjust as necessary.
print "magnet:?xt=urn:btih:" info "&dn=" name print "magnet:?xt=urn:btih:" info "&dn=" name
}' }'
done done
```
</code></pre>
8. I then create the magnet links file, and update the 8. I then create the magnet links file, and update the
[Torrents](https://wiki.freebsd.org/Torrents) wiki page. [Torrents](https://wiki.freebsd.org/Torrents) wiki page.


Sorry about the code formatting. I don't know how to make it look better
in blogger.
<s>Sorry about the code formatting. I don't know how to make it look better
in blogger.</s>

Loading…
Cancel
Save