From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 10 17:49:21 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8D3916A423 for ; Wed, 10 Aug 2005 17:49:21 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id F13F843D5C for ; Wed, 10 Aug 2005 17:49:20 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.40.201] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Wed, 10 Aug 2005 14:04:09 -0400 From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 10 Aug 2005 11:07:30 -0400 User-Agent: KMail/1.8 References: <356446ef0508100239320d2bf0@mail.gmail.com> <6.1.0.6.2.20050810032350.078f3eb0@cobalt.antimatter.net> <356446ef050810061832003965@mail.gmail.com> In-Reply-To: <356446ef050810061832003965@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508101107.31917.jhb@FreeBSD.org> Cc: iv gan , Glenn Dawson Subject: Re: howto make sysintall X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 17:49:22 -0000 On Wednesday 10 August 2005 09:18 am, iv gan wrote: > I am not so sure because the script cannot detect different devices. > It can be ad or ar or whatever but it cannot chechk for it. And what I > would like to do is more to detect the device and then to do something > like 10% to /, 20% to /tmp 35% to /var and 35% to /usr or something > like it. > Any suggestion? You can run a command to generate a config file that you then include. I use this with shell scripts that invoke 'dialog' to provide the user with custom menus. A sample is something like this: install.cfg: # select media command=sh /stand/setmedia.sh system configFile=/stand/setmedia.cfg loadConfig setmedia.sh: #!/bin/sh # # Set the installation media based on kernel environment variables. config=/stand/setmedia.cfg case `kenv media` in FTP) iface=`kenv iface` server=`kenv server` echo "abort" > ${config} if [ -z "${iface}" -o -z "${server}" ]; then dialog --title "Missing Settings" --msgbox "The network interface and FTP server must be specified\nvia the 'iface' and 'server' variables in loader.conf." -1 -1 exit 1 fi found=0 for ifn in `ifconfig -l`; do if [ "${ifn}" = "${iface}" ]; then found=1 fi done if [ ${found} -eq 0 ]; then dialog --title "Invalid Interface" --msgbox "The network interface ${iface} is not present." -1 -1 exit 1 fi echo "# Setup for FTP install" > ${config} echo "command=/stand/dhclient ${iface}" >> ${config} echo "system" >> ${config} echo "hostname=localhost" >> ${config} echo "netDev=${iface}" >> ${config} echo "_ftpPath=ftp://${server}/pub/FreeBSD" >> ${config} echo "ifconfig_${iface}=DHCP" >> ${config} echo "mediaSetFTP" >> ${config} ;; *) # Default to CD echo "# select CDROM media" > ${config} echo "mediaSetCDROM" >> ${config} esac This is just the part to setup the install media. What I do here is share the same mfsroot across both CD installs and installs over PXE, but in the /usr/nfsroot on the PXE server I have a boot/loader.conf that looks like: boot/loader.conf: # NFS install media=FTP iface=fxp0 server=10.1.2.3 I also use a similar approach to use different disk layouts for different configurations, etc. In my case I patched the release sources to include kenv and dialog in the crunch for the mfsroot and added my custom scripts to stand/ in the mfsroot. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org