From owner-freebsd-questions@FreeBSD.ORG Thu Apr 21 04:23:50 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51B9816A4CE for ; Thu, 21 Apr 2005 04:23:50 +0000 (GMT) Received: from ns1.tiadon.com (SMTP.tiadon.com [69.27.132.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA89F43D2F for ; Thu, 21 Apr 2005 04:23:49 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [69.27.131.0] ([69.27.131.0]) by ns1.tiadon.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 Apr 2005 23:23:13 -0500 Message-ID: <42672ACE.1020306@daleco.biz> Date: Wed, 20 Apr 2005 23:23:42 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041210 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "W. D." References: <426698CE.3040307@speakeasy.net> <426686A2.4030303@gmx.net> <426698CE.3040307@speakeasy.net> <5.1.0.14.2.20050420213634.2d47e270@209.152.117.178> In-Reply-To: <5.1.0.14.2.20050420213634.2d47e270@209.152.117.178> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Apr 2005 04:23:13.0860 (UTC) FILETIME=[D572C840:01C54629] cc: questions@freebsd.org Subject: Re: FreeBSD vs Linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2005 04:23:50 -0000 W. D. wrote: >At 15:20 4/20/2005, Kevin Kinsey wrote: > > > >>After using sysinstall for the base system, with a little reading up on >>shell scripting, you can set up your own "install wizard" and run it >> >> >>from a floppy, cross a reboot and take a day off while the > > >>server/desktop/whatever box sets itself up.... >> >>I'm trying it, myself. >> >> > >Would you please let us know what you come up with? > > Nothing spectacular, to be sure. I simply noticed that I have done a lot of things to set up a server or whatever, and they can easily be scripted. I'm certainly no shell scripting expert (A month ago I would have tried this in PHP, but there's a little "chicken/egg" problem there, and /bin/sh is really made for this stuff). Here's the rough outline: 1. Install a base system manually with sysinstall. Make sure that a source tree and ports tree exists by some manual means (like the aforementioned sysinstall). Make sure in BIOS that the system will boot with a floppy in the drive (priority to HD). 2. On a floppy I have three scripts, we'll call 'em "install", "setup1", "setup2"; and supfiles for -STABLE and ports. Mount the floppy and run "install" with a $SERVERTYPE argument .... 3. "install" copies the supfiles from floppy to a location on the machine's filesystem. It then copies "setup1" and "setup2" to /tmp/ and makes sure that they are executable. Having received an argument that tells the script what type of machine we're setting up, it calls /tmp/setup1 with that argument.... 4. "setup1" checks for the existence of the ports tree, then builds cvsup-without-gui from ports. (This seems to be one Achilles tendon). It then runs cvsup on the src tree, builds world, builds a generic kernel, installs it, copies root's crontab to /tmp/ and adds an "@reboot" command pointing to /tmp/setup2 with the server type argument to the root crontab. It then calls "shutdown -r". 5. When the machine comes back up on the new kernel, cron calls "setup2", which sleeps a little (?maybe?) and then does some checks and installs the newly created world. I've not decided how to handle mergemaster. Setup2 adjusts make.conf and builds a list of ports to be installed based on the command line argument. The ports tree gets cvsupped, and each port is installed in turn. The backup copy of root's crontab is restored to its proper place so that the script isn't called anymore. The scripts deletes as much of my stuff as possible, and exits. That's about the size of it. My code isn't pretty, as I'm not real experienced with /bin/sh, but after some testing I might get it out for viewing, although it seems simple enough (to me) that anyone could follow this outline and make it happen for themselves...IOW, I can't believe that somebody out there doesn't have something like this already, and I'm quite sure that they do, (unless maybe they just image HD's instead?) And I see no reason why it couldn't be expanded to do a lot of other stuff as well. Scripting is just "doing what you'd do yourself" in code, so you can do something else, after all...I used to sit at terminals and watch "buildworld" happen ... now I'm generally past that ;-) although I've not yet been brave enough to have my buildworld scripts call "shutdown" for themselves on my production boxes.... Kevin Kinsey