Bug 166484

Summary: [rc] [patch] rc.initdiskless patch for different major versions living together
Product: Base System Reporter: nagy.attila
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Description Flags
file.diff none

Description nagy.attila 2012-03-29 10:10:08 UTC
In /etc/rc.initdiskless (used for NFS based diskless booting) it is possible to use different template directories, currently base -used mainly for storing the FreeBSD standard /etc base-, default -which is used for all netbooted machines, overriding what is in base-, broadcast and IP address based overrides.
This scheme works well for a small amount of machines running the same major FreeBSD version, but when there are different major versions running concurrently, the same base /etc starts to cause problems.
In our application we use FreeBSD 7, 8 and 9 versions, and to make things work somehow, we have to pick one /etc (main concerns are the rc scripts in rc* and rc.d/*) from a given major version which works for all major versions.
But due to incompatibilities, this is a no go, so we started to use different base templates for the given major release.
The attached patch is the fix for this problem, it makes possible to use base as today, and base.${major_release} (preferred over base if exists) for the major release.
With this patch we can run any FreeBSD major releases together from the same NFS servers without any problems and hacks due to differing rc.d and rc script versions and needs.

Fix: Multiple -major release based- base templates.

Patch attached with submission follows:
How-To-Repeat: Use different FreeBSD major releases with the same /etc.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-03-29 20:07:22 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Chris Rees 2012-11-04 12:21:22 UTC
I think this is a great idea.

My only concern is the backslashitis in the finding of $rel, and also
the fact that it won't catch 10 properly :)

Instead of:

rel=`expr \`uname -r\` : '\(.\)'`


rel=$(expr `uname -r` : '\([0-9][0-9]*\)')

Does anyone else have any opinions?

Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:48 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped