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

Add BSD support #191

Closed
woodsb02 opened this issue Aug 28, 2017 · 13 comments
Closed

Add BSD support #191

woodsb02 opened this issue Aug 28, 2017 · 13 comments

Comments

@woodsb02
Copy link

Would it be appropriate to add support for detecting the different families of BSD?

  • FreeBSD
  • NetBSD
  • OpenBSD
  • DragonFlyBSD
  • TrueOS
@sethmlarson
Copy link
Contributor

I would love to see this. Do you have access to a VirtualBox or other virtualization software @woodsb02 ?

@krytarowski
Copy link

Do you mean vbox on BSD as host?

@woodsb02
Copy link
Author

I can spin up a FreeBSD guest within my Vultr account, and give you access, if that would help with testing?
I also use the FreeBSD bhyve type 2 hypervisor at home for my own testing, but can't give external access to this.

@sethmlarson
Copy link
Contributor

Well I could do the virtualization myself. :) I was just wondering if you were up to making the contribution yourself.

@nir0s
Copy link
Collaborator

nir0s commented Dec 30, 2017

It would be awesome to support these. I would need a contribute for that though as I don't currently have the time to invest.

Anyone? :)

@sethmlarson
Copy link
Contributor

I'll try to make a dent in this!

@sethmlarson
Copy link
Contributor

So I've installed and configured an OpenBSD installation and I've found that there is no /etc/*-release files and no lsb-release installed by default. It seems that the only way to get version info is via uname -rs which outputs OpenBSD 6.2. So perhaps we should try that if lsb-release isn't installed?

@krytarowski
Copy link

lsb stands for LINUX standard base.

On BSD use uname. If you really need to parse userland version, there is an option to grep for version in headers.

$ awk '/^#define/ && /__NetBSD_Version__/ {print $6}' /usr/include/sys/param.h  
8.99.7

@sethmlarson
Copy link
Contributor

Thanks for the tip, I was doubtful LSB would be available but was surprised that there wasn't any release info in /etc. I think I'll go down the uname -rs route.

@woodsb02
Copy link
Author

Note that on FreeBSD you can use the command "freebsd-version -k" to give you the same details of the kernel version. The helpful part is that if you want the userland details, you use "freebsd-version -u" (it can be different to the kernel if patches have come out for a release that only affect either kernel or userland).

@woodsb02
Copy link
Author

Note that distro 1.2.0 has now been added to the FreeBSD ports collection, with Seth's patch in #207. If the BSD implementation changes, we can easily update the patch in the ports tree, but at least this has it working on FreeBSD :)
https://www.freshports.org/sysutils/py-distro

@krytarowski
Copy link

Why would be there /etc/*release, it's a Linux specific file. BSD are one - from the kernel to userland, and in typical scenarios uname(1) retrieves the version for everything at once.

@sethmlarson
Copy link
Contributor

sethmlarson commented Jan 1, 2018

I was reporting information back. I've never investigated or booted into *BSD before, so I'm not sure how I would know that before investigating and learning myself.

I reported back so others don't need to verify why I made the decisions I did when reviewing my PR and to make sure that I didn't miss any better way of doing things from actual BSD experts.

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