From owner-freebsd-current@FreeBSD.ORG Sat Nov 22 10:24:46 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5301065672 for ; Sat, 22 Nov 2008 10:24:46 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id EDE808FC13 for ; Sat, 22 Nov 2008 10:24:45 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1L3pQX-000MPo-IF; Sat, 22 Nov 2008 12:09:21 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Luigi Rizzo In-reply-to: <20081122012351.GA98158@onelab2.iet.unipi.it> References: <20081122012351.GA98158@onelab2.iet.unipi.it> Comments: In-reply-to Luigi Rizzo message dated "Sat, 22 Nov 2008 02:23:51 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 22 Nov 2008 12:09:21 +0200 From: Danny Braniss Message-ID: Cc: current@freebsd.org Subject: Re: RFC - per-host configuration of pxe booting X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 10:24:46 -0000 > [this mailing list is as good as anyone i guess... feel free > to forward it if you believe there is a more appropriate forum] > > The goal of this email is to figure out how to load host-specific > configurations from pxeboot -- maybe as simple as loading > /boot/loader.conf.${hostname} and possibly something slightly more > flexible that allows me to define machine 'classes' (e.g. based on > similar hardware configurations etc.). > why not use DHCP? you need it to boot the diskless anyways, and it can provide a wealth of information. The code has been around for many years. for example, in the dhcpd.conf: option FBSD.ind1 "hw.msk.legacy_intr=1"; option FBSD.ind2 "machdep.conspeed=115200"; option FBSD.rc-conf4 "rc.ws" these are placed, by bootp.c, in kenv. > I have a trivial suggestion (patches below) to implement the former, > and some ideas for the latter. > > At the moment the only host-specific variables available to pxeboot > are: "boot.netif.hwaddr", "boot.netif.ip", and "dhcp.host-name". > > "loaddev" is also available but it is not machine-specific. > > The list of config files is specified in /boot/defaults/loader.conf > in the "loader_conf_files" variable, and there is no way > to override it from other files. > So we need to change its default value to include the hostname, e.g. > > loader_conf_files="/boot/device.hints /boot/device.hints.${dhcp.host-name} /boot/loader.conf /boot/loader.conf.${dhcp.host-name}" > > (pardon the ling line -- forth does not allow line breaks) > > Also we need to redefine the function set_conf_files > in /boot/support.4th so that it can expand ${variable} > > : set_conf_files > conf_files .addr @ ?dup if free-memory then > set_environment_variable > s" loader_conf_files" getenv > strdup > conf_files .len ! conf_files .addr ! > ; > > (this is actually a slight simplification of the existing code). > > It might be useful to let dhcp pass more parameters to pxeboot > so e.g. we can expand it to a 'machine class' which can be used > for multiple machines. This should be relatively trivial to impelemnt, > but it requires modifications to the pxeboot binary -- no big deal > since this is something centralized. > > Comments ? > > cheers > luigi > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >