1

Topic: Experience trying to compile HyperBK and HyperbolaBSD userland

(note: this was done in Hyperbola GNU+LinuxLibre, the latest stable version. Not trying to pressure the Hyperbola team, I just hope this throught documentation of what I've faced can be helpful)

I've managed to compile a kernel and it is 18 megabytes in size, though I had to modify the ld.script file in the compilation directory because it contains PT_OPENBSD_RANDOMIZE (which gave me an "unknown phdr type" error), so I changed PT_OPENBSD_RANDOMIZE to just PT_LOAD and the kernel managed to compile (this workaround might break something (or everything) within the kernel, I'm not sure, but atleast I got a binary)

I've also noticed that the "make install" script for the kernel seems to be directed at (Open)BSD-based systems and therefore it doesn't work inside Hyperbola GNU+LinuxLibre, so it might be a good idea to add a comment in the documentation mentioning that the make install script is not compatible with GNU+Linux systems, so that people who are compiling from GNU+Linux won't get confused

Now, I also tried to compile the userland more than once; at first I put the source for the userland inside the /usr/src directory of my Hyperbola GNU+LinuxLibre installation, but later I decided to make a separate "OpenBSD data" partition through the cfdisk utility, and I added an ext2 filesystem to the partition through the mkfs utility (which is deprecated and not meant for OpenBSD partitions, so perhaps I didn't think this one through); I then made an /usr/src directory for the "OpenBSD data" partition and I put the source for the userland there (thought I had to get as close to an HyperbolaBSD environment as possible). Now, I didn't have nearly as much success trying to compile the userland as compiling the kernel, and one of the reasons for that was that the /usr/include/sys directory within my Hyperbola GNU+LinuxLibre installation did not have the C headers requested by the sources of HyperbolaBSD's userland. I tried a workaround by temporarily overwriting my /user/include/sys directory with the sys directory included in the HyperBK source (which seems to have some of the C headers I was missing).

Then there's something weird that happened when I ran the "bmake obj" command. Maybe I should send this to Hyperbola's issue tracker, but I'm not sure if this is really a bug or if I'm just doing something wrong, plus I can't actually log into the issue tracker (I get Error 23, which claims that my user is not permitted to log in). What happens is: "bmake obj" can result in 2 different outcomes: 1: it gives a chown error ("chown: invalid user: build:wobj") or 2: it makes directories like there's no tomorrow, and the number of forward slashes keeps increasing (not sure if this intended or not). The output of the "bmake obj" command looks something like this (not sure if the name of the directories actually repeats itself, but I will represent them as if they do)
./foo
./foo2
.//foo
.//foo2
.///foo
.///foo2
.////foo
.////foo2
./////foo
./////foo2
.//////foo
.//////foo2
Not sure if this goes on for infinity or if it eventually stops.

Then there's also something about mtree; I'm not sure what mtree really is, but Makefile.cross tries to execute it. There's a manpage about mtree in my installation, and there are a bunch of  files named "mtree" within /var/lib/pacman/local, but there's no mtree binary in my system that Makefile.cross can execute, so it errors out and ceases cross compilation. After doing some research, It appears that mtree is a program included in OpenBSD, though I'm not sure of its status in GNU+Linux.

Look at https://pst.moe/paste/hqdjuj?format=raw if you want to see the output of my last compilation attempt

I hereby liberate ALL works of my own posted in the forums, to the fullest extent allowed, under the CC0+a waiver of all other restrictions
Promote love!

2

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

To build the kernel, you need the "x86_64-unknown-hyperbolabsd-binutils" (in version 2.34-5) and the "x86_64-unknown-hyperbolabsd-gcc", this version of binutils supports PT_OPENBSD_RANDOMIZE.
The "bmake install" (the kernel) is not yet developed and the "i686" architecture has not yet been tested.
For now the kernel binary is called "bsd".

The userspace is incomplete, I did not write a manual to compile the userspace, the "bmake obj" does not work correctly and
there is no "bmake install",
If the source code of "userspace" is in "/usr/src", the "obj" directory is in "/usr/obj", otherwise the directories "userspace-alpha/<subdir>/<software_or_library>/obj" are generated.
For now I use these two commands to compile the userspace:
$ bmake CC='x86_64-unknown-hyperbolabsd-cc' LD='x86_64-unknown-hyperbolabsd-ld' -m ${PWD}/share/mk -j 4 clean > clean.log
$ bmake CC='x86_64-unknown-hyperbolabsd-cc -nostdinc -nostdlib' LD='x86_64-unknown-hyperbolabsd-ld' -m ${PWD}/share/mk -j 4 > build.log

3

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

The userspace is being developing in the stage1 branch, the changes were not applied to the master branch.

4

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

Thank you for the help :> <3

My x86_64-unknown-hyperbolabsd-binutils are in version 2.34-4 instead of 2.34-5 so I guess that's why I wasn't able to use PT_OPENBSD_RANDOMIZE. Next time I try to compile I will follow the instructions you have given in this thread

I hereby liberate ALL works of my own posted in the forums, to the fullest extent allowed, under the CC0+a waiver of all other restrictions
Promote love!

5

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

Hm, should I wait for version 2.34.5 of x86_64-unknown-hyperbolabsd-binutils to come into Hyperbola Stable before I try testing further?

I hereby liberate ALL works of my own posted in the forums, to the fullest extent allowed, under the CC0+a waiver of all other restrictions
Promote love!

6

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

You mean from testing to stable? You can temporary switch in the mirrorlist and install that version already.
(/etc/pacman.d/mirrorlist)

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

7

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

I've done what you said and now I can compile HyperBK error-free; though I probably should take a break from testing as I'm quite burnt-out (not just because of testing, there are other reasons)

I hereby liberate ALL works of my own posted in the forums, to the fullest extent allowed, under the CC0+a waiver of all other restrictions
Promote love!

8

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

Please take always care about yourself!
Taking a break is good and best wishes.

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

9

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

Hi; I'm just gonna say this now because I don't wanna leave people hanging: I'm not sure if I will actually be able to do testing, I am too unexperienced and the process would likely be too unenjoyable and stressful for me. Sorry.

I hereby liberate ALL works of my own posted in the forums, to the fullest extent allowed, under the CC0+a waiver of all other restrictions
Promote love!

10

Re: Experience trying to compile HyperBK and HyperbolaBSD userland

Probably wise for the time being anyhow.

There are other ways to help if you are willing that might be more helpful.

HyperbolaBSD: The Future of Secure Libre Lightweight Operating Systems!