From owner-freebsd-stable@FreeBSD.ORG Sun Feb 12 06:44:01 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3DE106566B for ; Sun, 12 Feb 2012 06:44:01 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 49A1D8FC17 for ; Sun, 12 Feb 2012 06:43:59 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-202-187.lns20.adl6.internode.on.net [118.210.202.187]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id q1C6hnn3065228 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 12 Feb 2012 17:13:55 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: "Daniel O'Connor" In-Reply-To: <4F3577C9.6050401@rewt.org.uk> Date: Sun, 12 Feb 2012 17:13:48 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <4F7A77DF-BA0B-4A75-A5EF-3CCDA314AD93@gsoft.com.au> References: <4F355A5B.9080007@rewt.org.uk> <4F35743B.4020302@os2.kiev.ua> <4F35762D.60908@rewt.org.uk> <4F3577C9.6050401@rewt.org.uk> To: Joe Holden X-Mailer: Apple Mail (2.1257) X-Spam-Score: 2.161 (**) BAYES_00,KHOP_DYNAMIC,LOTS_OF_MONEY,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: FreeBSD Stable Mailing List , Alex Samorukov Subject: Re: New BSD Installer X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 06:44:01 -0000 On 11/02/2012, at 6:32, Joe Holden wrote: > On a related note - does the new installer have any kind of config = file for unattended installs a la sysinstall? No it doesn't, that said since the new release CD is a live file system = (vs the old MFS on a CD kludge) it is much much easier to script your = own install. Especially with gpart it is fairly easy to setup a working system. I use this at work - image.txz.?? is created from a chroot where I = pre-build rather than using packages since it is a lot faster. The original also does things like put certain settings in sysctl.conf, = loader.conf and rc.conf. I found it was a lot simpler to set this up vs doing something similar = with sysinstall because sysinstall's environment was so restrictive. Currently the user selects shell and then runs the script, but I am = looking at modifying the release rc.local to add a menu option to make = it simpler. #!/bin/sh PATH=3D/bin:/usr/bin:/sbin:/usr/sbin export PATH BLOCKSIZE=3D10240 ROSINST=3D"/ros-install.sh" if [ $# -ne 1 ]; then devs=3D`camcontrol devlist | sed -nEe 's,<(.*)> +at = scbus.*\((.*)\,(.*)\),\1|\2 \3,p' | sed -Ee 's,pass[0-9]+,,' | sed -Ee = 's,(.*)\| ?(.*),/dev/\2 \\\"\1\\\",' | xargs echo` eval dialog --backtitle \"FreeBSD Installer\" --title \"Device = selection\" --menu \"Select device to install onto\" 20 50 40 $devs = 2>/tmp/devselection if [ $? -ne 0 ]; then echo echo "Aborting installation" exit 1 fi DEV=3D`cat /tmp/devselection` rm -f /tmp/devselection else DEV=3D"${1}" fi if [ ! -c "${DEV}" ]; then echo "${DEV} isn't a device" exit 1 fi set -e echo "Installing to ${DEV}" echo echo "Please enter the fully qualified hostname" echo "If you just press enter default values for networking will be = used" read hostname if [ -z "$hostname" ]; then hostname=3D"newradar.local" ifconfig=3D"DHCP" else echo "Please enter the ifconfig line (DHCP or a static IP)" read ifconfig=20 if [ "$ifconfig" !=3D "DHCP" ]; then echo "Please enter the default router" read defrouter echo "Please enter the DNS search domain" read dnssearch echo "Please enter the DNS server" read dnsserver fi fi echo "WARNING WARNING WARNING WARNING WARNING WARNING" echo "Continuing will destroy all data on ${DEV}" echo "WARNING WARNING WARNING WARNING WARNING WARNING" echo "Do you wish to continue? (y/n)" read answer if [ $answer !=3D "y" ]; then echo "Aborting" exit 0 fi TMPDIR=3D`mktemp -d -q /tmp/installos.XXXXXX` if [ $? -ne 0 ]; then echo "Unable to create temporary directory" exit 1 fi mkdir "${TMPDIR}/mnt" gpart destroy -F ${DEV} || echo -n gpart create -s GPT ${DEV} gpart add -t freebsd-boot -s 64K ${DEV} gpart bootcode -b ${SRC}/boot/pmbr -p ${SRC}/boot/gptboot -i 1 ${DEV} gpart add -t freebsd-ufs -s 1G -l slash ${DEV} gpart add -t freebsd-swap -s 4G -l swap ${DEV} gpart add -t freebsd-ufs -s 1G -l var ${DEV} gpart add -t freebsd-ufs -s 20G -l usr ${DEV} gpart add -t freebsd-ufs -l local0 ${DEV} for d in 2 4 5 6; do newfs -j "${DEV}p${d}" done mount "${DEV}p2" "${TMPDIR}/mnt" mkdir "${TMPDIR}/mnt/var" "${TMPDIR}/mnt/usr" "${TMPDIR}/mnt/local0" mount "${DEV}p4" "${TMPDIR}/mnt/var" mount "${DEV}p5" "${TMPDIR}/mnt/usr" mount "${DEV}p6" "${TMPDIR}/mnt/local0" for d in base doc games kernel lib32 src; do echo "Extracting $d" tar -C "${TMPDIR}/mnt" -pxf /usr/freebsd-dist/${d}.txz done echo "Extracting port image" # Disable exit on error because tar will complain about chflag'd stuff set +e cat /image.txz.* | tar -C "${TMPDIR}/mnt" -pUxf - if [ $? -ne 0 ]; then echo "Warning unpack return an error" fi set -e echo "# Device Mountpoint FStype Options Dump Pass#" = >${TMPDIR}/mnt/etc/fstab echo '/dev/gpt/slash / ufs rw 1 1' = >>${TMPDIR}/mnt/etc/fstab echo '/dev/gpt/swap none swap sw 0 0' = >>${TMPDIR}/mnt/etc/fstab echo '/dev/gpt/var /var ufs rw 2 2' = >>${TMPDIR}/mnt/etc/fstab echo '/dev/gpt/usr /usr ufs rw 2 2' = >>${TMPDIR}/mnt/etc/fstab echo '/dev/gpt/local0 /local0 ufs rw 2 2' = >>${TMPDIR}/mnt/etc/fstab echo '/dev/cd0 /cdrom cd9660 ro,noauto 0 0' = >>${TMPDIR}/mnt/etc/fstab echo 'linprocfs /compat/linux/proc linprocfs rw 0 0' = >>${TMPDIR}/mnt/etc/fstab echo 'procfs /proc procfs rw,noauto 0 0' = >>${TMPDIR}/mnt/etc/fstab # Put your customisation stuff here if [ "$ifconfig" !=3D "DHCP" ]; then cat >${TMPDIR}/mnt/etc/resolv.conf <>${TMPDIR}/mnt/etc/aliases <