Skip to content

Add BSD support #191

Closed
Closed

Description

@woodsb02

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

  • FreeBSD
  • NetBSD
  • OpenBSD
  • DragonFlyBSD
  • TrueOS

Activity

  1. sethmlarson commented on Aug 28, 2017

    @sethmlarson
    Contributor

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

  2. krytarowski commented on Aug 29, 2017

    @krytarowski

    Do you mean vbox on BSD as host?

  3. woodsb02 commented on Aug 30, 2017

    @woodsb02
    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.

  4. sethmlarson commented on Aug 30, 2017

    @sethmlarson
    Contributor

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

  5. nir0s commented on Dec 30, 2017

    @nir0s
    Collaborator

    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? :)

  6. sethmlarson commented on Dec 30, 2017

    @sethmlarson
    Contributor

    I'll try to make a dent in this!

  7. sethmlarson commented on Dec 31, 2017

    @sethmlarson
    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?

  8. krytarowski commented on Dec 31, 2017

    @krytarowski

    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
    
  9. sethmlarson commented on Dec 31, 2017

    @sethmlarson
    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.

  10. woodsb02 commented on Dec 31, 2017

    @woodsb02
    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).

  11. woodsb02 commented on Dec 31, 2017

    @woodsb02
    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

  12. krytarowski commented on Jan 1, 2018

    @krytarowski

    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.

  13. sethmlarson commented on Jan 1, 2018

    @sethmlarson
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions