From owner-svn-src-all@FreeBSD.ORG Sun Jul 27 16:29:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C283850E; Sun, 27 Jul 2014 16:29:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9550C2AE9; Sun, 27 Jul 2014 16:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6RGTvqi092337; Sun, 27 Jul 2014 16:29:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6RGTvMf092336; Sun, 27 Jul 2014 16:29:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407271629.s6RGTvMf092336@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 27 Jul 2014 16:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269154 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 16:29:57 -0000 Author: marcel Date: Sun Jul 27 16:29:57 2014 New Revision: 269154 URL: http://svnweb.freebsd.org/changeset/base/269154 Log: 1. Suppress output for the TFTP-based PXE loader, but leave it in place for the NFS-based PXE loader. Information like rootpath or rootip aren't that useful for TFTP and the gateway IP is typically already printed by the firmware. 2. Only set boot.nfsroot.* environment variables for NFS. This makes it possible for the OS to work either way by checking for the presence or absence of environment variables. 3. Set boot.netif.server when using TFTP so that the OS can fetch files as well. A typical use case for this is network-based installations with the installation process implemented on top of FreeBSD. 4. The pxelinux loader has a set of alternative names it tries for configuration files. Make it easier to do something similar in Forth by providing the IP address as a 32-bit hex number in the pxeboot.ip variable and the MAC address with dashes in the pxeboot.hwaddr environment variable. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Sun Jul 27 16:12:51 2014 (r269153) +++ head/sys/boot/i386/libi386/pxe.c Sun Jul 27 16:29:57 2014 (r269154) @@ -301,10 +301,6 @@ pxe_open(struct open_file *f, ...) bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } - printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); - printf("pxe_open: server path: %s\n", rootpath); - printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip)); - setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); @@ -312,9 +308,24 @@ pxe_open(struct open_file *f, ...) sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); } +#ifdef LOADER_NFS_SUPPORT + printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); + printf("pxe_open: server path: %s\n", rootpath); + printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip)); + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); +#else + setenv("boot.netif.server", inet_ntoa(rootip), 1); +#endif setenv("dhcp.host-name", hostname, 1); + + sprintf(temp, "%08X", ntohl(myip.s_addr)); + setenv("pxeboot.ip", temp, 1); + if (bootplayer.Hardware == ETHER_TYPE) { + sprintf(temp, "%6D", bootplayer.CAddr, "-"); + setenv("pxeboot.hwaddr", temp, 1); + } } } pxe_opens++;