The FreeBSD Diary

The FreeBSD Diary (TM) Remember
I remember
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Simpler solution
Author: Dennis Kovarsky 
Date:   16-01-02 02:20

Just use an /stand/sysinstall's unattended install script. If you specify your CDROM as the installation media and don't install XFree86 - you get a brand new box in just over 5 minutes. Play around with the script, it ain't all that bad if you have a huge cluster to roll out. :) And yes, you can use DHCP if you wanted to...

--------------------------------------------------------
debug=yes

hostname=your.host.here
domainname=your.domain
nameserver=primary_dns_ip_here
nameserver=secondary_dns_ip_here
defaultrouter=your_gateway_ip_here
ipaddr=your_ip_here
netmask=your_netmask_here

_ftpPath=ftp://ftp3.freebsd.org/pub/FreeBSD
netDev=ed0
mediaSetFTPActive

dists=bin crypto
distSetCustom

disk=ad0
partition=all
bootManager=standart
diskPartitionEditor
ad0s1-1=ufs 204800 /
ad0s1-2=swap 786432 none
ad0s1-3=ufs 104857 /var 1
ad0s1-4=ufs 0 /usr 1
diskLabelEditor
diskPartitionWrite
diskLabelCommit

installCommit

command=mount -t msdos /dev/fd0 /mnt
system
command=cp /mnt/etc/rc.conf /etc
system
command=cp /mnt/etc/resolv.conf /etc
system
command=cp /mnt/etc/XF86Config /etc/X11
system

package=bash-2.05
packageAdd
package=XFree86-4.1.0_6
packageAdd
package=linux_base-6.1
packageAdd
package=linux-navigator-4.78
packageAdd

command=/usr/sbin/tzsetup
system
command=/usr/bin/passwd
system
command=pw user add -n new_username_here -d /usr/home/new_username_here -g wheel -L wheel -m -s /usr/local/bin/bash -w random
| mail -s "new_username_here password" email_address_here
system
shutdown

Reply To This Message
 
 Re: Simpler solution
Author: Dan Langille 
Date:   16-01-02 04:09

This is interesting. Given the above script, how do you invoke it with/from /stand/sysinstall?

Reply To This Message
 
 Re: Simpler solution
Author: Dennis Kovarsky 
Date:   16-01-02 21:33

For now, when I boot off of the FBSD CD I get an option in the main sysinstall menu for "Load config" with install.cfg being the default value. That is somewhat defeating the purpose of an "unattended" install since it actually reqires human interaction, but that's just due to the fact that I have no time to trully test my premises. This would be a fun thing to do on a huge cluster, but unless I get a job offer from Sandia or Loas Alamos, something tells me I won't be testing this any time soon.

But you might. :)

man sysinstall says:

LOAD_CONFIG_FILE
If sysinstall is compiled with LOAD_CONFIG_FILE set in the envi­
ronment (or in the Makefile) to some value, then that value will
be used as the filename to automatically look for and load when
sysinstall starts up and with no user interaction required. This
option is aimed primarily at large sites who wish to create a
single prototype install for multiple machines with largely iden­
tical configurations and/or installation options.

which means that you can probably make a custom boot floppy (or better yet, a custom boot CD), that automatically looks for install.cfg on the floppy when booting. Which means that you would just have to put a boot CD into the drive, put the floppy with install.cfg on it into the floppy drive, boot and continue moving down the rack.

You could also, of course, just make a boot floppy with a custom install.cfg on it and specify FTP as your media, thus eliminating the need for the CD all together - it all would depend on your specific needs.

Closer to the bottom of the script you see the automatic user account creation with the random password being mailed off - that could also be improved, say, by making the script create a random usersname as well as a random password and have those credentials deposited securely using scp. You get the idea.

My point is that even though man sysinstall says "This utility is a prototype which lasted several years past its expiration date and is greatly in need of death" - I wouldn't write it off just yet. If there's a will, there is a way.

Reply To This Message
 
 Re: Simpler solution
Author: James A. Peltier 
Date:   23-01-02 10:02

I think the meta-port is a better option since chances are your ports directory will be more up-to-date than any of the files on the original CD. On a side note though this would be much quicker than compiling from ports

Reply To This Message
 
 Re: Simpler solution
Author: James A. Peltier 
Date:   23-01-02 10:10

can you have the script automatically run another script ie. if I install BIND 9.2.0 from the ports directory can I have it automatically run /usr/local/sbin/bind9-enable ??? same with qmail or anything else???

Reply To This Message
 
 Re: Simpler solution
Author: Dan Langille 
Date:   23-01-02 16:55

James A. Peltier wrote:
>
> On a side note though this
> would be much quicker than compiling from ports

But the meta-port <I>does</I> compile from ports. The meta-port is just a short hand way of doing:

is port x/y installed?
no, cd /usr/ports/x/y && make install

is port a/by installed?
no, cd /usr/ports/a/b && make install

etc.

Reply To This Message
 
 Re: Simpler solution
Author: Dennis Kovarsky 
Date:   23-01-02 21:26

Yes, you can have the script run another script/program. If you look at the bottom of it, that's how a new user is created. You call command="you script here without the quotes" and then do a 'system' call. From man sysinstall:

system Execute an arbitrary command with system(3)

Variables:

command
The name of the command to execute.

Reply To This Message
 
 Re: Simpler solution
Author: James A. Peltier 
Date:   24-01-02 05:58

actually i was referring to the meta-port example regarding running the script. but it's my fault i didn't post it in the correct area.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org