Solved Installworld doesn't re-install deleted files

Today, I was compiling the world and kernel for FreeBSD 13.1 RELEASE (HyperV VM).

On my first attempt I accidently deleted the ssh files - sshd_config and /etc/rc.d/sshd (WITHOUT_OPENSSH=YES).
But when I tried to rectify the issue by removing the above config and recompiling and reinstalling world, the files did not get reinstalled.

Is this the usual case or am I missing something?

Does this mean that if a file gets deleted accidently or otherwise (say by upgrading process) it won't be reinstalled by installworld?,
 
When you say you deleted them, from where? The build tree or the install target?
To the best of my knowledge if you deleted them from the install target, installworld should install them. But it's been a while since I've rebuilt/reinstall from source so it may have changed.
I would also double check your "build output" tree I think it usually lives at /usr/obj to make sure the files are there. Why? There are some cases where you need to to a clean before make world to regenerate dependencies. I don't know if what you did requires it but would be an easy check.
 
When you say you deleted them, from where? The build tree or the install target?
To the best of my knowledge if you deleted them from the install target, installworld should install them. But it's been a while since I've rebuilt/reinstall from source so it may have changed.
I would also double check your "build output" tree I think it usually lives at /usr/obj to make sure the files are there. Why? There are some cases where you need to to a clean before make world to regenerate dependencies. I don't know if what you did requires it but would be an easy check.

In the install target. The deletion was, if I remember correctly might have been during 'make delete old' process.

I will check in /usr/obj to see if it's there.
 
Configuration files are only installed by make distribution, not by make installworld. This is meant to happen only once ... keeping them up to date is the job of etcupdate(8). You could just run make distribution again, but then you'll have everything in /etc reset to the defaults....
 
I haven't tried it myself but reading etcupdate(8) I think you can easily restore those files using etcupdate revert /etc/ssh/sshd_config

Code:
   Revert Mode
     The revert mode is used to restore the stock versions of files.  In this
     mode, etcupdate installs the stock version of requested files.  This mode
     cannot be used to restore directories, only individual files.
 
Configuration files are only installed by make distribution, not by make installworld. This is meant to happen only once ... keeping them up to date is the job of etcupdate(8). You could just run make distribution again, but then you'll have everything in /etc reset to the defaults....

I haven't tried it myself but reading etcupdate(8) I think you can easily restore those files using etcupdate revert /etc/ssh/sshd_config

Code:
   Revert Mode
     The revert mode is used to restore the stock versions of files.  In this
     mode, etcupdate installs the stock version of requested files.  This mode
     cannot be used to restore directories, only individual files.


Great info. Thanks All.
 
Back
Top