Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP WANTED] CI for NetBSD #1120

Open
ngortheone opened this issue Dec 29, 2020 · 5 comments
Open

[HELP WANTED] CI for NetBSD #1120

ngortheone opened this issue Dec 29, 2020 · 5 comments

Comments

@ngortheone
Copy link
Contributor

HELP NEEDED TO GET NETBSD BUILD

It is possible to get NetBSD CI build going on SourceHut. The only blocker for this is somewhat broken NetBSD image on SourceHut. This is why it is not listed on https://man.sr.ht/builds.sr.ht/compatibility.md

The problem is that in current state NetBSD image is not bootstrapped - it does not build itself properly. Every next image that the image produces has smaller and smaller disk size. Unfortunately I don't know much about NetBSD and QEMU to fix this quickly and currently I don't have enough free time to dive into this and learn both the OS and QEMU

Discussions we had with @ddevault:

We have an almost working NetBSD image already. The scripts for it are
at images/netbsd/ and are designed to be run on a NetBSD host.

The blocker for a while now has been that the images are self-hosting -
they're supposed to build themselves. The NetBSD scripts produce an
image which is smaller than the host. Repeating this process several
times will run out of space. We need to figure out a way to expand the
filesystem inside of the qcow2 to use all available space at genimg
time, or at first boot.

...

What are the requirements to build an image? I'd like to figure out
how manifest data are passed on to the build image (I'd like to have
custom repository support for FreeBSD).

You should be able to just run the genimg script from any NetBSD
machine. You may have to install qemu-img and such, but enumerating the
script dependencies is an exercise left to the reader.

...

The NetBSD image is almost complete, you can see the genimg script
here:
https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/images/netbsd

If you clone this repo on a NetBSD box and pop over to the 8.x or
current directories, then run ./genimg as root, it'll produce a working
NetBSD image (or at least it did when I last touched it).

The problem was that I'm unable to get it to resize itself to fill the
available space on the first boot. Since we use the images to generate
themselves, this means that the NetBSD image will get smaller and
smaller with each successive run and will eventually be too small to
accomodate builds.

...

has the NetBSD image resize problem ever been resolved?

NetBSD has been shipping with a "resize_root" rc.d script since v7
https://wiki.netbsd.org/archives/2015/08/; the Pinebook installer
images use the feature. The fix should be as easy as

echo "resize_root=YES" >> /mnt/etc/rc.conf

Unfortunately it does not seem to be that easy. The image building
scripts are here if you wish to take a crack at it yourself:

https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/images/netbsd

The code for image NetBSD generation is here:

https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/images/netbsd

This will prevent issues like #1114 and help the community in general

@edgarpettijohn
Copy link

It seems like anita is broken. I'm going to keep playing with it and see if I can get anywhere.

@ddevault
Copy link

It may be better to use an approach similar to our FreeBSD and OpenBSD approaches, which don't rely on anything like Anita and just extract the tarballs directly. See these:

https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/images/freebsd/genimg

https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/images/openbsd/genimg

@edgarpettijohn
Copy link

I have a working script. Going to do some hopefully thorough testing before submitting any patches.

@ngortheone
Copy link
Contributor Author

@edgarpettijohn 👀

@omar-polo
Copy link
Contributor

ping... :)

it would be nice to have some BSDs in the ci as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants