outpaddling / desktop-installer

Quickly configure a FreeBSD or NetBSD desktop system
BSD 2-Clause "Simplified" License
54 stars 7 forks source link

New OS request - NOT an ISSUE #30

Open piranah opened 10 months ago

piranah commented 10 months ago

Hi Team,

Very good work with FreeBSD stuff, just plain love it.

Is there a possibility to add support for OpenBSD 7.x in the future?

Would love to hear from you,

Reg, p

outpaddling commented 10 months ago

I'd be happy to see support for other platforms, but I'm spread too thin already to do it myself.

The first step would be to add OpenBSD cases to all the relevant auto-admin scripts. "grep auto- NetBSD/desktop-installer" and get the auto-admin menu working on OpenBSD. That should cover most of it.

Second step would be writing the desktop-installer script for OpenBSD. I'd recommend the NetBSD script as a model, since it's much simpler than the FreeBSD script at this time.

piranah commented 9 months ago

Hi Jason,

Thanks for getting back to me. What I am working on is a personal customization script I am writing for myself to help automate the laborious tasks one has to do after an OpenBSD installation like:

  1. Adding the hostname to the /etc/hosts file
  2. Enable trl+alt+bksp(zapping Xorg ) to break out of a W-windows session
  3. Adding ~/.profile to the .xsession file
  4. ...etc ...

I think you get the idea ...

I would have to look at the NetBSD scripts and see if I can make sense of it from a noobs-perspective ...Sure the OpenBSD and NetBSD scripts are very close, so the mods should be easy ?!?

I am going to spend some time looking at the scripts.

Reg, p

On Sat, Sep 23, 2023 at 11:44 PM Jason Bacon @.***> wrote:

I'd be happy to see support for other platforms, but I'm spread too thin already to do it myself.

The first step would be to add OpenBSD cases to all the relevant auto-admin scripts. "grep auto-admin- NetBSD/desktop-installer" and get the auto-admin menu working on OpenBSD. That should cover most of it.

Second step would be writing the desktop-installer script for OpenBSD. I'd recommend the NetBSD script as a model, since it's much simpler than the FreeBSD script at this time.

— Reply to this email directly, view it on GitHub https://github.com/outpaddling/desktop-installer/issues/30#issuecomment-1732415740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGN6PRVX7DZZM6WPPQ5FD3X35J5PANCNFSM6AAAAAA5EM3UFA . You are receiving this because you authored the thread.Message ID: @.***>

outpaddling commented 9 months ago

The auto-admin scripts that require platform-specific code use case statements controlled by auto-ostype, a wrapper around uname mainly to distinguish Linux distros from each other (uname just reports "linux", which is useless in determining sysadmin commands, which are specific to the distro, not the kernel).

case $(auto-ostype) in
FreeBSD)
     # FreeBSD code
     ;;

RHEL)
     # Redhat Enerprise code
     ;;

esac

Where the necessary commands are exactly the same as a supported platform, it would be a simple matter of adding "or OpenBSD", e.g.

FreeBSD|OpenBSD)

In other cases, you would need to add a new OpenBSD case and write the appropriate code. The command below lists the auto-admin scripts run directly by the NetBSD version of desktop-installer. You can go through these one-by-one (recursively since they may run other auto-admin scripts) and add OpenBSD cases.

# grep --only-matching 'auto-[a-z\-]*' NetBSD/desktop-installer | sort | uniq
auto-admin
auto-append-line
auto-automount-setup          # Low priority, can be added later
auto-enable-service
auto-install-base-components  # Low priority, can be added later
auto-package-installed
auto-pkgsrc-wip-checkout    # Not really necessary for OpenBSD
auto-replace-file
auto-update-pkgsrc              # Not necessary for OpenBSD
auto-update-system

Only a fraction of auto-admin scripts are required by desktop-installer, directly or indirectly, so this task is not as daunting as one might assume at first. Just identify which scripts are required and pick them off one-by-one.

I would approach it top-down: Start writing the desktop-installer script, using the NetBSD version as a model, and when you reach a point where an auto-admin script is needed, add the OpenBSD case to it and test it by running your desktop-installer. This way, you'll make steady progress and have a well-tested script by the time you reach the end.

outpaddling commented 9 months ago

I just committed some simple changes to auto-adduser, auto-useradd, and auto-groupadd to support OpenBSD. These should provide good examples for other scripts. These are not fully tested, but auto-adduser did work on my OpenBSD VM.

Also, it looks like you can make work-in-progress auto-admin and desktop-installer ports available fir testing via https://github.com/jasperla/openbsd-wip.

piranah commented 9 months ago

I am at a loss, pathetic as it may be I have NEVER used git or committed like ever. I suppose now is as good a time as ever to get started. Gonna do a practice run on my own repos then get back to you.

Reg, p

On Wed, Sep 27, 2023 at 4:53 PM Jason Bacon @.***> wrote:

I just committed some simple changes to auto-adduser, auto-useradd, and auto-groupadd to support OpenBSD. These should provide good examples for other scripts. These are not fully tested, but auto-adduser did work on my OpenBSD VM.

Also, it looks like you can make work-in-progress auto-admin and desktop-installer ports available fir testing via https://github.com/jasperla/openbsd-wip.

— Reply to this email directly, view it on GitHub https://github.com/outpaddling/desktop-installer/issues/30#issuecomment-1737565437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGN6PU6EBKNU6S45RRZNFDX4Q4W7ANCNFSM6AAAAAA5EM3UFA . You are receiving this because you authored the thread.Message ID: @.***>

outpaddling commented 9 months ago

No time like the present. For now, you can just clone the repo, edit the scripts, and send "git diff" output to this thread. I'll review and commit. Be sure to keep your copy updated by running "git pull" before every edit. When you get better with git[hub], you can learn about pull requests.

Izder456 commented 3 weeks ago

Submitted a PR to get the ball rolling on this.

https://github.com/outpaddling/desktop-installer/pull/37

outpaddling commented 3 weeks ago

Terrific, thanks for pitching in! Couple of things:

  1. Can you please sign your work by adding your name to a block comment at the beginning of each script? Then people won't have to brows the git logs to figure out who the original author is.
  2. Have you considered adding desktop-installer to https://github.com/jasperla/openbsd-wip/tree/master/sysutils? I'd suggest using your fork as the dist for the WIP port. Maybe also fork auto-admin and switch the WIP port for that to your fork. Then you and other OpenBSD users can easily test your latest changes.
Izder456 commented 3 weeks ago

Thanks for the response:

  1. Yes, i certainly can. that's totally reasonable.

  2. I maintain a few ports myself, I plan to just port it when complete and submit it to the ports@ mailing list.

I have yet to get auto-admin up and working with openbsd, following the tips you posted here.

again, thanks for the great software!

outpaddling commented 3 weeks ago
2. I maintain a few ports myself, I plan to just port it when complete and submit it to the ports@ mailing list.

Well, I wouldn't regard it as fully tested unless it was installed via ports, since it relies on files being installed in the proper hierarchy.

I have yet to get auto-admin up and working with openbsd, following the tips you posted here.

openbsd-wip would solve this for you as well, installing auto-admin as a dependency.

Cheers...