Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

handling reboots and updates #12

Open
jungle-boogie opened this issue Jan 5, 2018 · 5 comments
Open

handling reboots and updates #12

jungle-boogie opened this issue Jan 5, 2018 · 5 comments

Comments

@jungle-boogie
Copy link

Hi There,

Because this wonderful tool isn't actually editing /etc/hostname.xxx, will it be necessary to connect to the network each time after a reboot?

Is there currently a way to have it update the /etc/hostname.xxx file? In doing so, openBSD updates (i.e. updating bsd.rd from snapshot-to-snapshot) could be accomplished without the user needing to edit the file manually each time.

@farhaven
Copy link
Owner

farhaven commented Jan 5, 2018

There is a bit of a chicken-and-egg problem at least with my current usage. My /etc/hostname.iwm0 roughly looks like this:

up
!/usr/local/bin/wireless
dhcp

This way, reboots and such are already covered. I have sh /etc/netstart in /etc/apm/resume for reattaching to WIFI after resuming somewhere else. This wouldn't work anymore if wireless rewrote the hostname file of the device. I'd be okay with a patch that makes this optional behaviour though.

Other than that, something like

up
!/usr/local/bin/wireless || /mnt/usr/local/bin/wireless

should also work. This uses the wireless binary from the installed system.

@jungle-boogie
Copy link
Author

Hey @farhaven,

If I make my hostname.wpi file look like that and run wireless while I'm logged into the system, I'll associate with a network and get an IP address - all good. Thanks for the pointers on what your config looks like.

However, during the boot process, I type boot.bsd followed by s for shell and then these for upgrading:
mount mnt && cp mnt/auto_upgrade.conf . && autoinstall As you probably already know, autoinstall will read the conf file and proceed to upgrade. However, since I don't have a real network config in hostname.wpi, it will die - no problem though, since /usr/local/bin/ is mounted.

Calling /mnt/usr/local/bin/wireless with or without it pointing to my wireless.config file will result in an abort trap. Running sh /mnt/etc/nestart wpi0 results in directories missing.

@jungle-boogie
Copy link
Author

Any ideas on this?

@farhaven
Copy link
Owner

Sorry, I haven't given that much thought. Which directories go missing? And it'd be great if you could find out what the cause for the abort trap is.

@jungle-boogie
Copy link
Author

Hi @farhaven,

No problem at all.

I shouldn't say go missing, but netstart can't find the directories. I think /etc/rc.d/rc.subr is what it's looking for:
https://github.com/openbsd/src/blob/master/etc/netstart#L163

And it'd be great if you could find out what the cause for the abort trap is.

Well I can give recreation steps to see if it can happen to you, but I don't know if I can determine the cause.

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

No branches or pull requests

2 participants