From owner-freebsd-bugs@FreeBSD.ORG Sat Jun 19 11:40:15 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E30C16A4CE for ; Sat, 19 Jun 2004 11:40:15 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3314A43D58 for ; Sat, 19 Jun 2004 11:40:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i5JBe6it060279 for ; Sat, 19 Jun 2004 11:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i5JBe6a5060275; Sat, 19 Jun 2004 11:40:06 GMT (envelope-from gnats) Resent-Date: Sat, 19 Jun 2004 11:40:06 GMT Resent-Message-Id: <200406191140.i5JBe6a5060275@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dirk-Willem van Gulik Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C609816A4CE for ; Sat, 19 Jun 2004 11:36:29 +0000 (GMT) Received: from www.asemantics.com (fia193-115-100.dsl.hccnet.nl [80.100.115.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 114B743D41 for ; Sat, 19 Jun 2004 11:36:27 +0000 (GMT) (envelope-from root@webweaving.org) Received: from webweaving.org (localhost [127.0.0.1]) by webweaving.org (8.12.10/8.12.10) with ESMTP id i5JBFeE9000487 for ; Sat, 19 Jun 2004 13:15:40 +0200 (CEST) (envelope-from root@webweaving.org) Received: (from root@localhost) by webweaving.org (8.12.10/8.12.10/Submit) id i5JB1Zin041637; Sat, 19 Jun 2004 13:01:35 +0200 (CEST) (envelope-from root) Message-Id: <200406191101.i5JB1Zin041637@webweaving.org> Date: Sat, 19 Jun 2004 13:01:35 +0200 (CEST) From: Dirk-Willem van Gulik To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Dirk-Willem van Gulik Subject: conf/68108: Adding mac-address /conf selector to diskless boot X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dirk-Willem van Gulik List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 11:40:15 -0000 >Number: 68108 >Category: conf >Synopsis: Adding mac-address /conf selector to diskless boot >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jun 19 11:40:06 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Charlie & >Release: FreeBSD 5.2.1-RELEASE i386 >Organization: >Environment: System: FreeBSD webweaving.org 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #2: Fri Mar 19 06:56:16 CET 2004 dirkx@webweaving.org:/usr/src/sys/i386/compile/GENERIC i386 Diskless machines, booting with pxeboot et.al. under 5.2.1 and above. >Description: Right now during a diskless boot /conf/default, /conf/b-cast and /conf/ip address is checked for system specific configs. As some configs are very tied to HW, rather than to the subnet the HW happens to be used with - it can be useful to tie certain configs to the mac address. The patch below add this facilities very much along the lines of that supported by Solaris. >How-To-Repeat: Patch, reboot diskless machine. >Fix: *** /tmp/initdiskless Sat Jun 19 12:51:53 2004 --- initdiskless Sat Jun 19 12:55:53 2004 *************** *** 40,45 **** --- 40,46 ---- # # /conf/base universal base # /conf/default modified by a secondary universal base + # /conf/${macaddress} modified by the mac address of the physical machine. # /conf/${ipba} modified based on the assigned broadcast IP # /conf/${ip} modified based on the machine's assigned IP # *************** *** 132,137 **** --- 133,142 ---- bootp_ipbca="" iflist=`ifconfig -l` for i in ${iflist} ; do + set `ifconfig ${i} | grep ether | sed -e 's/://g'` + if [ "x$1" = "ether" ]; then + boot_mac=$2 + fi set `ifconfig ${i}` while [ $# -ge 1 ] ; do if [ "${bootp_ifc}" = "" -a "$1" = "inet" ] ; then *************** *** 146,152 **** break fi done ! echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" # Figure out our NFS root path # --- 151,157 ---- break fi done ! echo "Interface ${boot_mac} ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}" # Figure out our NFS root path # *************** *** 159,167 **** shift done ! # Resolve templates in /conf/base, /conf/default, /conf/${bootp_ipbca}, ! # and /conf/${bootp_ipa}. For each subdirectory found within these ! # directories: # # - calculate memory filesystem sizes. If the subdirectory (prior to # NFS remounting) contains the file 'md_size', the contents specified --- 164,172 ---- shift done ! # Resolve templates in /conf/base, /conf/default, /conf/${boot_mac}, ! # /conf/${bootp_ipbca} # and /conf/${bootp_ipa}. For each subdirectory ! # found within these directories: # # - calculate memory filesystem sizes. If the subdirectory (prior to # NFS remounting) contains the file 'md_size', the contents specified *************** *** 179,185 **** # it before attemping to the remount. This allows the root to be # relocated without needing to change the remount files. # ! for i in base default ${bootp_ipbca} ${bootp_ipa} ; do for j in /conf/$i/* ; do # memory filesystem size specification # --- 184,190 ---- # it before attemping to the remount. This allows the root to be # relocated without needing to change the remount files. # ! for i in base default ${boot_mac} ${bootp_ipbca} ${bootp_ipa} ; do for j in /conf/$i/* ; do # memory filesystem size specification # >Release-Note: >Audit-Trail: >Unformatted: