You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
247 lines
6.0 KiB
247 lines
6.0 KiB
1 year ago
|
+++
|
||
|
# vim: ft=markdown
|
||
1 year ago
|
title = 'OpenBSD-current: built from source'
|
||
1 year ago
|
summary = 'Keeping up to date with OpenBSD-current. Some quick notes.'
|
||
1 year ago
|
date = '2023-09-03T08:59:12+0200'
|
||
|
# lastmod = ''
|
||
1 year ago
|
categories = [ 'computerstuff' ]
|
||
1 year ago
|
tags = [ 'openbsd' ]
|
||
|
|
||
|
draft = true
|
||
|
|
||
|
+++
|
||
|
|
||
1 year ago
|
[Initially]({{< ref "2023-07-29-going-back-from-openbsd-snapshot/index.md" >}}) I
|
||
1 year ago
|
wanted to not look at OpenBSD-current again but I did it again.
|
||
|
|
||
|
All went good this time and I could compile everything except the
|
||
|
ports. I'm still looking to find a good solution to update all
|
||
|
the packages in one run.
|
||
|
|
||
1 year ago
|
{{< alert >}}
|
||
|
This post is about following OpenBSD-current and **building OpenBSD from source**.
|
||
|
{{< /alert >}}
|
||
|
|
||
1 year ago
|
I'm still studying the [ports(7)], [bulk(8)] and [dpb(1)] manpages, as well as
|
||
|
the [release(8)] and [cvs(1)] pages.
|
||
|
|
||
|
[ports(7)]: https://man.openbsd.org/ports.7
|
||
|
[bulk(8)]: https://man.openbsd.org/bulk.8
|
||
|
[dpb(1)]: https://man.openbsd.org/dpb.1
|
||
|
[release(8)]: https://man.openbsd.org/release.8
|
||
|
[cvs(1)]: https://man.openbsd.org/cvs.1
|
||
1 year ago
|
|
||
1 year ago
|
## What went wrong the last time
|
||
|
|
||
|
I have no clue. The last time I had problems with the recent snapshot,
|
||
|
when the packages could not get updated properly. This time they updated
|
||
|
just fine. So maybe this was only an issue with that particular snapshot
|
||
|
back then. Maybe, <abbr title="I don't know">IDK</abbr>.
|
||
|
|
||
|
## Fetch the actual sources
|
||
|
|
||
|
The user is member of **wsrc**.
|
||
|
|
||
|
```console
|
||
|
$ cd /usr/src
|
||
|
$ cvs -q up -Pd -A
|
||
1 year ago
|
$ cd /usr/xenocara
|
||
|
$ cvs -q up -Pd -A
|
||
|
$ cd /usr/ports
|
||
|
$ cvs -q up -Pd -A
|
||
1 year ago
|
```
|
||
|
|
||
|
Initially we fetched the source with
|
||
|
|
||
|
```console
|
||
|
$ cd /usr
|
||
|
$ cvs -qd anoncvs@ftp.hostserver.de:/cvs checkout -P src
|
||
|
```
|
||
|
|
||
|
Same with `xenocara` and `ports`.
|
||
|
|
||
1 year ago
|
## Create the kernel
|
||
1 year ago
|
|
||
|
```console
|
||
|
$ cd /sys/arch/$(machine)/compile/GENERIC.MP
|
||
|
$ doas make obj
|
||
|
$ doas make config
|
||
1 year ago
|
$ doas make && doas make install
|
||
1 year ago
|
```
|
||
|
|
||
1 year ago
|
The current kernel gets copied to `/obsd` and the new kernel gets
|
||
|
installed as `/bsd`. On multi-processor machines `/bsd` is actually
|
||
|
`/bsd.mp` and the single processor kernel gets renamed to `/bsd.sp`.
|
||
1 year ago
|
|
||
1 year ago
|
Reboot the machine to use the new kernel.
|
||
1 year ago
|
|
||
|
## Build base system
|
||
|
|
||
|
```console
|
||
|
$ cd /usr/src
|
||
|
$ doas make obj && doas make build
|
||
|
```
|
||
|
|
||
|
```console
|
||
|
$ doas sysmerge
|
||
|
$ cd /dev && doas ./MAKEDEV all
|
||
|
```
|
||
|
|
||
1 year ago
|
This takes on my Lenovo X1 Carbon Gen7 something in between <mark>8 to 12 hours</mark> usually.
|
||
1 year ago
|
|
||
1 year ago
|
## Build and install Xenocara (X)
|
||
|
|
||
|
```console
|
||
|
$ cd /src/xenocara
|
||
1 year ago
|
$ doas make bootstrap
|
||
|
$ doas make obj
|
||
|
$ doas make build
|
||
1 year ago
|
```
|
||
|
|
||
1 year ago
|
Building Xenocara took on my laptop (see above) <mark>around 1.5 hours</mark>.
|
||
|
|
||
1 year ago
|
## Reboot
|
||
|
|
||
1 year ago
|
Once we built our new system, we want to boot into it.
|
||
|
|
||
|
## Upgrading the ports
|
||
|
|
||
|
I do have a packagelist of the manually installed packages in my home folder. That looks
|
||
|
something like this:
|
||
|
|
||
|
```
|
||
|
ImageMagick--
|
||
|
abook--
|
||
|
adb--
|
||
|
adwaita-icon-theme--
|
||
|
aircrack-ng--
|
||
|
alacritty--
|
||
|
anacron--
|
||
|
appstream-glib--
|
||
|
[...]
|
||
|
```
|
||
|
|
||
|
This is of no help to me, so I modified it a bit with sed:
|
||
|
|
||
|
```console
|
||
|
$ sed s/--// packagelist.txt > localports
|
||
|
```
|
||
|
|
||
|
That removes only the two minuses at the end.
|
||
|
|
||
|
Now I `cd` into `/usr/ports` and I'm looking if the
|
||
|
resulting category/package name fits the ports directory
|
||
|
structure.
|
||
|
|
||
|
```console
|
||
|
$ for i in `cat ~/localports`; do echo */$i; done | tee localports
|
||
|
```
|
||
|
|
||
|
Run the command without the `| tee ...` part to see if any errors occur.
|
||
|
|
||
|
If the for loop finishes without errors, we can add the `tee` part and
|
||
|
write the new localports file into `/usr/ports`.
|
||
|
|
||
1 year ago
|
Make sure to remove the `distfiles/<port>` sections.
|
||
|
|
||
1 year ago
|
The final file should look like this:
|
||
|
|
||
|
```
|
||
|
graphics/ImageMagick
|
||
|
mail/abook
|
||
|
devel/adb
|
||
|
security/aircrack-ng
|
||
|
x11/alacritty
|
||
|
sysutils/anacron
|
||
|
devel/appstream-glib
|
||
|
```
|
||
|
|
||
1 year ago
|
Some paths should be modified like the firefox browser is not found
|
||
|
as _firefox_ but as _fitefox-i18n_ for example.
|
||
|
|
||
1 year ago
|
Notice, there is already the package `adwaita-icon-theme` misssing
|
||
|
because there is no such port in the ports tree.
|
||
|
|
||
|
Within `/usr/ports`, we run `dpb`:
|
||
|
|
||
|
```console
|
||
|
$ doas /usr/ports/infrastructure/bin/dpb -P localports
|
||
|
```
|
||
|
|
||
|
That's it. The screen gets filled with all the ports that
|
||
|
are updated at once/in parallel.
|
||
|
|
||
1 year ago
|
I do have about 100 packages to build, which usually consumes around
|
||
|
<mark>40 minutes</mark> of time.
|
||
|
|
||
1 year ago
|
## Creating a release
|
||
|
|
||
|
There are a few steps needed to create your own installation media.
|
||
|
|
||
|
First of all, we setup some space that we can mount with
|
||
|
`noperm` options.
|
||
|
|
||
|
I use an external <abbr title="solid state disk">SSD</abbr>
|
||
|
which I mount into `/build`.
|
||
|
|
||
|
```console
|
||
|
$ doas mount -o noperm /dev/sd2a /build
|
||
|
```
|
||
|
|
||
|
Set the owner of this directory to build and chmod the directory
|
||
1 year ago
|
with 0700. Read along in the [release man page][release].
|
||
1 year ago
|
|
||
|
[release]: https://man.openbsd.org/release
|
||
|
|
||
|
I use four directories: `dest`, `release`, `xdest` and `xrelease`.
|
||
|
|
||
|
`dist` and `xdest` will be used to build the system, while
|
||
|
`release` will hold the tarballs and the final installation media files
|
||
|
when in `xrelease` the Xenocara release files will land.
|
||
|
|
||
|
{{< alert >}}
|
||
|
Have a look at the **manpage**, permissions and owners are quite important
|
||
|
for these tasks!
|
||
|
{{< /alert >}}
|
||
|
|
||
|
### It is the base system that we create first
|
||
|
|
||
|
```console
|
||
|
$ export DESTDIR=/build/dest RELEASEDIR=/build/release
|
||
|
$ cd /usr/src/etc && doas make release
|
||
|
$ cd /usr/src/distrib/sets && doas sh checkflist
|
||
|
$ unset RELEASEDIR DESTDIR
|
||
|
```
|
||
|
|
||
1 year ago
|
Time for coffe, the second line above takes around <mark>an hour</mark>.
|
||
|
This step creates a base installation of OpenBSD within `/build/dest` and
|
||
|
creates the installation media (tarballs) in `/build/release`.
|
||
|
|
||
1 year ago
|
### We continue with building the X release files
|
||
|
|
||
|
```console
|
||
|
$ export DESTDIR=/build/xdest RELEASEDIR=/build/xrelease
|
||
|
$ doas make release
|
||
|
$ doas make checkdist
|
||
|
$ unset RELEASEDIR DESTDIR
|
||
|
```
|
||
|
|
||
1 year ago
|
This run is fairly quick, expect <mark>a few minutes</mark> to run.
|
||
|
|
||
1 year ago
|
### Creating the installation media files
|
||
|
|
||
|
```console
|
||
|
$ export RELDIR=/build/release RELXDIR=/build/xrelease
|
||
|
$ cd /usr/src/distrib/$(machine)/iso && doas make
|
||
|
$ doas make install
|
||
|
```
|
||
|
|
||
1 year ago
|
Also this is done in a <mark>few minutes</mark>.
|
||
|
|
||
|
You'll find your `install73.img` and `install.iso` files in `$RELDIR`.
|
||
|
Ready to be used.
|
||
1 year ago
|
|
||
1 year ago
|
I sometimes upload these files [to my webserver][pub].
|
||
1 year ago
|
|
||
1 year ago
|
[pub]: http://bor.oe7drt.com/pub/OpenBSD/current/amd64/
|